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.
Files changed (79) hide show
  1. package/README.md +1 -0
  2. package/lib/rest/ContentBase.d.ts +3 -0
  3. package/lib/rest/ContentBase.js +5 -0
  4. package/lib/rest/Twilio.d.ts +0 -5
  5. package/lib/rest/Twilio.js +0 -6
  6. package/lib/rest/api/v2010/account/call/stream.d.ts +5 -5
  7. package/lib/rest/api/v2010/account/message.d.ts +1 -1
  8. package/lib/rest/content/V2.d.ts +20 -0
  9. package/lib/rest/content/V2.js +43 -0
  10. package/lib/rest/content/v2/content.d.ts +196 -0
  11. package/lib/rest/content/v2/content.js +136 -0
  12. package/lib/rest/content/v2/contentAndApprovals.d.ts +190 -0
  13. package/lib/rest/content/v2/contentAndApprovals.js +134 -0
  14. package/lib/rest/flexApi/V2.d.ts +5 -0
  15. package/lib/rest/flexApi/V2.js +6 -0
  16. package/lib/rest/flexApi/v1/interaction.d.ts +1 -1
  17. package/lib/rest/flexApi/v1/interaction.js +2 -4
  18. package/lib/rest/flexApi/v1/plugin/pluginVersions.d.ts +4 -1
  19. package/lib/rest/flexApi/v1/plugin/pluginVersions.js +2 -0
  20. package/lib/rest/flexApi/v2/flexUser.d.ts +170 -0
  21. package/lib/rest/flexApi/v2/flexUser.js +142 -0
  22. package/lib/rest/flexApi/v2/webChannels.d.ts +2 -0
  23. package/lib/rest/flexApi/v2/webChannels.js +2 -0
  24. package/lib/rest/intelligence/V2.d.ts +30 -0
  25. package/lib/rest/intelligence/V2.js +40 -0
  26. package/lib/rest/intelligence/v2/customOperator.d.ts +330 -0
  27. package/lib/rest/intelligence/v2/customOperator.js +279 -0
  28. package/lib/rest/intelligence/v2/operator.d.ts +263 -0
  29. package/lib/rest/intelligence/v2/operator.js +197 -0
  30. package/lib/rest/intelligence/v2/operatorAttachment.d.ts +112 -0
  31. package/lib/rest/intelligence/v2/operatorAttachment.js +135 -0
  32. package/lib/rest/intelligence/v2/operatorAttachments.d.ts +94 -0
  33. package/lib/rest/intelligence/v2/operatorAttachments.js +110 -0
  34. package/lib/rest/intelligence/v2/operatorType.d.ts +259 -0
  35. package/lib/rest/intelligence/v2/operatorType.js +197 -0
  36. package/lib/rest/intelligence/v2/prebuiltOperator.d.ts +263 -0
  37. package/lib/rest/intelligence/v2/prebuiltOperator.js +197 -0
  38. package/lib/rest/intelligence/v2/service.d.ts +8 -4
  39. package/lib/rest/intelligence/v2/service.js +3 -2
  40. package/lib/rest/messaging/v1/service.d.ts +0 -6
  41. package/lib/rest/messaging/v1/service.js +0 -2
  42. package/lib/rest/numbers/V1.d.ts +20 -10
  43. package/lib/rest/numbers/V1.js +31 -14
  44. package/lib/rest/numbers/v1/portingPortIn.d.ts +133 -14
  45. package/lib/rest/numbers/v1/portingPortIn.js +116 -24
  46. package/lib/rest/numbers/v1/portingPortInPhoneNumber.d.ts +175 -0
  47. package/lib/rest/numbers/v1/portingPortInPhoneNumber.js +157 -0
  48. package/lib/rest/numbers/v1/portingWebhookConfiguration.d.ts +79 -0
  49. package/lib/rest/{previewMessaging/v1/broadcast.js → numbers/v1/portingWebhookConfiguration.js} +19 -32
  50. package/lib/rest/numbers/v1/portingWebhookConfigurationDelete.d.ts +51 -0
  51. package/lib/rest/numbers/v1/portingWebhookConfigurationDelete.js +68 -0
  52. package/lib/rest/numbers/v1/portingWebhookConfigurationFetch.d.ts +75 -0
  53. package/lib/rest/numbers/v1/portingWebhookConfigurationFetch.js +72 -0
  54. package/lib/rest/taskrouter/v1/workspace/task.d.ts +24 -0
  55. package/lib/rest/taskrouter/v1/workspace/task.js +12 -0
  56. package/lib/rest/trusthub/v1/complianceTollfreeInquiries.d.ts +2 -0
  57. package/lib/rest/trusthub/v1/complianceTollfreeInquiries.js +2 -0
  58. package/lib/rest/trusthub/v1/customerProfiles.d.ts +6 -0
  59. package/lib/rest/trusthub/v1/customerProfiles.js +2 -0
  60. package/lib/rest/trusthub/v1/trustProducts.d.ts +6 -0
  61. package/lib/rest/trusthub/v1/trustProducts.js +2 -0
  62. package/lib/rest/verify/v2/service/verification.d.ts +1 -1
  63. package/lib/rest/verify/v2/service/verificationCheck.d.ts +1 -1
  64. package/lib/rest/verify/v2/service.d.ts +1 -1
  65. package/lib/webhooks/webhooks.js +9 -11
  66. package/package.json +4 -6
  67. package/lib/rest/PreviewMessaging.d.ts +0 -9
  68. package/lib/rest/PreviewMessaging.js +0 -15
  69. package/lib/rest/PreviewMessagingBase.d.ts +0 -13
  70. package/lib/rest/PreviewMessagingBase.js +0 -31
  71. package/lib/rest/numbers/v1/portingBulkPortability.d.ts +0 -120
  72. package/lib/rest/numbers/v1/portingBulkPortability.js +0 -136
  73. package/lib/rest/numbers/v1/portingPortInFetch.d.ts +0 -142
  74. package/lib/rest/numbers/v1/portingPortInFetch.js +0 -128
  75. package/lib/rest/previewMessaging/V1.d.ts +0 -20
  76. package/lib/rest/previewMessaging/V1.js +0 -42
  77. package/lib/rest/previewMessaging/v1/broadcast.d.ts +0 -108
  78. package/lib/rest/previewMessaging/v1/message.d.ts +0 -178
  79. package/lib/rest/previewMessaging/v1/message.js +0 -91
