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,157 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.PortingPortInPhoneNumberListInstance = exports.PortingPortInPhoneNumberInstance = exports.PortingPortInPhoneNumberContextImpl = void 0;
17
+ const util_1 = require("util");
18
+ const deserialize = require("../../../base/deserialize");
19
+ const serialize = require("../../../base/serialize");
20
+ const utility_1 = require("../../../base/utility");
21
+ class PortingPortInPhoneNumberContextImpl {
22
+ constructor(_version, portInRequestSid, phoneNumberSid) {
23
+ this._version = _version;
24
+ if (!(0, utility_1.isValidPathParam)(portInRequestSid)) {
25
+ throw new Error("Parameter 'portInRequestSid' is not valid.");
26
+ }
27
+ if (!(0, utility_1.isValidPathParam)(phoneNumberSid)) {
28
+ throw new Error("Parameter 'phoneNumberSid' is not valid.");
29
+ }
30
+ this._solution = { portInRequestSid, phoneNumberSid };
31
+ this._uri = `/Porting/PortIn/${portInRequestSid}/PhoneNumber/${phoneNumberSid}`;
32
+ }
33
+ remove(callback) {
34
+ const instance = this;
35
+ let operationVersion = instance._version, operationPromise = operationVersion.remove({
36
+ uri: instance._uri,
37
+ method: "delete",
38
+ });
39
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
40
+ return operationPromise;
41
+ }
42
+ fetch(callback) {
43
+ const instance = this;
44
+ let operationVersion = instance._version, operationPromise = operationVersion.fetch({
45
+ uri: instance._uri,
46
+ method: "get",
47
+ });
48
+ operationPromise = operationPromise.then((payload) => new PortingPortInPhoneNumberInstance(operationVersion, payload, instance._solution.portInRequestSid, instance._solution.phoneNumberSid));
49
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
50
+ return operationPromise;
51
+ }
52
+ /**
53
+ * Provide a user-friendly representation
54
+ *
55
+ * @returns Object
56
+ */
57
+ toJSON() {
58
+ return this._solution;
59
+ }
60
+ [util_1.inspect.custom](_depth, options) {
61
+ return (0, util_1.inspect)(this.toJSON(), options);
62
+ }
63
+ }
64
+ exports.PortingPortInPhoneNumberContextImpl = PortingPortInPhoneNumberContextImpl;
65
+ class PortingPortInPhoneNumberInstance {
66
+ constructor(_version, payload, portInRequestSid, phoneNumberSid) {
67
+ this._version = _version;
68
+ this.portInRequestSid = payload.port_in_request_sid;
69
+ this.phoneNumberSid = payload.phone_number_sid;
70
+ this.url = payload.url;
71
+ this.accountSid = payload.account_sid;
72
+ this.phoneNumberType = payload.phone_number_type;
73
+ this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
74
+ this.country = payload.country;
75
+ this.missingRequiredFields = payload.missing_required_fields;
76
+ this.statusLastTimeUpdatedTimestamp = deserialize.iso8601DateTime(payload.status_last_time_updated_timestamp);
77
+ this.phoneNumber = payload.phone_number;
78
+ this.portable = payload.portable;
79
+ this.notPortabilityReason = payload.not_portability_reason;
80
+ this.notPortabilityReasonCode = payload.not_portability_reason_code;
81
+ this.portInPhoneNumberStatus = payload.port_in_phone_number_status;
82
+ this._solution = {
83
+ portInRequestSid: portInRequestSid || this.portInRequestSid,
84
+ phoneNumberSid: phoneNumberSid || this.phoneNumberSid,
85
+ };
86
+ }
87
+ get _proxy() {
88
+ this._context =
89
+ this._context ||
90
+ new PortingPortInPhoneNumberContextImpl(this._version, this._solution.portInRequestSid, this._solution.phoneNumberSid);
91
+ return this._context;
92
+ }
93
+ /**
94
+ * Remove a PortingPortInPhoneNumberInstance
95
+ *
96
+ * @param callback - Callback to handle processed record
97
+ *
98
+ * @returns Resolves to processed boolean
99
+ */
100
+ remove(callback) {
101
+ return this._proxy.remove(callback);
102
+ }
103
+ /**
104
+ * Fetch a PortingPortInPhoneNumberInstance
105
+ *
106
+ * @param callback - Callback to handle processed record
107
+ *
108
+ * @returns Resolves to processed PortingPortInPhoneNumberInstance
109
+ */
110
+ fetch(callback) {
111
+ return this._proxy.fetch(callback);
112
+ }
113
+ /**
114
+ * Provide a user-friendly representation
115
+ *
116
+ * @returns Object
117
+ */
118
+ toJSON() {
119
+ return {
120
+ portInRequestSid: this.portInRequestSid,
121
+ phoneNumberSid: this.phoneNumberSid,
122
+ url: this.url,
123
+ accountSid: this.accountSid,
124
+ phoneNumberType: this.phoneNumberType,
125
+ dateCreated: this.dateCreated,
126
+ country: this.country,
127
+ missingRequiredFields: this.missingRequiredFields,
128
+ statusLastTimeUpdatedTimestamp: this.statusLastTimeUpdatedTimestamp,
129
+ phoneNumber: this.phoneNumber,
130
+ portable: this.portable,
131
+ notPortabilityReason: this.notPortabilityReason,
132
+ notPortabilityReasonCode: this.notPortabilityReasonCode,
133
+ portInPhoneNumberStatus: this.portInPhoneNumberStatus,
134
+ };
135
+ }
136
+ [util_1.inspect.custom](_depth, options) {
137
+ return (0, util_1.inspect)(this.toJSON(), options);
138
+ }
139
+ }
140
+ exports.PortingPortInPhoneNumberInstance = PortingPortInPhoneNumberInstance;
141
+ function PortingPortInPhoneNumberListInstance(version) {
142
+ const instance = ((portInRequestSid, phoneNumberSid) => instance.get(portInRequestSid, phoneNumberSid));
143
+ instance.get = function get(portInRequestSid, phoneNumberSid) {
144
+ return new PortingPortInPhoneNumberContextImpl(version, portInRequestSid, phoneNumberSid);
145
+ };
146
+ instance._version = version;
147
+ instance._solution = {};
148
+ instance._uri = ``;
149
+ instance.toJSON = function toJSON() {
150
+ return instance._solution;
151
+ };
152
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
153
+ return (0, util_1.inspect)(instance.toJSON(), options);
154
+ };
155
+ return instance;
156
+ }
157
+ exports.PortingPortInPhoneNumberListInstance = PortingPortInPhoneNumberListInstance;
@@ -0,0 +1,79 @@
1
+ /// <reference types="node" />
2
+ import { inspect, InspectOptions } from "util";
3
+ import V1 from "../V1";
4
+ /**
5
+ * Options to pass to create a PortingWebhookConfigurationInstance
6
+ */
7
+ export interface PortingWebhookConfigurationListInstanceCreateOptions {
8
+ /** */
9
+ body?: object;
10
+ }
11
+ export interface PortingWebhookConfigurationSolution {
12
+ }
13
+ export interface PortingWebhookConfigurationListInstance {
14
+ _version: V1;
15
+ _solution: PortingWebhookConfigurationSolution;
16
+ _uri: string;
17
+ /**
18
+ * Create a PortingWebhookConfigurationInstance
19
+ *
20
+ * @param callback - Callback to handle processed record
21
+ *
22
+ * @returns Resolves to processed PortingWebhookConfigurationInstance
23
+ */
24
+ create(callback?: (error: Error | null, item?: PortingWebhookConfigurationInstance) => any): Promise<PortingWebhookConfigurationInstance>;
25
+ /**
26
+ * Create a PortingWebhookConfigurationInstance
27
+ *
28
+ * @param params - Body for request
29
+ * @param callback - Callback to handle processed record
30
+ *
31
+ * @returns Resolves to processed PortingWebhookConfigurationInstance
32
+ */
33
+ create(params: object, callback?: (error: Error | null, item?: PortingWebhookConfigurationInstance) => any): Promise<PortingWebhookConfigurationInstance>;
34
+ /**
35
+ * Provide a user-friendly representation
36
+ */
37
+ toJSON(): any;
38
+ [inspect.custom](_depth: any, options: InspectOptions): any;
39
+ }
40
+ export declare function PortingWebhookConfigurationListInstance(version: V1): PortingWebhookConfigurationListInstance;
41
+ interface PortingWebhookConfigurationResource {
42
+ url: string;
43
+ port_in_target_url: string;
44
+ port_out_target_url: string;
45
+ notifications_of: Array<string>;
46
+ }
47
+ export declare class PortingWebhookConfigurationInstance {
48
+ protected _version: V1;
49
+ constructor(_version: V1, payload: PortingWebhookConfigurationResource);
50
+ /**
51
+ * The URL of the webhook configuration request
52
+ */
53
+ url: string;
54
+ /**
55
+ * Webhook URL to send a request when a port in request or port in phone number event happens
56
+ */
57
+ portInTargetUrl: string;
58
+ /**
59
+ * Webhook URL to send a request when a port out phone number event happens
60
+ */
61
+ portOutTargetUrl: string;
62
+ /**
63
+ * List of notification events to send a request to the webhook URL
64
+ */
65
+ notificationsOf: Array<string>;
66
+ /**
67
+ * Provide a user-friendly representation
68
+ *
69
+ * @returns Object
70
+ */
71
+ toJSON(): {
72
+ url: string;
73
+ portInTargetUrl: string;
74
+ portOutTargetUrl: string;
75
+ notificationsOf: string[];
76
+ };
77
+ [inspect.custom](_depth: any, options: InspectOptions): string;
78
+ }
79
+ export {};
@@ -5,29 +5,23 @@
5
5
  * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
