twilio 5.10.5 → 5.10.6

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.
@@ -70,6 +70,26 @@ export declare class ContentCreateRequest {
70
70
  "language": string;
71
71
  "types": Types;
72
72
  }
73
+ /**
74
+ * Content update request body
75
+ */
76
+ export declare class ContentUpdateRequest {
77
+ /**
78
+ * User defined name of the content
79
+ */
80
+ "friendlyName"?: string;
81
+ /**
82
+ * Key value pairs of variable name to value
83
+ */
84
+ "variables"?: {
85
+ [key: string]: string;
86
+ };
87
+ /**
88
+ * Language code for the content
89
+ */
90
+ "language"?: string;
91
+ "types": Types;
92
+ }
73
93
  export declare class FlowsPage {
74
94
  "id": string;
75
95
  "nextPageId"?: string;
@@ -234,6 +254,13 @@ export declare class WhatsappFlows {
234
254
  "flowFirstPageId"?: string;
235
255
  "isFlowFirstPageEndpoint"?: boolean;
236
256
  }
257
+ /**
258
+ * Options to pass to update a ContentInstance
259
+ */
260
+ export interface ContentContextUpdateOptions {
261
+ /** */
262
+ contentUpdateRequest: ContentUpdateRequest;
263
+ }
237
264
  /**
238
265
  * Options to pass to create a ContentInstance
239
266
  */
@@ -293,6 +320,16 @@ export interface ContentContext {
293
320
  * @returns Resolves to processed ContentInstance
294
321
  */
295
322
  fetch(callback?: (error: Error | null, item?: ContentInstance) => any): Promise<ContentInstance>;
323
+ /**
324
+ * Update a ContentInstance
325
+ *
326
+ * @param params - Body for request
327
+ * @param headers - header params for request
328
+ * @param callback - Callback to handle processed record
329
+ *
330
+ * @returns Resolves to processed ContentInstance
331
+ */
332
+ update(params: ContentUpdateRequest, headers?: any, callback?: (error: Error | null, item?: ContentInstance) => any): Promise<ContentInstance>;
296
333
  /**
297
334
  * Provide a user-friendly representation
298
335
  */
@@ -313,6 +350,7 @@ export declare class ContentContextImpl implements ContentContext {
313
350
  get approvalFetch(): ApprovalFetchListInstance;
314
351
  remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
315
352
  fetch(callback?: (error: Error | null, item?: ContentInstance) => any): Promise<ContentInstance>;
353
+ update(params: ContentUpdateRequest, headers?: any, callback?: (error: Error | null, item?: ContentInstance) => any): Promise<ContentInstance>;
316
354
  /**
317
355
  * Provide a user-friendly representation
318
356
  *
@@ -398,6 +436,16 @@ export declare class ContentInstance {
398
436
  * @returns Resolves to processed ContentInstance
399
437
  */
400
438
  fetch(callback?: (error: Error | null, item?: ContentInstance) => any): Promise<ContentInstance>;
439
+ /**
440
+ * Update a ContentInstance
441
+ *
442
+ * @param params - Body for request
443
+ * @param headers - header params for request
444
+ * @param callback - Callback to handle processed record
445
+ *
446
+ * @returns Resolves to processed ContentInstance
447
+ */
448
+ update(params: ContentUpdateRequest, headers?: any, callback?: (error: Error | null, item?: ContentInstance) => any): Promise<ContentInstance>;
401
449
  /**
402
450
  * Access the approvalCreate.
403
451
  */
@@ -16,7 +16,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  return (mod && mod.__esModule) ? mod : { "default": mod };
17
17
  };
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.ContentPage = exports.ContentInstance = exports.ContentContextImpl = exports.WhatsappFlows = exports.WhatsappCard = exports.WhatsappAuthentication = exports.Types = exports.TwilioText = exports.TwilioSchedule = exports.TwilioQuickReply = exports.TwilioMedia = exports.TwilioLocation = exports.TwilioListPicker = exports.TwilioFlows = exports.TwilioCatalog = exports.TwilioCarousel = exports.TwilioCard = exports.TwilioCallToAction = exports.QuickReplyAction = exports.ListItem = exports.FlowsPageComponent = exports.FlowsPage = exports.ContentCreateRequest = exports.CatalogItem = exports.CarouselCard = exports.CarouselAction = exports.CardAction = exports.CallToActionAction = exports.AuthenticationAction = void 0;
19
+ exports.ContentPage = exports.ContentInstance = exports.ContentContextImpl = exports.WhatsappFlows = exports.WhatsappCard = exports.WhatsappAuthentication = exports.Types = exports.TwilioText = exports.TwilioSchedule = exports.TwilioQuickReply = exports.TwilioMedia = exports.TwilioLocation = exports.TwilioListPicker = exports.TwilioFlows = exports.TwilioCatalog = exports.TwilioCarousel = exports.TwilioCard = exports.TwilioCallToAction = exports.QuickReplyAction = exports.ListItem = exports.FlowsPageComponent = exports.FlowsPage = exports.ContentUpdateRequest = exports.ContentCreateRequest = exports.CatalogItem = exports.CarouselCard = exports.CarouselAction = exports.CardAction = exports.CallToActionAction = exports.AuthenticationAction = void 0;
20
20
  exports.ContentListInstance = ContentListInstance;
21
21
  const util_1 = require("util");
22
22
  const Page_1 = __importDefault(require("../../../base/Page"));
@@ -49,6 +49,12 @@ exports.CatalogItem = CatalogItem;
49
49
  class ContentCreateRequest {
50
50
  }
51
51
  exports.ContentCreateRequest = ContentCreateRequest;
52
+ /**
53
+ * Content update request body
54
+ */
55
+ class ContentUpdateRequest {
56
+ }
57
+ exports.ContentUpdateRequest = ContentUpdateRequest;
52
58
  class FlowsPage {
53
59
  }
54
60
  exports.FlowsPage = FlowsPage;
@@ -196,6 +202,28 @@ class ContentContextImpl {
196
202
  operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
197
203
  return operationPromise;
198
204
  }
205
+ update(params, headers, callback) {
206
+ if (params === null || params === undefined) {
207
+ throw new Error('Required parameter "params" missing.');
208
+ }
209
+ let data = {};
210
+ data = params;
211
+ if (headers === null || headers === undefined) {
212
+ headers = {};
213
+ }
214
+ headers["Content-Type"] = "application/json";
215
+ headers["Accept"] = "application/json";
216
+ const instance = this;
217
+ let operationVersion = instance._version, operationPromise = operationVersion.update({
218
+ uri: instance._uri,
219
+ method: "put",
220
+ data,
221
+ headers,
222
+ });
223
+ operationPromise = operationPromise.then((payload) => new ContentInstance(operationVersion, payload, instance._solution.sid));
224
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
225
+ return operationPromise;
226
+ }
199
227
  /**
200
228
  * Provide a user-friendly representation
201
229
  *
@@ -250,6 +278,9 @@ class ContentInstance {
250
278
  fetch(callback) {
251
279
  return this._proxy.fetch(callback);
252
280
  }
281
+ update(params, callback) {
282
+ return this._proxy.update(params, callback);
283
+ }
253
284
  /**
254
285
  * Access the approvalCreate.
255
286
  */
@@ -1,5 +1,6 @@
1
1
  import NumbersBase from "../NumbersBase";
2
2
  import Version from "../../base/Version";
3
+ import { ApplicationListInstance } from "./v2/application";
3
4
  import { AuthorizationDocumentListInstance } from "./v2/authorizationDocument";
4
5
  import { BulkHostedNumberOrderListInstance } from "./v2/bulkHostedNumberOrder";
5
6
  import { BundleCloneListInstance } from "./v2/bundleClone";
@@ -12,6 +13,8 @@ export default class V2 extends Version {
12
13
  * @param domain - The Twilio (Twilio.Numbers) domain
13
14
  */
14
15
  constructor(domain: NumbersBase);
16
+ /** applications - { Twilio.Numbers.V2.ApplicationListInstance } resource */
17
+ protected _applications?: ApplicationListInstance;
15
18
  /** authorizationDocuments - { Twilio.Numbers.V2.AuthorizationDocumentListInstance } resource */
16
19
  protected _authorizationDocuments?: AuthorizationDocumentListInstance;
17
20
  /** bulkHostedNumberOrders - { Twilio.Numbers.V2.BulkHostedNumberOrderListInstance } resource */
@@ -22,6 +25,8 @@ export default class V2 extends Version {
22
25
  protected _hostedNumberOrders?: HostedNumberOrderListInstance;
23
26
  /** regulatoryCompliance - { Twilio.Numbers.V2.RegulatoryComplianceListInstance } resource */
24
27
  protected _regulatoryCompliance?: RegulatoryComplianceListInstance;
28
+ /** Getter for applications resource */
29
+ get applications(): ApplicationListInstance;
25
30
  /** Getter for authorizationDocuments resource */
26
31
  get authorizationDocuments(): AuthorizationDocumentListInstance;
27
32
  /** Getter for bulkHostedNumberOrders resource */
@@ -17,6 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  };
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  const Version_1 = __importDefault(require("../../base/Version"));
20
+ const application_1 = require("./v2/application");
20
21
  const authorizationDocument_1 = require("./v2/authorizationDocument");
21
22
  const bulkHostedNumberOrder_1 = require("./v2/bulkHostedNumberOrder");
22
23
  const bundleClone_1 = require("./v2/bundleClone");
@@ -31,6 +32,11 @@ class V2 extends Version_1.default {
31
32
  constructor(domain) {
32
33
  super(domain, "v2");
33
34
  }
35
+ /** Getter for applications resource */
36
+ get applications() {
37
+ this._applications = this._applications || (0, application_1.ApplicationListInstance)(this);
38
+ return this._applications;
39
+ }
34
40
  /** Getter for authorizationDocuments resource */
35
41
  get authorizationDocuments() {
36
42
  this._authorizationDocuments =
@@ -0,0 +1,257 @@
1
+ import { inspect, InspectOptions } from "util";
2
+ import Page, { TwilioResponsePayload } from "../../../base/Page";
3
+ import Response from "../../../http/response";
4
+ import V2 from "../V2";
5
+ export declare class CreateShortCodeApplicationRequest {
6
+ /**
7
+ * The friendly name for the short code application.
8
+ */
9
+ "friendlyName": string;
10
+ /**
11
+ * The ISO country code.
12
+ */
13
+ "isoCountry": string;
14
+ "businessInformation": CreateShortCodeApplicationRequestBusinessInformation;
15
+ "setup": CreateShortCodeApplicationRequestSetup;
16
+ }
17
+ /**
18
+ * Business information associated with the application.
19
+ */
20
+ export declare class CreateShortCodeApplicationRequestBusinessInformation {
21
+ /**
22
+ * The Compliance Profile SID for the customer-facing business profile.
23
+ */
24
+ "customerFacingProfile": string;
25
+ }
26
+ export declare class CreateShortCodeApplicationRequestSetup {
27
+ "chargesApply": boolean;
28
+ }
29
+ /**
30
+ * Options to pass to create a ApplicationInstance
31
+ */
32
+ export interface ApplicationListInstanceCreateOptions {
33
+ /** */
34
+ createShortCodeApplicationRequest: CreateShortCodeApplicationRequest;
35
+ }
36
+ /**
37
+ * Options to pass to each
38
+ */
39
+ export interface ApplicationListInstanceEachOptions {
40
+ /** How many resources to return in each list page. The default is 50, and the maximum is 50. */
41
+ pageSize?: number;
42
+ /** Function to process each record. If this and a positional callback are passed, this one will be used */
43
+ callback?: (item: ApplicationInstance, done: (err?: Error) => void) => void;
44
+ /** Function to be called upon completion of streaming */
45
+ done?: Function;
46
+ /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
47
+ limit?: number;
48
+ }
49
+ /**
50
+ * Options to pass to list
51
+ */
52
+ export interface ApplicationListInstanceOptions {
53
+ /** How many resources to return in each list page. The default is 50, and the maximum is 50. */
54
+ pageSize?: number;
55
+ /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
56
+ limit?: number;
57
+ }
58
+ /**
59
+ * Options to pass to page
60
+ */
61
+ export interface ApplicationListInstancePageOptions {
62
+ /** How many resources to return in each list page. The default is 50, and the maximum is 50. */
63
+ pageSize?: number;
64
+ /** Page Number, this value is simply for client state */
65
+ pageNumber?: number;
66
+ /** PageToken provided by the API */
67
+ pageToken?: string;
68
+ }
69
+ export interface ApplicationContext {
70
+ /**
71
+ * Fetch a ApplicationInstance
72
+ *
73
+ * @param callback - Callback to handle processed record
74
+ *
75
+ * @returns Resolves to processed ApplicationInstance
76
+ */
77
+ fetch(callback?: (error: Error | null, item?: ApplicationInstance) => any): Promise<ApplicationInstance>;
78
+ /**
79
+ * Provide a user-friendly representation
80
+ */
81
+ toJSON(): any;
82
+ [inspect.custom](_depth: any, options: InspectOptions): any;
83
+ }
84
+ export interface ApplicationContextSolution {
85
+ sid: string;
86
+ }
87
+ export declare class ApplicationContextImpl implements ApplicationContext {
88
+ protected _version: V2;
89
+ protected _solution: ApplicationContextSolution;
90
+ protected _uri: string;
91
+ constructor(_version: V2, sid: string);
92
+ fetch(callback?: (error: Error | null, item?: ApplicationInstance) => any): Promise<ApplicationInstance>;
93
+ /**
94
+ * Provide a user-friendly representation
95
+ *
96
+ * @returns Object
97
+ */
98
+ toJSON(): ApplicationContextSolution;
99
+ [inspect.custom](_depth: any, options: InspectOptions): string;
100
+ }
101
+ interface ApplicationPayload extends TwilioResponsePayload {
102
+ results: ApplicationResource[];
103
+ }
104
+ interface ApplicationResource {
105
+ sid: string;
106
+ bundle_sid: string;
107
+ application_requirements_sid: string;
108
+ friendly_name: string;
109
+ iso_country: string;
110
+ state: string;
111
+ }
112
+ export declare class ApplicationInstance {
113
+ protected _version: V2;
114
+ protected _solution: ApplicationContextSolution;
115
+ protected _context?: ApplicationContext;
116
+ constructor(_version: V2, payload: ApplicationResource, sid?: string);
117
+ /**
118
+ * The unique identifier of the Short Code Application.
119
+ */
120
+ sid: string;
121
+ /**
122
+ * The Bundle SID for regulatory compliance.
123
+ */
124
+ bundleSid: string;
125
+ /**
126
+ * The Application Requirements SID.
127
+ */
128
+ applicationRequirementsSid: string;
129
+ /**
130
+ * The friendly name of the application.
131
+ */
132
+ friendlyName: string;
133
+ /**
134
+ * The ISO country code.
135
+ */
136
+ isoCountry: string;
137
+ /**
138
+ * The state of the application.
139
+ */
140
+ state: string;
141
+ private get _proxy();
142
+ /**
143
+ * Fetch a ApplicationInstance
144
+ *
145
+ * @param callback - Callback to handle processed record
146
+ *
147
+ * @returns Resolves to processed ApplicationInstance
148
+ */
149
+ fetch(callback?: (error: Error | null, item?: ApplicationInstance) => any): Promise<ApplicationInstance>;
150
+ /**
151
+ * Provide a user-friendly representation
152
+ *
153
+ * @returns Object
154
+ */
155
+ toJSON(): {
156
+ sid: string;
157
+ bundleSid: string;
158
+ applicationRequirementsSid: string;
159
+ friendlyName: string;
160
+ isoCountry: string;
161
+ state: string;
162
+ };
163
+ [inspect.custom](_depth: any, options: InspectOptions): string;
164
+ }
165
+ export interface ApplicationSolution {
166
+ }
167
+ export interface ApplicationListInstance {
168
+ _version: V2;
169
+ _solution: ApplicationSolution;
170
+ _uri: string;
171
+ (sid: string): ApplicationContext;
172
+ get(sid: string): ApplicationContext;
173
+ /**
174
+ * Create a ApplicationInstance
175
+ *
176
+ * @param params - Body for request
177
+ * @param headers - header params for request
178
+ * @param callback - Callback to handle processed record
179
+ *
180
+ * @returns Resolves to processed ApplicationInstance
181
+ */
182
+ create(params: CreateShortCodeApplicationRequest, headers?: any, callback?: (error: Error | null, item?: ApplicationInstance) => any): Promise<ApplicationInstance>;
183
+ /**
184
+ * Streams ApplicationInstance records from the API.
185
+ *
186
+ * This operation lazily loads records as efficiently as possible until the limit
187
+ * is reached.
188
+ *
189
+ * The results are passed into the callback function, so this operation is memory
190
+ * efficient.
191
+ *
192
+ * If a function is passed as the first argument, it will be used as the callback
193
+ * function.
194
+ *
195
+ * @param { ApplicationListInstanceEachOptions } [params] - Options for request
196
+ * @param { function } [callback] - Function to process each record
197
+ */
198
+ each(callback?: (item: ApplicationInstance, done: (err?: Error) => void) => void): void;
199
+ each(params: ApplicationListInstanceEachOptions, callback?: (item: ApplicationInstance, done: (err?: Error) => void) => void): void;
200
+ /**
201
+ * Retrieve a single target page of ApplicationInstance records from the API.
202
+ *
203
+ * The request is executed immediately.
204
+ *
205
+ * @param { string } [targetUrl] - API-generated URL for the requested results page
206
+ * @param { function } [callback] - Callback to handle list of records
207
+ */
208
+ getPage(targetUrl: string, callback?: (error: Error | null, items: ApplicationPage) => any): Promise<ApplicationPage>;
209
+ /**
210
+ * Lists ApplicationInstance records from the API as a list.
211
+ *
212
+ * If a function is passed as the first argument, it will be used as the callback
213
+ * function.
214
+ *
215
+ * @param { ApplicationListInstanceOptions } [params] - Options for request
216
+ * @param { function } [callback] - Callback to handle list of records
217
+ */
218
+ list(callback?: (error: Error | null, items: ApplicationInstance[]) => any): Promise<ApplicationInstance[]>;
219
+ list(params: ApplicationListInstanceOptions, callback?: (error: Error | null, items: ApplicationInstance[]) => any): Promise<ApplicationInstance[]>;
220
+ /**
221
+ * Retrieve a single page of ApplicationInstance records from the API.
222
+ *
223
+ * The request is executed immediately.
224
+ *
225
+ * If a function is passed as the first argument, it will be used as the callback
226
+ * function.
227
+ *
228
+ * @param { ApplicationListInstancePageOptions } [params] - Options for request
229
+ * @param { function } [callback] - Callback to handle list of records
230
+ */
231
+ page(callback?: (error: Error | null, items: ApplicationPage) => any): Promise<ApplicationPage>;
232
+ page(params: ApplicationListInstancePageOptions, callback?: (error: Error | null, items: ApplicationPage) => any): Promise<ApplicationPage>;
233
+ /**
234
+ * Provide a user-friendly representation
235
+ */
236
+ toJSON(): any;
237
+ [inspect.custom](_depth: any, options: InspectOptions): any;
238
+ }
239
+ export declare function ApplicationListInstance(version: V2): ApplicationListInstance;
240
+ export declare class ApplicationPage extends Page<V2, ApplicationPayload, ApplicationResource, ApplicationInstance> {
241
+ /**
242
+ * Initialize the ApplicationPage
243
+ *
244
+ * @param version - Version of the resource
245
+ * @param response - Response from the API
246
+ * @param solution - Path solution
247
+ */
248
+ constructor(version: V2, response: Response<string>, solution: ApplicationSolution);
249
+ /**
250
+ * Build an instance of ApplicationInstance
251
+ *
252
+ * @param payload - Payload response from the API
253
+ */
254
+ getInstance(payload: ApplicationResource): ApplicationInstance;
255
+ [inspect.custom](depth: any, options: InspectOptions): string;
256
+ }
257
+ export {};
@@ -0,0 +1,218 @@
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.ApplicationPage = exports.ApplicationInstance = exports.ApplicationContextImpl = exports.CreateShortCodeApplicationRequestSetup = exports.CreateShortCodeApplicationRequestBusinessInformation = exports.CreateShortCodeApplicationRequest = void 0;
20
+ exports.ApplicationListInstance = ApplicationListInstance;
21
+ const util_1 = require("util");
22
+ const Page_1 = __importDefault(require("../../../base/Page"));
23
+ const deserialize = require("../../../base/deserialize");
24
+ const serialize = require("../../../base/serialize");
25
+ const utility_1 = require("../../../base/utility");
26
+ class CreateShortCodeApplicationRequest {
27
+ }
28
+ exports.CreateShortCodeApplicationRequest = CreateShortCodeApplicationRequest;
29
+ /**
30
+ * Business information associated with the application.
31
+ */
32
+ class CreateShortCodeApplicationRequestBusinessInformation {
33
+ }
34
+ exports.CreateShortCodeApplicationRequestBusinessInformation = CreateShortCodeApplicationRequestBusinessInformation;
35
+ class CreateShortCodeApplicationRequestSetup {
36
+ }
37
+ exports.CreateShortCodeApplicationRequestSetup = CreateShortCodeApplicationRequestSetup;
38
+ class ApplicationContextImpl {
39
+ constructor(_version, sid) {
40
+ this._version = _version;
41
+ if (!(0, utility_1.isValidPathParam)(sid)) {
42
+ throw new Error("Parameter 'sid' is not valid.");
43
+ }
44
+ this._solution = { sid };
45
+ this._uri = `/ShortCodes/Applications/${sid}`;
46
+ }
47
+ fetch(callback) {
48
+ const headers = {};
49
+ headers["Accept"] = "application/json";
50
+ const instance = this;
51
+ let operationVersion = instance._version, operationPromise = operationVersion.fetch({
52
+ uri: instance._uri,
53
+ method: "get",
54
+ headers,
55
+ });
56
+ operationPromise = operationPromise.then((payload) => new ApplicationInstance(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.ApplicationContextImpl = ApplicationContextImpl;
73
+ class ApplicationInstance {
74
+ constructor(_version, payload, sid) {
75
+ this._version = _version;
76
+ this.sid = payload.sid;
77
+ this.bundleSid = payload.bundle_sid;
78
+ this.applicationRequirementsSid = payload.application_requirements_sid;
79
+ this.friendlyName = payload.friendly_name;
80
+ this.isoCountry = payload.iso_country;
81
+ this.state = payload.state;
82
+ this._solution = { sid: sid || this.sid };
83
+ }
84
+ get _proxy() {
85
+ this._context =
86
+ this._context ||
87
+ new ApplicationContextImpl(this._version, this._solution.sid);
88
+ return this._context;
89
+ }
90
+ /**
91
+ * Fetch a ApplicationInstance
92
+ *
93
+ * @param callback - Callback to handle processed record
94
+ *
95
+ * @returns Resolves to processed ApplicationInstance
96
+ */
97
+ fetch(callback) {
98
+ return this._proxy.fetch(callback);
99
+ }
100
+ /**
101
+ * Provide a user-friendly representation
102
+ *
103
+ * @returns Object
104
+ */
105
+ toJSON() {
106
+ return {
107
+ sid: this.sid,
108
+ bundleSid: this.bundleSid,
109
+ applicationRequirementsSid: this.applicationRequirementsSid,
110
+ friendlyName: this.friendlyName,
111
+ isoCountry: this.isoCountry,
112
+ state: this.state,
113
+ };
114
+ }
115
+ [util_1.inspect.custom](_depth, options) {
116
+ return (0, util_1.inspect)(this.toJSON(), options);
117
+ }
118
+ }
119
+ exports.ApplicationInstance = ApplicationInstance;
120
+ function ApplicationListInstance(version) {
121
+ const instance = ((sid) => instance.get(sid));
122
+ instance.get = function get(sid) {
123
+ return new ApplicationContextImpl(version, sid);
124
+ };
125
+ instance._version = version;
126
+ instance._solution = {};
127
+ instance._uri = `/ShortCodes/Applications`;
128
+ instance.create = function create(params, headers, callback) {
129
+ if (params === null || params === undefined) {
130
+ throw new Error('Required parameter "params" missing.');
131
+ }
132
+ let data = {};
133
+ data = params;
134
+ if (headers === null || headers === undefined) {
135
+ headers = {};
136
+ }
137
+ headers["Content-Type"] = "application/json";
138
+ headers["Accept"] = "application/json";
139
+ let operationVersion = version, operationPromise = operationVersion.create({
140
+ uri: instance._uri,
141
+ method: "post",
142
+ data,
143
+ headers,
144
+ });
145
+ operationPromise = operationPromise.then((payload) => new ApplicationInstance(operationVersion, payload));
146
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
147
+ return operationPromise;
148
+ };
149
+ instance.page = function page(params, callback) {
150
+ if (params instanceof Function) {
151
+ callback = params;
152
+ params = {};
153
+ }
154
+ else {
155
+ params = params || {};
156
+ }
157
+ let data = {};
158
+ if (params["pageSize"] !== undefined)
159
+ data["PageSize"] = params["pageSize"];
160
+ if (params.pageNumber !== undefined)
161
+ data["Page"] = params.pageNumber;
162
+ if (params.pageToken !== undefined)
163
+ data["PageToken"] = params.pageToken;
164
+ const headers = {};
165
+ headers["Accept"] = "application/json";
166
+ let operationVersion = version, operationPromise = operationVersion.page({
167
+ uri: instance._uri,
168
+ method: "get",
169
+ params: data,
170
+ headers,
171
+ });
172
+ operationPromise = operationPromise.then((payload) => new ApplicationPage(operationVersion, payload, instance._solution));
173
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
174
+ return operationPromise;
175
+ };
176
+ instance.each = instance._version.each;
177
+ instance.list = instance._version.list;
178
+ instance.getPage = function getPage(targetUrl, callback) {
179
+ const operationPromise = instance._version._domain.twilio.request({
180
+ method: "get",
181
+ uri: targetUrl,
182
+ });
183
+ let pagePromise = operationPromise.then((payload) => new ApplicationPage(instance._version, payload, instance._solution));
184
+ pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
185
+ return pagePromise;
186
+ };
187
+ instance.toJSON = function toJSON() {
188
+ return instance._solution;
189
+ };
190
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
191
+ return (0, util_1.inspect)(instance.toJSON(), options);
192
+ };
193
+ return instance;
194
+ }
195
+ class ApplicationPage extends Page_1.default {
196
+ /**
197
+ * Initialize the ApplicationPage
198
+ *
199
+ * @param version - Version of the resource
200
+ * @param response - Response from the API
201
+ * @param solution - Path solution
202
+ */
203
+ constructor(version, response, solution) {
204
+ super(version, response, solution);
205
+ }
206
+ /**
207
+ * Build an instance of ApplicationInstance
208
+ *
209
+ * @param payload - Payload response from the API
210
+ */
211
+ getInstance(payload) {
212
+ return new ApplicationInstance(this._version, payload);
213
+ }
214
+ [util_1.inspect.custom](depth, options) {
215
+ return (0, util_1.inspect)(this.toJSON(), options);
216
+ }
217
+ }
218
+ exports.ApplicationPage = ApplicationPage;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "twilio",
3
3
  "description": "A Twilio helper library",
4
- "version": "5.10.5",
4
+ "version": "5.10.6",
5
5
  "author": "API Team <api@twilio.com>",
6
6
  "contributors": [
7
7
  {