twilio 5.0.4 → 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 (71) hide show
  1. package/lib/rest/ContentBase.d.ts +3 -0
  2. package/lib/rest/ContentBase.js +5 -0
  3. package/lib/rest/Twilio.d.ts +0 -5
  4. package/lib/rest/Twilio.js +0 -6
  5. package/lib/rest/api/v2010/account/message.d.ts +1 -1
  6. package/lib/rest/content/V2.d.ts +20 -0
  7. package/lib/rest/content/V2.js +43 -0
  8. package/lib/rest/content/v2/content.d.ts +196 -0
  9. package/lib/rest/content/v2/content.js +136 -0
  10. package/lib/rest/content/v2/contentAndApprovals.d.ts +190 -0
  11. package/lib/rest/content/v2/contentAndApprovals.js +134 -0
  12. package/lib/rest/flexApi/v1/interaction.d.ts +1 -1
  13. package/lib/rest/flexApi/v1/interaction.js +2 -4
  14. package/lib/rest/flexApi/v1/plugin/pluginVersions.d.ts +4 -1
  15. package/lib/rest/flexApi/v1/plugin/pluginVersions.js +2 -0
  16. package/lib/rest/intelligence/V2.d.ts +30 -0
  17. package/lib/rest/intelligence/V2.js +40 -0
  18. package/lib/rest/intelligence/v2/customOperator.d.ts +330 -0
  19. package/lib/rest/intelligence/v2/customOperator.js +279 -0
  20. package/lib/rest/intelligence/v2/operator.d.ts +263 -0
  21. package/lib/rest/intelligence/v2/operator.js +197 -0
  22. package/lib/rest/intelligence/v2/operatorAttachment.d.ts +112 -0
  23. package/lib/rest/intelligence/v2/operatorAttachment.js +135 -0
  24. package/lib/rest/intelligence/v2/operatorAttachments.d.ts +94 -0
  25. package/lib/rest/intelligence/v2/operatorAttachments.js +110 -0
  26. package/lib/rest/intelligence/v2/operatorType.d.ts +259 -0
  27. package/lib/rest/intelligence/v2/operatorType.js +197 -0
  28. package/lib/rest/intelligence/v2/prebuiltOperator.d.ts +263 -0
  29. package/lib/rest/intelligence/v2/prebuiltOperator.js +197 -0
  30. package/lib/rest/intelligence/v2/service.d.ts +8 -4
  31. package/lib/rest/intelligence/v2/service.js +3 -2
  32. package/lib/rest/messaging/v1/service.d.ts +0 -6
  33. package/lib/rest/messaging/v1/service.js +0 -2
  34. package/lib/rest/numbers/V1.d.ts +15 -10
  35. package/lib/rest/numbers/V1.js +24 -15
  36. package/lib/rest/numbers/v1/portingPortIn.d.ts +74 -0
  37. package/lib/rest/numbers/v1/portingPortIn.js +38 -0
  38. package/lib/rest/numbers/v1/portingPortInPhoneNumber.d.ts +124 -0
  39. package/lib/rest/numbers/v1/portingPortInPhoneNumber.js +87 -1
  40. package/lib/rest/numbers/v1/portingWebhookConfiguration.d.ts +79 -0
  41. package/lib/rest/{previewMessaging/v1/broadcast.js → numbers/v1/portingWebhookConfiguration.js} +19 -32
  42. package/lib/rest/numbers/v1/portingWebhookConfigurationDelete.d.ts +51 -0
  43. package/lib/rest/numbers/v1/portingWebhookConfigurationDelete.js +68 -0
  44. package/lib/rest/numbers/v1/portingWebhookConfigurationFetch.d.ts +75 -0
  45. package/lib/rest/numbers/v1/portingWebhookConfigurationFetch.js +72 -0
  46. package/lib/rest/taskrouter/v1/workspace/task.d.ts +24 -0
  47. package/lib/rest/taskrouter/v1/workspace/task.js +12 -0
  48. package/lib/rest/trusthub/v1/complianceTollfreeInquiries.d.ts +2 -0
  49. package/lib/rest/trusthub/v1/complianceTollfreeInquiries.js +2 -0
  50. package/lib/rest/trusthub/v1/customerProfiles.d.ts +6 -0
  51. package/lib/rest/trusthub/v1/customerProfiles.js +2 -0
  52. package/lib/rest/trusthub/v1/trustProducts.d.ts +6 -0
  53. package/lib/rest/trusthub/v1/trustProducts.js +2 -0
  54. package/lib/rest/verify/v2/service/verification.d.ts +1 -1
  55. package/lib/rest/verify/v2/service/verificationCheck.d.ts +1 -1
  56. package/lib/rest/verify/v2/service.d.ts +1 -1
  57. package/lib/webhooks/webhooks.js +4 -5
  58. package/package.json +1 -1
  59. package/lib/rest/PreviewMessaging.d.ts +0 -9
  60. package/lib/rest/PreviewMessaging.js +0 -15
  61. package/lib/rest/PreviewMessagingBase.d.ts +0 -13
  62. package/lib/rest/PreviewMessagingBase.js +0 -31
  63. package/lib/rest/numbers/v1/portingBulkPortability.d.ts +0 -120
  64. package/lib/rest/numbers/v1/portingBulkPortability.js +0 -136
  65. package/lib/rest/numbers/v1/portingPortInFetch.d.ts +0 -142
  66. package/lib/rest/numbers/v1/portingPortInFetch.js +0 -128
  67. package/lib/rest/previewMessaging/V1.d.ts +0 -20
  68. package/lib/rest/previewMessaging/V1.js +0 -42
  69. package/lib/rest/previewMessaging/v1/broadcast.d.ts +0 -108
  70. package/lib/rest/previewMessaging/v1/message.d.ts +0 -178
  71. package/lib/rest/previewMessaging/v1/message.js +0 -91
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ /*
3
+ * This code was generated by
4
+ * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
5
+ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
+ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
+ *
8
+ * Twilio - Content
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.ContentAndApprovalsPage = exports.ContentAndApprovalsInstance = exports.ContentAndApprovalsListInstance = 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
+ function ContentAndApprovalsListInstance(version) {
25
+ const instance = {};
26
+ instance._version = version;
27
+ instance._solution = {};
28
+ instance._uri = `/ContentAndApprovals`;
29
+ instance.page = function page(params, callback) {
30
+ if (params instanceof Function) {
31
+ callback = params;
32
+ params = {};
33
+ }
34
+ else {
35
+ params = params || {};
36
+ }
37
+ let data = {};
38
+ if (params["pageSize"] !== undefined)
39
+ data["PageSize"] = params["pageSize"];
40
+ if (params.pageNumber !== undefined)
41
+ data["Page"] = params.pageNumber;
42
+ if (params.pageToken !== undefined)
43
+ data["PageToken"] = params.pageToken;
44
+ const headers = {};
45
+ let operationVersion = version, operationPromise = operationVersion.page({
46
+ uri: instance._uri,
47
+ method: "get",
48
+ params: data,
49
+ headers,
50
+ });
51
+ operationPromise = operationPromise.then((payload) => new ContentAndApprovalsPage(operationVersion, payload, instance._solution));
52
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
53
+ return operationPromise;
54
+ };
55
+ instance.each = instance._version.each;
56
+ instance.list = instance._version.list;
57
+ instance.getPage = function getPage(targetUrl, callback) {
58
+ const operationPromise = instance._version._domain.twilio.request({
59
+ method: "get",
60
+ uri: targetUrl,
61
+ });
62
+ let pagePromise = operationPromise.then((payload) => new ContentAndApprovalsPage(instance._version, payload, instance._solution));
63
+ pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
64
+ return pagePromise;
65
+ };
66
+ instance.toJSON = function toJSON() {
67
+ return instance._solution;
68
+ };
69
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
70
+ return (0, util_1.inspect)(instance.toJSON(), options);
71
+ };
72
+ return instance;
73
+ }
74
+ exports.ContentAndApprovalsListInstance = ContentAndApprovalsListInstance;
75
+ class ContentAndApprovalsInstance {
76
+ constructor(_version, payload) {
77
+ this._version = _version;
78
+ this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
79
+ this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
80
+ this.sid = payload.sid;
81
+ this.accountSid = payload.account_sid;
82
+ this.friendlyName = payload.friendly_name;
83
+ this.language = payload.language;
84
+ this.variables = payload.variables;
85
+ this.types = payload.types;
86
+ this.approvalRequests = payload.approval_requests;
87
+ }
88
+ /**
89
+ * Provide a user-friendly representation
90
+ *
91
+ * @returns Object
92
+ */
93
+ toJSON() {
94
+ return {
95
+ dateCreated: this.dateCreated,
96
+ dateUpdated: this.dateUpdated,
97
+ sid: this.sid,
98
+ accountSid: this.accountSid,
99
+ friendlyName: this.friendlyName,
100
+ language: this.language,
101
+ variables: this.variables,
102
+ types: this.types,
103
+ approvalRequests: this.approvalRequests,
104
+ };
105
+ }
106
+ [util_1.inspect.custom](_depth, options) {
107
+ return (0, util_1.inspect)(this.toJSON(), options);
108
+ }
109
+ }
110
+ exports.ContentAndApprovalsInstance = ContentAndApprovalsInstance;
111
+ class ContentAndApprovalsPage extends Page_1.default {
112
+ /**
113
+ * Initialize the ContentAndApprovalsPage
114
+ *
115
+ * @param version - Version of the resource
116
+ * @param response - Response from the API
117
+ * @param solution - Path solution
118
+ */
119
+ constructor(version, response, solution) {
120
+ super(version, response, solution);
121
+ }
122
+ /**
123
+ * Build an instance of ContentAndApprovalsInstance
124
+ *
125
+ * @param payload - Payload response from the API
126
+ */
127
+ getInstance(payload) {
128
+ return new ContentAndApprovalsInstance(this._version, payload);
129
+ }
130
+ [util_1.inspect.custom](depth, options) {
131
+ return (0, util_1.inspect)(this.toJSON(), options);
132
+ }
133
+ }
134
+ exports.ContentAndApprovalsPage = ContentAndApprovalsPage;
@@ -9,7 +9,7 @@ export interface InteractionListInstanceCreateOptions {
9
9
  /** The Interaction\\\'s channel. */
10
10
  channel: any;
11
11
  /** The Interaction\\\'s routing logic. */
12
- routing: any;
12
+ routing?: any;
13
13
  /** The Interaction context sid is used for adding a context lookup sid */
14
14
  interactionContextSid?: string;
15
15
  }
