twilio 5.0.3 → 5.1.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/README.md +1 -0
- package/lib/rest/ContentBase.d.ts +3 -0
- package/lib/rest/ContentBase.js +5 -0
- package/lib/rest/Twilio.d.ts +0 -5
- package/lib/rest/Twilio.js +0 -6
- package/lib/rest/api/v2010/account/call/stream.d.ts +5 -5
- package/lib/rest/api/v2010/account/message.d.ts +1 -1
- package/lib/rest/content/V2.d.ts +20 -0
- package/lib/rest/content/V2.js +43 -0
- package/lib/rest/content/v2/content.d.ts +196 -0
- package/lib/rest/content/v2/content.js +136 -0
- package/lib/rest/content/v2/contentAndApprovals.d.ts +190 -0
- package/lib/rest/content/v2/contentAndApprovals.js +134 -0
- package/lib/rest/flexApi/V2.d.ts +5 -0
- package/lib/rest/flexApi/V2.js +6 -0
- package/lib/rest/flexApi/v1/interaction.d.ts +1 -1
- package/lib/rest/flexApi/v1/interaction.js +2 -4
- package/lib/rest/flexApi/v1/plugin/pluginVersions.d.ts +4 -1
- package/lib/rest/flexApi/v1/plugin/pluginVersions.js +2 -0
- package/lib/rest/flexApi/v2/flexUser.d.ts +170 -0
- package/lib/rest/flexApi/v2/flexUser.js +142 -0
- package/lib/rest/flexApi/v2/webChannels.d.ts +2 -0
- package/lib/rest/flexApi/v2/webChannels.js +2 -0
- package/lib/rest/intelligence/V2.d.ts +30 -0
- package/lib/rest/intelligence/V2.js +40 -0
- package/lib/rest/intelligence/v2/customOperator.d.ts +330 -0
- package/lib/rest/intelligence/v2/customOperator.js +279 -0
- package/lib/rest/intelligence/v2/operator.d.ts +263 -0
- package/lib/rest/intelligence/v2/operator.js +197 -0
- package/lib/rest/intelligence/v2/operatorAttachment.d.ts +112 -0
- package/lib/rest/intelligence/v2/operatorAttachment.js +135 -0
- package/lib/rest/intelligence/v2/operatorAttachments.d.ts +94 -0
- package/lib/rest/intelligence/v2/operatorAttachments.js +110 -0
- package/lib/rest/intelligence/v2/operatorType.d.ts +259 -0
- package/lib/rest/intelligence/v2/operatorType.js +197 -0
- package/lib/rest/intelligence/v2/prebuiltOperator.d.ts +263 -0
- package/lib/rest/intelligence/v2/prebuiltOperator.js +197 -0
- package/lib/rest/intelligence/v2/service.d.ts +8 -4
- package/lib/rest/intelligence/v2/service.js +3 -2
- package/lib/rest/messaging/v1/service.d.ts +0 -6
- package/lib/rest/messaging/v1/service.js +0 -2
- package/lib/rest/numbers/V1.d.ts +20 -10
- package/lib/rest/numbers/V1.js +31 -14
- package/lib/rest/numbers/v1/portingPortIn.d.ts +133 -14
- package/lib/rest/numbers/v1/portingPortIn.js +116 -24
- package/lib/rest/numbers/v1/portingPortInPhoneNumber.d.ts +175 -0
- package/lib/rest/numbers/v1/portingPortInPhoneNumber.js +157 -0
- package/lib/rest/numbers/v1/portingWebhookConfiguration.d.ts +79 -0
- package/lib/rest/{previewMessaging/v1/broadcast.js → numbers/v1/portingWebhookConfiguration.js} +19 -32
- package/lib/rest/numbers/v1/portingWebhookConfigurationDelete.d.ts +51 -0
- package/lib/rest/numbers/v1/portingWebhookConfigurationDelete.js +68 -0
- package/lib/rest/numbers/v1/portingWebhookConfigurationFetch.d.ts +75 -0
- package/lib/rest/numbers/v1/portingWebhookConfigurationFetch.js +72 -0
- package/lib/rest/taskrouter/v1/workspace/task.d.ts +24 -0
- package/lib/rest/taskrouter/v1/workspace/task.js +12 -0
- package/lib/rest/trusthub/v1/complianceTollfreeInquiries.d.ts +2 -0
- package/lib/rest/trusthub/v1/complianceTollfreeInquiries.js +2 -0
- package/lib/rest/trusthub/v1/customerProfiles.d.ts +6 -0
- package/lib/rest/trusthub/v1/customerProfiles.js +2 -0
- package/lib/rest/trusthub/v1/trustProducts.d.ts +6 -0
- package/lib/rest/trusthub/v1/trustProducts.js +2 -0
- package/lib/rest/verify/v2/service/verification.d.ts +1 -1
- package/lib/rest/verify/v2/service/verificationCheck.d.ts +1 -1
- package/lib/rest/verify/v2/service.d.ts +1 -1
- package/lib/webhooks/webhooks.js +9 -11
- package/package.json +4 -6
- package/lib/rest/PreviewMessaging.d.ts +0 -9
- package/lib/rest/PreviewMessaging.js +0 -15
- package/lib/rest/PreviewMessagingBase.d.ts +0 -13
- package/lib/rest/PreviewMessagingBase.js +0 -31
- package/lib/rest/numbers/v1/portingBulkPortability.d.ts +0 -120
- package/lib/rest/numbers/v1/portingBulkPortability.js +0 -136
- package/lib/rest/numbers/v1/portingPortInFetch.d.ts +0 -142
- package/lib/rest/numbers/v1/portingPortInFetch.js +0 -128
- package/lib/rest/previewMessaging/V1.d.ts +0 -20
- package/lib/rest/previewMessaging/V1.js +0 -42
- package/lib/rest/previewMessaging/v1/broadcast.d.ts +0 -108
- package/lib/rest/previewMessaging/v1/message.d.ts +0 -178
- package/lib/rest/previewMessaging/v1/message.js +0 -91
|
@@ -0,0 +1,263 @@
|
|
|
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
|
+
export type PrebuiltOperatorAvailability = "internal" | "beta" | "public" | "retired";
|
|
7
|
+
/**
|
|
8
|
+
* Options to pass to each
|
|
9
|
+
*/
|
|
10
|
+
export interface PrebuiltOperatorListInstanceEachOptions {
|
|
11
|
+
/** Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired. */
|
|
12
|
+
availability?: PrebuiltOperatorAvailability;
|
|
13
|
+
/** Returns Pre-built Operators that support the provided language code. */
|
|
14
|
+
languageCode?: string;
|
|
15
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
16
|
+
pageSize?: number;
|
|
17
|
+
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
|
18
|
+
callback?: (item: PrebuiltOperatorInstance, done: (err?: Error) => void) => void;
|
|
19
|
+
/** Function to be called upon completion of streaming */
|
|
20
|
+
done?: Function;
|
|
21
|
+
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
|
22
|
+
limit?: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Options to pass to list
|
|
26
|
+
*/
|
|
27
|
+
export interface PrebuiltOperatorListInstanceOptions {
|
|
28
|
+
/** Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired. */
|
|
29
|
+
availability?: PrebuiltOperatorAvailability;
|
|
30
|
+
/** Returns Pre-built Operators that support the provided language code. */
|
|
31
|
+
languageCode?: string;
|
|
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 PrebuiltOperatorListInstancePageOptions {
|
|
41
|
+
/** Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired. */
|
|
42
|
+
availability?: PrebuiltOperatorAvailability;
|
|
43
|
+
/** Returns Pre-built Operators that support the provided language code. */
|
|
44
|
+
languageCode?: string;
|
|
45
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
46
|
+
pageSize?: number;
|
|
47
|
+
/** Page Number, this value is simply for client state */
|
|
48
|
+
pageNumber?: number;
|
|
49
|
+
/** PageToken provided by the API */
|
|
50
|
+
pageToken?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface PrebuiltOperatorContext {
|
|
53
|
+
/**
|
|
54
|
+
* Fetch a PrebuiltOperatorInstance
|
|
55
|
+
*
|
|
56
|
+
* @param callback - Callback to handle processed record
|
|
57
|
+
*
|
|
58
|
+
* @returns Resolves to processed PrebuiltOperatorInstance
|
|
59
|
+
*/
|
|
60
|
+
fetch(callback?: (error: Error | null, item?: PrebuiltOperatorInstance) => any): Promise<PrebuiltOperatorInstance>;
|
|
61
|
+
/**
|
|
62
|
+
* Provide a user-friendly representation
|
|
63
|
+
*/
|
|
64
|
+
toJSON(): any;
|
|
65
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
66
|
+
}
|
|
67
|
+
export interface PrebuiltOperatorContextSolution {
|
|
68
|
+
sid: string;
|
|
69
|
+
}
|
|
70
|
+
export declare class PrebuiltOperatorContextImpl implements PrebuiltOperatorContext {
|
|
71
|
+
protected _version: V2;
|
|
72
|
+
protected _solution: PrebuiltOperatorContextSolution;
|
|
73
|
+
protected _uri: string;
|
|
74
|
+
constructor(_version: V2, sid: string);
|
|
75
|
+
fetch(callback?: (error: Error | null, item?: PrebuiltOperatorInstance) => any): Promise<PrebuiltOperatorInstance>;
|
|
76
|
+
/**
|
|
77
|
+
* Provide a user-friendly representation
|
|
78
|
+
*
|
|
79
|
+
* @returns Object
|
|
80
|
+
*/
|
|
81
|
+
toJSON(): PrebuiltOperatorContextSolution;
|
|
82
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
83
|
+
}
|
|
84
|
+
interface PrebuiltOperatorPayload extends TwilioResponsePayload {
|
|
85
|
+
operators: PrebuiltOperatorResource[];
|
|
86
|
+
}
|
|
87
|
+
interface PrebuiltOperatorResource {
|
|
88
|
+
account_sid: string;
|
|
89
|
+
sid: string;
|
|
90
|
+
friendly_name: string;
|
|
91
|
+
description: string;
|
|
92
|
+
author: string;
|
|
93
|
+
operator_type: string;
|
|
94
|
+
version: number;
|
|
95
|
+
availability: PrebuiltOperatorAvailability;
|
|
96
|
+
config: any;
|
|
97
|
+
date_created: Date;
|
|
98
|
+
date_updated: Date;
|
|
99
|
+
url: string;
|
|
100
|
+
}
|
|
101
|
+
export declare class PrebuiltOperatorInstance {
|
|
102
|
+
protected _version: V2;
|
|
103
|
+
protected _solution: PrebuiltOperatorContextSolution;
|
|
104
|
+
protected _context?: PrebuiltOperatorContext;
|
|
105
|
+
constructor(_version: V2, payload: PrebuiltOperatorResource, sid?: string);
|
|
106
|
+
/**
|
|
107
|
+
* The unique SID identifier of the Account the Pre-built Operator belongs to.
|
|
108
|
+
*/
|
|
109
|
+
accountSid: string;
|
|
110
|
+
/**
|
|
111
|
+
* A 34 character string that uniquely identifies this Pre-built Operator.
|
|
112
|
+
*/
|
|
113
|
+
sid: string;
|
|
114
|
+
/**
|
|
115
|
+
* A human-readable name of this resource, up to 64 characters.
|
|
116
|
+
*/
|
|
117
|
+
friendlyName: string;
|
|
118
|
+
/**
|
|
119
|
+
* A human-readable description of this resource, longer than the friendly name.
|
|
120
|
+
*/
|
|
121
|
+
description: string;
|
|
122
|
+
/**
|
|
123
|
+
* The creator of the Operator. Pre-built Operators can only be created by Twilio.
|
|
124
|
+
*/
|
|
125
|
+
author: string;
|
|
126
|
+
/**
|
|
127
|
+
* Operator Type for this Operator. References an existing Operator Type resource.
|
|
128
|
+
*/
|
|
129
|
+
operatorType: string;
|
|
130
|
+
/**
|
|
131
|
+
* Numeric Operator version. Incremented with each update on the resource, used to ensure integrity when updating the Operator.
|
|
132
|
+
*/
|
|
133
|
+
version: number;
|
|
134
|
+
availability: PrebuiltOperatorAvailability;
|
|
135
|
+
/**
|
|
136
|
+
* Operator configuration, following the schema defined by the Operator Type. Only available on Custom Operators created by the Account, will be empty for Pre-Built Operators.
|
|
137
|
+
*/
|
|
138
|
+
config: any;
|
|
139
|
+
/**
|
|
140
|
+
* The date that this Pre-built Operator was created, given in ISO 8601 format.
|
|
141
|
+
*/
|
|
142
|
+
dateCreated: Date;
|
|
143
|
+
/**
|
|
144
|
+
* The date that this Pre-built Operator was updated, given in ISO 8601 format.
|
|
145
|
+
*/
|
|
146
|
+
dateUpdated: Date;
|
|
147
|
+
/**
|
|
148
|
+
* The URL of this resource.
|
|
149
|
+
*/
|
|
150
|
+
url: string;
|
|
151
|
+
private get _proxy();
|
|
152
|
+
/**
|
|
153
|
+
* Fetch a PrebuiltOperatorInstance
|
|
154
|
+
*
|
|
155
|
+
* @param callback - Callback to handle processed record
|
|
156
|
+
*
|
|
157
|
+
* @returns Resolves to processed PrebuiltOperatorInstance
|
|
158
|
+
*/
|
|
159
|
+
fetch(callback?: (error: Error | null, item?: PrebuiltOperatorInstance) => any): Promise<PrebuiltOperatorInstance>;
|
|
160
|
+
/**
|
|
161
|
+
* Provide a user-friendly representation
|
|
162
|
+
*
|
|
163
|
+
* @returns Object
|
|
164
|
+
*/
|
|
165
|
+
toJSON(): {
|
|
166
|
+
accountSid: string;
|
|
167
|
+
sid: string;
|
|
168
|
+
friendlyName: string;
|
|
169
|
+
description: string;
|
|
170
|
+
author: string;
|
|
171
|
+
operatorType: string;
|
|
172
|
+
version: number;
|
|
173
|
+
availability: PrebuiltOperatorAvailability;
|
|
174
|
+
config: any;
|
|
175
|
+
dateCreated: Date;
|
|
176
|
+
dateUpdated: Date;
|
|
177
|
+
url: string;
|
|
178
|
+
};
|
|
179
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
180
|
+
}
|
|
181
|
+
export interface PrebuiltOperatorSolution {
|
|
182
|
+
}
|
|
183
|
+
export interface PrebuiltOperatorListInstance {
|
|
184
|
+
_version: V2;
|
|
185
|
+
_solution: PrebuiltOperatorSolution;
|
|
186
|
+
_uri: string;
|
|
187
|
+
(sid: string): PrebuiltOperatorContext;
|
|
188
|
+
get(sid: string): PrebuiltOperatorContext;
|
|
189
|
+
/**
|
|
190
|
+
* Streams PrebuiltOperatorInstance records from the API.
|
|
191
|
+
*
|
|
192
|
+
* This operation lazily loads records as efficiently as possible until the limit
|
|
193
|
+
* is reached.
|
|
194
|
+
*
|
|
195
|
+
* The results are passed into the callback function, so this operation is memory
|
|
196
|
+
* efficient.
|
|
197
|
+
*
|
|
198
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
199
|
+
* function.
|
|
200
|
+
*
|
|
201
|
+
* @param { PrebuiltOperatorListInstanceEachOptions } [params] - Options for request
|
|
202
|
+
* @param { function } [callback] - Function to process each record
|
|
203
|
+
*/
|
|
204
|
+
each(callback?: (item: PrebuiltOperatorInstance, done: (err?: Error) => void) => void): void;
|
|
205
|
+
each(params: PrebuiltOperatorListInstanceEachOptions, callback?: (item: PrebuiltOperatorInstance, done: (err?: Error) => void) => void): void;
|
|
206
|
+
/**
|
|
207
|
+
* Retrieve a single target page of PrebuiltOperatorInstance records from the API.
|
|
208
|
+
*
|
|
209
|
+
* The request is executed immediately.
|
|
210
|
+
*
|
|
211
|
+
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
|
212
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
213
|
+
*/
|
|
214
|
+
getPage(targetUrl: string, callback?: (error: Error | null, items: PrebuiltOperatorPage) => any): Promise<PrebuiltOperatorPage>;
|
|
215
|
+
/**
|
|
216
|
+
* Lists PrebuiltOperatorInstance records from the API as a list.
|
|
217
|
+
*
|
|
218
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
219
|
+
* function.
|
|
220
|
+
*
|
|
221
|
+
* @param { PrebuiltOperatorListInstanceOptions } [params] - Options for request
|
|
222
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
223
|
+
*/
|
|
224
|
+
list(callback?: (error: Error | null, items: PrebuiltOperatorInstance[]) => any): Promise<PrebuiltOperatorInstance[]>;
|
|
225
|
+
list(params: PrebuiltOperatorListInstanceOptions, callback?: (error: Error | null, items: PrebuiltOperatorInstance[]) => any): Promise<PrebuiltOperatorInstance[]>;
|
|
226
|
+
/**
|
|
227
|
+
* Retrieve a single page of PrebuiltOperatorInstance records from the API.
|
|
228
|
+
*
|
|
229
|
+
* The request is executed immediately.
|
|
230
|
+
*
|
|
231
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
232
|
+
* function.
|
|
233
|
+
*
|
|
234
|
+
* @param { PrebuiltOperatorListInstancePageOptions } [params] - Options for request
|
|
235
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
236
|
+
*/
|
|
237
|
+
page(callback?: (error: Error | null, items: PrebuiltOperatorPage) => any): Promise<PrebuiltOperatorPage>;
|
|
238
|
+
page(params: PrebuiltOperatorListInstancePageOptions, callback?: (error: Error | null, items: PrebuiltOperatorPage) => any): Promise<PrebuiltOperatorPage>;
|
|
239
|
+
/**
|
|
240
|
+
* Provide a user-friendly representation
|
|
241
|
+
*/
|
|
242
|
+
toJSON(): any;
|
|
243
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
244
|
+
}
|
|
245
|
+
export declare function PrebuiltOperatorListInstance(version: V2): PrebuiltOperatorListInstance;
|
|
246
|
+
export declare class PrebuiltOperatorPage extends Page<V2, PrebuiltOperatorPayload, PrebuiltOperatorResource, PrebuiltOperatorInstance> {
|
|
247
|
+
/**
|
|
248
|
+
* Initialize the PrebuiltOperatorPage
|
|
249
|
+
*
|
|
250
|
+
* @param version - Version of the resource
|
|
251
|
+
* @param response - Response from the API
|
|
252
|
+
* @param solution - Path solution
|
|
253
|
+
*/
|
|
254
|
+
constructor(version: V2, response: Response<string>, solution: PrebuiltOperatorSolution);
|
|
255
|
+
/**
|
|
256
|
+
* Build an instance of PrebuiltOperatorInstance
|
|
257
|
+
*
|
|
258
|
+
* @param payload - Payload response from the API
|
|
259
|
+
*/
|
|
260
|
+
getInstance(payload: PrebuiltOperatorResource): PrebuiltOperatorInstance;
|
|
261
|
+
[inspect.custom](depth: any, options: InspectOptions): string;
|
|
262
|
+
}
|
|
263
|
+
export {};
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Intelligence
|
|
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.PrebuiltOperatorPage = exports.PrebuiltOperatorListInstance = exports.PrebuiltOperatorInstance = exports.PrebuiltOperatorContextImpl = 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 PrebuiltOperatorContextImpl {
|
|
26
|
+
constructor(_version, sid) {
|
|
27
|
+
this._version = _version;
|
|
28
|
+
if (!(0, utility_1.isValidPathParam)(sid)) {
|
|
29
|
+
throw new Error("Parameter 'sid' is not valid.");
|
|
30
|
+
}
|
|
31
|
+
this._solution = { sid };
|
|
32
|
+
this._uri = `/Operators/PreBuilt/${sid}`;
|
|
33
|
+
}
|
|
34
|
+
fetch(callback) {
|
|
35
|
+
const instance = this;
|
|
36
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
37
|
+
uri: instance._uri,
|
|
38
|
+
method: "get",
|
|
39
|
+
});
|
|
40
|
+
operationPromise = operationPromise.then((payload) => new PrebuiltOperatorInstance(operationVersion, payload, instance._solution.sid));
|
|
41
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
42
|
+
return operationPromise;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Provide a user-friendly representation
|
|
46
|
+
*
|
|
47
|
+
* @returns Object
|
|
48
|
+
*/
|
|
49
|
+
toJSON() {
|
|
50
|
+
return this._solution;
|
|
51
|
+
}
|
|
52
|
+
[util_1.inspect.custom](_depth, options) {
|
|
53
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.PrebuiltOperatorContextImpl = PrebuiltOperatorContextImpl;
|
|
57
|
+
class PrebuiltOperatorInstance {
|
|
58
|
+
constructor(_version, payload, sid) {
|
|
59
|
+
this._version = _version;
|
|
60
|
+
this.accountSid = payload.account_sid;
|
|
61
|
+
this.sid = payload.sid;
|
|
62
|
+
this.friendlyName = payload.friendly_name;
|
|
63
|
+
this.description = payload.description;
|
|
64
|
+
this.author = payload.author;
|
|
65
|
+
this.operatorType = payload.operator_type;
|
|
66
|
+
this.version = deserialize.integer(payload.version);
|
|
67
|
+
this.availability = payload.availability;
|
|
68
|
+
this.config = payload.config;
|
|
69
|
+
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
|
70
|
+
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
|
71
|
+
this.url = payload.url;
|
|
72
|
+
this._solution = { sid: sid || this.sid };
|
|
73
|
+
}
|
|
74
|
+
get _proxy() {
|
|
75
|
+
this._context =
|
|
76
|
+
this._context ||
|
|
77
|
+
new PrebuiltOperatorContextImpl(this._version, this._solution.sid);
|
|
78
|
+
return this._context;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Fetch a PrebuiltOperatorInstance
|
|
82
|
+
*
|
|
83
|
+
* @param callback - Callback to handle processed record
|
|
84
|
+
*
|
|
85
|
+
* @returns Resolves to processed PrebuiltOperatorInstance
|
|
86
|
+
*/
|
|
87
|
+
fetch(callback) {
|
|
88
|
+
return this._proxy.fetch(callback);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Provide a user-friendly representation
|
|
92
|
+
*
|
|
93
|
+
* @returns Object
|
|
94
|
+
*/
|
|
95
|
+
toJSON() {
|
|
96
|
+
return {
|
|
97
|
+
accountSid: this.accountSid,
|
|
98
|
+
sid: this.sid,
|
|
99
|
+
friendlyName: this.friendlyName,
|
|
100
|
+
description: this.description,
|
|
101
|
+
author: this.author,
|
|
102
|
+
operatorType: this.operatorType,
|
|
103
|
+
version: this.version,
|
|
104
|
+
availability: this.availability,
|
|
105
|
+
config: this.config,
|
|
106
|
+
dateCreated: this.dateCreated,
|
|
107
|
+
dateUpdated: this.dateUpdated,
|
|
108
|
+
url: this.url,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
[util_1.inspect.custom](_depth, options) {
|
|
112
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
exports.PrebuiltOperatorInstance = PrebuiltOperatorInstance;
|
|
116
|
+
function PrebuiltOperatorListInstance(version) {
|
|
117
|
+
const instance = ((sid) => instance.get(sid));
|
|
118
|
+
instance.get = function get(sid) {
|
|
119
|
+
return new PrebuiltOperatorContextImpl(version, sid);
|
|
120
|
+
};
|
|
121
|
+
instance._version = version;
|
|
122
|
+
instance._solution = {};
|
|
123
|
+
instance._uri = `/Operators/PreBuilt`;
|
|
124
|
+
instance.page = function page(params, callback) {
|
|
125
|
+
if (params instanceof Function) {
|
|
126
|
+
callback = params;
|
|
127
|
+
params = {};
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
params = params || {};
|
|
131
|
+
}
|
|
132
|
+
let data = {};
|
|
133
|
+
if (params["availability"] !== undefined)
|
|
134
|
+
data["Availability"] = params["availability"];
|
|
135
|
+
if (params["languageCode"] !== undefined)
|
|
136
|
+
data["LanguageCode"] = params["languageCode"];
|
|
137
|
+
if (params["pageSize"] !== undefined)
|
|
138
|
+
data["PageSize"] = params["pageSize"];
|
|
139
|
+
if (params.pageNumber !== undefined)
|
|
140
|
+
data["Page"] = params.pageNumber;
|
|
141
|
+
if (params.pageToken !== undefined)
|
|
142
|
+
data["PageToken"] = params.pageToken;
|
|
143
|
+
const headers = {};
|
|
144
|
+
let operationVersion = version, operationPromise = operationVersion.page({
|
|
145
|
+
uri: instance._uri,
|
|
146
|
+
method: "get",
|
|
147
|
+
params: data,
|
|
148
|
+
headers,
|
|
149
|
+
});
|
|
150
|
+
operationPromise = operationPromise.then((payload) => new PrebuiltOperatorPage(operationVersion, payload, instance._solution));
|
|
151
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
152
|
+
return operationPromise;
|
|
153
|
+
};
|
|
154
|
+
instance.each = instance._version.each;
|
|
155
|
+
instance.list = instance._version.list;
|
|
156
|
+
instance.getPage = function getPage(targetUrl, callback) {
|
|
157
|
+
const operationPromise = instance._version._domain.twilio.request({
|
|
158
|
+
method: "get",
|
|
159
|
+
uri: targetUrl,
|
|
160
|
+
});
|
|
161
|
+
let pagePromise = operationPromise.then((payload) => new PrebuiltOperatorPage(instance._version, payload, instance._solution));
|
|
162
|
+
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
163
|
+
return pagePromise;
|
|
164
|
+
};
|
|
165
|
+
instance.toJSON = function toJSON() {
|
|
166
|
+
return instance._solution;
|
|
167
|
+
};
|
|
168
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
169
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
170
|
+
};
|
|
171
|
+
return instance;
|
|
172
|
+
}
|
|
173
|
+
exports.PrebuiltOperatorListInstance = PrebuiltOperatorListInstance;
|
|
174
|
+
class PrebuiltOperatorPage extends Page_1.default {
|
|
175
|
+
/**
|
|
176
|
+
* Initialize the PrebuiltOperatorPage
|
|
177
|
+
*
|
|
178
|
+
* @param version - Version of the resource
|
|
179
|
+
* @param response - Response from the API
|
|
180
|
+
* @param solution - Path solution
|
|
181
|
+
*/
|
|
182
|
+
constructor(version, response, solution) {
|
|
183
|
+
super(version, response, solution);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Build an instance of PrebuiltOperatorInstance
|
|
187
|
+
*
|
|
188
|
+
* @param payload - Payload response from the API
|
|
189
|
+
*/
|
|
190
|
+
getInstance(payload) {
|
|
191
|
+
return new PrebuiltOperatorInstance(this._version, payload);
|
|
192
|
+
}
|
|
193
|
+
[util_1.inspect.custom](depth, options) {
|
|
194
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
exports.PrebuiltOperatorPage = PrebuiltOperatorPage;
|
|
@@ -16,8 +16,6 @@ export interface ServiceContextUpdateOptions {
|
|
|
16
16
|
dataLogging?: boolean;
|
|
17
17
|
/** A human readable description of this resource, up to 64 characters. */
|
|
18
18
|
friendlyName?: string;
|
|
19
|
-
/** The default language code of the audio. */
|
|
20
|
-
languageCode?: string;
|
|
21
19
|
/** Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. */
|
|
22
20
|
uniqueName?: string;
|
|
23
21
|
/** Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. */
|
|
@@ -41,7 +39,7 @@ export interface ServiceListInstanceCreateOptions {
|
|
|
41
39
|
dataLogging?: boolean;
|
|
42
40
|
/** A human readable description of this resource, up to 64 characters. */
|
|
43
41
|
friendlyName?: string;
|
|
44
|
-
/** The default language code
|
|
42
|
+
/** The language code set during Service creation determines the Transcription language for all call recordings processed by that Service. The default is en-US if no language code is set. A Service can only support one language code, and it cannot be updated once it\\\'s set. */
|
|
45
43
|
languageCode?: string;
|
|
46
44
|
/** Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. */
|
|
47
45
|
autoRedaction?: boolean;
|
|
@@ -162,6 +160,7 @@ interface ServiceResource {
|
|
|
162
160
|
url: string;
|
|
163
161
|
webhook_url: string;
|
|
164
162
|
webhook_http_method: ServiceHttpMethod;
|
|
163
|
+
read_only_attached_operator_sids: Array<string>;
|
|
165
164
|
version: number;
|
|
166
165
|
}
|
|
167
166
|
export declare class ServiceInstance {
|
|
@@ -202,7 +201,7 @@ export declare class ServiceInstance {
|
|
|
202
201
|
*/
|
|
203
202
|
friendlyName: string;
|
|
204
203
|
/**
|
|
205
|
-
* The default language code
|
|
204
|
+
* The language code set during Service creation determines the Transcription language for all call recordings processed by that Service. The default is en-US if no language code is set. A Service can only support one language code, and it cannot be updated once it\'s set.
|
|
206
205
|
*/
|
|
207
206
|
languageCode: string;
|
|
208
207
|
/**
|
|
@@ -222,6 +221,10 @@ export declare class ServiceInstance {
|
|
|
222
221
|
*/
|
|
223
222
|
webhookUrl: string;
|
|
224
223
|
webhookHttpMethod: ServiceHttpMethod;
|
|
224
|
+
/**
|
|
225
|
+
* Operator sids attached to this service, read only
|
|
226
|
+
*/
|
|
227
|
+
readOnlyAttachedOperatorSids: Array<string>;
|
|
225
228
|
/**
|
|
226
229
|
* The version number of this Service.
|
|
227
230
|
*/
|
|
@@ -280,6 +283,7 @@ export declare class ServiceInstance {
|
|
|
280
283
|
url: string;
|
|
281
284
|
webhookUrl: string;
|
|
282
285
|
webhookHttpMethod: ServiceHttpMethod;
|
|
286
|
+
readOnlyAttachedOperatorSids: string[];
|
|
283
287
|
version: number;
|
|
284
288
|
};
|
|
285
289
|
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
@@ -65,8 +65,6 @@ class ServiceContextImpl {
|
|
|
65
65
|
data["DataLogging"] = serialize.bool(params["dataLogging"]);
|
|
66
66
|
if (params["friendlyName"] !== undefined)
|
|
67
67
|
data["FriendlyName"] = params["friendlyName"];
|
|
68
|
-
if (params["languageCode"] !== undefined)
|
|
69
|
-
data["LanguageCode"] = params["languageCode"];
|
|
70
68
|
if (params["uniqueName"] !== undefined)
|
|
71
69
|
data["UniqueName"] = params["uniqueName"];
|
|
72
70
|
if (params["autoRedaction"] !== undefined)
|
|
@@ -122,6 +120,8 @@ class ServiceInstance {
|
|
|
122
120
|
this.url = payload.url;
|
|
123
121
|
this.webhookUrl = payload.webhook_url;
|
|
124
122
|
this.webhookHttpMethod = payload.webhook_http_method;
|
|
123
|
+
this.readOnlyAttachedOperatorSids =
|
|
124
|
+
payload.read_only_attached_operator_sids;
|
|
125
125
|
this.version = deserialize.integer(payload.version);
|
|
126
126
|
this._solution = { sid: sid || this.sid };
|
|
127
127
|
}
|
|
@@ -175,6 +175,7 @@ class ServiceInstance {
|
|
|
175
175
|
url: this.url,
|
|
176
176
|
webhookUrl: this.webhookUrl,
|
|
177
177
|
webhookHttpMethod: this.webhookHttpMethod,
|
|
178
|
+
readOnlyAttachedOperatorSids: this.readOnlyAttachedOperatorSids,
|
|
178
179
|
version: this.version,
|
|
179
180
|
};
|
|
180
181
|
}
|
|
@@ -221,7 +221,6 @@ interface ServiceResource {
|
|
|
221
221
|
usecase: string;
|
|
222
222
|
us_app_to_person_registered: boolean;
|
|
223
223
|
use_inbound_webhook_on_number: boolean;
|
|
224
|
-
sending_windows: any;
|
|
225
224
|
}
|
|
226
225
|
export declare class ServiceInstance {
|
|
227
226
|
protected _version: V1;
|
|
@@ -317,10 +316,6 @@ export declare class ServiceInstance {
|
|
|
317
316
|
* A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service.
|
|
318
317
|
*/
|
|
319
318
|
useInboundWebhookOnNumber: boolean;
|
|
320
|
-
/**
|
|
321
|
-
* A list of Sending Windows, which indicate defined time ranges in which a message can be sent, in the UTC time zone. Each window is defined by two strings, labeled \"start_time\" and \"end_time\".
|
|
322
|
-
*/
|
|
323
|
-
sendingWindows: any;
|
|
324
319
|
private get _proxy();
|
|
325
320
|
/**
|
|
326
321
|
* Remove a ServiceInstance
|
|
@@ -408,7 +403,6 @@ export declare class ServiceInstance {
|
|
|
408
403
|
usecase: string;
|
|
409
404
|
usAppToPersonRegistered: boolean;
|
|
410
405
|
useInboundWebhookOnNumber: boolean;
|
|
411
|
-
sendingWindows: any;
|
|
412
406
|
};
|
|
413
407
|
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
414
408
|
}
|
|
@@ -185,7 +185,6 @@ class ServiceInstance {
|
|
|
185
185
|
this.usecase = payload.usecase;
|
|
186
186
|
this.usAppToPersonRegistered = payload.us_app_to_person_registered;
|
|
187
187
|
this.useInboundWebhookOnNumber = payload.use_inbound_webhook_on_number;
|
|
188
|
-
this.sendingWindows = payload.sending_windows;
|
|
189
188
|
this._solution = { sid: sid || this.sid };
|
|
190
189
|
}
|
|
191
190
|
get _proxy() {
|
|
@@ -283,7 +282,6 @@ class ServiceInstance {
|
|
|
283
282
|
usecase: this.usecase,
|
|
284
283
|
usAppToPersonRegistered: this.usAppToPersonRegistered,
|
|
285
284
|
useInboundWebhookOnNumber: this.useInboundWebhookOnNumber,
|
|
286
|
-
sendingWindows: this.sendingWindows,
|
|
287
285
|
};
|
|
288
286
|
}
|
|
289
287
|
[util_1.inspect.custom](_depth, options) {
|
package/lib/rest/numbers/V1.d.ts
CHANGED
|
@@ -2,10 +2,12 @@ import NumbersBase from "../NumbersBase";
|
|
|
2
2
|
import Version from "../../base/Version";
|
|
3
3
|
import { BulkEligibilityListInstance } from "./v1/bulkEligibility";
|
|
4
4
|
import { EligibilityListInstance } from "./v1/eligibility";
|
|
5
|
-
import { PortingBulkPortabilityListInstance } from "./v1/portingBulkPortability";
|
|
6
5
|
import { PortingPortInListInstance } from "./v1/portingPortIn";
|
|
7
|
-
import {
|
|
6
|
+
import { PortingPortInPhoneNumberListInstance } from "./v1/portingPortInPhoneNumber";
|
|
8
7
|
import { PortingPortabilityListInstance } from "./v1/portingPortability";
|
|
8
|
+
import { PortingWebhookConfigurationListInstance } from "./v1/portingWebhookConfiguration";
|
|
9
|
+
import { PortingWebhookConfigurationDeleteListInstance } from "./v1/portingWebhookConfigurationDelete";
|
|
10
|
+
import { PortingWebhookConfigurationFetchListInstance } from "./v1/portingWebhookConfigurationFetch";
|
|
9
11
|
export default class V1 extends Version {
|
|
10
12
|
/**
|
|
11
13
|
* Initialize the V1 version of Numbers
|
|
@@ -17,24 +19,32 @@ export default class V1 extends Version {
|
|
|
17
19
|
protected _bulkEligibilities?: BulkEligibilityListInstance;
|
|
18
20
|
/** eligibilities - { Twilio.Numbers.V1.EligibilityListInstance } resource */
|
|
19
21
|
protected _eligibilities?: EligibilityListInstance;
|
|
20
|
-
/** portingBulkPortabilities - { Twilio.Numbers.V1.PortingBulkPortabilityListInstance } resource */
|
|
21
|
-
protected _portingBulkPortabilities?: PortingBulkPortabilityListInstance;
|
|
22
22
|
/** portingPortIns - { Twilio.Numbers.V1.PortingPortInListInstance } resource */
|
|
23
23
|
protected _portingPortIns?: PortingPortInListInstance;
|
|
24
|
-
/**
|
|
25
|
-
protected
|
|
24
|
+
/** portingPortInPhoneNumber - { Twilio.Numbers.V1.PortingPortInPhoneNumberListInstance } resource */
|
|
25
|
+
protected _portingPortInPhoneNumber?: PortingPortInPhoneNumberListInstance;
|
|
26
26
|
/** portingPortabilities - { Twilio.Numbers.V1.PortingPortabilityListInstance } resource */
|
|
27
27
|
protected _portingPortabilities?: PortingPortabilityListInstance;
|
|
28
|
+
/** portingWebhookConfigurations - { Twilio.Numbers.V1.PortingWebhookConfigurationListInstance } resource */
|
|
29
|
+
protected _portingWebhookConfigurations?: PortingWebhookConfigurationListInstance;
|
|
30
|
+
/** portingWebhookConfigurationsDelete - { Twilio.Numbers.V1.PortingWebhookConfigurationDeleteListInstance } resource */
|
|
31
|
+
protected _portingWebhookConfigurationsDelete?: PortingWebhookConfigurationDeleteListInstance;
|
|
32
|
+
/** portingWebhookConfigurationFetch - { Twilio.Numbers.V1.PortingWebhookConfigurationFetchListInstance } resource */
|
|
33
|
+
protected _portingWebhookConfigurationFetch?: PortingWebhookConfigurationFetchListInstance;
|
|
28
34
|
/** Getter for bulkEligibilities resource */
|
|
29
35
|
get bulkEligibilities(): BulkEligibilityListInstance;
|
|
30
36
|
/** Getter for eligibilities resource */
|
|
31
37
|
get eligibilities(): EligibilityListInstance;
|
|
32
|
-
/** Getter for portingBulkPortabilities resource */
|
|
33
|
-
get portingBulkPortabilities(): PortingBulkPortabilityListInstance;
|
|
34
38
|
/** Getter for portingPortIns resource */
|
|
35
39
|
get portingPortIns(): PortingPortInListInstance;
|
|
36
|
-
/** Getter for
|
|
37
|
-
get
|
|
40
|
+
/** Getter for portingPortInPhoneNumber resource */
|
|
41
|
+
get portingPortInPhoneNumber(): PortingPortInPhoneNumberListInstance;
|
|
38
42
|
/** Getter for portingPortabilities resource */
|
|
39
43
|
get portingPortabilities(): PortingPortabilityListInstance;
|
|
44
|
+
/** Getter for portingWebhookConfigurations resource */
|
|
45
|
+
get portingWebhookConfigurations(): PortingWebhookConfigurationListInstance;
|
|
46
|
+
/** Getter for portingWebhookConfigurationsDelete resource */
|
|
47
|
+
get portingWebhookConfigurationsDelete(): PortingWebhookConfigurationDeleteListInstance;
|
|
48
|
+
/** Getter for portingWebhookConfigurationFetch resource */
|
|
49
|
+
get portingWebhookConfigurationFetch(): PortingWebhookConfigurationFetchListInstance;
|
|
40
50
|
}
|