6
  * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
7
  *
8
- * Bulk Messaging and Broadcast
9
- * Bulk Sending is a public Twilio REST API for 1:Many Message creation up to 100 recipients. Broadcast is a public Twilio REST API for 1:Many Message creation up to 10,000 recipients via file upload.
8
+ * Twilio - Numbers
9
+ * This is the public Twilio REST API.
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator.
12
12
  * https://openapi-generator.tech
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.BroadcastInstance = exports.BroadcastListInstance = exports.MessagingV1BroadcastExecutionDetails = void 0;
16
+ exports.PortingWebhookConfigurationInstance = exports.PortingWebhookConfigurationListInstance = void 0;
17
17
  const util_1 = require("util");
18
18
  const deserialize = require("../../../base/deserialize");
19
19
  const serialize = require("../../../base/serialize");
20
- /**
21
- * Details on the statuses of messages sent to recipients
22
- */
23
- class MessagingV1BroadcastExecutionDetails {
24
- }
25
- exports.MessagingV1BroadcastExecutionDetails = MessagingV1BroadcastExecutionDetails;
26
- function BroadcastListInstance(version) {
20
+ function PortingWebhookConfigurationListInstance(version) {
27
21
  const instance = {};
28
22
  instance._version = version;
29
23
  instance._solution = {};
30
- instance._uri = `/Broadcasts`;
24
+ instance._uri = `/Porting/Configuration/Webhook`;
31
25
  instance.create = function create(params, callback) {
32
26
  if (params instanceof Function) {
33
27
  callback = params;
@@ -37,16 +31,16 @@ function BroadcastListInstance(version) {
37
31
  params = params || {};
38
32
  }
39
33
  let data = {};
34
+ data = params;
40
35
  const headers = {};
41
- if (params["xTwilioRequestKey"] !== undefined)
42
- headers["X-Twilio-Request-Key"] = params["xTwilioRequestKey"];
36
+ headers["Content-Type"] = "application/json";
43
37
  let operationVersion = version, operationPromise = operationVersion.create({
44
38
  uri: instance._uri,
45
39
  method: "post",
46
40
  data,
47
41
  headers,
48
42
  });
49
- operationPromise = operationPromise.then((payload) => new BroadcastInstance(operationVersion, payload));
43
+ operationPromise = operationPromise.then((payload) => new PortingWebhookConfigurationInstance(operationVersion, payload));
50
44
  operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
51
45
  return operationPromise;
52
46
  };
@@ -58,19 +52,14 @@ function BroadcastListInstance(version) {
58
52
  };
59
53
  return instance;
60
54
  }
61
- exports.BroadcastListInstance = BroadcastListInstance;
62
- /**
63
- * Details of a Broadcast
64
- */
65
- class BroadcastInstance {
55
+ exports.PortingWebhookConfigurationListInstance = PortingWebhookConfigurationListInstance;
56
+ class PortingWebhookConfigurationInstance {
66
57
  constructor(_version, payload) {
67
58
  this._version = _version;
68
- this.broadcastSid = payload.broadcast_sid;
69
- this.createdDate = deserialize.iso8601DateTime(payload.created_date);
70
- this.updatedDate = deserialize.iso8601DateTime(payload.updated_date);
71
- this.broadcastStatus = payload.broadcast_status;
72
- this.executionDetails = payload.execution_details;
73
- this.resultsFile = payload.results_file;
59
+ this.url = payload.url;
60
+ this.portInTargetUrl = payload.port_in_target_url;
61
+ this.portOutTargetUrl = payload.port_out_target_url;
62
+ this.notificationsOf = payload.notifications_of;
74
63
  }
75
64
  /**
76
65
  * Provide a user-friendly representation
@@ -79,16 +68,14 @@ class BroadcastInstance {
79
68
  */
80
69
  toJSON() {
81
70
  return {
82
- broadcastSid: this.broadcastSid,
83
- createdDate: this.createdDate,
84
- updatedDate: this.updatedDate,
85
- broadcastStatus: this.broadcastStatus,
86
- executionDetails: this.executionDetails,
87
- resultsFile: this.resultsFile,
71
+ url: this.url,
72
+ portInTargetUrl: this.portInTargetUrl,
73
+ portOutTargetUrl: this.portOutTargetUrl,
74
+ notificationsOf: this.notificationsOf,
88
75
  };
89
76
  }
90
77
  [util_1.inspect.custom](_depth, options) {
91
78
  return (0, util_1.inspect)(this.toJSON(), options);
92
79
  }
93
80
  }
94
- exports.BroadcastInstance = BroadcastInstance;
81
+ exports.PortingWebhookConfigurationInstance = PortingWebhookConfigurationInstance;
@@ -0,0 +1,51 @@
1
+ /// <reference types="node" />
2
+ import { inspect, InspectOptions } from "util";
3
+ import V1 from "../V1";
4
+ export type PortingWebhookConfigurationDeleteWebhookType = "PORT_IN" | "PORT_OUT";
5
+ export interface PortingWebhookConfigurationDeleteContext {
6
+ /**
7
+ * Remove a PortingWebhookConfigurationDeleteInstance
8
+ *
9
+ * @param callback - Callback to handle processed record
10
+ *
11
+ * @returns Resolves to processed boolean
12
+ */
13
+ remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
14
+ /**
15
+ * Provide a user-friendly representation
16
+ */
17
+ toJSON(): any;
18
+ [inspect.custom](_depth: any, options: InspectOptions): any;
19
+ }
20
+ export interface PortingWebhookConfigurationDeleteContextSolution {
21
+ webhookType: PortingWebhookConfigurationDeleteWebhookType;
22
+ }
23
+ export declare class PortingWebhookConfigurationDeleteContextImpl implements PortingWebhookConfigurationDeleteContext {
24
+ protected _version: V1;
25
+ protected _solution: PortingWebhookConfigurationDeleteContextSolution;
26
+ protected _uri: string;
27
+ constructor(_version: V1, webhookType: PortingWebhookConfigurationDeleteWebhookType);
28
+ remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
29
+ /**
30
+ * Provide a user-friendly representation
31
+ *
32
+ * @returns Object
33
+ */
34
+ toJSON(): PortingWebhookConfigurationDeleteContextSolution;
35
+ [inspect.custom](_depth: any, options: InspectOptions): string;
36
+ }
37
+ export interface PortingWebhookConfigurationDeleteSolution {
38
+ }
39
+ export interface PortingWebhookConfigurationDeleteListInstance {
40
+ _version: V1;
41
+ _solution: PortingWebhookConfigurationDeleteSolution;
42
+ _uri: string;
43
+ (webhookType: PortingWebhookConfigurationDeleteWebhookType): PortingWebhookConfigurationDeleteContext;
44
+ get(webhookType: PortingWebhookConfigurationDeleteWebhookType): PortingWebhookConfigurationDeleteContext;
45
+ /**
46
+ * Provide a user-friendly representation
47
+ */
48
+ toJSON(): any;
49
+ [inspect.custom](_depth: any, options: InspectOptions): any;
50
+ }
51
+ export declare function PortingWebhookConfigurationDeleteListInstance(version: V1): PortingWebhookConfigurationDeleteListInstance;
@@ -0,0 +1,68 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.PortingWebhookConfigurationDeleteListInstance = exports.PortingWebhookConfigurationDeleteContextImpl = void 0;
17
+ const util_1 = require("util");
18
+ const deserialize = require("../../../base/deserialize");
19
+ const serialize = require("../../../base/serialize");
20
+ const utility_1 = require("../../../base/utility");
21
+ class PortingWebhookConfigurationDeleteContextImpl {
22
+ constructor(_version, webhookType) {
23
+ this._version = _version;
24
+ if (!(0, utility_1.isValidPathParam)(webhookType)) {
25
+ throw new Error("Parameter 'webhookType' is not valid.");
26
+ }
27
+ this._solution = { webhookType };
28
+ this._uri = `/Porting/Configuration/Webhook/${webhookType}`;
29
+ }
30
+ remove(callback) {
31
+ const instance = this;
32
+ let operationVersion = instance._version, operationPromise = operationVersion.remove({
33
+ uri: instance._uri,
34
+ method: "delete",
35
+ });
36
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
37
+ return operationPromise;
38
+ }
39
+ /**
40
+ * Provide a user-friendly representation
41
+ *
42
+ * @returns Object
43
+ */
44
+ toJSON() {
45
+ return this._solution;
46
+ }
47
+ [util_1.inspect.custom](_depth, options) {
48
+ return (0, util_1.inspect)(this.toJSON(), options);
49
+ }
50
+ }
51
+ exports.PortingWebhookConfigurationDeleteContextImpl = PortingWebhookConfigurationDeleteContextImpl;
52
+ function PortingWebhookConfigurationDeleteListInstance(version) {
53
+ const instance = ((webhookType) => instance.get(webhookType));
54
+ instance.get = function get(webhookType) {
55
+ return new PortingWebhookConfigurationDeleteContextImpl(version, webhookType);
56
+ };
57
+ instance._version = version;
58
+ instance._solution = {};
59
+ instance._uri = ``;
60
+ instance.toJSON = function toJSON() {
61
+ return instance._solution;
62
+ };
63
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
64
+ return (0, util_1.inspect)(instance.toJSON(), options);
65
+ };
66
+ return instance;
67
+ }
68
+ exports.PortingWebhookConfigurationDeleteListInstance = PortingWebhookConfigurationDeleteListInstance;
@@ -0,0 +1,75 @@
1
+ /// <reference types="node" />
2
+ import { inspect, InspectOptions } from "util";
3
+ import V1 from "../V1";
4
+ export interface PortingWebhookConfigurationFetchSolution {
5
+ }
6
+ export interface PortingWebhookConfigurationFetchListInstance {
7
+ _version: V1;
8
+ _solution: PortingWebhookConfigurationFetchSolution;
9
+ _uri: string;
10
+ /**
11
+ * Fetch a PortingWebhookConfigurationFetchInstance
12
+ *
13
+ * @param callback - Callback to handle processed record
14
+ *
15
+ * @returns Resolves to processed PortingWebhookConfigurationFetchInstance
16
+ */
17
+ fetch(callback?: (error: Error | null, item?: PortingWebhookConfigurationFetchInstance) => any): Promise<PortingWebhookConfigurationFetchInstance>;
18
+ /**
19
+ * Provide a user-friendly representation
20
+ */
21
+ toJSON(): any;
22
+ [inspect.custom](_depth: any, options: InspectOptions): any;
23
+ }
24
+ export declare function PortingWebhookConfigurationFetchListInstance(version: V1): PortingWebhookConfigurationFetchListInstance;
25
+ interface PortingWebhookConfigurationFetchResource {
26
+ url: string;
27
+ port_in_target_url: string;
28
+ port_out_target_url: string;
29
+ notifications_of: Array<string>;
30
+ port_in_target_date_created: Date;
31
+ port_out_target_date_created: Date;
32
+ }
33
+ export declare class PortingWebhookConfigurationFetchInstance {
34
+ protected _version: V1;
35
+ constructor(_version: V1, payload: PortingWebhookConfigurationFetchResource);
36
+ /**
37
+ * The URL of the webhook configuration request
38
+ */
39
+ url: string;
40
+ /**
41
+ * Webhook URL to send a request when a port in request or port in phone number event happens
42
+ */
43
+ portInTargetUrl: string;
44
+ /**
45
+ * Webhook URL to send a request when a port out phone number event happens
46
+ */
47
+ portOutTargetUrl: string;
48
+ /**
49
+ * List of notification events to send a request to the webhook URL
50
+ */
51
+ notificationsOf: Array<string>;
52
+ /**
53
+ * Creation date for the port in webhook configuration
54
+ */
55
+ portInTargetDateCreated: Date;
56
+ /**
57
+ * Creation date for the port out webhook configuration
58
+ */
59
+ portOutTargetDateCreated: Date;
60
+ /**
61
+ * Provide a user-friendly representation
62
+ *
63
+ * @returns Object
64
+ */
65
+ toJSON(): {
66
+ url: string;
67
+ portInTargetUrl: string;
68
+ portOutTargetUrl: string;
69
+ notificationsOf: string[];
70
+ portInTargetDateCreated: Date;
71
+ portOutTargetDateCreated: Date;
72
+ };
73
+ [inspect.custom](_depth: any, options: InspectOptions): string;
74
+ }
75
+ export {};
@@ -0,0 +1,72 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.PortingWebhookConfigurationFetchInstance = exports.PortingWebhookConfigurationFetchListInstance = void 0;
17
+ const util_1 = require("util");
18
+ const deserialize = require("../../../base/deserialize");
19
+ const serialize = require("../../../base/serialize");
20
+ function PortingWebhookConfigurationFetchListInstance(version) {
21
+ const instance = {};
22
+ instance._version = version;
23
+ instance._solution = {};
24
+ instance._uri = `/Porting/Configuration/Webhook`;
25
+ instance.fetch = function fetch(callback) {
26
+ let operationVersion = version, operationPromise = operationVersion.fetch({
27
+ uri: instance._uri,
28
+ method: "get",
29
+ });
30
+ operationPromise = operationPromise.then((payload) => new PortingWebhookConfigurationFetchInstance(operationVersion, payload));
31
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
32
+ return operationPromise;
33
+ };
34
+ instance.toJSON = function toJSON() {
35
+ return instance._solution;
36
+ };
37
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
38
+ return (0, util_1.inspect)(instance.toJSON(), options);
39
+ };
40
+ return instance;
41
+ }
42
+ exports.PortingWebhookConfigurationFetchListInstance = PortingWebhookConfigurationFetchListInstance;
43
+ class PortingWebhookConfigurationFetchInstance {
44
+ constructor(_version, payload) {
45
+ this._version = _version;
46
+ this.url = payload.url;
47
+ this.portInTargetUrl = payload.port_in_target_url;
48
+ this.portOutTargetUrl = payload.port_out_target_url;
49
+ this.notificationsOf = payload.notifications_of;
50
+ this.portInTargetDateCreated = deserialize.iso8601DateTime(payload.port_in_target_date_created);
51
+ this.portOutTargetDateCreated = deserialize.iso8601DateTime(payload.port_out_target_date_created);
52
+ }
53
+ /**
54
+ * Provide a user-friendly representation
55
+ *
56
+ * @returns Object
57
+ */
58
+ toJSON() {
59
+ return {
60
+ url: this.url,
61
+ portInTargetUrl: this.portInTargetUrl,
62
+ portOutTargetUrl: this.portOutTargetUrl,
63
+ notificationsOf: this.notificationsOf,
64
+ portInTargetDateCreated: this.portInTargetDateCreated,
65
+ portOutTargetDateCreated: this.portOutTargetDateCreated,
66
+ };
67
+ }
68
+ [util_1.inspect.custom](_depth, options) {
69
+ return (0, util_1.inspect)(this.toJSON(), options);
70
+ }
71
+ }
72
+ exports.PortingWebhookConfigurationFetchInstance = PortingWebhookConfigurationFetchInstance;
@@ -47,6 +47,12 @@ export interface TaskListInstanceCreateOptions {
47
47
  attributes?: string;
48
48
  /** The virtual start time to assign the new task and override the default. When supplied, the new task will have this virtual start time. When not supplied, the new task will have the virtual start time equal to `date_created`. Value can\\\'t be in the future. */
49
49
  virtualStartTime?: Date;
50
+ /** A SID of a Worker, Queue, or Workflow to route a Task to */
51
+ routingTarget?: string;
52
+ /** A boolean indicating if a new task should respect a worker\\\'s capacity during assignment */
53
+ ignoreCapacity?: string;
54
+ /** The SID of the TaskQueue in which the Task belongs */
55
+ taskQueueSid?: string;
50
56
  }
51
57
  /**
52
58
  * Options to pass to each
@@ -66,6 +72,8 @@ export interface TaskListInstanceEachOptions {
66
72
  taskQueueName?: string;
67
73
  /** The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. */
68
74
  evaluateTaskAttributes?: string;
75
+ /** A SID of a Worker, Queue, or Workflow to route a Task to */
76
+ routingTarget?: string;
69
77
  /** How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. */
70
78
  ordering?: string;
71
79
  /** Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. */
@@ -97,6 +105,8 @@ export interface TaskListInstanceOptions {
97
105
  taskQueueName?: string;
98
106
  /** The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. */
99
107
  evaluateTaskAttributes?: string;
108
+ /** A SID of a Worker, Queue, or Workflow to route a Task to */
109
+ routingTarget?: string;
100
110
  /** How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. */
101
111
  ordering?: string;
102
112
  /** Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. */
@@ -124,6 +134,8 @@ export interface TaskListInstancePageOptions {
124
134
  taskQueueName?: string;
125
135
  /** The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. */
126
136
  evaluateTaskAttributes?: string;
137
+ /** A SID of a Worker, Queue, or Workflow to route a Task to */
138
+ routingTarget?: string;
127
139
  /** How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. */
128
140
  ordering?: string;
129
141
  /** Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. */
@@ -233,6 +245,8 @@ interface TaskResource {
233
245
  url: string;
234
246
  links: Record<string, string>;
235
247
  virtual_start_time: Date;
248
+ ignore_capacity: boolean;
249
+ routing_target: string;
236
250
  }
237
251
  export declare class TaskInstance {
238
252
  protected _version: V1;
@@ -324,6 +338,14 @@ export declare class TaskInstance {
324
338
  * The date and time in GMT indicating the ordering for routing of the Task specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
325
339
  */
326
340
  virtualStartTime: Date;
341
+ /**
342
+ * A boolean indicating if a new task should respect a worker\'s capacity during assignment
343
+ */
344
+ ignoreCapacity: boolean;
345
+ /**
346
+ * A SID of a Worker, Queue, or Workflow to route a Task to
347
+ */
348
+ routingTarget: string;
327
349
  private get _proxy();
328
350
  /**
329
351
  * Remove a TaskInstance
@@ -399,6 +421,8 @@ export declare class TaskInstance {
399
421
  url: string;
400
422
  links: Record<string, string>;
401
423
  virtualStartTime: Date;
424
+ ignoreCapacity: boolean;
425
+ routingTarget: string;
402
426
  };
403
427
  [inspect.custom](_depth: any, options: InspectOptions): string;
404
428
  }