twilio 5.12.2 → 5.13.1

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 (108) hide show
  1. package/README.md +1 -0
  2. package/lib/rest/InsightsBase.d.ts +3 -0
  3. package/lib/rest/InsightsBase.js +5 -0
  4. package/lib/rest/api/v2010/account/call/payment.d.ts +6 -2
  5. package/lib/rest/api/v2010/account/call/payment.js +8 -0
  6. package/lib/rest/api/v2010/account/call/transcription.d.ts +4 -0
  7. package/lib/rest/api/v2010/account/call/transcription.js +8 -0
  8. package/lib/rest/api/v2010/account/token.d.ts +1 -0
  9. package/lib/rest/api/v2010/account/token.js +10 -1
  10. package/lib/rest/assistants/v1/assistant/feedback.d.ts +1 -0
  11. package/lib/rest/assistants/v1/assistant/feedback.js +6 -0
  12. package/lib/rest/assistants/v1/assistant/message.d.ts +1 -0
  13. package/lib/rest/assistants/v1/assistant/message.js +7 -0
  14. package/lib/rest/assistants/v1/assistant.d.ts +6 -0
  15. package/lib/rest/assistants/v1/assistant.js +58 -2
  16. package/lib/rest/assistants/v1/knowledge.d.ts +3 -0
  17. package/lib/rest/assistants/v1/knowledge.js +24 -0
  18. package/lib/rest/assistants/v1/tool.d.ts +4 -0
  19. package/lib/rest/assistants/v1/tool.js +40 -1
  20. package/lib/rest/content/v1/content/approvalCreate.d.ts +1 -0
  21. package/lib/rest/content/v1/content/approvalCreate.js +4 -0
  22. package/lib/rest/content/v1/content.d.ts +27 -0
  23. package/lib/rest/content/v1/content.js +171 -0
  24. package/lib/rest/flexApi/v1/createFlexInstance.d.ts +2 -0
  25. package/lib/rest/flexApi/v1/createFlexInstance.js +6 -0
  26. package/lib/rest/iam/v1/oAuthApp.d.ts +4 -0
  27. package/lib/rest/iam/v1/oAuthApp.js +28 -1
  28. package/lib/rest/insights/V2.d.ts +21 -0
  29. package/lib/rest/insights/V2.js +46 -0
  30. package/lib/rest/insights/v2/inbound.d.ts +436 -0
  31. package/lib/rest/insights/v2/inbound.js +342 -0
  32. package/lib/rest/insights/v2/outbound.d.ts +529 -0
  33. package/lib/rest/insights/v2/outbound.js +392 -0
  34. package/lib/rest/insights/v2/report.d.ts +783 -0
  35. package/lib/rest/insights/v2/report.js +550 -0
  36. package/lib/rest/intelligence/v2/operatorType.d.ts +6 -0
  37. package/lib/rest/intelligence/v2/operatorType.js +4 -0
  38. package/lib/rest/knowledge/v1/knowledge.d.ts +3 -0
  39. package/lib/rest/knowledge/v1/knowledge.js +23 -0
  40. package/lib/rest/lookups/v2/bucket.d.ts +1 -0
  41. package/lib/rest/lookups/v2/bucket.js +4 -0
  42. package/lib/rest/lookups/v2/lookupOverride.d.ts +1 -0
  43. package/lib/rest/lookups/v2/lookupOverride.js +4 -0
  44. package/lib/rest/lookups/v2/phoneNumber.d.ts +9 -0
  45. package/lib/rest/lookups/v2/phoneNumber.js +94 -8
  46. package/lib/rest/lookups/v2/query.d.ts +15 -0
  47. package/lib/rest/lookups/v2/query.js +113 -1
  48. package/lib/rest/lookups/v2/rateLimit.d.ts +1 -0
  49. package/lib/rest/lookups/v2/rateLimit.js +11 -1
  50. package/lib/rest/marketplace/v1/installedAddOn/installedAddOnUsage.d.ts +2 -0
  51. package/lib/rest/marketplace/v1/installedAddOn/installedAddOnUsage.js +13 -1
  52. package/lib/rest/marketplace/v1/referralConversion.d.ts +1 -0
  53. package/lib/rest/marketplace/v1/referralConversion.js +3 -0
  54. package/lib/rest/messaging/v1/service/usAppToPerson.d.ts +78 -5
  55. package/lib/rest/messaging/v1/service/usAppToPerson.js +60 -20
  56. package/lib/rest/messaging/v1/tollfreeVerification.d.ts +26 -24
  57. package/lib/rest/messaging/v2/channelsSender.d.ts +18 -0
  58. package/lib/rest/messaging/v2/channelsSender.js +115 -6
  59. package/lib/rest/numbers/V1.d.ts +8 -0
  60. package/lib/rest/numbers/V1.js +12 -0
  61. package/lib/rest/numbers/v1/embeddedSession.d.ts +84 -0
  62. package/lib/rest/numbers/v1/embeddedSession.js +115 -0
  63. package/lib/rest/numbers/v1/portingPortIn.d.ts +5 -0
  64. package/lib/rest/numbers/v1/portingPortIn.js +67 -2
  65. package/lib/rest/numbers/v1/senderIdRegistration.d.ts +181 -0
  66. package/lib/rest/numbers/v1/senderIdRegistration.js +146 -0
  67. package/lib/rest/numbers/v2/application.d.ts +194 -4
  68. package/lib/rest/numbers/v2/application.js +188 -3
  69. package/lib/rest/previewIam/versionless/organization/roleAssignment.d.ts +1 -0
  70. package/lib/rest/previewIam/versionless/organization/roleAssignment.js +5 -0
  71. package/lib/rest/previewIam/versionless/organization/user.d.ts +69 -0
  72. package/lib/rest/previewIam/versionless/organization/user.js +117 -4
  73. package/lib/rest/pricing/v1/messaging/country.d.ts +3 -0
  74. package/lib/rest/pricing/v1/messaging/country.js +26 -2
  75. package/lib/rest/pricing/v1/phoneNumber/country.d.ts +1 -0
  76. package/lib/rest/pricing/v1/phoneNumber/country.js +10 -1
  77. package/lib/rest/pricing/v1/voice/country.d.ts +2 -0
  78. package/lib/rest/pricing/v1/voice/country.js +21 -2
  79. package/lib/rest/pricing/v1/voice/number.d.ts +2 -0
  80. package/lib/rest/pricing/v1/voice/number.js +19 -2
  81. package/lib/rest/pricing/v2/country.d.ts +2 -0
  82. package/lib/rest/pricing/v2/country.js +22 -2
  83. package/lib/rest/pricing/v2/number.d.ts +2 -0
  84. package/lib/rest/pricing/v2/number.js +22 -2
  85. package/lib/rest/pricing/v2/voice/country.d.ts +2 -0
  86. package/lib/rest/pricing/v2/voice/country.js +22 -2
  87. package/lib/rest/pricing/v2/voice/number.d.ts +2 -0
  88. package/lib/rest/pricing/v2/voice/number.js +20 -2
  89. package/lib/rest/studio/v2/flow/execution.d.ts +12 -0
  90. package/lib/rest/studio/v2/flow/execution.js +4 -0
  91. package/lib/rest/studio/v2/flow/flowRevision.d.ts +6 -0
  92. package/lib/rest/studio/v2/flow/flowRevision.js +2 -0
  93. package/lib/rest/studio/v2/flow.d.ts +6 -0
  94. package/lib/rest/studio/v2/flow.js +2 -0
  95. package/lib/rest/verify/v2/service/approveChallenge.d.ts +2 -0
  96. package/lib/rest/verify/v2/service/approveChallenge.js +13 -0
  97. package/lib/rest/verify/v2/service/newChallenge.d.ts +1 -0
  98. package/lib/rest/verify/v2/service/newChallenge.js +4 -0
  99. package/lib/rest/verify/v2/service/newFactor.d.ts +3 -0
  100. package/lib/rest/verify/v2/service/newFactor.js +16 -0
  101. package/lib/rest/verify/v2/service/newVerifyFactor.d.ts +2 -0
  102. package/lib/rest/verify/v2/service/newVerifyFactor.js +12 -0
  103. package/lib/rest/verify/v2/service/verification.d.ts +1 -1
  104. package/lib/rest/video/v1/room/participant/subscribeRules.d.ts +1 -0
  105. package/lib/rest/video/v1/room/participant/subscribeRules.js +12 -1
  106. package/lib/rest/video/v1/room/recordingRules.d.ts +1 -0
  107. package/lib/rest/video/v1/room/recordingRules.js +11 -1
  108. package/package.json +4 -4