@@ -125,12 +125,10 @@ function InteractionListInstance(version) {
125
125
  if (params["channel"] === null || params["channel"] === undefined) {
126
126
  throw new Error("Required parameter \"params['channel']\" missing.");
127
127
  }
128
- if (params["routing"] === null || params["routing"] === undefined) {
129
- throw new Error("Required parameter \"params['routing']\" missing.");
130
- }
131
128
  let data = {};
132
129
  data["Channel"] = serialize.object(params["channel"]);
133
- data["Routing"] = serialize.object(params["routing"]);
130
+ if (params["routing"] !== undefined)
131
+ data["Routing"] = serialize.object(params["routing"]);
134
132
  if (params["interactionContextSid"] !== undefined)
135
133
  data["InteractionContextSid"] = params["interactionContextSid"];
136
134
  const headers = {};
@@ -122,6 +122,7 @@ interface PluginVersionsResource {
122
122
  changelog: string;
123
123
  private: boolean;
124
124
  archived: boolean;
125
+ validated: boolean;
125
126
  date_created: Date;
126
127
  url: string;
127
128
  }
@@ -155,13 +156,14 @@ export declare class PluginVersionsInstance {
155
156
  */
156
157
  changelog: string;
157
158
  /**
158
- * Whether to inject credentials while accessing this Plugin Version. The default value is false.
159
+ * Whether the Flex Plugin Version is validated. The default value is false.
159
160
  */
160
161
  _private: boolean;
161
162
  /**
162
163
  * Whether the Flex Plugin Version is archived. The default value is false.
163
164
  */
164
165
  archived: boolean;
166
+ validated: boolean;
165
167
  /**
166
168
  * The date and time in GMT when the Flex Plugin Version was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
167
169
  */
@@ -202,6 +204,7 @@ export declare class PluginVersionsInstance {
202
204
  changelog: string;
203
205
  _private: boolean;
204
206
  archived: boolean;
207
+ validated: boolean;
205
208
  dateCreated: Date;
206
209
  url: string;
207
210
  };
@@ -81,6 +81,7 @@ class PluginVersionsInstance {
81
81
  this.changelog = payload.changelog;
82
82
  this._private = payload.private;
83
83
  this.archived = payload.archived;
84
+ this.validated = payload.validated;
84
85
  this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
85
86
  this.url = payload.url;
86
87
  this._solution = { pluginSid, sid: sid || this.sid };
@@ -109,6 +110,7 @@ class PluginVersionsInstance {
109
110
  changelog: this.changelog,
110
111
  _private: this._private,
111
112
  archived: this.archived,
113
+ validated: this.validated,
112
114
  dateCreated: this.dateCreated,
113
115
  url: this.url,
114
116
  };
@@ -1,5 +1,11 @@
1
1
  import IntelligenceBase from "../IntelligenceBase";
2
2
  import Version from "../../base/Version";
3
+ import { CustomOperatorListInstance } from "./v2/customOperator";
4
+ import { OperatorListInstance } from "./v2/operator";
5
+ import { OperatorAttachmentListInstance } from "./v2/operatorAttachment";
6
+ import { OperatorAttachmentsListInstance } from "./v2/operatorAttachments";
7
+ import { OperatorTypeListInstance } from "./v2/operatorType";
8
+ import { PrebuiltOperatorListInstance } from "./v2/prebuiltOperator";
3
9
  import { ServiceListInstance } from "./v2/service";
4
10
  import { TranscriptListInstance } from "./v2/transcript";
5
11
  export default class V2 extends Version {
@@ -9,10 +15,34 @@ export default class V2 extends Version {
9
15
  * @param domain - The Twilio (Twilio.Intelligence) domain
10
16
  */
11
17
  constructor(domain: IntelligenceBase);
18
+ /** customOperators - { Twilio.Intelligence.V2.CustomOperatorListInstance } resource */
19
+ protected _customOperators?: CustomOperatorListInstance;
20
+ /** operators - { Twilio.Intelligence.V2.OperatorListInstance } resource */
21
+ protected _operators?: OperatorListInstance;
22
+ /** operatorAttachment - { Twilio.Intelligence.V2.OperatorAttachmentListInstance } resource */
23
+ protected _operatorAttachment?: OperatorAttachmentListInstance;
24
+ /** operatorAttachments - { Twilio.Intelligence.V2.OperatorAttachmentsListInstance } resource */
25
+ protected _operatorAttachments?: OperatorAttachmentsListInstance;
26
+ /** operatorType - { Twilio.Intelligence.V2.OperatorTypeListInstance } resource */
27
+ protected _operatorType?: OperatorTypeListInstance;
28
+ /** prebuiltOperators - { Twilio.Intelligence.V2.PrebuiltOperatorListInstance } resource */
29
+ protected _prebuiltOperators?: PrebuiltOperatorListInstance;
12
30
  /** services - { Twilio.Intelligence.V2.ServiceListInstance } resource */
13
31
  protected _services?: ServiceListInstance;
14
32
  /** transcripts - { Twilio.Intelligence.V2.TranscriptListInstance } resource */
15
33
  protected _transcripts?: TranscriptListInstance;
34
+ /** Getter for customOperators resource */
35
+ get customOperators(): CustomOperatorListInstance;
36
+ /** Getter for operators resource */
37
+ get operators(): OperatorListInstance;
38
+ /** Getter for operatorAttachment resource */
39
+ get operatorAttachment(): OperatorAttachmentListInstance;
40
+ /** Getter for operatorAttachments resource */
41
+ get operatorAttachments(): OperatorAttachmentsListInstance;
42
+ /** Getter for operatorType resource */
43
+ get operatorType(): OperatorTypeListInstance;
44
+ /** Getter for prebuiltOperators resource */
45
+ get prebuiltOperators(): PrebuiltOperatorListInstance;
16
46
  /** Getter for services resource */
17
47
  get services(): ServiceListInstance;
18
48
  /** Getter for transcripts resource */
@@ -17,6 +17,12 @@ 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 customOperator_1 = require("./v2/customOperator");
21
+ const operator_1 = require("./v2/operator");
22
+ const operatorAttachment_1 = require("./v2/operatorAttachment");
23
+ const operatorAttachments_1 = require("./v2/operatorAttachments");
24
+ const operatorType_1 = require("./v2/operatorType");
25
+ const prebuiltOperator_1 = require("./v2/prebuiltOperator");
20
26
  const service_1 = require("./v2/service");
21
27
  const transcript_1 = require("./v2/transcript");
22
28
  class V2 extends Version_1.default {
@@ -28,6 +34,40 @@ class V2 extends Version_1.default {
28
34
  constructor(domain) {
29
35
  super(domain, "v2");
30
36
  }
37
+ /** Getter for customOperators resource */
38
+ get customOperators() {
39
+ this._customOperators =
40
+ this._customOperators || (0, customOperator_1.CustomOperatorListInstance)(this);
41
+ return this._customOperators;
42
+ }
43
+ /** Getter for operators resource */
44
+ get operators() {
45
+ this._operators = this._operators || (0, operator_1.OperatorListInstance)(this);
46
+ return this._operators;
47
+ }
48
+ /** Getter for operatorAttachment resource */
49
+ get operatorAttachment() {
50
+ this._operatorAttachment =
51
+ this._operatorAttachment || (0, operatorAttachment_1.OperatorAttachmentListInstance)(this);
52
+ return this._operatorAttachment;
53
+ }
54
+ /** Getter for operatorAttachments resource */
55
+ get operatorAttachments() {
56
+ this._operatorAttachments =
57
+ this._operatorAttachments || (0, operatorAttachments_1.OperatorAttachmentsListInstance)(this);
58
+ return this._operatorAttachments;
59
+ }
60
+ /** Getter for operatorType resource */
61
+ get operatorType() {
62
+ this._operatorType = this._operatorType || (0, operatorType_1.OperatorTypeListInstance)(this);
63
+ return this._operatorType;
64
+ }
65
+ /** Getter for prebuiltOperators resource */
66
+ get prebuiltOperators() {
67
+ this._prebuiltOperators =
68
+ this._prebuiltOperators || (0, prebuiltOperator_1.PrebuiltOperatorListInstance)(this);
69
+ return this._prebuiltOperators;
70
+ }
31
71
  /** Getter for services resource */
32
72
  get services() {
33
73
  this._services = this._services || (0, service_1.ServiceListInstance)(this);
@@ -0,0 +1,330 @@
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 CustomOperatorAvailability = "internal" | "beta" | "public" | "retired";
7
+ /**
8
+ * Options to pass to update a CustomOperatorInstance
9
+ */
10
+ export interface CustomOperatorContextUpdateOptions {
11
+ /** A human-readable name of this resource, up to 64 characters. */
12
+ friendlyName: string;
13
+ /** Operator configuration, following the schema defined by the Operator Type. */
14
+ config: any;
15
+ /** The If-Match HTTP request header */
16
+ ifMatch?: string;
17
+ }
18
+ /**
19
+ * Options to pass to create a CustomOperatorInstance
20
+ */
21
+ export interface CustomOperatorListInstanceCreateOptions {
22
+ /** A human readable description of the new Operator, up to 64 characters. */
23
+ friendlyName: string;
24
+ /** Operator Type for this Operator. References an existing Operator Type resource. */
25
+ operatorType: string;
26
+ /** Operator configuration, following the schema defined by the Operator Type. */
27
+ config: any;
28
+ }
29
+ /**
30
+ * Options to pass to each
31
+ */
32
+ export interface CustomOperatorListInstanceEachOptions {
33
+ /** Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired. */
34
+ availability?: CustomOperatorAvailability;
35
+ /** Returns Custom Operators that support the provided language code. */
36
+ languageCode?: string;
37
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
38
+ pageSize?: number;
39
+ /** Function to process each record. If this and a positional callback are passed, this one will be used */
40
+ callback?: (item: CustomOperatorInstance, done: (err?: Error) => void) => void;
41
+ /** Function to be called upon completion of streaming */
42
+ done?: Function;
43
+ /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
44
+ limit?: number;
45
+ }
46
+ /**
47
+ * Options to pass to list
48
+ */
49
+ export interface CustomOperatorListInstanceOptions {
50
+ /** Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired. */
51
+ availability?: CustomOperatorAvailability;
52
+ /** Returns Custom Operators that support the provided language code. */
53
+ languageCode?: string;
54
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
55
+ pageSize?: number;
56
+ /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
57
+ limit?: number;
58
+ }
59
+ /**
60
+ * Options to pass to page
61
+ */
62
+ export interface CustomOperatorListInstancePageOptions {
63
+ /** Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired. */
64
+ availability?: CustomOperatorAvailability;
65
+ /** Returns Custom Operators that support the provided language code. */
66
+ languageCode?: string;
67
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
68
+ pageSize?: number;
69
+ /** Page Number, this value is simply for client state */
70
+ pageNumber?: number;
71
+ /** PageToken provided by the API */
72
+ pageToken?: string;
73
+ }
74
+ export interface CustomOperatorContext {
75
+ /**
76
+ * Remove a CustomOperatorInstance
77
+ *
78
+ * @param callback - Callback to handle processed record
79
+ *
80
+ * @returns Resolves to processed boolean
81
+ */
82
+ remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
83
+ /**
84
+ * Fetch a CustomOperatorInstance
85
+ *
86
+ * @param callback - Callback to handle processed record
87
+ *
88
+ * @returns Resolves to processed CustomOperatorInstance
89
+ */
90
+ fetch(callback?: (error: Error | null, item?: CustomOperatorInstance) => any): Promise<CustomOperatorInstance>;
91
+ /**
92
+ * Update a CustomOperatorInstance
93
+ *
94
+ * @param params - Parameter for request
95
+ * @param callback - Callback to handle processed record
96
+ *
97
+ * @returns Resolves to processed CustomOperatorInstance
98
+ */
99
+ update(params: CustomOperatorContextUpdateOptions, callback?: (error: Error | null, item?: CustomOperatorInstance) => any): Promise<CustomOperatorInstance>;
100
+ /**
101
+ * Provide a user-friendly representation
102
+ */
103
+ toJSON(): any;
104
+ [inspect.custom](_depth: any, options: InspectOptions): any;
105
+ }
106
+ export interface CustomOperatorContextSolution {
107
+ sid: string;
108
+ }
109
+ export declare class CustomOperatorContextImpl implements CustomOperatorContext {
110
+ protected _version: V2;
111
+ protected _solution: CustomOperatorContextSolution;
112
+ protected _uri: string;
113
+ constructor(_version: V2, sid: string);
114
+ remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
115
+ fetch(callback?: (error: Error | null, item?: CustomOperatorInstance) => any): Promise<CustomOperatorInstance>;
116
+ update(params: CustomOperatorContextUpdateOptions, callback?: (error: Error | null, item?: CustomOperatorInstance) => any): Promise<CustomOperatorInstance>;
117
+ /**
118
+ * Provide a user-friendly representation
119
+ *
120
+ * @returns Object
121
+ */
122
+ toJSON(): CustomOperatorContextSolution;
123
+ [inspect.custom](_depth: any, options: InspectOptions): string;
124
+ }
125
+ interface CustomOperatorPayload extends TwilioResponsePayload {
126
+ operators: CustomOperatorResource[];
127
+ }
128
+ interface CustomOperatorResource {
129
+ account_sid: string;
130
+ sid: string;
131
+ friendly_name: string;
132
+ description: string;
133
+ author: string;
134
+ operator_type: string;
135
+ version: number;
136
+ availability: CustomOperatorAvailability;
137
+ config: any;
138
+ date_created: Date;
139
+ date_updated: Date;
140
+ url: string;
141
+ }
142
+ export declare class CustomOperatorInstance {
143
+ protected _version: V2;
144
+ protected _solution: CustomOperatorContextSolution;
145
+ protected _context?: CustomOperatorContext;
146
+ constructor(_version: V2, payload: CustomOperatorResource, sid?: string);
147
+ /**
148
+ * The unique SID identifier of the Account the Custom Operator belongs to.
149
+ */
150
+ accountSid: string;
151
+ /**
152
+ * A 34 character string that uniquely identifies this Custom Operator.
153
+ */
154
+ sid: string;
155
+ /**
156
+ * A human-readable name of this resource, up to 64 characters.
157
+ */
158
+ friendlyName: string;
159
+ /**
160
+ * A human-readable description of this resource, longer than the friendly name.
161
+ */
162
+ description: string;
163
+ /**
164
+ * The creator of the Custom Operator. Custom Operators can only be created by a Twilio Account.
165
+ */
166
+ author: string;
167
+ /**
168
+ * Operator Type for this Operator. References an existing Operator Type resource.
169
+ */
170
+ operatorType: string;
171
+ /**
172
+ * Numeric Custom Operator version. Incremented with each update on the resource, used to ensure integrity when updating the Custom Operator.
173
+ */
174
+ version: number;
175
+ availability: CustomOperatorAvailability;
176
+ /**
177
+ * Operator configuration, following the schema defined by the Operator Type. Only available on Operators created by the Account.
178
+ */
179
+ config: any;
180
+ /**
181
+ * The date that this Custom Operator was created, given in ISO 8601 format.
182
+ */
183
+ dateCreated: Date;
184
+ /**
185
+ * The date that this Custom Operator was updated, given in ISO 8601 format.
186
+ */
187
+ dateUpdated: Date;
188
+ /**
189
+ * The URL of this resource.
190
+ */
191
+ url: string;
192
+ private get _proxy();
193
+ /**
194
+ * Remove a CustomOperatorInstance
195
+ *
196
+ * @param callback - Callback to handle processed record
197
+ *
198
+ * @returns Resolves to processed boolean
199
+ */
200
+ remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
201
+ /**
202
+ * Fetch a CustomOperatorInstance
203
+ *
204
+ * @param callback - Callback to handle processed record
205
+ *
206
+ * @returns Resolves to processed CustomOperatorInstance
207
+ */
208
+ fetch(callback?: (error: Error | null, item?: CustomOperatorInstance) => any): Promise<CustomOperatorInstance>;
209
+ /**
210
+ * Update a CustomOperatorInstance
211
+ *
212
+ * @param params - Parameter for request
213
+ * @param callback - Callback to handle processed record
214
+ *
215
+ * @returns Resolves to processed CustomOperatorInstance
216
+ */
217
+ update(params: CustomOperatorContextUpdateOptions, callback?: (error: Error | null, item?: CustomOperatorInstance) => any): Promise<CustomOperatorInstance>;
218
+ /**
219
+ * Provide a user-friendly representation
220
+ *
221
+ * @returns Object
222
+ */
223
+ toJSON(): {
224
+ accountSid: string;
225
+ sid: string;
226
+ friendlyName: string;
227
+ description: string;
228
+ author: string;
229
+ operatorType: string;
230
+ version: number;
231
+ availability: CustomOperatorAvailability;
232
+ config: any;
233
+ dateCreated: Date;
234
+ dateUpdated: Date;
235
+ url: string;
236
+ };
237
+ [inspect.custom](_depth: any, options: InspectOptions): string;
238
+ }
239
+ export interface CustomOperatorSolution {
240
+ }
241
+ export interface CustomOperatorListInstance {
242
+ _version: V2;
243
+ _solution: CustomOperatorSolution;
244
+ _uri: string;
245
+ (sid: string): CustomOperatorContext;
246
+ get(sid: string): CustomOperatorContext;
247
+ /**
248
+ * Create a CustomOperatorInstance
249
+ *
250
+ * @param params - Parameter for request
251
+ * @param callback - Callback to handle processed record
252
+ *
253
+ * @returns Resolves to processed CustomOperatorInstance
254
+ */
255
+ create(params: CustomOperatorListInstanceCreateOptions, callback?: (error: Error | null, item?: CustomOperatorInstance) => any): Promise<CustomOperatorInstance>;
256
+ /**
257
+ * Streams CustomOperatorInstance records from the API.
258
+ *
259
+ * This operation lazily loads records as efficiently as possible until the limit
260
+ * is reached.
261
+ *
262
+ * The results are passed into the callback function, so this operation is memory
263
+ * efficient.
264
+ *
265
+ * If a function is passed as the first argument, it will be used as the callback
266
+ * function.
267
+ *
268
+ * @param { CustomOperatorListInstanceEachOptions } [params] - Options for request
269
+ * @param { function } [callback] - Function to process each record
270
+ */
271
+ each(callback?: (item: CustomOperatorInstance, done: (err?: Error) => void) => void): void;
272
+ each(params: CustomOperatorListInstanceEachOptions, callback?: (item: CustomOperatorInstance, done: (err?: Error) => void) => void): void;
273
+ /**
274
+ * Retrieve a single target page of CustomOperatorInstance records from the API.
275
+ *
276
+ * The request is executed immediately.
277
+ *
278
+ * @param { string } [targetUrl] - API-generated URL for the requested results page
279
+ * @param { function } [callback] - Callback to handle list of records
280
+ */
281
+ getPage(targetUrl: string, callback?: (error: Error | null, items: CustomOperatorPage) => any): Promise<CustomOperatorPage>;
282
+ /**
283
+ * Lists CustomOperatorInstance records from the API as a list.
284
+ *
285
+ * If a function is passed as the first argument, it will be used as the callback
286
+ * function.
287
+ *
288
+ * @param { CustomOperatorListInstanceOptions } [params] - Options for request
289
+ * @param { function } [callback] - Callback to handle list of records
290
+ */
291
+ list(callback?: (error: Error | null, items: CustomOperatorInstance[]) => any): Promise<CustomOperatorInstance[]>;
292
+ list(params: CustomOperatorListInstanceOptions, callback?: (error: Error | null, items: CustomOperatorInstance[]) => any): Promise<CustomOperatorInstance[]>;
293
+ /**
294
+ * Retrieve a single page of CustomOperatorInstance records from the API.
295
+ *
296
+ * The request is executed immediately.
297
+ *
298
+ * If a function is passed as the first argument, it will be used as the callback
299
+ * function.
300
+ *
301
+ * @param { CustomOperatorListInstancePageOptions } [params] - Options for request
302
+ * @param { function } [callback] - Callback to handle list of records
303
+ */
304
+ page(callback?: (error: Error | null, items: CustomOperatorPage) => any): Promise<CustomOperatorPage>;
305
+ page(params: CustomOperatorListInstancePageOptions, callback?: (error: Error | null, items: CustomOperatorPage) => any): Promise<CustomOperatorPage>;
306
+ /**
307
+ * Provide a user-friendly representation
308
+ */
309
+ toJSON(): any;
310
+ [inspect.custom](_depth: any, options: InspectOptions): any;
311
+ }
312
+ export declare function CustomOperatorListInstance(version: V2): CustomOperatorListInstance;
313
+ export declare class CustomOperatorPage extends Page<V2, CustomOperatorPayload, CustomOperatorResource, CustomOperatorInstance> {
314
+ /**
315
+ * Initialize the CustomOperatorPage
316
+ *
317
+ * @param version - Version of the resource
318
+ * @param response - Response from the API
319
+ * @param solution - Path solution
320
+ */
321
+ constructor(version: V2, response: Response<string>, solution: CustomOperatorSolution);
322
+ /**
323
+ * Build an instance of CustomOperatorInstance
324
+ *
325
+ * @param payload - Payload response from the API
326
+ */
327
+ getInstance(payload: CustomOperatorResource): CustomOperatorInstance;
328
+ [inspect.custom](depth: any, options: InspectOptions): string;
329
+ }
330
+ export {};