twilio 4.7.0 → 4.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/rest/api/v2010/account/availablePhoneNumberCountry/local.d.ts +1 -1
- package/lib/rest/api/v2010/account/availablePhoneNumberCountry/machineToMachine.d.ts +1 -1
- package/lib/rest/api/v2010/account/availablePhoneNumberCountry/mobile.d.ts +1 -1
- package/lib/rest/api/v2010/account/availablePhoneNumberCountry/national.d.ts +1 -1
- package/lib/rest/api/v2010/account/availablePhoneNumberCountry/sharedCost.d.ts +1 -1
- package/lib/rest/api/v2010/account/availablePhoneNumberCountry/tollFree.d.ts +1 -1
- package/lib/rest/api/v2010/account/availablePhoneNumberCountry/voip.d.ts +1 -1
- package/lib/rest/api/v2010/account/call.d.ts +1 -1
- package/lib/rest/api/v2010/account/incomingPhoneNumber/local.d.ts +1 -1
- package/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.d.ts +1 -1
- package/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.d.ts +1 -1
- package/lib/rest/api/v2010/account/incomingPhoneNumber.d.ts +1 -1
- package/lib/rest/content/V1.d.ts +5 -0
- package/lib/rest/content/V1.js +7 -0
- package/lib/rest/content/v1/legacyContent.d.ts +202 -0
- package/lib/rest/content/v1/legacyContent.js +138 -0
- package/lib/rest/flexApi/V1.d.ts +15 -0
- package/lib/rest/flexApi/V1.js +22 -0
- package/lib/rest/flexApi/v1/insightsAssessmentsComment.d.ts +255 -0
- package/lib/rest/flexApi/v1/insightsAssessmentsComment.js +198 -0
- package/lib/rest/flexApi/v1/insightsQuestionnaires.d.ts +357 -0
- package/lib/rest/flexApi/v1/insightsQuestionnaires.js +280 -0
- package/lib/rest/flexApi/v1/insightsQuestionnairesCategory.d.ts +111 -0
- package/lib/rest/flexApi/v1/insightsQuestionnairesCategory.js +68 -1
- package/lib/rest/flexApi/v1/insightsQuestionnairesQuestion.d.ts +129 -6
- package/lib/rest/flexApi/v1/insightsQuestionnairesQuestion.js +78 -13
- package/lib/rest/flexApi/v1/insightsSegments.d.ts +224 -0
- package/lib/rest/flexApi/v1/insightsSegments.js +154 -0
- package/lib/rest/flexApi/v1/insightsSession.d.ts +2 -2
- package/lib/rest/flexApi/v1/insightsSession.js +2 -2
- package/lib/rest/flexApi/v1/insightsUserRoles.d.ts +2 -2
- package/lib/rest/flexApi/v1/insightsUserRoles.js +2 -2
- package/lib/rest/lookups/v2/phoneNumber.d.ts +12 -0
- package/lib/rest/lookups/v2/phoneNumber.js +4 -0
- package/lib/rest/microvisor/V1.d.ts +10 -0
- package/lib/rest/microvisor/V1.js +14 -0
- package/lib/rest/microvisor/v1/accountConfig.d.ts +237 -0
- package/lib/rest/microvisor/v1/accountConfig.js +221 -0
- package/lib/rest/microvisor/v1/accountSecret.d.ts +231 -0
- package/lib/rest/microvisor/v1/accountSecret.js +219 -0
- package/lib/rest/microvisor/v1/device/deviceConfig.d.ts +245 -0
- package/lib/rest/microvisor/v1/device/deviceConfig.js +229 -0
- package/lib/rest/microvisor/v1/device/deviceSecret.d.ts +239 -0
- package/lib/rest/microvisor/v1/device/deviceSecret.js +227 -0
- package/lib/rest/microvisor/v1/device.d.ts +16 -0
- package/lib/rest/microvisor/v1/device.js +26 -0
- package/lib/rest/preview/hosted_numbers/authorizationDocument/dependentHostedNumberOrder.d.ts +1 -1
- package/lib/rest/preview/hosted_numbers/hostedNumberOrder.d.ts +1 -1
- package/lib/rest/proxy/v1/service/phoneNumber.d.ts +1 -1
- package/lib/rest/proxy/v1/service/shortCode.d.ts +1 -1
- package/lib/rest/supersim/v1/smsCommand.d.ts +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { inspect, InspectOptions } from "util";
|
|
3
|
+
import Page, { TwilioResponsePayload } from "../../../base/Page";
|
|
4
|
+
import Response from "../../../http/response";
|
|
5
|
+
import V1 from "../V1";
|
|
6
|
+
/**
|
|
7
|
+
* Options to pass to create a AccountConfigInstance
|
|
8
|
+
*/
|
|
9
|
+
export interface AccountConfigListInstanceCreateOptions {
|
|
10
|
+
/** The config key; up to 100 characters. */
|
|
11
|
+
key: string;
|
|
12
|
+
/** The config value; up to 4096 characters. */
|
|
13
|
+
value: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Options to pass to each
|
|
17
|
+
*/
|
|
18
|
+
export interface AccountConfigListInstanceEachOptions {
|
|
19
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
20
|
+
pageSize?: number;
|
|
21
|
+
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
|
22
|
+
callback?: (item: AccountConfigInstance, done: (err?: Error) => void) => void;
|
|
23
|
+
/** Function to be called upon completion of streaming */
|
|
24
|
+
done?: Function;
|
|
25
|
+
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
|
26
|
+
limit?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Options to pass to list
|
|
30
|
+
*/
|
|
31
|
+
export interface AccountConfigListInstanceOptions {
|
|
32
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
33
|
+
pageSize?: number;
|
|
34
|
+
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
|
35
|
+
limit?: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Options to pass to page
|
|
39
|
+
*/
|
|
40
|
+
export interface AccountConfigListInstancePageOptions {
|
|
41
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
42
|
+
pageSize?: number;
|
|
43
|
+
/** Page Number, this value is simply for client state */
|
|
44
|
+
pageNumber?: number;
|
|
45
|
+
/** PageToken provided by the API */
|
|
46
|
+
pageToken?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface AccountConfigContext {
|
|
49
|
+
/**
|
|
50
|
+
* Remove a AccountConfigInstance
|
|
51
|
+
*
|
|
52
|
+
* @param callback - Callback to handle processed record
|
|
53
|
+
*
|
|
54
|
+
* @returns Resolves to processed boolean
|
|
55
|
+
*/
|
|
56
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
57
|
+
/**
|
|
58
|
+
* Fetch a AccountConfigInstance
|
|
59
|
+
*
|
|
60
|
+
* @param callback - Callback to handle processed record
|
|
61
|
+
*
|
|
62
|
+
* @returns Resolves to processed AccountConfigInstance
|
|
63
|
+
*/
|
|
64
|
+
fetch(callback?: (error: Error | null, item?: AccountConfigInstance) => any): Promise<AccountConfigInstance>;
|
|
65
|
+
/**
|
|
66
|
+
* Provide a user-friendly representation
|
|
67
|
+
*/
|
|
68
|
+
toJSON(): any;
|
|
69
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
70
|
+
}
|
|
71
|
+
export interface AccountConfigContextSolution {
|
|
72
|
+
key: string;
|
|
73
|
+
}
|
|
74
|
+
export declare class AccountConfigContextImpl implements AccountConfigContext {
|
|
75
|
+
protected _version: V1;
|
|
76
|
+
protected _solution: AccountConfigContextSolution;
|
|
77
|
+
protected _uri: string;
|
|
78
|
+
constructor(_version: V1, key: string);
|
|
79
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
80
|
+
fetch(callback?: (error: Error | null, item?: AccountConfigInstance) => any): Promise<AccountConfigInstance>;
|
|
81
|
+
/**
|
|
82
|
+
* Provide a user-friendly representation
|
|
83
|
+
*
|
|
84
|
+
* @returns Object
|
|
85
|
+
*/
|
|
86
|
+
toJSON(): AccountConfigContextSolution;
|
|
87
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
88
|
+
}
|
|
89
|
+
interface AccountConfigPayload extends TwilioResponsePayload {
|
|
90
|
+
configs: AccountConfigResource[];
|
|
91
|
+
}
|
|
92
|
+
interface AccountConfigResource {
|
|
93
|
+
key: string;
|
|
94
|
+
date_updated: Date;
|
|
95
|
+
value: string;
|
|
96
|
+
url: string;
|
|
97
|
+
}
|
|
98
|
+
export declare class AccountConfigInstance {
|
|
99
|
+
protected _version: V1;
|
|
100
|
+
protected _solution: AccountConfigContextSolution;
|
|
101
|
+
protected _context?: AccountConfigContext;
|
|
102
|
+
constructor(_version: V1, payload: AccountConfigResource, key?: string);
|
|
103
|
+
/**
|
|
104
|
+
* The config key; up to 100 characters.
|
|
105
|
+
*/
|
|
106
|
+
key: string;
|
|
107
|
+
dateUpdated: Date;
|
|
108
|
+
/**
|
|
109
|
+
* The config value; up to 4096 characters.
|
|
110
|
+
*/
|
|
111
|
+
value: string;
|
|
112
|
+
/**
|
|
113
|
+
* The absolute URL of the Config.
|
|
114
|
+
*/
|
|
115
|
+
url: string;
|
|
116
|
+
private get _proxy();
|
|
117
|
+
/**
|
|
118
|
+
* Remove a AccountConfigInstance
|
|
119
|
+
*
|
|
120
|
+
* @param callback - Callback to handle processed record
|
|
121
|
+
*
|
|
122
|
+
* @returns Resolves to processed boolean
|
|
123
|
+
*/
|
|
124
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
125
|
+
/**
|
|
126
|
+
* Fetch a AccountConfigInstance
|
|
127
|
+
*
|
|
128
|
+
* @param callback - Callback to handle processed record
|
|
129
|
+
*
|
|
130
|
+
* @returns Resolves to processed AccountConfigInstance
|
|
131
|
+
*/
|
|
132
|
+
fetch(callback?: (error: Error | null, item?: AccountConfigInstance) => any): Promise<AccountConfigInstance>;
|
|
133
|
+
/**
|
|
134
|
+
* Provide a user-friendly representation
|
|
135
|
+
*
|
|
136
|
+
* @returns Object
|
|
137
|
+
*/
|
|
138
|
+
toJSON(): {
|
|
139
|
+
key: string;
|
|
140
|
+
dateUpdated: Date;
|
|
141
|
+
value: string;
|
|
142
|
+
url: string;
|
|
143
|
+
};
|
|
144
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
145
|
+
}
|
|
146
|
+
export interface AccountConfigSolution {
|
|
147
|
+
}
|
|
148
|
+
export interface AccountConfigListInstance {
|
|
149
|
+
_version: V1;
|
|
150
|
+
_solution: AccountConfigSolution;
|
|
151
|
+
_uri: string;
|
|
152
|
+
(key: string): AccountConfigContext;
|
|
153
|
+
get(key: string): AccountConfigContext;
|
|
154
|
+
/**
|
|
155
|
+
* Create a AccountConfigInstance
|
|
156
|
+
*
|
|
157
|
+
* @param params - Parameter for request
|
|
158
|
+
* @param callback - Callback to handle processed record
|
|
159
|
+
*
|
|
160
|
+
* @returns Resolves to processed AccountConfigInstance
|
|
161
|
+
*/
|
|
162
|
+
create(params: AccountConfigListInstanceCreateOptions, callback?: (error: Error | null, item?: AccountConfigInstance) => any): Promise<AccountConfigInstance>;
|
|
163
|
+
/**
|
|
164
|
+
* Streams AccountConfigInstance records from the API.
|
|
165
|
+
*
|
|
166
|
+
* This operation lazily loads records as efficiently as possible until the limit
|
|
167
|
+
* is reached.
|
|
168
|
+
*
|
|
169
|
+
* The results are passed into the callback function, so this operation is memory
|
|
170
|
+
* efficient.
|
|
171
|
+
*
|
|
172
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
173
|
+
* function.
|
|
174
|
+
*
|
|
175
|
+
* @param { AccountConfigListInstanceEachOptions } [params] - Options for request
|
|
176
|
+
* @param { function } [callback] - Function to process each record
|
|
177
|
+
*/
|
|
178
|
+
each(callback?: (item: AccountConfigInstance, done: (err?: Error) => void) => void): void;
|
|
179
|
+
each(params: AccountConfigListInstanceEachOptions, callback?: (item: AccountConfigInstance, done: (err?: Error) => void) => void): void;
|
|
180
|
+
/**
|
|
181
|
+
* Retrieve a single target page of AccountConfigInstance records from the API.
|
|
182
|
+
*
|
|
183
|
+
* The request is executed immediately.
|
|
184
|
+
*
|
|
185
|
+
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
|
186
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
187
|
+
*/
|
|
188
|
+
getPage(targetUrl: string, callback?: (error: Error | null, items: AccountConfigPage) => any): Promise<AccountConfigPage>;
|
|
189
|
+
/**
|
|
190
|
+
* Lists AccountConfigInstance records from the API as a list.
|
|
191
|
+
*
|
|
192
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
193
|
+
* function.
|
|
194
|
+
*
|
|
195
|
+
* @param { AccountConfigListInstanceOptions } [params] - Options for request
|
|
196
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
197
|
+
*/
|
|
198
|
+
list(callback?: (error: Error | null, items: AccountConfigInstance[]) => any): Promise<AccountConfigInstance[]>;
|
|
199
|
+
list(params: AccountConfigListInstanceOptions, callback?: (error: Error | null, items: AccountConfigInstance[]) => any): Promise<AccountConfigInstance[]>;
|
|
200
|
+
/**
|
|
201
|
+
* Retrieve a single page of AccountConfigInstance records from the API.
|
|
202
|
+
*
|
|
203
|
+
* The request is executed immediately.
|
|
204
|
+
*
|
|
205
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
206
|
+
* function.
|
|
207
|
+
*
|
|
208
|
+
* @param { AccountConfigListInstancePageOptions } [params] - Options for request
|
|
209
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
210
|
+
*/
|
|
211
|
+
page(callback?: (error: Error | null, items: AccountConfigPage) => any): Promise<AccountConfigPage>;
|
|
212
|
+
page(params: AccountConfigListInstancePageOptions, callback?: (error: Error | null, items: AccountConfigPage) => any): Promise<AccountConfigPage>;
|
|
213
|
+
/**
|
|
214
|
+
* Provide a user-friendly representation
|
|
215
|
+
*/
|
|
216
|
+
toJSON(): any;
|
|
217
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
218
|
+
}
|
|
219
|
+
export declare function AccountConfigListInstance(version: V1): AccountConfigListInstance;
|
|
220
|
+
export declare class AccountConfigPage extends Page<V1, AccountConfigPayload, AccountConfigResource, AccountConfigInstance> {
|
|
221
|
+
/**
|
|
222
|
+
* Initialize the AccountConfigPage
|
|
223
|
+
*
|
|
224
|
+
* @param version - Version of the resource
|
|
225
|
+
* @param response - Response from the API
|
|
226
|
+
* @param solution - Path solution
|
|
227
|
+
*/
|
|
228
|
+
constructor(version: V1, response: Response<string>, solution: AccountConfigSolution);
|
|
229
|
+
/**
|
|
230
|
+
* Build an instance of AccountConfigInstance
|
|
231
|
+
*
|
|
232
|
+
* @param payload - Payload response from the API
|
|
233
|
+
*/
|
|
234
|
+
getInstance(payload: AccountConfigResource): AccountConfigInstance;
|
|
235
|
+
[inspect.custom](depth: any, options: InspectOptions): string;
|
|
236
|
+
}
|
|
237
|
+
export {};
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Microvisor
|
|
9
|
+
* This is the public Twilio REST API.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator.
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.AccountConfigPage = exports.AccountConfigListInstance = exports.AccountConfigInstance = exports.AccountConfigContextImpl = void 0;
|
|
20
|
+
const util_1 = require("util");
|
|
21
|
+
const Page_1 = __importDefault(require("../../../base/Page"));
|
|
22
|
+
const deserialize = require("../../../base/deserialize");
|
|
23
|
+
const serialize = require("../../../base/serialize");
|
|
24
|
+
const utility_1 = require("../../../base/utility");
|
|
25
|
+
class AccountConfigContextImpl {
|
|
26
|
+
constructor(_version, key) {
|
|
27
|
+
this._version = _version;
|
|
28
|
+
if (!(0, utility_1.isValidPathParam)(key)) {
|
|
29
|
+
throw new Error("Parameter 'key' is not valid.");
|
|
30
|
+
}
|
|
31
|
+
this._solution = { key };
|
|
32
|
+
this._uri = `/Configs/${key}`;
|
|
33
|
+
}
|
|
34
|
+
remove(callback) {
|
|
35
|
+
const instance = this;
|
|
36
|
+
let operationVersion = instance._version, operationPromise = operationVersion.remove({
|
|
37
|
+
uri: instance._uri,
|
|
38
|
+
method: "delete",
|
|
39
|
+
});
|
|
40
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
41
|
+
return operationPromise;
|
|
42
|
+
}
|
|
43
|
+
fetch(callback) {
|
|
44
|
+
const instance = this;
|
|
45
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
46
|
+
uri: instance._uri,
|
|
47
|
+
method: "get",
|
|
48
|
+
});
|
|
49
|
+
operationPromise = operationPromise.then((payload) => new AccountConfigInstance(operationVersion, payload, instance._solution.key));
|
|
50
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
51
|
+
return operationPromise;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Provide a user-friendly representation
|
|
55
|
+
*
|
|
56
|
+
* @returns Object
|
|
57
|
+
*/
|
|
58
|
+
toJSON() {
|
|
59
|
+
return this._solution;
|
|
60
|
+
}
|
|
61
|
+
[util_1.inspect.custom](_depth, options) {
|
|
62
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.AccountConfigContextImpl = AccountConfigContextImpl;
|
|
66
|
+
class AccountConfigInstance {
|
|
67
|
+
constructor(_version, payload, key) {
|
|
68
|
+
this._version = _version;
|
|
69
|
+
this.key = payload.key;
|
|
70
|
+
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
|
71
|
+
this.value = payload.value;
|
|
72
|
+
this.url = payload.url;
|
|
73
|
+
this._solution = { key: key || this.key };
|
|
74
|
+
}
|
|
75
|
+
get _proxy() {
|
|
76
|
+
this._context =
|
|
77
|
+
this._context ||
|
|
78
|
+
new AccountConfigContextImpl(this._version, this._solution.key);
|
|
79
|
+
return this._context;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Remove a AccountConfigInstance
|
|
83
|
+
*
|
|
84
|
+
* @param callback - Callback to handle processed record
|
|
85
|
+
*
|
|
86
|
+
* @returns Resolves to processed boolean
|
|
87
|
+
*/
|
|
88
|
+
remove(callback) {
|
|
89
|
+
return this._proxy.remove(callback);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Fetch a AccountConfigInstance
|
|
93
|
+
*
|
|
94
|
+
* @param callback - Callback to handle processed record
|
|
95
|
+
*
|
|
96
|
+
* @returns Resolves to processed AccountConfigInstance
|
|
97
|
+
*/
|
|
98
|
+
fetch(callback) {
|
|
99
|
+
return this._proxy.fetch(callback);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Provide a user-friendly representation
|
|
103
|
+
*
|
|
104
|
+
* @returns Object
|
|
105
|
+
*/
|
|
106
|
+
toJSON() {
|
|
107
|
+
return {
|
|
108
|
+
key: this.key,
|
|
109
|
+
dateUpdated: this.dateUpdated,
|
|
110
|
+
value: this.value,
|
|
111
|
+
url: this.url,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
[util_1.inspect.custom](_depth, options) {
|
|
115
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
exports.AccountConfigInstance = AccountConfigInstance;
|
|
119
|
+
function AccountConfigListInstance(version) {
|
|
120
|
+
const instance = ((key) => instance.get(key));
|
|
121
|
+
instance.get = function get(key) {
|
|
122
|
+
return new AccountConfigContextImpl(version, key);
|
|
123
|
+
};
|
|
124
|
+
instance._version = version;
|
|
125
|
+
instance._solution = {};
|
|
126
|
+
instance._uri = `/Configs`;
|
|
127
|
+
instance.create = function create(params, callback) {
|
|
128
|
+
if (params === null || params === undefined) {
|
|
129
|
+
throw new Error('Required parameter "params" missing.');
|
|
130
|
+
}
|
|
131
|
+
if (params["key"] === null || params["key"] === undefined) {
|
|
132
|
+
throw new Error("Required parameter \"params['key']\" missing.");
|
|
133
|
+
}
|
|
134
|
+
if (params["value"] === null || params["value"] === undefined) {
|
|
135
|
+
throw new Error("Required parameter \"params['value']\" missing.");
|
|
136
|
+
}
|
|
137
|
+
let data = {};
|
|
138
|
+
data["Key"] = params["key"];
|
|
139
|
+
data["Value"] = params["value"];
|
|
140
|
+
const headers = {};
|
|
141
|
+
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
142
|
+
let operationVersion = version, operationPromise = operationVersion.create({
|
|
143
|
+
uri: instance._uri,
|
|
144
|
+
method: "post",
|
|
145
|
+
data,
|
|
146
|
+
headers,
|
|
147
|
+
});
|
|
148
|
+
operationPromise = operationPromise.then((payload) => new AccountConfigInstance(operationVersion, payload));
|
|
149
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
150
|
+
return operationPromise;
|
|
151
|
+
};
|
|
152
|
+
instance.page = function page(params, callback) {
|
|
153
|
+
if (params instanceof Function) {
|
|
154
|
+
callback = params;
|
|
155
|
+
params = {};
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
params = params || {};
|
|
159
|
+
}
|
|
160
|
+
let data = {};
|
|
161
|
+
if (params["pageSize"] !== undefined)
|
|
162
|
+
data["PageSize"] = params["pageSize"];
|
|
163
|
+
if (params.pageNumber !== undefined)
|
|
164
|
+
data["Page"] = params.pageNumber;
|
|
165
|
+
if (params.pageToken !== undefined)
|
|
166
|
+
data["PageToken"] = params.pageToken;
|
|
167
|
+
const headers = {};
|
|
168
|
+
let operationVersion = version, operationPromise = operationVersion.page({
|
|
169
|
+
uri: instance._uri,
|
|
170
|
+
method: "get",
|
|
171
|
+
params: data,
|
|
172
|
+
headers,
|
|
173
|
+
});
|
|
174
|
+
operationPromise = operationPromise.then((payload) => new AccountConfigPage(operationVersion, payload, instance._solution));
|
|
175
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
176
|
+
return operationPromise;
|
|
177
|
+
};
|
|
178
|
+
instance.each = instance._version.each;
|
|
179
|
+
instance.list = instance._version.list;
|
|
180
|
+
instance.getPage = function getPage(targetUrl, callback) {
|
|
181
|
+
const operationPromise = instance._version._domain.twilio.request({
|
|
182
|
+
method: "get",
|
|
183
|
+
uri: targetUrl,
|
|
184
|
+
});
|
|
185
|
+
let pagePromise = operationPromise.then((payload) => new AccountConfigPage(instance._version, payload, instance._solution));
|
|
186
|
+
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
187
|
+
return pagePromise;
|
|
188
|
+
};
|
|
189
|
+
instance.toJSON = function toJSON() {
|
|
190
|
+
return instance._solution;
|
|
191
|
+
};
|
|
192
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
193
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
194
|
+
};
|
|
195
|
+
return instance;
|
|
196
|
+
}
|
|
197
|
+
exports.AccountConfigListInstance = AccountConfigListInstance;
|
|
198
|
+
class AccountConfigPage extends Page_1.default {
|
|
199
|
+
/**
|
|
200
|
+
* Initialize the AccountConfigPage
|
|
201
|
+
*
|
|
202
|
+
* @param version - Version of the resource
|
|
203
|
+
* @param response - Response from the API
|
|
204
|
+
* @param solution - Path solution
|
|
205
|
+
*/
|
|
206
|
+
constructor(version, response, solution) {
|
|
207
|
+
super(version, response, solution);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Build an instance of AccountConfigInstance
|
|
211
|
+
*
|
|
212
|
+
* @param payload - Payload response from the API
|
|
213
|
+
*/
|
|
214
|
+
getInstance(payload) {
|
|
215
|
+
return new AccountConfigInstance(this._version, payload);
|
|
216
|
+
}
|
|
217
|
+
[util_1.inspect.custom](depth, options) {
|
|
218
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
exports.AccountConfigPage = AccountConfigPage;
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { inspect, InspectOptions } from "util";
|
|
3
|
+
import Page, { TwilioResponsePayload } from "../../../base/Page";
|
|
4
|
+
import Response from "../../../http/response";
|
|
5
|
+
import V1 from "../V1";
|
|
6
|
+
/**
|
|
7
|
+
* Options to pass to create a AccountSecretInstance
|
|
8
|
+
*/
|
|
9
|
+
export interface AccountSecretListInstanceCreateOptions {
|
|
10
|
+
/** The secret key; up to 100 characters. */
|
|
11
|
+
key: string;
|
|
12
|
+
/** The secret value; up to 4096 characters. */
|
|
13
|
+
value: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Options to pass to each
|
|
17
|
+
*/
|
|
18
|
+
export interface AccountSecretListInstanceEachOptions {
|
|
19
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
20
|
+
pageSize?: number;
|
|
21
|
+
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
|
22
|
+
callback?: (item: AccountSecretInstance, done: (err?: Error) => void) => void;
|
|
23
|
+
/** Function to be called upon completion of streaming */
|
|
24
|
+
done?: Function;
|
|
25
|
+
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
|
26
|
+
limit?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Options to pass to list
|
|
30
|
+
*/
|
|
31
|
+
export interface AccountSecretListInstanceOptions {
|
|
32
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
33
|
+
pageSize?: number;
|
|
34
|
+
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
|
35
|
+
limit?: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Options to pass to page
|
|
39
|
+
*/
|
|
40
|
+
export interface AccountSecretListInstancePageOptions {
|
|
41
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
42
|
+
pageSize?: number;
|
|
43
|
+
/** Page Number, this value is simply for client state */
|
|
44
|
+
pageNumber?: number;
|
|
45
|
+
/** PageToken provided by the API */
|
|
46
|
+
pageToken?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface AccountSecretContext {
|
|
49
|
+
/**
|
|
50
|
+
* Remove a AccountSecretInstance
|
|
51
|
+
*
|
|
52
|
+
* @param callback - Callback to handle processed record
|
|
53
|
+
*
|
|
54
|
+
* @returns Resolves to processed boolean
|
|
55
|
+
*/
|
|
56
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
57
|
+
/**
|
|
58
|
+
* Fetch a AccountSecretInstance
|
|
59
|
+
*
|
|
60
|
+
* @param callback - Callback to handle processed record
|
|
61
|
+
*
|
|
62
|
+
* @returns Resolves to processed AccountSecretInstance
|
|
63
|
+
*/
|
|
64
|
+
fetch(callback?: (error: Error | null, item?: AccountSecretInstance) => any): Promise<AccountSecretInstance>;
|
|
65
|
+
/**
|
|
66
|
+
* Provide a user-friendly representation
|
|
67
|
+
*/
|
|
68
|
+
toJSON(): any;
|
|
69
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
70
|
+
}
|
|
71
|
+
export interface AccountSecretContextSolution {
|
|
72
|
+
key: string;
|
|
73
|
+
}
|
|
74
|
+
export declare class AccountSecretContextImpl implements AccountSecretContext {
|
|
75
|
+
protected _version: V1;
|
|
76
|
+
protected _solution: AccountSecretContextSolution;
|
|
77
|
+
protected _uri: string;
|
|
78
|
+
constructor(_version: V1, key: string);
|
|
79
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
80
|
+
fetch(callback?: (error: Error | null, item?: AccountSecretInstance) => any): Promise<AccountSecretInstance>;
|
|
81
|
+
/**
|
|
82
|
+
* Provide a user-friendly representation
|
|
83
|
+
*
|
|
84
|
+
* @returns Object
|
|
85
|
+
*/
|
|
86
|
+
toJSON(): AccountSecretContextSolution;
|
|
87
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
88
|
+
}
|
|
89
|
+
interface AccountSecretPayload extends TwilioResponsePayload {
|
|
90
|
+
secrets: AccountSecretResource[];
|
|
91
|
+
}
|
|
92
|
+
interface AccountSecretResource {
|
|
93
|
+
key: string;
|
|
94
|
+
date_rotated: Date;
|
|
95
|
+
url: string;
|
|
96
|
+
}
|
|
97
|
+
export declare class AccountSecretInstance {
|
|
98
|
+
protected _version: V1;
|
|
99
|
+
protected _solution: AccountSecretContextSolution;
|
|
100
|
+
protected _context?: AccountSecretContext;
|
|
101
|
+
constructor(_version: V1, payload: AccountSecretResource, key?: string);
|
|
102
|
+
/**
|
|
103
|
+
* The secret key; up to 100 characters.
|
|
104
|
+
*/
|
|
105
|
+
key: string;
|
|
106
|
+
dateRotated: Date;
|
|
107
|
+
/**
|
|
108
|
+
* The absolute URL of the Secret.
|
|
109
|
+
*/
|
|
110
|
+
url: string;
|
|
111
|
+
private get _proxy();
|
|
112
|
+
/**
|
|
113
|
+
* Remove a AccountSecretInstance
|
|
114
|
+
*
|
|
115
|
+
* @param callback - Callback to handle processed record
|
|
116
|
+
*
|
|
117
|
+
* @returns Resolves to processed boolean
|
|
118
|
+
*/
|
|
119
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
120
|
+
/**
|
|
121
|
+
* Fetch a AccountSecretInstance
|
|
122
|
+
*
|
|
123
|
+
* @param callback - Callback to handle processed record
|
|
124
|
+
*
|
|
125
|
+
* @returns Resolves to processed AccountSecretInstance
|
|
126
|
+
*/
|
|
127
|
+
fetch(callback?: (error: Error | null, item?: AccountSecretInstance) => any): Promise<AccountSecretInstance>;
|
|
128
|
+
/**
|
|
129
|
+
* Provide a user-friendly representation
|
|
130
|
+
*
|
|
131
|
+
* @returns Object
|
|
132
|
+
*/
|
|
133
|
+
toJSON(): {
|
|
134
|
+
key: string;
|
|
135
|
+
dateRotated: Date;
|
|
136
|
+
url: string;
|
|
137
|
+
};
|
|
138
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
139
|
+
}
|
|
140
|
+
export interface AccountSecretSolution {
|
|
141
|
+
}
|
|
142
|
+
export interface AccountSecretListInstance {
|
|
143
|
+
_version: V1;
|
|
144
|
+
_solution: AccountSecretSolution;
|
|
145
|
+
_uri: string;
|
|
146
|
+
(key: string): AccountSecretContext;
|
|
147
|
+
get(key: string): AccountSecretContext;
|
|
148
|
+
/**
|
|
149
|
+
* Create a AccountSecretInstance
|
|
150
|
+
*
|
|
151
|
+
* @param params - Parameter for request
|
|
152
|
+
* @param callback - Callback to handle processed record
|
|
153
|
+
*
|
|
154
|
+
* @returns Resolves to processed AccountSecretInstance
|
|
155
|
+
*/
|
|
156
|
+
create(params: AccountSecretListInstanceCreateOptions, callback?: (error: Error | null, item?: AccountSecretInstance) => any): Promise<AccountSecretInstance>;
|
|
157
|
+
/**
|
|
158
|
+
* Streams AccountSecretInstance records from the API.
|
|
159
|
+
*
|
|
160
|
+
* This operation lazily loads records as efficiently as possible until the limit
|
|
161
|
+
* is reached.
|
|
162
|
+
*
|
|
163
|
+
* The results are passed into the callback function, so this operation is memory
|
|
164
|
+
* efficient.
|
|
165
|
+
*
|
|
166
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
167
|
+
* function.
|
|
168
|
+
*
|
|
169
|
+
* @param { AccountSecretListInstanceEachOptions } [params] - Options for request
|
|
170
|
+
* @param { function } [callback] - Function to process each record
|
|
171
|
+
*/
|
|
172
|
+
each(callback?: (item: AccountSecretInstance, done: (err?: Error) => void) => void): void;
|
|
173
|
+
each(params: AccountSecretListInstanceEachOptions, callback?: (item: AccountSecretInstance, done: (err?: Error) => void) => void): void;
|
|
174
|
+
/**
|
|
175
|
+
* Retrieve a single target page of AccountSecretInstance records from the API.
|
|
176
|
+
*
|
|
177
|
+
* The request is executed immediately.
|
|
178
|
+
*
|
|
179
|
+
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
|
180
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
181
|
+
*/
|
|
182
|
+
getPage(targetUrl: string, callback?: (error: Error | null, items: AccountSecretPage) => any): Promise<AccountSecretPage>;
|
|
183
|
+
/**
|
|
184
|
+
* Lists AccountSecretInstance records from the API as a list.
|
|
185
|
+
*
|
|
186
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
187
|
+
* function.
|
|
188
|
+
*
|
|
189
|
+
* @param { AccountSecretListInstanceOptions } [params] - Options for request
|
|
190
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
191
|
+
*/
|
|
192
|
+
list(callback?: (error: Error | null, items: AccountSecretInstance[]) => any): Promise<AccountSecretInstance[]>;
|
|
193
|
+
list(params: AccountSecretListInstanceOptions, callback?: (error: Error | null, items: AccountSecretInstance[]) => any): Promise<AccountSecretInstance[]>;
|
|
194
|
+
/**
|
|
195
|
+
* Retrieve a single page of AccountSecretInstance records from the API.
|
|
196
|
+
*
|
|
197
|
+
* The request is executed immediately.
|
|
198
|
+
*
|
|
199
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
200
|
+
* function.
|
|
201
|
+
*
|
|
202
|
+
* @param { AccountSecretListInstancePageOptions } [params] - Options for request
|
|
203
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
204
|
+
*/
|
|
205
|
+
page(callback?: (error: Error | null, items: AccountSecretPage) => any): Promise<AccountSecretPage>;
|
|
206
|
+
page(params: AccountSecretListInstancePageOptions, callback?: (error: Error | null, items: AccountSecretPage) => any): Promise<AccountSecretPage>;
|
|
207
|
+
/**
|
|
208
|
+
* Provide a user-friendly representation
|
|
209
|
+
*/
|
|
210
|
+
toJSON(): any;
|
|
211
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
212
|
+
}
|
|
213
|
+
export declare function AccountSecretListInstance(version: V1): AccountSecretListInstance;
|
|
214
|
+
export declare class AccountSecretPage extends Page<V1, AccountSecretPayload, AccountSecretResource, AccountSecretInstance> {
|
|
215
|
+
/**
|
|
216
|
+
* Initialize the AccountSecretPage
|
|
217
|
+
*
|
|
218
|
+
* @param version - Version of the resource
|
|
219
|
+
* @param response - Response from the API
|
|
220
|
+
* @param solution - Path solution
|
|
221
|
+
*/
|
|
222
|
+
constructor(version: V1, response: Response<string>, solution: AccountSecretSolution);
|
|
223
|
+
/**
|
|
224
|
+
* Build an instance of AccountSecretInstance
|
|
225
|
+
*
|
|
226
|
+
* @param payload - Payload response from the API
|
|
227
|
+
*/
|
|
228
|
+
getInstance(payload: AccountSecretResource): AccountSecretInstance;
|
|
229
|
+
[inspect.custom](depth: any, options: InspectOptions): string;
|
|
230
|
+
}
|
|
231
|
+
export {};
|