@@ -27,60 +27,151 @@ const utility_1 = require("../../../base/utility");
27
27
  * The configuration settings for creating a sender.
28
28
  */
29
29
  class MessagingV2ChannelsSenderConfiguration {
30
+ constructor(payload) {
31
+ this.wabaId = payload["waba_id"];
32
+ this.verificationMethod = payload["verification_method"];
33
+ this.verificationCode = payload["verification_code"];
34
+ this.voiceApplicationSid = payload["voice_application_sid"];
35
+ this.accountType = payload["account_type"];
36
+ }
30
37
  }
31
38
  exports.MessagingV2ChannelsSenderConfiguration = MessagingV2ChannelsSenderConfiguration;
32
39
  class MessagingV2ChannelsSenderOfflineReasonsItems {
40
+ constructor(payload) {
41
+ this.code = payload["code"];
42
+ this.message = payload["message"];
43
+ this.moreInfo = payload["more_info"];
44
+ }
33
45
  }
34
46
  exports.MessagingV2ChannelsSenderOfflineReasonsItems = MessagingV2ChannelsSenderOfflineReasonsItems;
35
47
  /**
36
48
  * The profile information for the sender.
37
49
  */
38
50
  class MessagingV2ChannelsSenderProfile {
51
+ constructor(payload) {
52
+ this.name = payload["name"];
53
+ this.about = payload["about"];
54
+ this.address = payload["address"];
55
+ this.description = payload["description"];
56
+ this.logoUrl = payload["logo_url"];
57
+ this.bannerUrl = payload["banner_url"];
58
+ this.privacyUrl = payload["privacy_url"];
59
+ this.termsOfServiceUrl = payload["terms_of_service_url"];
60
+ this.accentColor = payload["accent_color"];
61
+ this.vertical = payload["vertical"];
62
+ this.websites = payload["websites"];
63
+ this.emails = payload["emails"];
64
+ this.phoneNumbers = payload["phone_numbers"];
65
+ }
39
66
  }