@@ -0,0 +1,279 @@
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.CustomOperatorPage = exports.CustomOperatorListInstance = exports.CustomOperatorInstance = exports.CustomOperatorContextImpl = 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 CustomOperatorContextImpl {
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/Custom/${sid}`;
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 CustomOperatorInstance(operationVersion, payload, instance._solution.sid));
50
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
51
+ return operationPromise;
52
+ }
53
+ update(params, callback) {
54
+ if (params === null || params === undefined) {
55
+ throw new Error('Required parameter "params" missing.');
56
+ }
57
+ if (params["friendlyName"] === null ||
58
+ params["friendlyName"] === undefined) {
59
+ throw new Error("Required parameter \"params['friendlyName']\" missing.");
60
+ }
61
+ if (params["config"] === null || params["config"] === undefined) {
62
+ throw new Error("Required parameter \"params['config']\" missing.");
63
+ }
64
+ let data = {};
65
+ data["FriendlyName"] = params["friendlyName"];
66
+ data["Config"] = serialize.object(params["config"]);
67
+ const headers = {};
68
+ headers["Content-Type"] = "application/x-www-form-urlencoded";
69
+ if (params["ifMatch"] !== undefined)
70
+ headers["If-Match"] = params["ifMatch"];
71
+ const instance = this;
72
+ let operationVersion = instance._version, operationPromise = operationVersion.update({
73
+ uri: instance._uri,
74
+ method: "post",
75
+ data,
76
+ headers,
77
+ });
78
+ operationPromise = operationPromise.then((payload) => new CustomOperatorInstance(operationVersion, payload, instance._solution.sid));
79
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
80
+ return operationPromise;
81
+ }
82
+ /**
83
+ * Provide a user-friendly representation
84
+ *
85
+ * @returns Object
86
+ */
87
+ toJSON() {
88
+ return this._solution;
89
+ }
90
+ [util_1.inspect.custom](_depth, options) {
91
+ return (0, util_1.inspect)(this.toJSON(), options);
92
+ }
93
+ }
94
+ exports.CustomOperatorContextImpl = CustomOperatorContextImpl;
95
+ class CustomOperatorInstance {
96
+ constructor(_version, payload, sid) {
97
+ this._version = _version;
98
+ this.accountSid = payload.account_sid;
99
+ this.sid = payload.sid;
100
+ this.friendlyName = payload.friendly_name;
101
+ this.description = payload.description;
102
+ this.author = payload.author;
103
+ this.operatorType = payload.operator_type;
104
+ this.version = deserialize.integer(payload.version);
105
+ this.availability = payload.availability;
106
+ this.config = payload.config;
107
+ this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
108
+ this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
109
+ this.url = payload.url;
110
+ this._solution = { sid: sid || this.sid };
111
+ }
112
+ get _proxy() {
113
+ this._context =
114
+ this._context ||
115
+ new CustomOperatorContextImpl(this._version, this._solution.sid);
116
+ return this._context;
117
+ }
118
+ /**
119
+ * Remove a CustomOperatorInstance
120
+ *
121
+ * @param callback - Callback to handle processed record
122
+ *
123
+ * @returns Resolves to processed boolean
124
+ */
125
+ remove(callback) {
126
+ return this._proxy.remove(callback);
127
+ }
128
+ /**
129
+ * Fetch a CustomOperatorInstance
130
+ *
131
+ * @param callback - Callback to handle processed record
132
+ *
133
+ * @returns Resolves to processed CustomOperatorInstance
134
+ */
135
+ fetch(callback) {
136
+ return this._proxy.fetch(callback);
137
+ }
138
+ update(params, callback) {
139
+ return this._proxy.update(params, callback);
140
+ }
141
+ /**
142
+ * Provide a user-friendly representation
143
+ *
144
+ * @returns Object
145
+ */
146
+ toJSON() {
147
+ return {
148
+ accountSid: this.accountSid,
149
+ sid: this.sid,
150
+ friendlyName: this.friendlyName,
151
+ description: this.description,
152
+ author: this.author,
153
+ operatorType: this.operatorType,
154
+ version: this.version,
155
+ availability: this.availability,
156
+ config: this.config,
157
+ dateCreated: this.dateCreated,
158
+ dateUpdated: this.dateUpdated,
159
+ url: this.url,
160
+ };
161
+ }
162
+ [util_1.inspect.custom](_depth, options) {
163
+ return (0, util_1.inspect)(this.toJSON(), options);
164
+ }
165
+ }
166
+ exports.CustomOperatorInstance = CustomOperatorInstance;
167
+ function CustomOperatorListInstance(version) {
168
+ const instance = ((sid) => instance.get(sid));
169
+ instance.get = function get(sid) {
170
+ return new CustomOperatorContextImpl(version, sid);
171
+ };
172
+ instance._version = version;
173
+ instance._solution = {};
174
+ instance._uri = `/Operators/Custom`;
175
+ instance.create = function create(params, callback) {
176
+ if (params === null || params === undefined) {
177
+ throw new Error('Required parameter "params" missing.');
178
+ }
179
+ if (params["friendlyName"] === null ||
180
+ params["friendlyName"] === undefined) {
181
+ throw new Error("Required parameter \"params['friendlyName']\" missing.");
182
+ }
183
+ if (params["operatorType"] === null ||
184
+ params["operatorType"] === undefined) {
185
+ throw new Error("Required parameter \"params['operatorType']\" missing.");
186
+ }
187
+ if (params["config"] === null || params["config"] === undefined) {
188
+ throw new Error("Required parameter \"params['config']\" missing.");
189
+ }
190
+ let data = {};
191
+ data["FriendlyName"] = params["friendlyName"];
192
+ data["OperatorType"] = params["operatorType"];
193
+ data["Config"] = serialize.object(params["config"]);
194
+ const headers = {};
195
+ headers["Content-Type"] = "application/x-www-form-urlencoded";
196
+ let operationVersion = version, operationPromise = operationVersion.create({
197
+ uri: instance._uri,
198
+ method: "post",
199
+ data,
200
+ headers,
201
+ });
202
+ operationPromise = operationPromise.then((payload) => new CustomOperatorInstance(operationVersion, payload));
203
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
204
+ return operationPromise;
205
+ };
206
+ instance.page = function page(params, callback) {
207
+ if (params instanceof Function) {
208
+ callback = params;
209
+ params = {};
210
+ }
211
+ else {
212
+ params = params || {};
213
+ }
214
+ let data = {};
215
+ if (params["availability"] !== undefined)
216
+ data["Availability"] = params["availability"];
217
+ if (params["languageCode"] !== undefined)
218
+ data["LanguageCode"] = params["languageCode"];
219
+ if (params["pageSize"] !== undefined)
220
+ data["PageSize"] = params["pageSize"];
221
+ if (params.pageNumber !== undefined)
222
+ data["Page"] = params.pageNumber;
223
+ if (params.pageToken !== undefined)
224
+ data["PageToken"] = params.pageToken;
225
+ const headers = {};
226
+ let operationVersion = version, operationPromise = operationVersion.page({
227
+ uri: instance._uri,
228
+ method: "get",
229
+ params: data,
230
+ headers,
231
+ });
232
+ operationPromise = operationPromise.then((payload) => new CustomOperatorPage(operationVersion, payload, instance._solution));
233
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
234
+ return operationPromise;
235
+ };
236
+ instance.each = instance._version.each;
237
+ instance.list = instance._version.list;
238
+ instance.getPage = function getPage(targetUrl, callback) {
239
+ const operationPromise = instance._version._domain.twilio.request({
240
+ method: "get",
241
+ uri: targetUrl,
242
+ });
243
+ let pagePromise = operationPromise.then((payload) => new CustomOperatorPage(instance._version, payload, instance._solution));
244
+ pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
245
+ return pagePromise;
246
+ };
247
+ instance.toJSON = function toJSON() {
248
+ return instance._solution;
249
+ };
250
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
251
+ return (0, util_1.inspect)(instance.toJSON(), options);
252
+ };
253
+ return instance;
254
+ }
255
+ exports.CustomOperatorListInstance = CustomOperatorListInstance;
256
+ class CustomOperatorPage extends Page_1.default {
257
+ /**
258
+ * Initialize the CustomOperatorPage
259
+ *
260
+ * @param version - Version of the resource
261
+ * @param response - Response from the API
262
+ * @param solution - Path solution
263
+ */
264
+ constructor(version, response, solution) {
265
+ super(version, response, solution);
266
+ }
267
+ /**
268
+ * Build an instance of CustomOperatorInstance
269
+ *
270
+ * @param payload - Payload response from the API
271
+ */
272
+ getInstance(payload) {
273
+ return new CustomOperatorInstance(this._version, payload);
274
+ }
275
+ [util_1.inspect.custom](depth, options) {
276
+ return (0, util_1.inspect)(this.toJSON(), options);
277
+ }
278
+ }
279
+ exports.CustomOperatorPage = CustomOperatorPage;
@@ -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 OperatorAvailability = "internal" | "beta" | "public" | "retired";
7
+ /**
8
+ * Options to pass to each
9
+ */
10
+ export interface OperatorListInstanceEachOptions {
11
+ /** Returns Operators with the provided availability type. Possible values: internal, beta, public, retired. */
12
+ availability?: OperatorAvailability;
13
+ /** Returns 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: OperatorInstance, 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 OperatorListInstanceOptions {
28
+ /** Returns Operators with the provided availability type. Possible values: internal, beta, public, retired. */
29
+ availability?: OperatorAvailability;
30
+ /** Returns 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 OperatorListInstancePageOptions {
41
+ /** Returns Operators with the provided availability type. Possible values: internal, beta, public, retired. */
42
+ availability?: OperatorAvailability;
43
+ /** Returns 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 OperatorContext {
53
+ /**
54
+ * Fetch a OperatorInstance
55
+ *
56
+ * @param callback - Callback to handle processed record
57
+ *
58
+ * @returns Resolves to processed OperatorInstance
59
+ */
60
+ fetch(callback?: (error: Error | null, item?: OperatorInstance) => any): Promise<OperatorInstance>;
61
+ /**
62
+ * Provide a user-friendly representation
63
+ */
64
+ toJSON(): any;
65
+ [inspect.custom](_depth: any, options: InspectOptions): any;
66
+ }
67
+ export interface OperatorContextSolution {
68
+ sid: string;
69
+ }
70
+ export declare class OperatorContextImpl implements OperatorContext {
71
+ protected _version: V2;
72
+ protected _solution: OperatorContextSolution;
73
+ protected _uri: string;
74
+ constructor(_version: V2, sid: string);
75
+ fetch(callback?: (error: Error | null, item?: OperatorInstance) => any): Promise<OperatorInstance>;
76
+ /**
77
+ * Provide a user-friendly representation
78
+ *
79
+ * @returns Object
80
+ */
81
+ toJSON(): OperatorContextSolution;
82
+ [inspect.custom](_depth: any, options: InspectOptions): string;
83
+ }
84
+ interface OperatorPayload extends TwilioResponsePayload {
85
+ operators: OperatorResource[];
86
+ }
87
+ interface OperatorResource {
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: OperatorAvailability;
96
+ config: any;
97
+ date_created: Date;
98
+ date_updated: Date;
99
+ url: string;
100
+ }
101
+ export declare class OperatorInstance {
102
+ protected _version: V2;
103
+ protected _solution: OperatorContextSolution;
104
+ protected _context?: OperatorContext;
105
+ constructor(_version: V2, payload: OperatorResource, sid?: string);
106
+ /**
107
+ * The unique SID identifier of the Account the Operator belongs to.
108
+ */
109
+ accountSid: string;
110
+ /**
111
+ * A 34 character string that uniquely identifies this 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. Either Twilio or the creating Account.
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: OperatorAvailability;
135
+ /**
136
+ * Operator configuration, following the schema defined by the Operator Type. Only available on Custom Operators created by the Account.
137
+ */
138
+ config: any;
139
+ /**
140
+ * The date that this Operator was created, given in ISO 8601 format.
141
+ */
142
+ dateCreated: Date;
143
+ /**
144
+ * The date that this 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 OperatorInstance
154
+ *
155
+ * @param callback - Callback to handle processed record
156
+ *
157
+ * @returns Resolves to processed OperatorInstance
158
+ */
159
+ fetch(callback?: (error: Error | null, item?: OperatorInstance) => any): Promise<OperatorInstance>;
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: OperatorAvailability;
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 OperatorSolution {
182
+ }
183
+ export interface OperatorListInstance {
184
+ _version: V2;
185
+ _solution: OperatorSolution;
186
+ _uri: string;
187
+ (sid: string): OperatorContext;
188
+ get(sid: string): OperatorContext;
189
+ /**
190
+ * Streams OperatorInstance 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 { OperatorListInstanceEachOptions } [params] - Options for request
202
+ * @param { function } [callback] - Function to process each record
203
+ */
204
+ each(callback?: (item: OperatorInstance, done: (err?: Error) => void) => void): void;
205
+ each(params: OperatorListInstanceEachOptions, callback?: (item: OperatorInstance, done: (err?: Error) => void) => void): void;
206
+ /**
207
+ * Retrieve a single target page of OperatorInstance 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: OperatorPage) => any): Promise<OperatorPage>;
215
+ /**
216
+ * Lists OperatorInstance 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 { OperatorListInstanceOptions } [params] - Options for request
222
+ * @param { function } [callback] - Callback to handle list of records
223
+ */
224
+ list(callback?: (error: Error | null, items: OperatorInstance[]) => any): Promise<OperatorInstance[]>;
225
+ list(params: OperatorListInstanceOptions, callback?: (error: Error | null, items: OperatorInstance[]) => any): Promise<OperatorInstance[]>;
226
+ /**
227
+ * Retrieve a single page of OperatorInstance 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 { OperatorListInstancePageOptions } [params] - Options for request
235
+ * @param { function } [callback] - Callback to handle list of records
236
+ */
237
+ page(callback?: (error: Error | null, items: OperatorPage) => any): Promise<OperatorPage>;
238
+ page(params: OperatorListInstancePageOptions, callback?: (error: Error | null, items: OperatorPage) => any): Promise<OperatorPage>;
239
+ /**
240
+ * Provide a user-friendly representation
241
+ */
242
+ toJSON(): any;
243
+ [inspect.custom](_depth: any, options: InspectOptions): any;
244
+ }
245
+ export declare function OperatorListInstance(version: V2): OperatorListInstance;
246
+ export declare class OperatorPage extends Page<V2, OperatorPayload, OperatorResource, OperatorInstance> {
247
+ /**
248
+ * Initialize the OperatorPage
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: OperatorSolution);
255
+ /**
256
+ * Build an instance of OperatorInstance
257
+ *
258
+ * @param payload - Payload response from the API
259
+ */
260
+ getInstance(payload: OperatorResource): OperatorInstance;
261
+ [inspect.custom](depth: any, options: InspectOptions): string;
262
+ }
263
+ export {};