Skip to content

Commit 9b764d1

Browse files
committed
feat(platform notifications): remove acknowledge endpoints for now
1 parent bd0fbbf commit 9b764d1

4 files changed

Lines changed: 4 additions & 392 deletions

File tree

examples/platform-notifications.v1.test.js

Lines changed: 4 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,10 @@ describe('PlatformNotificationsV1', () => {
335335

336336
const allResults = [];
337337
try {
338-
const pager = new PlatformNotificationsV1.NotificationsPager(platformNotificationsService, params);
338+
const pager = new PlatformNotificationsV1.NotificationsPager(
339+
platformNotificationsService,
340+
params
341+
);
339342
while (pager.hasNext()) {
340343
const nextPage = await pager.getNext();
341344
expect(nextPage).not.toBeNull();
@@ -349,64 +352,6 @@ describe('PlatformNotificationsV1', () => {
349352
// end-list_notifications
350353
});
351354

352-
test('getAcknowledgment request example', async () => {
353-
consoleLogMock.mockImplementation((output) => {
354-
originalLog(output);
355-
});
356-
consoleWarnMock.mockImplementation((output) => {
357-
// if an error occurs, display the message and then fail the test
358-
originalWarn(output);
359-
expect(true).toBeFalsy();
360-
});
361-
362-
originalLog('getAcknowledgment() result:');
363-
// begin-get_acknowledgment
364-
365-
const params = {
366-
accountId: '1369339417d906e5620b8d861d40cfd7',
367-
lastProcessedId: '1678901234000',
368-
};
369-
370-
let res;
371-
try {
372-
res = await platformNotificationsService.getAcknowledgment(params);
373-
console.log(JSON.stringify(res.result, null, 2));
374-
} catch (err) {
375-
console.warn(err);
376-
}
377-
378-
// end-get_acknowledgment
379-
});
380-
381-
test('replaceNotificationAcknowledgment request example', async () => {
382-
consoleLogMock.mockImplementation((output) => {
383-
originalLog(output);
384-
});
385-
consoleWarnMock.mockImplementation((output) => {
386-
// if an error occurs, display the message and then fail the test
387-
originalWarn(output);
388-
expect(true).toBeFalsy();
389-
});
390-
391-
originalLog('replaceNotificationAcknowledgment() result:');
392-
// begin-replace_notification_acknowledgment
393-
394-
const params = {
395-
lastAcknowledgedId: '1772804159452',
396-
accountId: '1369339417d906e5620b8d861d40cfd7',
397-
};
398-
399-
let res;
400-
try {
401-
res = await platformNotificationsService.replaceNotificationAcknowledgment(params);
402-
console.log(JSON.stringify(res.result, null, 2));
403-
} catch (err) {
404-
console.warn(err);
405-
}
406-
407-
// end-replace_notification_acknowledgment
408-
});
409-
410355
test('deleteDistributionListDestination request example', async () => {
411356
consoleLogMock.mockImplementation((output) => {
412357
originalLog(output);

platform-notifications/v1.ts

Lines changed: 0 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -926,127 +926,6 @@ 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 acknowledgment for.
937-
* @param {string} [params.lastProcessedId] - Client's last known notification ID for quick comparison.
938-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
939-
* @returns {Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.Acknowledgment>>}
940-
*/
941-
public getAcknowledgment(
942-
params?: PlatformNotificationsV1.GetAcknowledgmentParams
943-
): Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.Acknowledgment>> {
944-
const _params = { ...params };
945-
const _requiredParams = [];
946-
const _validParams = ['accountId', 'lastProcessedId', 'signal', 'headers'];
947-
const _validationErrors = validateParams(_params, _requiredParams, _validParams);
948-
if (_validationErrors) {
949-
return Promise.reject(_validationErrors);
950-
}
951-
952-
const query = {
953-
'account_id': _params.accountId,
954-
'last_processed_id': _params.lastProcessedId,
955-
};
956-
957-
const sdkHeaders = getSdkHeaders(
958-
PlatformNotificationsV1.DEFAULT_SERVICE_NAME,
959-
'v1',
960-
'getAcknowledgment'
961-
);
962-
963-
const parameters = {
964-
options: {
965-
url: '/v1/notifications/acknowledgment',
966-
method: 'GET',
967-
qs: query,
968-
},
969-
defaultOptions: extend(true, {}, this.baseOptions, {
970-
headers: extend(
971-
true,
972-
sdkHeaders,
973-
this.baseOptions.headers,
974-
{
975-
'Accept': 'application/json',
976-
},
977-
_params.headers
978-
),
979-
axiosOptions: {
980-
signal: _params.signal,
981-
},
982-
}),
983-
};
984-
985-
return this.createRequest(parameters);
986-
}
987-
988-
/**
989-
* Update user's last acknowledged notification.
990-
*
991-
* Update the ID of the last notification acknowledged by the user for a specific account.
992-
*
993-
* @param {Object} params - The parameters to send to the service.
994-
* @param {string} params.lastAcknowledgedId - The ID of a notification.
995-
* @param {string} [params.accountId] - The account ID to update acknowledgment for.
996-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
997-
* @returns {Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.Acknowledgment>>}
998-
*/
999-
public replaceNotificationAcknowledgment(
1000-
params: PlatformNotificationsV1.ReplaceNotificationAcknowledgmentParams
1001-
): Promise<PlatformNotificationsV1.Response<PlatformNotificationsV1.Acknowledgment>> {
1002-
const _params = { ...params };
1003-
const _requiredParams = ['lastAcknowledgedId'];
1004-
const _validParams = ['lastAcknowledgedId', 'accountId', 'signal', 'headers'];
1005-
const _validationErrors = validateParams(_params, _requiredParams, _validParams);
1006-
if (_validationErrors) {
1007-
return Promise.reject(_validationErrors);
1008-
}
1009-
1010-
const body = {
1011-
'last_acknowledged_id': _params.lastAcknowledgedId,
1012-
};
1013-
1014-
const query = {
1015-
'account_id': _params.accountId,
1016-
};
1017-
1018-
const sdkHeaders = getSdkHeaders(
1019-
PlatformNotificationsV1.DEFAULT_SERVICE_NAME,
1020-
'v1',
1021-
'replaceNotificationAcknowledgment'
1022-
);
1023-
1024-
const parameters = {
1025-
options: {
1026-
url: '/v1/notifications/acknowledgment',
1027-
method: 'PUT',
1028-
body,
1029-
qs: query,
1030-
},
1031-
defaultOptions: extend(true, {}, this.baseOptions, {
1032-
headers: extend(
1033-
true,
1034-
sdkHeaders,
1035-
this.baseOptions.headers,
1036-
{
1037-
'Accept': 'application/json',
1038-
'Content-Type': 'application/json',
1039-
},
1040-
_params.headers
1041-
),
1042-
axiosOptions: {
1043-
signal: _params.signal,
1044-
},
1045-
}),
1046-
};
1047-
1048-
return this.createRequest(parameters);
1049-
}
1050929
}
1051930

1052931
/*************************
@@ -1260,38 +1139,10 @@ namespace PlatformNotificationsV1 {
12601139
limit?: number;
12611140
}
12621141

1263-
/** Parameters for the `getAcknowledgment` operation. */
1264-
export interface GetAcknowledgmentParams extends DefaultParams {
1265-
/** The account ID to retrieve acknowledgment for. */
1266-
accountId?: string;
1267-
/** Client's last known notification ID for quick comparison. */
1268-
lastProcessedId?: string;
1269-
}
1270-
1271-
/** Parameters for the `replaceNotificationAcknowledgment` operation. */
1272-
export interface ReplaceNotificationAcknowledgmentParams extends DefaultParams {
1273-
/** The ID of a notification, represented as a timestamp string. */
1274-
lastAcknowledgedId: string;
1275-
/** The account ID to update acknowledgment for. */
1276-
accountId?: string;
1277-
}
1278-
12791142
/*************************
12801143
* model interfaces
12811144
************************/
12821145

1283-
/**
1284-
* Status indicating whether the user has unread notifications.
1285-
*/
1286-
export interface Acknowledgment {
1287-
/** Indicates whether the user has unread notifications. */
1288-
has_unread: boolean;
1289-
/** The ID of the most recent notification available to the user. */
1290-
latest_notification_id: string;
1291-
/** The ID of the last notification acknowledged by the user. */
1292-
last_acknowledged_id: string;
1293-
}
1294-
12951146
/**
12961147
* AddDestination.
12971148
*/

test/integration/platform-notifications.v1.test.js

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -286,30 +286,6 @@ describe('PlatformNotificationsV1_integration', () => {
286286
console.log(`Retrieved a total of ${allResults.length} items(s) with pagination.`);
287287
});
288288

289-
test('getAcknowledgment()', async () => {
290-
const params = {
291-
accountId: '1369339417d906e5620b8d861d40cfd7',
292-
lastProcessedId: '1678901234000',
293-
};
294-
295-
const res = await platformNotificationsService.getAcknowledgment(params);
296-
expect(res).toBeDefined();
297-
expect(res.status).toBe(200);
298-
expect(res.result).toBeDefined();
299-
});
300-
301-
test('replaceNotificationAcknowledgment()', async () => {
302-
const params = {
303-
lastAcknowledgedId: '1772804159452',
304-
accountId: '1369339417d906e5620b8d861d40cfd7',
305-
};
306-
307-
const res = await platformNotificationsService.replaceNotificationAcknowledgment(params);
308-
expect(res).toBeDefined();
309-
expect(res.status).toBe(200);
310-
expect(res.result).toBeDefined();
311-
});
312-
313289
test('deleteNotificationPreferences()', async () => {
314290
const params = {
315291
iamId,

0 commit comments

Comments
 (0)