40
67
  exports.MessagingV2ChannelsSenderProfile = MessagingV2ChannelsSenderProfile;
41
68
  /**
42
69
  * The profile information for the sender.
43
70
  */
44
71
  class MessagingV2ChannelsSenderProfileGenericResponse {
72
+ constructor(payload) {
73
+ this.name = payload["name"];
74
+ this.about = payload["about"];
75
+ this.address = payload["address"];
76
+ this.description = payload["description"];
77
+ this.logoUrl = payload["logo_url"];
78
+ this.bannerUrl = payload["banner_url"];
79
+ this.privacyUrl = payload["privacy_url"];
80
+ this.termsOfServiceUrl = payload["terms_of_service_url"];
81
+ this.accentColor = payload["accent_color"];
82
+ this.vertical = payload["vertical"];
83
+ this.websites = payload["websites"];
84
+ this.emails = payload["emails"];
85
+ this.phoneNumbers = payload["phone_numbers"];
86
+ }
45
87
  }
46
88
  exports.MessagingV2ChannelsSenderProfileGenericResponse = MessagingV2ChannelsSenderProfileGenericResponse;
47
89
  class MessagingV2ChannelsSenderProfileGenericResponseEmails {
90
+ constructor(payload) {
91
+ this.email = payload["email"];
92
+ this.label = payload["label"];
93
+ }
48
94
  }
49
95
  exports.MessagingV2ChannelsSenderProfileGenericResponseEmails = MessagingV2ChannelsSenderProfileGenericResponseEmails;
50
96
  class MessagingV2ChannelsSenderProfileGenericResponsePhoneNumbers {
97
+ constructor(payload) {
98
+ this.phoneNumber = payload["phone_number"];
99
+ this.label = payload["label"];
100
+ }
51
101
  }
52
102
  exports.MessagingV2ChannelsSenderProfileGenericResponsePhoneNumbers = MessagingV2ChannelsSenderProfileGenericResponsePhoneNumbers;
53
103
  class MessagingV2ChannelsSenderProfileGenericResponseWebsites {
104
+ constructor(payload) {
105
+ this.website = payload["website"];
106
+ this.label = payload["label"];
107
+ }
54
108
  }
55
109
  exports.MessagingV2ChannelsSenderProfileGenericResponseWebsites = MessagingV2ChannelsSenderProfileGenericResponseWebsites;
56
110
  /**
57
111
  * The additional properties for the sender.
58
112
  */
59
113
  class MessagingV2ChannelsSenderProperties {
114
+ constructor(payload) {
115
+ this.qualityRating = payload["quality_rating"];
116
+ this.messagingLimit = payload["messaging_limit"];
117
+ }
60
118
  }
61
119
  exports.MessagingV2ChannelsSenderProperties = MessagingV2ChannelsSenderProperties;
62
120
  class MessagingV2ChannelsSenderRequestsCreate {
121
+ constructor(payload) {
122
+ this.senderId = payload["sender_id"];
123
+ this.configuration = payload["configuration"];
124
+ this.webhook = payload["webhook"];
125
+ this.profile = payload["profile"];
126
+ }
63
127
  }
64
128
  exports.MessagingV2ChannelsSenderRequestsCreate = MessagingV2ChannelsSenderRequestsCreate;
65
129
  class MessagingV2ChannelsSenderRequestsUpdate {
130
+ constructor(payload) {
131
+ this.configuration = payload["configuration"];
132
+ this.webhook = payload["webhook"];
133
+ this.profile = payload["profile"];
134
+ }
66
135
  }
67
136
  exports.MessagingV2ChannelsSenderRequestsUpdate = MessagingV2ChannelsSenderRequestsUpdate;
68
137
  /**
69
138
  * The configuration settings for webhooks.
70
139
  */
