@@ -926,6 +926,125 @@ class PlatformNotificationsV1 extends BaseService {
926926
927927 return this . createRequest ( parameters ) ;
928928 }
929+
930+ /**
931+ * Get user's last acknowledged notification Id.
932+ *
933+ * Retrieve the ID of the last notification acknowledged by the user for a specific account.
934+ *
935+ * @param {Object } [params] - The parameters to send to the service.
936+ * @param {string } [params.accountId] - The account ID to retrieve acknowledgement for.
937+ * @param {OutgoingHttpHeaders } [params.headers] - Custom request headers
938+ * @returns {Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.Acknowledgement>> }
939+ */
940+ public getAcknowledgement (
941+ params ?: PlatformNotificationsV1 . GetAcknowledgementParams
942+ ) : Promise < PlatformNotificationsV1 . Response < PlatformNotificationsV1 . Acknowledgement > > {
943+ const _params = { ...params } ;
944+ const _requiredParams = [ ] ;
945+ const _validParams = [ 'accountId' , 'signal' , 'headers' ] ;
946+ const _validationErrors = validateParams ( _params , _requiredParams , _validParams ) ;
947+ if ( _validationErrors ) {
948+ return Promise . reject ( _validationErrors ) ;
949+ }
950+
951+ const query = {
952+ 'account_id' : _params . accountId ,
953+ } ;
954+
955+ const sdkHeaders = getSdkHeaders (
956+ PlatformNotificationsV1 . DEFAULT_SERVICE_NAME ,
957+ 'v1' ,
958+ 'getAcknowledgement'
959+ ) ;
960+
961+ const parameters = {
962+ options : {
963+ url : '/v1/notifications/acknowledgement' ,
964+ method : 'GET' ,
965+ qs : query ,
966+ } ,
967+ defaultOptions : extend ( true , { } , this . baseOptions , {
968+ headers : extend (
969+ true ,
970+ sdkHeaders ,
971+ this . baseOptions . headers ,
972+ {
973+ 'Accept' : 'application/json' ,
974+ } ,
975+ _params . headers
976+ ) ,
977+ axiosOptions : {
978+ signal : _params . signal ,
979+ } ,
980+ } ) ,
981+ } ;
982+
983+ return this . createRequest ( parameters ) ;
984+ }
985+
986+ /**
987+ * Update user's last acknowledged notification.
988+ *
989+ * Update the ID of the last notification acknowledged by the user for a specific account.
990+ *
991+ * @param {Object } params - The parameters to send to the service.
992+ * @param {string } params.lastAcknowledgedId - The ID of a notification.
993+ * @param {string } [params.accountId] - The account ID to update acknowledgement for.
994+ * @param {OutgoingHttpHeaders } [params.headers] - Custom request headers
995+ * @returns {Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.Acknowledgement>> }
996+ */
997+ public replaceNotificationAcknowledgement (
998+ params : PlatformNotificationsV1 . ReplaceNotificationAcknowledgementParams
999+ ) : Promise < PlatformNotificationsV1 . Response < PlatformNotificationsV1 . Acknowledgement > > {
1000+ const _params = { ...params } ;
1001+ const _requiredParams = [ 'lastAcknowledgedId' ] ;
1002+ const _validParams = [ 'lastAcknowledgedId' , 'accountId' , 'signal' , 'headers' ] ;
1003+ const _validationErrors = validateParams ( _params , _requiredParams , _validParams ) ;
1004+ if ( _validationErrors ) {
1005+ return Promise . reject ( _validationErrors ) ;
1006+ }
1007+
1008+ const body = {
1009+ 'last_acknowledged_id' : _params . lastAcknowledgedId ,
1010+ } ;
1011+
1012+ const query = {
1013+ 'account_id' : _params . accountId ,
1014+ } ;
1015+
1016+ const sdkHeaders = getSdkHeaders (
1017+ PlatformNotificationsV1 . DEFAULT_SERVICE_NAME ,
1018+ 'v1' ,
1019+ 'replaceNotificationAcknowledgement'
1020+ ) ;
1021+
1022+ const parameters = {
1023+ options : {
1024+ url : '/v1/notifications/acknowledgement' ,
1025+ method : 'PUT' ,
1026+ body,
1027+ qs : query ,
1028+ } ,
1029+ defaultOptions : extend ( true , { } , this . baseOptions , {
1030+ headers : extend (
1031+ true ,
1032+ sdkHeaders ,
1033+ this . baseOptions . headers ,
1034+ {
1035+ 'Accept' : 'application/json' ,
1036+ 'Content-Type' : 'application/json' ,
1037+ } ,
1038+ _params . headers
1039+ ) ,
1040+ axiosOptions : {
1041+ signal : _params . signal ,
1042+ } ,
1043+ } ) ,
1044+ } ;
1045+
1046+ return this . createRequest ( parameters ) ;
1047+ }
9291048}
9301049
9311050/*************************
@@ -1139,6 +1258,20 @@ namespace PlatformNotificationsV1 {
11391258 limit ?: number ;
11401259 }
11411260
1261+ /** Parameters for the `getAcknowledgement` operation. */
1262+ export interface GetAcknowledgementParams extends DefaultParams {
1263+ /** The account ID to retrieve acknowledgement for. */
1264+ accountId ?: string ;
1265+ }
1266+
1267+ /** Parameters for the `replaceNotificationAcknowledgement` operation. */
1268+ export interface ReplaceNotificationAcknowledgementParams extends DefaultParams {
1269+ /** The ID of a notification. */
1270+ lastAcknowledgedId : string ;
1271+ /** The account ID to update acknowledgement for. */
1272+ accountId ?: string ;
1273+ }
1274+
11421275 /*************************
11431276 * model interfaces
11441277 ************************/
@@ -1393,6 +1526,18 @@ namespace PlatformNotificationsV1 {
13931526 message : string ;
13941527 }
13951528
1529+ /**
1530+ * Status indicating whether the user has unread notifications.
1531+ */
1532+ export interface Acknowledgement {
1533+ /** Indicates whether the user has unread notifications. */
1534+ has_unread : boolean ;
1535+ /** The ID of the most recent notification available to the user. */
1536+ latest_notification_id : string ;
1537+ /** The ID of the last notification acknowledged by the user. */
1538+ last_acknowledged_id : string ;
1539+ }
1540+
13961541 /**
13971542 * Prototype for creating an Event Notifications destination entry.
13981543 */
0 commit comments