-
Notifications
You must be signed in to change notification settings - Fork 1
/
update.ts
34 lines (28 loc) · 930 Bytes
/
update.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { Numbers } from '@sinch/sdk-core';
import {
getHmacSecretFromConfig,
getPrintFormat,
initNumbersService,
printFullResponse,
} from '../../config';
import * as process from 'process';
(async () => {
console.log('*******************************');
console.log('* UpdateCallbackConfiguration *');
console.log('*******************************');
const hmacSecret = getHmacSecretFromConfig();
const requestData: Numbers.UpdateCallbackConfigurationRequestData = {
updateCallbackConfigurationRequestBody: {
hmacSecret,
},
};
const numbersService = initNumbersService();
const response = await numbersService.callbacks.update(requestData);
const printFormat = getPrintFormat(process.argv);
if (printFormat === 'pretty') {
const prettyResponse = response.hmacSecret;
console.log(JSON.stringify(prettyResponse, null, 2));
} else {
printFullResponse(response);
}
})();