71
140
  class MessagingV2ChannelsSenderWebhook {
141
+ constructor(payload) {
142
+ this.callbackUrl = payload["callback_url"];
143
+ this.callbackMethod = payload["callback_method"];
144
+ this.fallbackUrl = payload["fallback_url"];
145
+ this.fallbackMethod = payload["fallback_method"];
146
+ this.statusCallbackUrl = payload["status_callback_url"];
147
+ this.statusCallbackMethod = payload["status_callback_method"];
148
+ }
72
149
  }
73
150
  exports.MessagingV2ChannelsSenderWebhook = MessagingV2ChannelsSenderWebhook;
74
151
  class MessagingV2RcsCarrier {
152
+ constructor(payload) {
153
+ this.name = payload["name"];
154
+ this.status = payload["status"];
155
+ }
75
156
  }
76
157
  exports.MessagingV2RcsCarrier = MessagingV2RcsCarrier;
77
158
  class MessagingV2RcsComplianceCountryResponse {
159
+ constructor(payload) {
160
+ this.country = payload["country"];
161
+ this.registrationSid = payload["registration_sid"];
162
+ this.status = payload["status"];
163
+ this.carriers = payload["carriers"];
164
+ }
78
165
  }
79
166
  exports.MessagingV2RcsComplianceCountryResponse = MessagingV2RcsComplianceCountryResponse;
80
167
  /**
81
168
  * The KYC compliance information. This section consists of response to the request launch.
82
169
  */
83
170
  class MessagingV2RcsComplianceResponse {
171
+ constructor(payload) {
172
+ this.registrationSid = payload["registration_sid"];
173
+ this.countries = payload["countries"];
174
+ }
84
175
  }
85
176
  exports.MessagingV2RcsComplianceResponse = MessagingV2RcsComplianceResponse;
