twilio 4.11.2 → 4.13.0
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/base/BaseTwilio.js +15 -8
- package/lib/rest/api/v2010/account/message.d.ts +2 -2
- package/lib/rest/api/v2010/account/message.js +2 -2
- package/lib/rest/insights/v1/call/annotation.d.ts +9 -9
- package/lib/rest/insights/v1/call/callSummary.d.ts +58 -1
- package/lib/rest/insights/v1/call/event.d.ts +30 -3
- package/lib/rest/insights/v1/call/metric.d.ts +27 -6
- package/lib/rest/insights/v1/callSummaries.d.ts +135 -78
- package/lib/rest/insights/v1/callSummaries.js +8 -6
- package/lib/rest/insights/v1/setting.d.ts +16 -4
- package/lib/rest/lookups/v2/phoneNumber.d.ts +9 -1
- package/lib/rest/lookups/v2/phoneNumber.js +4 -0
- package/lib/rest/numbers/V1.d.ts +10 -0
- package/lib/rest/numbers/V1.js +15 -0
- package/lib/rest/numbers/V2.d.ts +10 -0
- package/lib/rest/numbers/V2.js +14 -0
- package/lib/rest/numbers/v1/portingBulkPortability.d.ts +120 -0
- package/lib/rest/numbers/v1/portingBulkPortability.js +136 -0
- package/lib/rest/numbers/v1/portingPortability.d.ts +134 -0
- package/lib/rest/numbers/v1/portingPortability.js +124 -0
- package/lib/rest/numbers/v2/authorizationDocument/dependentHostedNumberOrder.d.ts +265 -0
- package/lib/rest/numbers/v2/authorizationDocument/dependentHostedNumberOrder.js +164 -0
- package/lib/rest/numbers/v2/authorizationDocument.d.ts +288 -0
- package/lib/rest/numbers/v2/authorizationDocument.js +257 -0
- package/lib/rest/numbers/v2/hostedNumberOrder.d.ts +390 -0
- package/lib/rest/numbers/v2/hostedNumberOrder.js +296 -0
- package/lib/rest/taskrouter/v1/workspace/worker.d.ts +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,288 @@
|
|
|
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 V2 from "../V2";
|
|
6
|
+
import { DependentHostedNumberOrderListInstance } from "./authorizationDocument/dependentHostedNumberOrder";
|
|
7
|
+
export type AuthorizationDocumentStatus = "opened" | "signing" | "signed" | "canceled" | "failed";
|
|
8
|
+
/**
|
|
9
|
+
* Options to pass to create a AuthorizationDocumentInstance
|
|
10
|
+
*/
|
|
11
|
+
export interface AuthorizationDocumentListInstanceCreateOptions {
|
|
12
|
+
/** A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. */
|
|
13
|
+
addressSid: string;
|
|
14
|
+
/** Email that this AuthorizationDocument will be sent to for signing. */
|
|
15
|
+
email: string;
|
|
16
|
+
/** The contact phone number of the person authorized to sign the Authorization Document. */
|
|
17
|
+
contactPhoneNumber: string;
|
|
18
|
+
/** The title of the person authorized to sign the Authorization Document for this phone number. */
|
|
19
|
+
contactTitle?: string;
|
|
20
|
+
/** Email recipients who will be informed when an Authorization Document has been sent and signed. */
|
|
21
|
+
ccEmails?: Array<string>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Options to pass to each
|
|
25
|
+
*/
|
|
26
|
+
export interface AuthorizationDocumentListInstanceEachOptions {
|
|
27
|
+
/** Email that this AuthorizationDocument will be sent to for signing. */
|
|
28
|
+
email?: string;
|
|
29
|
+
/** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/api/phone-numbers/hosted-number-authorization-documents#status-values) for more information on each of these statuses. */
|
|
30
|
+
status?: AuthorizationDocumentStatus;
|
|
31
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
32
|
+
pageSize?: number;
|
|
33
|
+
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
|
34
|
+
callback?: (item: AuthorizationDocumentInstance, done: (err?: Error) => void) => void;
|
|
35
|
+
/** Function to be called upon completion of streaming */
|
|
36
|
+
done?: Function;
|
|
37
|
+
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
|
38
|
+
limit?: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Options to pass to list
|
|
42
|
+
*/
|
|
43
|
+
export interface AuthorizationDocumentListInstanceOptions {
|
|
44
|
+
/** Email that this AuthorizationDocument will be sent to for signing. */
|
|
45
|
+
email?: string;
|
|
46
|
+
/** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/api/phone-numbers/hosted-number-authorization-documents#status-values) for more information on each of these statuses. */
|
|
47
|
+
status?: AuthorizationDocumentStatus;
|
|
48
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
49
|
+
pageSize?: number;
|
|
50
|
+
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
|
51
|
+
limit?: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Options to pass to page
|
|
55
|
+
*/
|
|
56
|
+
export interface AuthorizationDocumentListInstancePageOptions {
|
|
57
|
+
/** Email that this AuthorizationDocument will be sent to for signing. */
|
|
58
|
+
email?: string;
|
|
59
|
+
/** Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/api/phone-numbers/hosted-number-authorization-documents#status-values) for more information on each of these statuses. */
|
|
60
|
+
status?: AuthorizationDocumentStatus;
|
|
61
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
62
|
+
pageSize?: number;
|
|
63
|
+
/** Page Number, this value is simply for client state */
|
|
64
|
+
pageNumber?: number;
|
|
65
|
+
/** PageToken provided by the API */
|
|
66
|
+
pageToken?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface AuthorizationDocumentContext {
|
|
69
|
+
dependentHostedNumberOrders: DependentHostedNumberOrderListInstance;
|
|
70
|
+
/**
|
|
71
|
+
* Remove a AuthorizationDocumentInstance
|
|
72
|
+
*
|
|
73
|
+
* @param callback - Callback to handle processed record
|
|
74
|
+
*
|
|
75
|
+
* @returns Resolves to processed boolean
|
|
76
|
+
*/
|
|
77
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
78
|
+
/**
|
|
79
|
+
* Fetch a AuthorizationDocumentInstance
|
|
80
|
+
*
|
|
81
|
+
* @param callback - Callback to handle processed record
|
|
82
|
+
*
|
|
83
|
+
* @returns Resolves to processed AuthorizationDocumentInstance
|
|
84
|
+
*/
|
|
85
|
+
fetch(callback?: (error: Error | null, item?: AuthorizationDocumentInstance) => any): Promise<AuthorizationDocumentInstance>;
|
|
86
|
+
/**
|
|
87
|
+
* Provide a user-friendly representation
|
|
88
|
+
*/
|
|
89
|
+
toJSON(): any;
|
|
90
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
91
|
+
}
|
|
92
|
+
export interface AuthorizationDocumentContextSolution {
|
|
93
|
+
sid: string;
|
|
94
|
+
}
|
|
95
|
+
export declare class AuthorizationDocumentContextImpl implements AuthorizationDocumentContext {
|
|
96
|
+
protected _version: V2;
|
|
97
|
+
protected _solution: AuthorizationDocumentContextSolution;
|
|
98
|
+
protected _uri: string;
|
|
99
|
+
protected _dependentHostedNumberOrders?: DependentHostedNumberOrderListInstance;
|
|
100
|
+
constructor(_version: V2, sid: string);
|
|
101
|
+
get dependentHostedNumberOrders(): DependentHostedNumberOrderListInstance;
|
|
102
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
103
|
+
fetch(callback?: (error: Error | null, item?: AuthorizationDocumentInstance) => any): Promise<AuthorizationDocumentInstance>;
|
|
104
|
+
/**
|
|
105
|
+
* Provide a user-friendly representation
|
|
106
|
+
*
|
|
107
|
+
* @returns Object
|
|
108
|
+
*/
|
|
109
|
+
toJSON(): AuthorizationDocumentContextSolution;
|
|
110
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
111
|
+
}
|
|
112
|
+
interface AuthorizationDocumentPayload extends TwilioResponsePayload {
|
|
113
|
+
items: AuthorizationDocumentResource[];
|
|
114
|
+
}
|
|
115
|
+
interface AuthorizationDocumentResource {
|
|
116
|
+
sid: string;
|
|
117
|
+
address_sid: string;
|
|
118
|
+
status: AuthorizationDocumentStatus;
|
|
119
|
+
email: string;
|
|
120
|
+
cc_emails: Array<string>;
|
|
121
|
+
date_created: Date;
|
|
122
|
+
date_updated: Date;
|
|
123
|
+
url: string;
|
|
124
|
+
links: Record<string, string>;
|
|
125
|
+
}
|
|
126
|
+
export declare class AuthorizationDocumentInstance {
|
|
127
|
+
protected _version: V2;
|
|
128
|
+
protected _solution: AuthorizationDocumentContextSolution;
|
|
129
|
+
protected _context?: AuthorizationDocumentContext;
|
|
130
|
+
constructor(_version: V2, payload: AuthorizationDocumentResource, sid?: string);
|
|
131
|
+
/**
|
|
132
|
+
* A 34 character string that uniquely identifies this AuthorizationDocument.
|
|
133
|
+
*/
|
|
134
|
+
sid: string;
|
|
135
|
+
/**
|
|
136
|
+
* A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument.
|
|
137
|
+
*/
|
|
138
|
+
addressSid: string;
|
|
139
|
+
status: AuthorizationDocumentStatus;
|
|
140
|
+
/**
|
|
141
|
+
* Email that this AuthorizationDocument will be sent to for signing.
|
|
142
|
+
*/
|
|
143
|
+
email: string;
|
|
144
|
+
/**
|
|
145
|
+
* Email recipients who will be informed when an Authorization Document has been sent and signed.
|
|
146
|
+
*/
|
|
147
|
+
ccEmails: Array<string>;
|
|
148
|
+
/**
|
|
149
|
+
* The date this resource was created, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format.
|
|
150
|
+
*/
|
|
151
|
+
dateCreated: Date;
|
|
152
|
+
/**
|
|
153
|
+
* The date that this resource was updated, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format.
|
|
154
|
+
*/
|
|
155
|
+
dateUpdated: Date;
|
|
156
|
+
url: string;
|
|
157
|
+
links: Record<string, string>;
|
|
158
|
+
private get _proxy();
|
|
159
|
+
/**
|
|
160
|
+
* Remove a AuthorizationDocumentInstance
|
|
161
|
+
*
|
|
162
|
+
* @param callback - Callback to handle processed record
|
|
163
|
+
*
|
|
164
|
+
* @returns Resolves to processed boolean
|
|
165
|
+
*/
|
|
166
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
167
|
+
/**
|
|
168
|
+
* Fetch a AuthorizationDocumentInstance
|
|
169
|
+
*
|
|
170
|
+
* @param callback - Callback to handle processed record
|
|
171
|
+
*
|
|
172
|
+
* @returns Resolves to processed AuthorizationDocumentInstance
|
|
173
|
+
*/
|
|
174
|
+
fetch(callback?: (error: Error | null, item?: AuthorizationDocumentInstance) => any): Promise<AuthorizationDocumentInstance>;
|
|
175
|
+
/**
|
|
176
|
+
* Access the dependentHostedNumberOrders.
|
|
177
|
+
*/
|
|
178
|
+
dependentHostedNumberOrders(): DependentHostedNumberOrderListInstance;
|
|
179
|
+
/**
|
|
180
|
+
* Provide a user-friendly representation
|
|
181
|
+
*
|
|
182
|
+
* @returns Object
|
|
183
|
+
*/
|
|
184
|
+
toJSON(): {
|
|
185
|
+
sid: string;
|
|
186
|
+
addressSid: string;
|
|
187
|
+
status: AuthorizationDocumentStatus;
|
|
188
|
+
email: string;
|
|
189
|
+
ccEmails: string[];
|
|
190
|
+
dateCreated: Date;
|
|
191
|
+
dateUpdated: Date;
|
|
192
|
+
url: string;
|
|
193
|
+
links: Record<string, string>;
|
|
194
|
+
};
|
|
195
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
196
|
+
}
|
|
197
|
+
export interface AuthorizationDocumentSolution {
|
|
198
|
+
}
|
|
199
|
+
export interface AuthorizationDocumentListInstance {
|
|
200
|
+
_version: V2;
|
|
201
|
+
_solution: AuthorizationDocumentSolution;
|
|
202
|
+
_uri: string;
|
|
203
|
+
(sid: string): AuthorizationDocumentContext;
|
|
204
|
+
get(sid: string): AuthorizationDocumentContext;
|
|
205
|
+
/**
|
|
206
|
+
* Create a AuthorizationDocumentInstance
|
|
207
|
+
*
|
|
208
|
+
* @param params - Parameter for request
|
|
209
|
+
* @param callback - Callback to handle processed record
|
|
210
|
+
*
|
|
211
|
+
* @returns Resolves to processed AuthorizationDocumentInstance
|
|
212
|
+
*/
|
|
213
|
+
create(params: AuthorizationDocumentListInstanceCreateOptions, callback?: (error: Error | null, item?: AuthorizationDocumentInstance) => any): Promise<AuthorizationDocumentInstance>;
|
|
214
|
+
/**
|
|
215
|
+
* Streams AuthorizationDocumentInstance records from the API.
|
|
216
|
+
*
|
|
217
|
+
* This operation lazily loads records as efficiently as possible until the limit
|
|
218
|
+
* is reached.
|
|
219
|
+
*
|
|
220
|
+
* The results are passed into the callback function, so this operation is memory
|
|
221
|
+
* efficient.
|
|
222
|
+
*
|
|
223
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
224
|
+
* function.
|
|
225
|
+
*
|
|
226
|
+
* @param { AuthorizationDocumentListInstanceEachOptions } [params] - Options for request
|
|
227
|
+
* @param { function } [callback] - Function to process each record
|
|
228
|
+
*/
|
|
229
|
+
each(callback?: (item: AuthorizationDocumentInstance, done: (err?: Error) => void) => void): void;
|
|
230
|
+
each(params: AuthorizationDocumentListInstanceEachOptions, callback?: (item: AuthorizationDocumentInstance, done: (err?: Error) => void) => void): void;
|
|
231
|
+
/**
|
|
232
|
+
* Retrieve a single target page of AuthorizationDocumentInstance records from the API.
|
|
233
|
+
*
|
|
234
|
+
* The request is executed immediately.
|
|
235
|
+
*
|
|
236
|
+
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
|
237
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
238
|
+
*/
|
|
239
|
+
getPage(targetUrl: string, callback?: (error: Error | null, items: AuthorizationDocumentPage) => any): Promise<AuthorizationDocumentPage>;
|
|
240
|
+
/**
|
|
241
|
+
* Lists AuthorizationDocumentInstance records from the API as a list.
|
|
242
|
+
*
|
|
243
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
244
|
+
* function.
|
|
245
|
+
*
|
|
246
|
+
* @param { AuthorizationDocumentListInstanceOptions } [params] - Options for request
|
|
247
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
248
|
+
*/
|
|
249
|
+
list(callback?: (error: Error | null, items: AuthorizationDocumentInstance[]) => any): Promise<AuthorizationDocumentInstance[]>;
|
|
250
|
+
list(params: AuthorizationDocumentListInstanceOptions, callback?: (error: Error | null, items: AuthorizationDocumentInstance[]) => any): Promise<AuthorizationDocumentInstance[]>;
|
|
251
|
+
/**
|
|
252
|
+
* Retrieve a single page of AuthorizationDocumentInstance records from the API.
|
|
253
|
+
*
|
|
254
|
+
* The request is executed immediately.
|
|
255
|
+
*
|
|
256
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
257
|
+
* function.
|
|
258
|
+
*
|
|
259
|
+
* @param { AuthorizationDocumentListInstancePageOptions } [params] - Options for request
|
|
260
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
261
|
+
*/
|
|
262
|
+
page(callback?: (error: Error | null, items: AuthorizationDocumentPage) => any): Promise<AuthorizationDocumentPage>;
|
|
263
|
+
page(params: AuthorizationDocumentListInstancePageOptions, callback?: (error: Error | null, items: AuthorizationDocumentPage) => any): Promise<AuthorizationDocumentPage>;
|
|
264
|
+
/**
|
|
265
|
+
* Provide a user-friendly representation
|
|
266
|
+
*/
|
|
267
|
+
toJSON(): any;
|
|
268
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
269
|
+
}
|
|
270
|
+
export declare function AuthorizationDocumentListInstance(version: V2): AuthorizationDocumentListInstance;
|
|
271
|
+
export declare class AuthorizationDocumentPage extends Page<V2, AuthorizationDocumentPayload, AuthorizationDocumentResource, AuthorizationDocumentInstance> {
|
|
272
|
+
/**
|
|
273
|
+
* Initialize the AuthorizationDocumentPage
|
|
274
|
+
*
|
|
275
|
+
* @param version - Version of the resource
|
|
276
|
+
* @param response - Response from the API
|
|
277
|
+
* @param solution - Path solution
|
|
278
|
+
*/
|
|
279
|
+
constructor(version: V2, response: Response<string>, solution: AuthorizationDocumentSolution);
|
|
280
|
+
/**
|
|
281
|
+
* Build an instance of AuthorizationDocumentInstance
|
|
282
|
+
*
|
|
283
|
+
* @param payload - Payload response from the API
|
|
284
|
+
*/
|
|
285
|
+
getInstance(payload: AuthorizationDocumentResource): AuthorizationDocumentInstance;
|
|
286
|
+
[inspect.custom](depth: any, options: InspectOptions): string;
|
|
287
|
+
}
|
|
288
|
+
export {};
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Numbers
|
|
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.AuthorizationDocumentPage = exports.AuthorizationDocumentListInstance = exports.AuthorizationDocumentInstance = exports.AuthorizationDocumentContextImpl = 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
|
+
const dependentHostedNumberOrder_1 = require("./authorizationDocument/dependentHostedNumberOrder");
|
|
26
|
+
class AuthorizationDocumentContextImpl {
|
|
27
|
+
constructor(_version, sid) {
|
|
28
|
+
this._version = _version;
|
|
29
|
+
if (!(0, utility_1.isValidPathParam)(sid)) {
|
|
30
|
+
throw new Error("Parameter 'sid' is not valid.");
|
|
31
|
+
}
|
|
32
|
+
this._solution = { sid };
|
|
33
|
+
this._uri = `/HostedNumber/AuthorizationDocuments/${sid}`;
|
|
34
|
+
}
|
|
35
|
+
get dependentHostedNumberOrders() {
|
|
36
|
+
this._dependentHostedNumberOrders =
|
|
37
|
+
this._dependentHostedNumberOrders ||
|
|
38
|
+
(0, dependentHostedNumberOrder_1.DependentHostedNumberOrderListInstance)(this._version, this._solution.sid);
|
|
39
|
+
return this._dependentHostedNumberOrders;
|
|
40
|
+
}
|
|
41
|
+
remove(callback) {
|
|
42
|
+
const instance = this;
|
|
43
|
+
let operationVersion = instance._version, operationPromise = operationVersion.remove({
|
|
44
|
+
uri: instance._uri,
|
|
45
|
+
method: "delete",
|
|
46
|
+
});
|
|
47
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
48
|
+
return operationPromise;
|
|
49
|
+
}
|
|
50
|
+
fetch(callback) {
|
|
51
|
+
const instance = this;
|
|
52
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
53
|
+
uri: instance._uri,
|
|
54
|
+
method: "get",
|
|
55
|
+
});
|
|
56
|
+
operationPromise = operationPromise.then((payload) => new AuthorizationDocumentInstance(operationVersion, payload, instance._solution.sid));
|
|
57
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
58
|
+
return operationPromise;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Provide a user-friendly representation
|
|
62
|
+
*
|
|
63
|
+
* @returns Object
|
|
64
|
+
*/
|
|
65
|
+
toJSON() {
|
|
66
|
+
return this._solution;
|
|
67
|
+
}
|
|
68
|
+
[util_1.inspect.custom](_depth, options) {
|
|
69
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.AuthorizationDocumentContextImpl = AuthorizationDocumentContextImpl;
|
|
73
|
+
class AuthorizationDocumentInstance {
|
|
74
|
+
constructor(_version, payload, sid) {
|
|
75
|
+
this._version = _version;
|
|
76
|
+
this.sid = payload.sid;
|
|
77
|
+
this.addressSid = payload.address_sid;
|
|
78
|
+
this.status = payload.status;
|
|
79
|
+
this.email = payload.email;
|
|
80
|
+
this.ccEmails = payload.cc_emails;
|
|
81
|
+
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
|
82
|
+
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
|
83
|
+
this.url = payload.url;
|
|
84
|
+
this.links = payload.links;
|
|
85
|
+
this._solution = { sid: sid || this.sid };
|
|
86
|
+
}
|
|
87
|
+
get _proxy() {
|
|
88
|
+
this._context =
|
|
89
|
+
this._context ||
|
|
90
|
+
new AuthorizationDocumentContextImpl(this._version, this._solution.sid);
|
|
91
|
+
return this._context;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Remove a AuthorizationDocumentInstance
|
|
95
|
+
*
|
|
96
|
+
* @param callback - Callback to handle processed record
|
|
97
|
+
*
|
|
98
|
+
* @returns Resolves to processed boolean
|
|
99
|
+
*/
|
|
100
|
+
remove(callback) {
|
|
101
|
+
return this._proxy.remove(callback);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Fetch a AuthorizationDocumentInstance
|
|
105
|
+
*
|
|
106
|
+
* @param callback - Callback to handle processed record
|
|
107
|
+
*
|
|
108
|
+
* @returns Resolves to processed AuthorizationDocumentInstance
|
|
109
|
+
*/
|
|
110
|
+
fetch(callback) {
|
|
111
|
+
return this._proxy.fetch(callback);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Access the dependentHostedNumberOrders.
|
|
115
|
+
*/
|
|
116
|
+
dependentHostedNumberOrders() {
|
|
117
|
+
return this._proxy.dependentHostedNumberOrders;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Provide a user-friendly representation
|
|
121
|
+
*
|
|
122
|
+
* @returns Object
|
|
123
|
+
*/
|
|
124
|
+
toJSON() {
|
|
125
|
+
return {
|
|
126
|
+
sid: this.sid,
|
|
127
|
+
addressSid: this.addressSid,
|
|
128
|
+
status: this.status,
|
|
129
|
+
email: this.email,
|
|
130
|
+
ccEmails: this.ccEmails,
|
|
131
|
+
dateCreated: this.dateCreated,
|
|
132
|
+
dateUpdated: this.dateUpdated,
|
|
133
|
+
url: this.url,
|
|
134
|
+
links: this.links,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
[util_1.inspect.custom](_depth, options) {
|
|
138
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
exports.AuthorizationDocumentInstance = AuthorizationDocumentInstance;
|
|
142
|
+
function AuthorizationDocumentListInstance(version) {
|
|
143
|
+
const instance = ((sid) => instance.get(sid));
|
|
144
|
+
instance.get = function get(sid) {
|
|
145
|
+
return new AuthorizationDocumentContextImpl(version, sid);
|
|
146
|
+
};
|
|
147
|
+
instance._version = version;
|
|
148
|
+
instance._solution = {};
|
|
149
|
+
instance._uri = `/HostedNumber/AuthorizationDocuments`;
|
|
150
|
+
instance.create = function create(params, callback) {
|
|
151
|
+
if (params === null || params === undefined) {
|
|
152
|
+
throw new Error('Required parameter "params" missing.');
|
|
153
|
+
}
|
|
154
|
+
if (params["addressSid"] === null || params["addressSid"] === undefined) {
|
|
155
|
+
throw new Error("Required parameter \"params['addressSid']\" missing.");
|
|
156
|
+
}
|
|
157
|
+
if (params["email"] === null || params["email"] === undefined) {
|
|
158
|
+
throw new Error("Required parameter \"params['email']\" missing.");
|
|
159
|
+
}
|
|
160
|
+
if (params["contactPhoneNumber"] === null ||
|
|
161
|
+
params["contactPhoneNumber"] === undefined) {
|
|
162
|
+
throw new Error("Required parameter \"params['contactPhoneNumber']\" missing.");
|
|
163
|
+
}
|
|
164
|
+
let data = {};
|
|
165
|
+
data["AddressSid"] = params["addressSid"];
|
|
166
|
+
data["Email"] = params["email"];
|
|
167
|
+
data["ContactPhoneNumber"] = params["contactPhoneNumber"];
|
|
168
|
+
if (params["contactTitle"] !== undefined)
|
|
169
|
+
data["ContactTitle"] = params["contactTitle"];
|
|
170
|
+
if (params["ccEmails"] !== undefined)
|
|
171
|
+
data["CcEmails"] = serialize.map(params["ccEmails"], (e) => e);
|
|
172
|
+
const headers = {};
|
|
173
|
+
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
174
|
+
let operationVersion = version, operationPromise = operationVersion.create({
|
|
175
|
+
uri: instance._uri,
|
|
176
|
+
method: "post",
|
|
177
|
+
data,
|
|
178
|
+
headers,
|
|
179
|
+
});
|
|
180
|
+
operationPromise = operationPromise.then((payload) => new AuthorizationDocumentInstance(operationVersion, payload));
|
|
181
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
182
|
+
return operationPromise;
|
|
183
|
+
};
|
|
184
|
+
instance.page = function page(params, callback) {
|
|
185
|
+
if (params instanceof Function) {
|
|
186
|
+
callback = params;
|
|
187
|
+
params = {};
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
params = params || {};
|
|
191
|
+
}
|
|
192
|
+
let data = {};
|
|
193
|
+
if (params["email"] !== undefined)
|
|
194
|
+
data["Email"] = params["email"];
|
|
195
|
+
if (params["status"] !== undefined)
|
|
196
|
+
data["Status"] = params["status"];
|
|
197
|
+
if (params["pageSize"] !== undefined)
|
|
198
|
+
data["PageSize"] = params["pageSize"];
|
|
199
|
+
if (params.pageNumber !== undefined)
|
|
200
|
+
data["Page"] = params.pageNumber;
|
|
201
|
+
if (params.pageToken !== undefined)
|
|
202
|
+
data["PageToken"] = params.pageToken;
|
|
203
|
+
const headers = {};
|
|
204
|
+
let operationVersion = version, operationPromise = operationVersion.page({
|
|
205
|
+
uri: instance._uri,
|
|
206
|
+
method: "get",
|
|
207
|
+
params: data,
|
|
208
|
+
headers,
|
|
209
|
+
});
|
|
210
|
+
operationPromise = operationPromise.then((payload) => new AuthorizationDocumentPage(operationVersion, payload, instance._solution));
|
|
211
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
212
|
+
return operationPromise;
|
|
213
|
+
};
|
|
214
|
+
instance.each = instance._version.each;
|
|
215
|
+
instance.list = instance._version.list;
|
|
216
|
+
instance.getPage = function getPage(targetUrl, callback) {
|
|
217
|
+
const operationPromise = instance._version._domain.twilio.request({
|
|
218
|
+
method: "get",
|
|
219
|
+
uri: targetUrl,
|
|
220
|
+
});
|
|
221
|
+
let pagePromise = operationPromise.then((payload) => new AuthorizationDocumentPage(instance._version, payload, instance._solution));
|
|
222
|
+
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
223
|
+
return pagePromise;
|
|
224
|
+
};
|
|
225
|
+
instance.toJSON = function toJSON() {
|
|
226
|
+
return instance._solution;
|
|
227
|
+
};
|
|
228
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
229
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
230
|
+
};
|
|
231
|
+
return instance;
|
|
232
|
+
}
|
|
233
|
+
exports.AuthorizationDocumentListInstance = AuthorizationDocumentListInstance;
|
|
234
|
+
class AuthorizationDocumentPage extends Page_1.default {
|
|
235
|
+
/**
|
|
236
|
+
* Initialize the AuthorizationDocumentPage
|
|
237
|
+
*
|
|
238
|
+
* @param version - Version of the resource
|
|
239
|
+
* @param response - Response from the API
|
|
240
|
+
* @param solution - Path solution
|
|
241
|
+
*/
|
|
242
|
+
constructor(version, response, solution) {
|
|
243
|
+
super(version, response, solution);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Build an instance of AuthorizationDocumentInstance
|
|
247
|
+
*
|
|
248
|
+
* @param payload - Payload response from the API
|
|
249
|
+
*/
|
|
250
|
+
getInstance(payload) {
|
|
251
|
+
return new AuthorizationDocumentInstance(this._version, payload);
|
|
252
|
+
}
|
|
253
|
+
[util_1.inspect.custom](depth, options) {
|
|
254
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
exports.AuthorizationDocumentPage = AuthorizationDocumentPage;
|