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
@@ -19,11 +19,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
19
19
  const Version_1 = __importDefault(require("../../base/Version"));
20
20
  const bulkEligibility_1 = require("./v1/bulkEligibility");
21
21
  const eligibility_1 = require("./v1/eligibility");
22
- const portingBulkPortability_1 = require("./v1/portingBulkPortability");
23
22
  const portingPortIn_1 = require("./v1/portingPortIn");
24
- const portingPortInFetch_1 = require("./v1/portingPortInFetch");
25
23
  const portingPortInPhoneNumber_1 = require("./v1/portingPortInPhoneNumber");
26
24
  const portingPortability_1 = require("./v1/portingPortability");
25
+ const portingWebhookConfiguration_1 = require("./v1/portingWebhookConfiguration");
26
+ const portingWebhookConfigurationDelete_1 = require("./v1/portingWebhookConfigurationDelete");
27
+ const portingWebhookConfigurationFetch_1 = require("./v1/portingWebhookConfigurationFetch");
27
28
  class V1 extends Version_1.default {
28
29
  /**
29
30
  * Initialize the V1 version of Numbers
@@ -44,25 +45,12 @@ class V1 extends Version_1.default {
44
45
  this._eligibilities = this._eligibilities || (0, eligibility_1.EligibilityListInstance)(this);
45
46
  return this._eligibilities;
46
47
  }
47
- /** Getter for portingBulkPortabilities resource */
48
- get portingBulkPortabilities() {
49
- this._portingBulkPortabilities =
50
- this._portingBulkPortabilities ||
51
- (0, portingBulkPortability_1.PortingBulkPortabilityListInstance)(this);
52
- return this._portingBulkPortabilities;
53
- }
54
48
  /** Getter for portingPortIns resource */
55
49
  get portingPortIns() {
56
50
  this._portingPortIns =
57
51
  this._portingPortIns || (0, portingPortIn_1.PortingPortInListInstance)(this);
58
52
  return this._portingPortIns;
59
53
  }
60
- /** Getter for portingPortInsFetch resource */
61
- get portingPortInsFetch() {
62
- this._portingPortInsFetch =
63
- this._portingPortInsFetch || (0, portingPortInFetch_1.PortingPortInFetchListInstance)(this);
64
- return this._portingPortInsFetch;
65
- }
66
54
  /** Getter for portingPortInPhoneNumber resource */
67
55
  get portingPortInPhoneNumber() {
68
56
  this._portingPortInPhoneNumber =
@@ -76,5 +64,26 @@ class V1 extends Version_1.default {
76
64
  this._portingPortabilities || (0, portingPortability_1.PortingPortabilityListInstance)(this);
77
65
  return this._portingPortabilities;
78
66
  }
67
+ /** Getter for portingWebhookConfigurations resource */
68
+ get portingWebhookConfigurations() {
69
+ this._portingWebhookConfigurations =
70
+ this._portingWebhookConfigurations ||
71
+ (0, portingWebhookConfiguration_1.PortingWebhookConfigurationListInstance)(this);
72
+ return this._portingWebhookConfigurations;
73
+ }
74
+ /** Getter for portingWebhookConfigurationsDelete resource */
75
+ get portingWebhookConfigurationsDelete() {
76
+ this._portingWebhookConfigurationsDelete =
77
+ this._portingWebhookConfigurationsDelete ||
78
+ (0, portingWebhookConfigurationDelete_1.PortingWebhookConfigurationDeleteListInstance)(this);
79
+ return this._portingWebhookConfigurationsDelete;
80
+ }
81
+ /** Getter for portingWebhookConfigurationFetch resource */
82
+ get portingWebhookConfigurationFetch() {
83
+ this._portingWebhookConfigurationFetch =
84
+ this._portingWebhookConfigurationFetch ||
85
+ (0, portingWebhookConfigurationFetch_1.PortingWebhookConfigurationFetchListInstance)(this);
86
+ return this._portingWebhookConfigurationFetch;
87
+ }
79
88
  }
80
89
  exports.default = V1;
@@ -17,6 +17,14 @@ export interface PortingPortInContext {
17
17
  * @returns Resolves to processed boolean
18
18
  */
19
19
  remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
20
+ /**
21
+ * Fetch a PortingPortInInstance
22
+ *
23
+ * @param callback - Callback to handle processed record
24
+ *
25
+ * @returns Resolves to processed PortingPortInInstance
26
+ */
27
+ fetch(callback?: (error: Error | null, item?: PortingPortInInstance) => any): Promise<PortingPortInInstance>;
20
28
  /**
21
29
  * Provide a user-friendly representation
22
30
  */
@@ -32,6 +40,7 @@ export declare class PortingPortInContextImpl implements PortingPortInContext {
32
40
  protected _uri: string;
33
41
  constructor(_version: V1, portInRequestSid: string);
34
42
  remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
43
+ fetch(callback?: (error: Error | null, item?: PortingPortInInstance) => any): Promise<PortingPortInInstance>;
35
44
  /**
36
45
  * Provide a user-friendly representation
37
46
  *
@@ -43,6 +52,15 @@ export declare class PortingPortInContextImpl implements PortingPortInContext {
43
52
  interface PortingPortInResource {
44
53
  port_in_request_sid: string;
45
54
  url: string;
55
+ account_sid: string;
56
+ notification_emails: Array<string>;
57
+ target_port_in_date: Date;
58
+ target_port_in_time_range_start: string;
59
+ target_port_in_time_range_end: string;
60
+ port_in_request_status: string;
61
+ losing_carrier_information: any;
62
+ phone_numbers: Array<any>;
63
+ documents: Array<string>;
46
64
  }
47
65
  export declare class PortingPortInInstance {
48
66
  protected _version: V1;
@@ -53,7 +71,46 @@ export declare class PortingPortInInstance {
53
71
  * The SID of the Port In request. This is a unique identifier of the port in request.
54
72
  */
55
73
  portInRequestSid: string;
74
+ /**
75
+ * The URL of this Port In request
76
+ */
56
77
  url: string;
78
+ /**
79
+ * The Account SID that the numbers will be added to after they are ported into Twilio.
80
+ */
81
+ accountSid: string;
82
+ /**
83
+ * List of emails for getting notifications about the LOA signing process. Allowed Max 10 emails.
84
+ */
85
+ notificationEmails: Array<string>;
86
+ /**
87
+ * Minimum number of days in the future (at least 2 days) needs to be established with the Ops team for validation.
88
+ */
89
+ targetPortInDate: Date;
90
+ /**
91
+ * Minimum hour in the future needs to be established with the Ops team for validation.
92
+ */
93
+ targetPortInTimeRangeStart: string;
94
+ /**
95
+ * Maximum hour in the future needs to be established with the Ops team for validation.
96
+ */
97
+ targetPortInTimeRangeEnd: string;
98
+ /**
99
+ * The status of the port in request. The possible values are: In progress, Completed, Expired, In review, Waiting for Signature, Action Required, and Canceled.
100
+ */
101
+ portInRequestStatus: string;
102
+ /**
103
+ * The information for the losing carrier.
104
+ */
105
+ losingCarrierInformation: any;
106
+ /**
107
+ * The list of phone numbers to Port in. Phone numbers are in E.164 format (e.g. +16175551212).
108
+ */
109
+ phoneNumbers: Array<any>;
110
+ /**
111
+ * The list of documents SID referencing a utility bills
112
+ */
113
+ documents: Array<string>;
57
114
  private get _proxy();
58
115
  /**
59
116
  * Remove a PortingPortInInstance
@@ -63,6 +120,14 @@ export declare class PortingPortInInstance {
63
120
  * @returns Resolves to processed boolean
64
121
  */
65
122
  remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
123
+ /**
124
+ * Fetch a PortingPortInInstance
125
+ *
126
+ * @param callback - Callback to handle processed record
127
+ *
128
+ * @returns Resolves to processed PortingPortInInstance
129
+ */
130
+ fetch(callback?: (error: Error | null, item?: PortingPortInInstance) => any): Promise<PortingPortInInstance>;
66
131
  /**
67
132
  * Provide a user-friendly representation
68
133
  *
@@ -71,6 +136,15 @@ export declare class PortingPortInInstance {
71
136
  toJSON(): {
72
137
  portInRequestSid: string;
73
138
  url: string;
139
+ accountSid: string;
140
+ notificationEmails: string[];
141
+ targetPortInDate: Date;
142
+ targetPortInTimeRangeStart: string;
143
+ targetPortInTimeRangeEnd: string;
144
+ portInRequestStatus: string;
145
+ losingCarrierInformation: any;
146
+ phoneNumbers: any[];
147
+ documents: string[];
74
148
  };
75
149
  [inspect.custom](_depth: any, options: InspectOptions): string;
76
150
  }
@@ -36,6 +36,16 @@ class PortingPortInContextImpl {
36
36
  operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
37
37
  return operationPromise;
38
38
  }
39
+ fetch(callback) {
40
+ const instance = this;
41
+ let operationVersion = instance._version, operationPromise = operationVersion.fetch({
42
+ uri: instance._uri,
43
+ method: "get",
44
+ });
45
+ operationPromise = operationPromise.then((payload) => new PortingPortInInstance(operationVersion, payload, instance._solution.portInRequestSid));
46
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
47
+ return operationPromise;
48
+ }
39
49
  /**
40
50
  * Provide a user-friendly representation
41
51
  *
@@ -54,6 +64,15 @@ class PortingPortInInstance {
54
64
  this._version = _version;
55
65
  this.portInRequestSid = payload.port_in_request_sid;
56
66
  this.url = payload.url;
67
+ this.accountSid = payload.account_sid;
68
+ this.notificationEmails = payload.notification_emails;
69
+ this.targetPortInDate = deserialize.iso8601Date(payload.target_port_in_date);
70
+ this.targetPortInTimeRangeStart = payload.target_port_in_time_range_start;
71
+ this.targetPortInTimeRangeEnd = payload.target_port_in_time_range_end;
72
+ this.portInRequestStatus = payload.port_in_request_status;
73
+ this.losingCarrierInformation = payload.losing_carrier_information;
74
+ this.phoneNumbers = payload.phone_numbers;
75
+ this.documents = payload.documents;
57
76
  this._solution = {
58
77
  portInRequestSid: portInRequestSid || this.portInRequestSid,
59
78
  };
@@ -74,6 +93,16 @@ class PortingPortInInstance {
74
93
  remove(callback) {
75
94
  return this._proxy.remove(callback);
76
95
  }
96
+ /**
97
+ * Fetch a PortingPortInInstance
98
+ *
99
+ * @param callback - Callback to handle processed record
100
+ *
101
+ * @returns Resolves to processed PortingPortInInstance
102
+ */
103
+ fetch(callback) {
104
+ return this._proxy.fetch(callback);
105
+ }
77
106
  /**
78
107
  * Provide a user-friendly representation
79
108
  *
@@ -83,6 +112,15 @@ class PortingPortInInstance {
83
112
  return {
84
113
  portInRequestSid: this.portInRequestSid,
85
114
  url: this.url,
115
+ accountSid: this.accountSid,
116
+ notificationEmails: this.notificationEmails,
117
+ targetPortInDate: this.targetPortInDate,
118
+ targetPortInTimeRangeStart: this.targetPortInTimeRangeStart,
119
+ targetPortInTimeRangeEnd: this.targetPortInTimeRangeEnd,
120
+ portInRequestStatus: this.portInRequestStatus,
121
+ losingCarrierInformation: this.losingCarrierInformation,
122
+ phoneNumbers: this.phoneNumbers,
123
+ documents: this.documents,
86
124
  };
87
125
  }
88
126
  [util_1.inspect.custom](_depth, options) {
@@ -10,6 +10,14 @@ export interface PortingPortInPhoneNumberContext {
10
10
  * @returns Resolves to processed boolean
11
11
  */
12
12
  remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
13
+ /**
14
+ * Fetch a PortingPortInPhoneNumberInstance
15
+ *
16
+ * @param callback - Callback to handle processed record
17
+ *
18
+ * @returns Resolves to processed PortingPortInPhoneNumberInstance
19
+ */
20
+ fetch(callback?: (error: Error | null, item?: PortingPortInPhoneNumberInstance) => any): Promise<PortingPortInPhoneNumberInstance>;
13
21
  /**
14
22
  * Provide a user-friendly representation
15
23
  */
@@ -26,6 +34,7 @@ export declare class PortingPortInPhoneNumberContextImpl implements PortingPortI
26
34
  protected _uri: string;
27
35
  constructor(_version: V1, portInRequestSid: string, phoneNumberSid: string);
28
36
  remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
37
+ fetch(callback?: (error: Error | null, item?: PortingPortInPhoneNumberInstance) => any): Promise<PortingPortInPhoneNumberInstance>;
29
38
  /**
30
39
  * Provide a user-friendly representation
31
40
  *
@@ -34,6 +43,120 @@ export declare class PortingPortInPhoneNumberContextImpl implements PortingPortI
34
43
  toJSON(): PortingPortInPhoneNumberContextSolution;
35
44
  [inspect.custom](_depth: any, options: InspectOptions): string;
36
45
  }
46
+ interface PortingPortInPhoneNumberResource {
47
+ port_in_request_sid: string;
48
+ phone_number_sid: string;
49
+ url: string;
50
+ account_sid: string;
51
+ phone_number_type: string;
52
+ date_created: Date;
53
+ country: string;
54
+ missing_required_fields: boolean;
55
+ status_last_time_updated_timestamp: Date;
56
+ phone_number: string;
57
+ portable: boolean;
58
+ not_portability_reason: string;
59
+ not_portability_reason_code: string;
60
+ port_in_phone_number_status: string;
61
+ }
62
+ export declare class PortingPortInPhoneNumberInstance {
63
+ protected _version: V1;
64
+ protected _solution: PortingPortInPhoneNumberContextSolution;
65
+ protected _context?: PortingPortInPhoneNumberContext;
66
+ constructor(_version: V1, payload: PortingPortInPhoneNumberResource, portInRequestSid?: string, phoneNumberSid?: string);
67
+ /**
68
+ * The SID of the Port In request. This is a unique identifier of the port in request.
69
+ */
70
+ portInRequestSid: string;
71
+ /**
72
+ * The SID of the Port In request phone number. This is a unique identifier of the phone number.
73
+ */
74
+ phoneNumberSid: string;
75
+ url: string;
76
+ /**
77
+ * The SID of the account that the phone number belongs to.
78
+ */
79
+ accountSid: string;
80
+ /**
81
+ * The type of the phone number.
82
+ */
83
+ phoneNumberType: string;
84
+ /**
85
+ * The date when the phone number was created.
86
+ */
87
+ dateCreated: Date;
88
+ /**
89
+ * The country of the phone number.
90
+ */
91
+ country: string;
92
+ /**
93
+ * The phone number is missing required fields.
94
+ */
95
+ missingRequiredFields: boolean;
96
+ /**
97
+ * The timestamp when the status was last updated.
98
+ */
99
+ statusLastTimeUpdatedTimestamp: Date;
100
+ /**
101
+ * The phone number.
102
+ */
103
+ phoneNumber: string;
104
+ /**
105
+ * The phone number is portable.
106
+ */
107
+ portable: boolean;
108
+ /**
109
+ * The reason why the phone number is not portable.
110
+ */
111
+ notPortabilityReason: string;
112
+ /**
113
+ * The code of the reason why the phone number is not portable.
114
+ */
115
+ notPortabilityReasonCode: string;
116
+ /**
117
+ * The status of the phone number in the port in request.
118
+ */
119
+ portInPhoneNumberStatus: string;
120
+ private get _proxy();
121
+ /**
122
+ * Remove a PortingPortInPhoneNumberInstance
123
+ *
124
+ * @param callback - Callback to handle processed record
125
+ *
126
+ * @returns Resolves to processed boolean
127
+ */
128
+ remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
129
+ /**
130
+ * Fetch a PortingPortInPhoneNumberInstance
131
+ *
132
+ * @param callback - Callback to handle processed record
133
+ *
134
+ * @returns Resolves to processed PortingPortInPhoneNumberInstance
135
+ */
136
+ fetch(callback?: (error: Error | null, item?: PortingPortInPhoneNumberInstance) => any): Promise<PortingPortInPhoneNumberInstance>;
137
+ /**
138
+ * Provide a user-friendly representation
139
+ *
140
+ * @returns Object
141
+ */
142
+ toJSON(): {
143
+ portInRequestSid: string;
144
+ phoneNumberSid: string;
145
+ url: string;
146
+ accountSid: string;
147
+ phoneNumberType: string;
148
+ dateCreated: Date;
149
+ country: string;
150
+ missingRequiredFields: boolean;
151
+ statusLastTimeUpdatedTimestamp: Date;
152
+ phoneNumber: string;
153
+ portable: boolean;
154
+ notPortabilityReason: string;
155
+ notPortabilityReasonCode: string;
156
+ portInPhoneNumberStatus: string;
157
+ };
158
+ [inspect.custom](_depth: any, options: InspectOptions): string;
159
+ }
37
160
  export interface PortingPortInPhoneNumberSolution {
38
161
  }
39
162
  export interface PortingPortInPhoneNumberListInstance {
@@ -49,3 +172,4 @@ export interface PortingPortInPhoneNumberListInstance {
49
172
  [inspect.custom](_depth: any, options: InspectOptions): any;
50
173
  }
51
174
  export declare function PortingPortInPhoneNumberListInstance(version: V1): PortingPortInPhoneNumberListInstance;
175
+ export {};
@@ -13,7 +13,7 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.PortingPortInPhoneNumberListInstance = exports.PortingPortInPhoneNumberContextImpl = void 0;
16
+ exports.PortingPortInPhoneNumberListInstance = exports.PortingPortInPhoneNumberInstance = exports.PortingPortInPhoneNumberContextImpl = void 0;
17
17
  const util_1 = require("util");
18
18
  const deserialize = require("../../../base/deserialize");
19
19
  const serialize = require("../../../base/serialize");
@@ -39,6 +39,16 @@ class PortingPortInPhoneNumberContextImpl {
39
39
  operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
40
40
  return operationPromise;
41
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
+ }
42
52
  /**
43
53
  * Provide a user-friendly representation
44
54
  *
@@ -52,6 +62,82 @@ class PortingPortInPhoneNumberContextImpl {
52
62
  }
53
63
  }
54
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;
55
141
  function PortingPortInPhoneNumberListInstance(version) {
56
142
  const instance = ((portInRequestSid, phoneNumberSid) => instance.get(portInRequestSid, phoneNumberSid));
57
143
  instance.get = function get(portInRequestSid, phoneNumberSid) {
@@ -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;