86
177
  class ChannelsSenderContextImpl {
@@ -226,12 +317,30 @@ class ChannelsSenderInstance {
226
317
  this.sid = payload.sid;
227
318
  this.status = payload.status;
228
319
  this.senderId = payload.sender_id;
229
- this.configuration = payload.configuration;
230
- this.webhook = payload.webhook;
231
- this.profile = payload.profile;
232
- this.properties = payload.properties;
233
- this.offlineReasons = payload.offline_reasons;
234
- this.compliance = payload.compliance;
320
+ this.configuration =
321
+ payload.configuration !== null && payload.configuration !== undefined
322
+ ? new MessagingV2ChannelsSenderConfiguration(payload.configuration)
323
+ : null;
324
+ this.webhook =
325
+ payload.webhook !== null && payload.webhook !== undefined
326
+ ? new MessagingV2ChannelsSenderWebhook(payload.webhook)
327
+ : null;
328
+ this.profile =
329
+ payload.profile !== null && payload.profile !== undefined
330
+ ? new MessagingV2ChannelsSenderProfileGenericResponse(payload.profile)
331
+ : null;
332
+ this.properties =
333
+ payload.properties !== null && payload.properties !== undefined
334
+ ? new MessagingV2ChannelsSenderProperties(payload.properties)
335
+ : null;
336
+ this.offlineReasons =
337
+ payload.offline_reasons !== null && payload.offline_reasons !== undefined
338
+ ? payload.offline_reasons.map((payload) => new MessagingV2ChannelsSenderOfflineReasonsItems(payload))
339
+ : null;
340
+ this.compliance =
341
+ payload.compliance !== null && payload.compliance !== undefined
342
+ ? new MessagingV2RcsComplianceResponse(payload.compliance)
343
+ : null;
235
344
  this.url = payload.url;
236
345
  this._solution = { sid: sid || this.sid };
237
346
  }
@@ -2,12 +2,14 @@ import NumbersBase from "../NumbersBase";
2
2
  import Version from "../../base/Version";
3
3
  import { BulkEligibilityListInstance } from "./v1/bulkEligibility";
4
4
  import { EligibilityListInstance } from "./v1/eligibility";
5
+ import { EmbeddedSessionListInstance } from "./v1/embeddedSession";
5
6
  import { PortingAllPortInListInstance } from "./v1/portingAllPortIn";
6
7
  import { PortingPortInListInstance } from "./v1/portingPortIn";
7
8
  import { PortingPortInPhoneNumberListInstance } from "./v1/portingPortInPhoneNumber";
8
9
  import { PortingPortabilityListInstance } from "./v1/portingPortability";
9
10
  import { PortingWebhookConfigurationListInstance } from "./v1/portingWebhookConfiguration";
10
11
  import { PortingWebhookConfigurationDeleteListInstance } from "./v1/portingWebhookConfigurationDelete";
12
+ import { SenderIdRegistrationListInstance } from "./v1/senderIdRegistration";
11
13
  import { SigningRequestConfigurationListInstance } from "./v1/signingRequestConfiguration";
12
14
  import { WebhookListInstance } from "./v1/webhook";
13
15
  export default class V1 extends Version {
@@ -33,6 +35,8 @@ export default class V1 extends Version {
33
35
  protected _portingWebhookConfigurations?: PortingWebhookConfigurationListInstance;
34
36
  /** portingWebhookConfigurationsDelete - { Twilio.Numbers.V1.PortingWebhookConfigurationDeleteListInstance } resource */
35
37
  protected _portingWebhookConfigurationsDelete?: PortingWebhookConfigurationDeleteListInstance;
38
+ /** senderIdRegistrations - { Twilio.Numbers.V1.SenderIdRegistrationListInstance } resource */
39
+ protected _senderIdRegistrations?: SenderIdRegistrationListInstance;
36
40
  /** signingRequestConfigurations - { Twilio.Numbers.V1.SigningRequestConfigurationListInstance } resource */
37
41
  protected _signingRequestConfigurations?: SigningRequestConfigurationListInstance;
38
42
  /** webhook - { Twilio.Numbers.V1.WebhookListInstance } resource */
@@ -41,6 +45,8 @@ export default class V1 extends Version {
41
45
  get bulkEligibilities(): BulkEligibilityListInstance;
42
46
  /** Getter for eligibilities resource */
43
47
  get eligibilities(): EligibilityListInstance;
48
+ /** Accessor for embeddedSessions resource */
49
+ embeddedSessions(BundleSid: string): EmbeddedSessionListInstance;
44
50
  /** Getter for portingAllPortIns resource */
45
51
  get portingAllPortIns(): PortingAllPortInListInstance;
46
52
  /** Getter for portingPortIns resource */
@@ -53,6 +59,8 @@ export default class V1 extends Version {
53
59
  get portingWebhookConfigurations(): PortingWebhookConfigurationListInstance;
54
60
  /** Getter for portingWebhookConfigurationsDelete resource */
55
61
  get portingWebhookConfigurationsDelete(): PortingWebhookConfigurationDeleteListInstance;
62
+ /** Getter for senderIdRegistrations resource */
63
+ get senderIdRegistrations(): SenderIdRegistrationListInstance;
56
64
  /** Getter for signingRequestConfigurations resource */
57
65
  get signingRequestConfigurations(): SigningRequestConfigurationListInstance;
58
66
  /** Getter for webhook resource */
@@ -19,12 +19,14 @@ 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 embeddedSession_1 = require("./v1/embeddedSession");
22
23
  const portingAllPortIn_1 = require("./v1/portingAllPortIn");
23
24
  const portingPortIn_1 = require("./v1/portingPortIn");
24
25
  const portingPortInPhoneNumber_1 = require("./v1/portingPortInPhoneNumber");
25
26
  const portingPortability_1 = require("./v1/portingPortability");
26
27
  const portingWebhookConfiguration_1 = require("./v1/portingWebhookConfiguration");
27
28
  const portingWebhookConfigurationDelete_1 = require("./v1/portingWebhookConfigurationDelete");
29
+ const senderIdRegistration_1 = require("./v1/senderIdRegistration");
28
30
  const signingRequestConfiguration_1 = require("./v1/signingRequestConfiguration");
29
31
  const webhook_1 = require("./v1/webhook");
30
32
  class V1 extends Version_1.default {
@@ -47,6 +49,10 @@ class V1 extends Version_1.default {
47
49
  this._eligibilities = this._eligibilities || (0, eligibility_1.EligibilityListInstance)(this);
48
50
  return this._eligibilities;
49
51
  }
52
+ /** Accessor for embeddedSessions resource */
53
+ embeddedSessions(BundleSid) {
54
+ return (0, embeddedSession_1.EmbeddedSessionListInstance)(this, BundleSid);
55
+ }
50
56
  /** Getter for portingAllPortIns resource */
51
57
  get portingAllPortIns() {
52
58
  this._portingAllPortIns =
@@ -86,6 +92,12 @@ class V1 extends Version_1.default {
86
92
  (0, portingWebhookConfigurationDelete_1.PortingWebhookConfigurationDeleteListInstance)(this);
87
93
  return this._portingWebhookConfigurationsDelete;
88
94
  }
95
+ /** Getter for senderIdRegistrations resource */
96
+ get senderIdRegistrations() {
97
+ this._senderIdRegistrations =
98
+ this._senderIdRegistrations || (0, senderIdRegistration_1.SenderIdRegistrationListInstance)(this);
99
+ return this._senderIdRegistrations;
100
+ }
89
101
  /** Getter for signingRequestConfigurations resource */
90
102
  get signingRequestConfigurations() {
91
103
  this._signingRequestConfigurations =
@@ -0,0 +1,84 @@
1
+ import { inspect, InspectOptions } from "util";
2
+ import V1 from "../V1";
3
+ import { ApiResponse } from "../../../base/ApiResponse";
4
+ export declare class NumbersV1CreateEmbeddedSessionRequest {
5
+ /**
6
+ * Theme ID for the Compliance Embeddable UI. Overrides the theme set during registration creation.
7
+ */
8
+ "themeSetId"?: string;
9
+ constructor(payload: any);
10
+ }
11
+ /**
12
+ * Options to pass to create a EmbeddedSessionInstance
13
+ */
14
+ export interface EmbeddedSessionListInstanceCreateOptions {
15
+ /** */
16
+ numbersV1CreateEmbeddedSessionRequest: NumbersV1CreateEmbeddedSessionRequest;
17
+ }
18
+ export interface EmbeddedSessionSolution {
19
+ bundleSid: string;
20
+ }
21
+ export interface EmbeddedSessionListInstance {
22
+ _version: V1;
23
+ _solution: EmbeddedSessionSolution;
24
+ _uri: string;
25
+ /**
26
+ * Create a EmbeddedSessionInstance
27
+ *
28
+ * @param params - Body for request
29
+ * @param headers - header params for request
30
+ * @param callback - Callback to handle processed record
31
+ *
32
+ * @returns Resolves to processed EmbeddedSessionInstance
33
+ */
34
+ create(params: NumbersV1CreateEmbeddedSessionRequest, headers?: any, callback?: (error: Error | null, item?: EmbeddedSessionInstance) => any): Promise<EmbeddedSessionInstance>;
35
+ /**
36
+ * Create a EmbeddedSessionInstance and return HTTP info
37
+ *
38
+ * @param params - Body for request
39
+ * @param headers - header params for request
40
+ * @param callback - Callback to handle processed record
41
+ *
42
+ * @returns Resolves to processed EmbeddedSessionInstance with HTTP metadata
43
+ */
44
+ createWithHttpInfo(params: NumbersV1CreateEmbeddedSessionRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse<EmbeddedSessionInstance>) => any): Promise<ApiResponse<EmbeddedSessionInstance>>;
45
+ /**
46
+ * Provide a user-friendly representation
47
+ */
48
+ toJSON(): any;
49
+ [inspect.custom](_depth: any, options: InspectOptions): any;
50
+ }
51
+ export declare function EmbeddedSessionListInstance(version: V1, bundleSid: string): EmbeddedSessionListInstance;
52
+ interface EmbeddedSessionResource {
53
+ id: string;
54
+ sessionId: string;
55
+ sessionToken: string;
56
+ }
57
+ export declare class EmbeddedSessionInstance {
58
+ protected _version: V1;
59
+ constructor(_version: V1, payload: EmbeddedSessionResource, bundleSid?: string);
60
+ /**
61
+ * Registration identifier (BU-prefixed).
62
+ */
63
+ id: string;
64
+ /**
65
+ * Session ID for the compliance embeddable.
66
+ */
67
+ sessionId: string;
68
+ /**
69
+ * Ephemeral session token for the compliance embeddable.
70
+ */
71
+ sessionToken: string;
72
+ /**
73
+ * Provide a user-friendly representation
74
+ *
75
+ * @returns Object
76
+ */
77
+ toJSON(): {
78
+ id: string;
79
+ sessionId: string;
80
+ sessionToken: string;
81
+ };
82
+ [inspect.custom](_depth: any, options: InspectOptions): string;
83
+ }
84
+ export {};
@@ -0,0 +1,115 @@
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.EmbeddedSessionInstance = exports.NumbersV1CreateEmbeddedSessionRequest = void 0;
17
+ exports.EmbeddedSessionListInstance = EmbeddedSessionListInstance;
18
+ const util_1 = require("util");
19
+ const deserialize = require("../../../base/deserialize");
20
+ const serialize = require("../../../base/serialize");
21
+ const utility_1 = require("../../../base/utility");
22
+ class NumbersV1CreateEmbeddedSessionRequest {
23
+ constructor(payload) {
24
+ this.themeSetId = payload["themeSetId"];
25
+ }
26
+ }
27
+ exports.NumbersV1CreateEmbeddedSessionRequest = NumbersV1CreateEmbeddedSessionRequest;
28
+ function EmbeddedSessionListInstance(version, bundleSid) {
29
+ if (!(0, utility_1.isValidPathParam)(bundleSid)) {
30
+ throw new Error("Parameter 'bundleSid' is not valid.");
31
+ }
32
+ const instance = {};
33
+ instance._version = version;
34
+ instance._solution = { bundleSid };
35
+ instance._uri = `/SenderIdRegistrations/${bundleSid}/EmbeddedSessions`;
36
+ instance.create = function create(params, headers, callback) {
37
+ if (params === null || params === undefined) {
38
+ throw new Error('Required parameter "params" missing.');
39
+ }
40
+ let data = {};
41
+ data = params;
42
+ if (headers === null || headers === undefined) {
43
+ headers = {};
44
+ }
45
+ headers["Content-Type"] = "application/json";
46
+ headers["Accept"] = "application/json";
47
+ let operationVersion = version, operationPromise = operationVersion.create({
48
+ uri: instance._uri,
49
+ method: "post",
50
+ data,
51
+ headers,
52
+ });
53
+ operationPromise = operationPromise.then((payload) => new EmbeddedSessionInstance(operationVersion, payload, instance._solution.bundleSid));
54
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
55
+ return operationPromise;
56
+ };
57
+ instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
58
+ if (params === null || params === undefined) {
59
+ throw new Error('Required parameter "params" missing.');
60
+ }
61
+ let data = {};
62
+ data = params;
63
+ if (headers === null || headers === undefined) {
64
+ headers = {};
65
+ }
66
+ headers["Content-Type"] = "application/json";
67
+ headers["Accept"] = "application/json";
68
+ let operationVersion = version;
69
+ // CREATE, FETCH, UPDATE operations
70
+ let operationPromise = operationVersion
71
+ .createWithResponseInfo({
72
+ uri: instance._uri,
73
+ method: "post",
74
+ data,
75
+ headers,
76
+ })
77
+ .then((response) => ({
78
+ ...response,
79
+ body: new EmbeddedSessionInstance(operationVersion, response.body, instance._solution.bundleSid),
80
+ }));
81
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
82
+ return operationPromise;
83
+ };
84
+ instance.toJSON = function toJSON() {
85
+ return instance._solution;
86
+ };
87
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
88
+ return (0, util_1.inspect)(instance.toJSON(), options);
89
+ };
90
+ return instance;
91
+ }
92
+ class EmbeddedSessionInstance {
93
+ constructor(_version, payload, bundleSid) {
94
+ this._version = _version;
95
+ this.id = payload.id;
96
+ this.sessionId = payload.sessionId;
97
+ this.sessionToken = payload.sessionToken;
98
+ }
99
+ /**
100
+ * Provide a user-friendly representation
101
+ *
102
+ * @returns Object
103
+ */
104
+ toJSON() {
105
+ return {
106
+ id: this.id,
107
+ sessionId: this.sessionId,
108
+ sessionToken: this.sessionToken,
109
+ };
110
+ }
111
+ [util_1.inspect.custom](_depth, options) {
112
+ return (0, util_1.inspect)(this.toJSON(), options);
113
+ }
114
+ }
115
+ exports.EmbeddedSessionInstance = EmbeddedSessionInstance;
@@ -26,6 +26,7 @@ export declare class NumbersV1PortingAddress {
26
26
  * The country, ex: USA.
27
27
  */
28
28
  "country": string;
29
+ constructor(payload: any);
29
30
  }
30
31
  export declare class NumbersV1PortingLosingCarrierInformation {
31
32
  /**
@@ -61,6 +62,7 @@ export declare class NumbersV1PortingLosingCarrierInformation {
61
62
  "subMunicipality"?: string;
62
63
  "building"?: string;
63
64
  "katakanaName"?: string;
65
+ constructor(payload: any);
64
66
  }
65
67
  export declare class NumbersV1PortingPortInCreate {
66
68
  /**
@@ -104,6 +106,7 @@ export declare class NumbersV1PortingPortInCreate {
104
106
  * Japan specific field, indicates the number of phone numbers to automatically approve for cancellation.
105
107
  */
106
108
  "autoCancelApprovalNumbers"?: string | null;
109
+ constructor(payload: any);
107
110
  }
108
111
  export declare class NumbersV1PortingPortInCreatePhoneNumbers {
109
112
  /**
@@ -114,6 +117,7 @@ export declare class NumbersV1PortingPortInCreatePhoneNumbers {
114
117
  * Some losing carriers require a PIN to authorize the port of a phone number. If the phone number is a US mobile phone number, the PIN is mandatory to process a porting request. Other carriers and number types may also require a PIN, you\'ll need to contact the losing carrier to determine what your phone number\'s PIN is.
115
118
  */
116
119
  "pin"?: string;
120
+ constructor(payload: any);
117
121
  }
118
122
  export declare class NumbersV1PortingPortInPhoneNumberResult {
119
123
  /**
@@ -161,6 +165,7 @@ export declare class NumbersV1PortingPortInPhoneNumberResult {
161
165
  */
162
166
  "statusLastTimeUpdatedTimestamp"?: string | null;
163
167
  "externalPortingVendorPhoneNumberId"?: string | null;
168
+ constructor(payload: any);
164
169
  }
165
170
  /**
166
171
  * Options to pass to create a PortingPortInInstance
@@ -20,18 +20,76 @@ const deserialize = require("../../../base/deserialize");
20
20
  const serialize = require("../../../base/serialize");
21
21
  const utility_1 = require("../../../base/utility");
22
22
  class NumbersV1PortingAddress {
23
+ constructor(payload) {
24
+ this.street = payload["street"];
25
+ this.street2 = payload["street_2"];
26
+ this.city = payload["city"];
27
+ this.state = payload["state"];
28
+ this.zip = payload["zip"];
29
+ this.country = payload["country"];
30
+ }
23
31
  }
24
32
  exports.NumbersV1PortingAddress = NumbersV1PortingAddress;
25
33
  class NumbersV1PortingLosingCarrierInformation {
34
+ constructor(payload) {
35
+ this.customerName = payload["customer_name"];
36
+ this.accountNumber = payload["account_number"];
37
+ this.accountTelephoneNumber = payload["account_telephone_number"];
38
+ this.addressSid = payload["address_sid"];
39
+ this.address = payload["address"];
40
+ this.authorizedRepresentative = payload["authorized_representative"];
41
+ this.authorizedRepresentativeEmail =
42
+ payload["authorized_representative_email"];
43
+ this.customerType = payload["customer_type"];
44
+ this.authorizedRepresentativeKatakana =
45
+ payload["authorized_representative_katakana"];
46
+ this.subMunicipality = payload["sub_municipality"];
47
+ this.building = payload["building"];
48
+ this.katakanaName = payload["katakana_name"];
49
+ }
26
50
  }
27
51
  exports.NumbersV1PortingLosingCarrierInformation = NumbersV1PortingLosingCarrierInformation;
28
52
  class NumbersV1PortingPortInCreate {
53
+ constructor(payload) {
54
+ this.accountSid = payload["account_sid"];
55
+ this.documents = payload["documents"];
56
+ this.phoneNumbers = payload["phone_numbers"];
57
+ this.losingCarrierInformation = payload["losing_carrier_information"];
58
+ this.notificationEmails = payload["notification_emails"];
59
+ this.targetPortInDate = payload["target_port_in_date"];
60
+ this.targetPortInTimeRangeStart =
61
+ payload["target_port_in_time_range_start"];
62
+ this.targetPortInTimeRangeEnd = payload["target_port_in_time_range_end"];
63
+ this.bundleSid = payload["bundle_sid"];
64
+ this.portabilityAdvanceCarrier = payload["portability_advance_carrier"];
65
+ this.autoCancelApprovalNumbers = payload["auto_cancel_approval_numbers"];
66
+ }
29
67
  }
30
68
  exports.NumbersV1PortingPortInCreate = NumbersV1PortingPortInCreate;
31
69
  class NumbersV1PortingPortInCreatePhoneNumbers {
70
+ constructor(payload) {
71
+ this.phoneNumber = payload["phone_number"];
72
+ this.pin = payload["pin"];
73
+ }
32
74
  }
33
75
  exports.NumbersV1PortingPortInCreatePhoneNumbers = NumbersV1PortingPortInCreatePhoneNumbers;
34
76
  class NumbersV1PortingPortInPhoneNumberResult {
77
+ constructor(payload) {
78
+ this.notPortabilityReason = payload["not_portability_reason"];
79
+ this.notPortabilityReasonCode = payload["not_portability_reason_code"];
80
+ this.numberType = payload["number_type"];
81
+ this.phoneNumber = payload["phone_number"];
82
+ this.portDate = payload["port_date"];
83
+ this.portInPhoneNumberSid = payload["port_in_phone_number_sid"];
84
+ this.portInPhoneNumberStatus = payload["port_in_phone_number_status"];
85
+ this.portable = payload["portable"];
86
+ this.rejectionReason = payload["rejection_reason"];
87
+ this.rejectionReasonCode = payload["rejection_reason_code"];
88
+ this.statusLastTimeUpdatedTimestamp =
89
+ payload["status_last_time_updated_timestamp"];
90
+ this.externalPortingVendorPhoneNumberId =
91
+ payload["external_porting_vendor_phone_number_id"];
92
+ }
35
93
  }
36
94
  exports.NumbersV1PortingPortInPhoneNumberResult = NumbersV1PortingPortInPhoneNumberResult;
37
95
  class PortingPortInContextImpl {
@@ -125,8 +183,15 @@ class PortingPortInInstance {
125
183
  this.targetPortInTimeRangeEnd = payload.target_port_in_time_range_end;
126
184
  this.portInRequestStatus = payload.port_in_request_status;
127
185
  this.orderCancellationReason = payload.order_cancellation_reason;
128
- this.losingCarrierInformation = payload.losing_carrier_information;
129
- this.phoneNumbers = payload.phone_numbers;
186
+ this.losingCarrierInformation =
187
+ payload.losing_carrier_information !== null &&
188
+ payload.losing_carrier_information !== undefined
189
+ ? new NumbersV1PortingLosingCarrierInformation(payload.losing_carrier_information)
190
+ : null;
191
+ this.phoneNumbers =
192
+ payload.phone_numbers !== null && payload.phone_numbers !== undefined
193
+ ? payload.phone_numbers.map((payload) => new NumbersV1PortingPortInPhoneNumberResult(payload))
194
+ : null;
130
195
  this.bundleSid = payload.bundle_sid;
131
196
  this.portabilityAdvanceCarrier = payload.portability_advance_carrier;
132
197
  this.autoCancelApprovalNumbers = payload.auto_cancel_approval_numbers;