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
@@ -16,7 +16,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  return (mod && mod.__esModule) ? mod : { "default": mod };
17
17
  };
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.ApplicationPage = exports.ApplicationInstance = exports.ApplicationContextImpl = exports.CreateShortCodeApplicationRequestSetup = exports.CreateShortCodeApplicationRequestBusinessInformation = exports.CreateShortCodeApplicationRequest = void 0;
19
+ exports.ApplicationPage = exports.ApplicationInstance = exports.ApplicationContextImpl = exports.CreateShortCodeApplicationResponseUserSignUp = exports.CreateShortCodeApplicationResponseSmsCampaignDetails = exports.CreateShortCodeApplicationResponseSetup = exports.CreateShortCodeApplicationResponseContentExamples = exports.CreateShortCodeApplicationResponseComplianceKeywords = exports.CreateShortCodeApplicationResponseBusinessInformation = exports.CreateShortCodeApplicationRequestSetup = exports.CreateShortCodeApplicationRequestBusinessInformation = exports.CreateShortCodeApplicationRequest = void 0;
20
20
  exports.ApplicationListInstance = ApplicationListInstance;
21
21
  const util_1 = require("util");
22
22
  const Page_1 = __importDefault(require("../../../base/Page"));
@@ -24,17 +24,130 @@ const deserialize = require("../../../base/deserialize");
24
24
  const serialize = require("../../../base/serialize");
25
25
  const utility_1 = require("../../../base/utility");
26
26
  class CreateShortCodeApplicationRequest {
27
+ constructor(payload) {
28
+ this.friendlyName = payload["friendly_name"];
29
+ this.isoCountry = payload["iso_country"];
30
+ this.businessInformation = payload["business_information"];
31
+ this.setup = payload["setup"];
32
+ }
27
33
  }
28
34
  exports.CreateShortCodeApplicationRequest = CreateShortCodeApplicationRequest;
29
35
  /**
30
36
  * Business information associated with the application.
31
37
  */
32
38
  class CreateShortCodeApplicationRequestBusinessInformation {
39
+ constructor(payload) {
40
+ this.customerFacingProfile = payload["customer_facing_profile"];
41
+ }
33
42
  }
34
43
  exports.CreateShortCodeApplicationRequestBusinessInformation = CreateShortCodeApplicationRequestBusinessInformation;
35
44
  class CreateShortCodeApplicationRequestSetup {
45
+ constructor(payload) {
46
+ this.chargesApply = payload["charges_apply"];
47
+ }
36
48
  }
37
49
  exports.CreateShortCodeApplicationRequestSetup = CreateShortCodeApplicationRequestSetup;
50
+ /**
51
+ * Business information associated with the application.
52
+ */
53
+ class CreateShortCodeApplicationResponseBusinessInformation {
54
+ constructor(payload) {
55
+ this.managingCompanyProfile = payload["managing_company_profile"];
56
+ this.customerFacingProfile = payload["customer_facing_profile"];
57
+ this.businessWebsite = payload["business_website"];
58
+ this.einManagingCompanyProfile = payload["ein_managing_company_profile"];
59
+ this.einCustomerFacingProfile = payload["ein_customer_facing_profile"];
60
+ }
61
+ }
62
+ exports.CreateShortCodeApplicationResponseBusinessInformation = CreateShortCodeApplicationResponseBusinessInformation;
63
+ /**
64
+ * Compliance keywords for the application.
65
+ */
66
+ class CreateShortCodeApplicationResponseComplianceKeywords {
67
+ constructor(payload) {
68
+ this.help = payload["help"];
69
+ this.stop = payload["stop"];
70
+ this.info = payload["info"];
71
+ this.aide = payload["aide"];
72
+ this.arret = payload["arret"];
73
+ this.optOutFiltering = payload["opt_out_filtering"];
74
+ }
75
+ }
76
+ exports.CreateShortCodeApplicationResponseComplianceKeywords = CreateShortCodeApplicationResponseComplianceKeywords;
77
+ /**
78
+ * Content examples for the application.
79
+ */
80
+ class CreateShortCodeApplicationResponseContentExamples {
81
+ constructor(payload) {
82
+ this.examples = payload["examples"];
83
+ }
84
+ }
85
+ exports.CreateShortCodeApplicationResponseContentExamples = CreateShortCodeApplicationResponseContentExamples;
86
+ /**
87
+ * Setup configuration for the application.
88
+ */
89
+ class CreateShortCodeApplicationResponseSetup {
90
+ constructor(payload) {
91
+ this.requestType = payload["request_type"];
92
+ this.trafficType = payload["traffic_type"];
93
+ this.leaseType = payload["lease_type"];
94
+ this.paymentFrequency = payload["payment_frequency"];
95
+ this.shortCodePreference = payload["short_code_preference"];
96
+ this.mmsEnabled = payload["mms_enabled"];
97
+ this.freeToEndUser = payload["free_to_end_user"];
98
+ this.chargesApply = payload["charges_apply"];
99
+ this.currentProvider = payload["current_provider"];
100
+ this.migratedMmsEnabled = payload["migrated_mms_enabled"];
101
+ this.migratedLiveTraffic = payload["migrated_live_traffic"];
102
+ }
103
+ }
104
+ exports.CreateShortCodeApplicationResponseSetup = CreateShortCodeApplicationResponseSetup;
105
+ /**
106
+ * SMS campaign details for the application.
107
+ */
108
+ class CreateShortCodeApplicationResponseSmsCampaignDetails {
109
+ constructor(payload) {
110
+ this.campaignName = payload["campaign_name"];
111
+ this.campaignBrandWebsite = payload["campaign_brand_website"];
112
+ this.customerCareChannel = payload["customer_care_channel"];
113
+ this.customerCareValue = payload["customer_care_value"];
114
+ this.campaignFrequency = payload["campaign_frequency"];
115
+ this.scUseCaseCategories = payload["sc_use_case_categories"];
116
+ this.smsTermsOfServiceUrl = payload["sms_terms_of_service_url"];
117
+ this.smsPrivacyPolicyUrl = payload["sms_privacy_policy_url"];
118
+ this.monthlyOutboundVolumeExpected =
119
+ payload["monthly_outbound_volume_expected"];
120
+ this.monthlyInboundVolumeExpected =
121
+ payload["monthly_inbound_volume_expected"];
122
+ this.avgMonthlyMessagesSentToEachSubscriber =
123
+ payload["avg_monthly_messages_sent_to_each_subscriber"];
124
+ this.avgMonthlyMessagesReceivedFromSubscribers =
125
+ payload["avg_monthly_messages_received_from_subscribers"];
126
+ this.estimatedTotalSubscribers = payload["estimated_total_subscribers"];
127
+ this.durationOfTheCampaign = payload["duration_of_the_campaign"];
128
+ this.plannedTrafficSpikes = payload["planned_traffic_spikes"];
129
+ this.spikeDetails = payload["spike_details"];
130
+ this.expectedTrafficStartDate = payload["expected_traffic_start_date"];
131
+ }
132
+ }
133
+ exports.CreateShortCodeApplicationResponseSmsCampaignDetails = CreateShortCodeApplicationResponseSmsCampaignDetails;
134
+ /**
135
+ * User sign-up configuration for the application.
136
+ */
137
+ class CreateShortCodeApplicationResponseUserSignUp {
138
+ constructor(payload) {
139
+ this.signUpOptions = payload["sign_up_options"];
140
+ this.doubleOptInProcess = payload["double_opt_in_process"];
141
+ this.doubleOptInMessage = payload["double_opt_in_message"];
142
+ this.signUpConfirmationMessage = payload["sign_up_confirmation_message"];
143
+ this.doubleOptInResponseMessage = payload["double_opt_in_response_message"];
144
+ this.onlineWebFormMessage = payload["online_web_form_message"];
145
+ this.keywordMessage = payload["keyword_message"];
146
+ this.ivrMessage = payload["ivr_message"];
147
+ this.otherFormMessage = payload["other_form_message"];
148
+ }
149
+ }
150
+ exports.CreateShortCodeApplicationResponseUserSignUp = CreateShortCodeApplicationResponseUserSignUp;
38
151
  class ApplicationContextImpl {
39
152
  constructor(_version, sid) {
40
153
  this._version = _version;
@@ -93,11 +206,48 @@ class ApplicationInstance {
93
206
  constructor(_version, payload, sid) {
94
207
  this._version = _version;
95
208
  this.sid = payload.sid;
96
- this.bundleSid = payload.bundle_sid;
97
209
  this.applicationRequirementsSid = payload.application_requirements_sid;
210
+ this.applicationRequirementsVersion = deserialize.integer(payload.application_requirements_version);
211
+ this.accountSid = payload.account_sid;
212
+ this.bundleSid = payload.bundle_sid;
213
+ this.reviewer = payload.reviewer;
214
+ this.zendeskTicketId = payload.zendesk_ticket_id;
98
215
  this.friendlyName = payload.friendly_name;
216
+ this.notificationEmails = payload.notification_emails;
99
217
  this.isoCountry = payload.iso_country;
100
218
  this.state = payload.state;
219
+ this.setup =
220
+ payload.setup !== null && payload.setup !== undefined
221
+ ? new CreateShortCodeApplicationResponseSetup(payload.setup)
222
+ : null;
223
+ this.businessInformation =
224
+ payload.business_information !== null &&
225
+ payload.business_information !== undefined
226
+ ? new CreateShortCodeApplicationResponseBusinessInformation(payload.business_information)
227
+ : null;
228
+ this.userSignUp =
229
+ payload.user_sign_up !== null && payload.user_sign_up !== undefined
230
+ ? new CreateShortCodeApplicationResponseUserSignUp(payload.user_sign_up)
231
+ : null;
232
+ this.complianceKeywords =
233
+ payload.compliance_keywords !== null &&
234
+ payload.compliance_keywords !== undefined
235
+ ? new CreateShortCodeApplicationResponseComplianceKeywords(payload.compliance_keywords)
236
+ : null;
237
+ this.contentExamples =
238
+ payload.content_examples !== null &&
239
+ payload.content_examples !== undefined
240
+ ? new CreateShortCodeApplicationResponseContentExamples(payload.content_examples)
241
+ : null;
242
+ this.smsCampaignDetails =
243
+ payload.sms_campaign_details !== null &&
244
+ payload.sms_campaign_details !== undefined
245
+ ? new CreateShortCodeApplicationResponseSmsCampaignDetails(payload.sms_campaign_details)
246
+ : null;
247
+ this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
248
+ this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
249
+ this.createdBy = payload.created_by;
250
+ this.updatedBy = payload.updated_by;
101
251
  this._solution = { sid: sid || this.sid };
102
252
  }
103
253
  get _proxy() {
@@ -134,11 +284,26 @@ class ApplicationInstance {
134
284
  toJSON() {
135
285
  return {
136
286
  sid: this.sid,
137
- bundleSid: this.bundleSid,
138
287
  applicationRequirementsSid: this.applicationRequirementsSid,
288
+ applicationRequirementsVersion: this.applicationRequirementsVersion,
289
+ accountSid: this.accountSid,
290
+ bundleSid: this.bundleSid,
291
+ reviewer: this.reviewer,
292
+ zendeskTicketId: this.zendeskTicketId,
139
293
  friendlyName: this.friendlyName,
294
+ notificationEmails: this.notificationEmails,
140
295
  isoCountry: this.isoCountry,
141
296
  state: this.state,
297
+ setup: this.setup,
298
+ businessInformation: this.businessInformation,
299
+ userSignUp: this.userSignUp,
300
+ complianceKeywords: this.complianceKeywords,
301
+ contentExamples: this.contentExamples,
302
+ smsCampaignDetails: this.smsCampaignDetails,
303
+ dateCreated: this.dateCreated,
304
+ dateUpdated: this.dateUpdated,
305
+ createdBy: this.createdBy,
306
+ updatedBy: this.updatedBy,
142
307
  };
143
308
  }
144
309
  [util_1.inspect.custom](_depth, options) {
@@ -211,6 +376,16 @@ function ApplicationListInstance(version) {
211
376
  params = params || {};
212
377
  }
213
378
  let data = {};
379
+ if (params["accountSid"] !== undefined)
380
+ data["AccountSid"] = params["accountSid"];
381
+ if (params["isoCountry"] !== undefined)
382
+ data["IsoCountry"] = params["isoCountry"];
383
+ if (params["status"] !== undefined)
384
+ data["Status"] = params["status"];
385
+ if (params["friendlyName"] !== undefined)
386
+ data["FriendlyName"] = params["friendlyName"];
387
+ if (params["sid"] !== undefined)
388
+ data["Sid"] = params["sid"];
214
389
  if (params["pageSize"] !== undefined)
215
390
  data["PageSize"] = params["pageSize"];
216
391
  if (params.pageNumber !== undefined)
@@ -249,6 +424,16 @@ function ApplicationListInstance(version) {
249
424
  params = params || {};
250
425
  }
251
426
  let data = {};
427
+ if (params["accountSid"] !== undefined)
428
+ data["AccountSid"] = params["accountSid"];
429
+ if (params["isoCountry"] !== undefined)
430
+ data["IsoCountry"] = params["isoCountry"];
431
+ if (params["status"] !== undefined)
432
+ data["Status"] = params["status"];
433
+ if (params["friendlyName"] !== undefined)
434
+ data["FriendlyName"] = params["friendlyName"];
435
+ if (params["sid"] !== undefined)
436
+ data["Sid"] = params["sid"];
252
437
  if (params["pageSize"] !== undefined)
253
438
  data["PageSize"] = params["pageSize"];
254
439
  if (params.pageNumber !== undefined)
@@ -16,6 +16,7 @@ export declare class PublicApiCreateRoleAssignmentRequest {
16
16
  * Twilio Sid representing identity of this assignment
17
17
  */
18
18
  "identity": string;
19
+ constructor(payload: any);
19
20
  }
20
21
  /**
21
22
  * Options to pass to create a RoleAssignmentInstance
@@ -24,6 +24,11 @@ const deserialize = require("../../../../base/deserialize");
24
24
  const serialize = require("../../../../base/serialize");
25
25
  const utility_1 = require("../../../../base/utility");
26
26
  class PublicApiCreateRoleAssignmentRequest {
27
+ constructor(payload) {
28
+ this.roleSid = payload["role_sid"];
29
+ this.scope = payload["scope"];
30
+ this.identity = payload["identity"];
31
+ }
27
32
  }
28
33
  exports.PublicApiCreateRoleAssignmentRequest = PublicApiCreateRoleAssignmentRequest;
29
34
  class RoleAssignmentContextImpl {
@@ -19,6 +19,7 @@ export declare class ScimEmailAddress {
19
19
  * The type of email address (e.g., work, home, etc.)
20
20
  */
21
21
  "type"?: string;
22
+ constructor(payload: any);
22
23
  }
23
24
  /**
24
25
  * Meta
@@ -40,6 +41,7 @@ export declare class ScimMeta {
40
41
  * A version identifier for the resource. This can be used to manage resource versioning and concurrency control.
41
42
  */
42
43
  "version"?: string;
44
+ constructor(payload: any);
43
45
  }
44
46
  /**
45
47
  * User\'s name
@@ -53,6 +55,21 @@ export declare class ScimName {
53
55
  * The user\'s last or family name
54
56
  */
55
57
  "familyName"?: string;
58
+ constructor(payload: any);
59
+ }
60
+ export declare class ScimPatchOperation {
61
+ /**
62
+ * The operation to perform
63
+ */
64
+ "op"?: string;
65
+ "path"?: string;
66
+ "value"?: Record<string, object>;
67
+ constructor(payload: any);
68
+ }
69
+ export declare class ScimPatchRequest {
70
+ "schemas"?: Array<string>;
71
+ "operations"?: Array<ScimPatchOperation>;
72
+ constructor(payload: any);
56
73
  }
57
74
  export declare class ScimUser {
58
75
  /**
@@ -113,6 +130,16 @@ export declare class ScimUser {
113
130
  * Link to Error Code References
114
131
  */
115
132
  "moreInfo"?: string;
133
+ constructor(payload: any);
134
+ }
135
+ /**
136
+ * Options to pass to patch a UserInstance
137
+ */
138
+ export interface UserContextPatchOptions {
139
+ /** */
140
+ scimPatchRequest: ScimPatchRequest;
141
+ /** */
142
+ ifMatch?: string;
116
143
  }
117
144
  /**
118
145
  * Options to pass to update a UserInstance
@@ -196,6 +223,26 @@ export interface UserContext {
196
223
  * @returns Resolves to processed UserInstance with HTTP metadata
197
224
  */
198
225
  fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<UserInstance>) => any): Promise<ApiResponse<UserInstance>>;
226
+ /**
227
+ * Patch a UserInstance
228
+ *
229
+ * @param params - Body for request
230
+ * @param headers - header params for request
231
+ * @param callback - Callback to handle processed record
232
+ *
233
+ * @returns Resolves to processed UserInstance
234
+ */
235
+ patch(params: ScimPatchRequest, headers?: any, callback?: (error: Error | null, item?: UserInstance) => any): Promise<UserInstance>;
236
+ /**
237
+ * Patch a UserInstance and return HTTP info
238
+ *
239
+ * @param params - Body for request
240
+ * @param headers - header params for request
241
+ * @param callback - Callback to handle processed record
242
+ *
243
+ * @returns Resolves to processed UserInstance with HTTP metadata
244
+ */
245
+ patchWithHttpInfo(params: ScimPatchRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse<UserInstance>) => any): Promise<ApiResponse<UserInstance>>;
199
246
  /**
200
247
  * Update a UserInstance
201
248
  *
@@ -235,6 +282,8 @@ export declare class UserContextImpl implements UserContext {
235
282
  removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<boolean>) => any): Promise<ApiResponse<boolean>>;
236
283
  fetch(callback?: (error: Error | null, item?: UserInstance) => any): Promise<UserInstance>;
237
284
  fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<UserInstance>) => any): Promise<ApiResponse<UserInstance>>;
285
+ patch(params: ScimPatchRequest, headers?: any, callback?: (error: Error | null, item?: UserInstance) => any): Promise<UserInstance>;
286
+ patchWithHttpInfo(params: ScimPatchRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse<UserInstance>) => any): Promise<ApiResponse<UserInstance>>;
238
287
  update(params: ScimUser, headers?: any, callback?: (error: Error | null, item?: UserInstance) => any): Promise<UserInstance>;
239
288
  updateWithHttpInfo(params: ScimUser, headers?: any, callback?: (error: Error | null, item?: ApiResponse<UserInstance>) => any): Promise<ApiResponse<UserInstance>>;
240
289
  /**
@@ -362,6 +411,26 @@ export declare class UserInstance {
362
411
  * @returns Resolves to processed UserInstance with HTTP metadata
363
412
  */
364
413
  fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<UserInstance>) => any): Promise<ApiResponse<UserInstance>>;
414
+ /**
415
+ * Patch a UserInstance
416
+ *
417
+ * @param params - Body for request
418
+ * @param headers - header params for request
419
+ * @param callback - Callback to handle processed record
420
+ *
421
+ * @returns Resolves to processed UserInstance
422
+ */
423
+ patch(params: ScimPatchRequest, headers?: any, callback?: (error: Error | null, item?: UserInstance) => any): Promise<UserInstance>;
424
+ /**
425
+ * Patch a UserInstance and return HTTP info
426
+ *
427
+ * @param params - Body for request
428
+ * @param headers - header params for request
429
+ * @param callback - Callback to handle processed record
430
+ *
431
+ * @returns Resolves to processed UserInstance with HTTP metadata
432
+ */
433
+ patchWithHttpInfo(params: ScimPatchRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse<UserInstance>) => any): Promise<ApiResponse<UserInstance>>;
365
434
  /**
366
435
  * Update a UserInstance
367
436
  *
@@ -16,7 +16,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  return (mod && mod.__esModule) ? mod : { "default": mod };
17
17
  };
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.UserPage = exports.UserInstance = exports.UserContextImpl = exports.ScimUser = exports.ScimName = exports.ScimMeta = exports.ScimEmailAddress = void 0;
19
+ exports.UserPage = exports.UserInstance = exports.UserContextImpl = exports.ScimUser = exports.ScimPatchRequest = exports.ScimPatchOperation = exports.ScimName = exports.ScimMeta = exports.ScimEmailAddress = void 0;
20
20
  exports.UserListInstance = UserListInstance;
21
21
  const util_1 = require("util");
22
22
  const Page_1 = __importDefault(require("../../../../base/Page"));
@@ -27,21 +27,69 @@ const utility_1 = require("../../../../base/utility");
27
27
  * Email address list of the user. Primary email must be defined if there are more than 1 email. Primary email must match the username.
28
28
  */
29
29
  class ScimEmailAddress {
30
+ constructor(payload) {
31
+ this.primary = payload["primary"];
32
+ this.value = payload["value"];
33
+ this.type = payload["type"];
34
+ }
30
35
  }
31
36
  exports.ScimEmailAddress = ScimEmailAddress;
32
37
  /**
33
38
  * Meta
34
39
  */
35
40
  class ScimMeta {
41
+ constructor(payload) {
42
+ this.resourceType = payload["resourceType"];
43
+ this.created = payload["created"];
44
+ this.lastModified = payload["lastModified"];
45
+ this.version = payload["version"];
46
+ }
36
47
  }
37
48
  exports.ScimMeta = ScimMeta;
38
49
  /**
39
50
  * User\'s name
40
51
  */
41
52
  class ScimName {
53
+ constructor(payload) {
54
+ this.givenName = payload["givenName"];
55
+ this.familyName = payload["familyName"];
56
+ }
42
57
  }
43
58
  exports.ScimName = ScimName;
59
+ class ScimPatchOperation {
60
+ constructor(payload) {
61
+ this.op = payload["op"];
62
+ this.path = payload["path"];
63
+ this.value = payload["value"];
64
+ }
65
+ }
66
+ exports.ScimPatchOperation = ScimPatchOperation;
67
+ class ScimPatchRequest {
68
+ constructor(payload) {
69
+ this.schemas = payload["schemas"];
70
+ this.operations = payload["Operations"];
71
+ }
72
+ }
73
+ exports.ScimPatchRequest = ScimPatchRequest;
44
74
  class ScimUser {
75
+ constructor(payload) {
76
+ this.id = payload["id"];
77
+ this.externalId = payload["externalId"];
78
+ this.userName = payload["userName"];
79
+ this.displayName = payload["displayName"];
80
+ this.name = payload["name"];
81
+ this.emails = payload["emails"];
82
+ this.active = payload["active"];
83
+ this.locale = payload["locale"];
84
+ this.timezone = payload["timezone"];
85
+ this.schemas = payload["schemas"];
86
+ this.meta = payload["meta"];
87
+ this.detail = payload["detail"];
88
+ this.scimType = payload["scimType"];
89
+ this.status = payload["status"];
90
+ this.code = payload["code"];
91
+ this.moreInfo = payload["moreInfo"];
92
+ }
45
93
  }
46
94
  exports.ScimUser = ScimUser;
47
95
  class UserContextImpl {
@@ -113,6 +161,56 @@ class UserContextImpl {
113
161
  operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
114
162
  return operationPromise;
115
163
  }
164
+ patch(params, headers, callback) {
165
+ if (params === null || params === undefined) {
166
+ throw new Error('Required parameter "params" missing.');
167
+ }
168
+ let data = {};
169
+ data = params;
170
+ if (headers === null || headers === undefined) {
171
+ headers = {};
172
+ }
173
+ headers["Content-Type"] = "application/json";
174
+ headers["Accept"] = "application/scim+json";
175
+ const instance = this;
176
+ let operationVersion = instance._version, operationPromise = operationVersion.patch({
177
+ uri: instance._uri,
178
+ method: "patch",
179
+ data,
180
+ headers,
181
+ });
182
+ operationPromise = operationPromise.then((payload) => new UserInstance(operationVersion, payload, instance._solution.organizationSid, instance._solution.id));
183
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
184
+ return operationPromise;
185
+ }
186
+ patchWithHttpInfo(params, headers, callback) {
187
+ if (params === null || params === undefined) {
188
+ throw new Error('Required parameter "params" missing.');
189
+ }
190
+ let data = {};
191
+ data = params;
192
+ if (headers === null || headers === undefined) {
193
+ headers = {};
194
+ }
195
+ headers["Content-Type"] = "application/json";
196
+ headers["Accept"] = "application/scim+json";
197
+ const instance = this;
198
+ let operationVersion = instance._version;
199
+ // CREATE, FETCH, UPDATE operations
200
+ let operationPromise = operationVersion
201
+ .patchWithResponseInfo({
202
+ uri: instance._uri,
203
+ method: "patch",
204
+ data,
205
+ headers,
206
+ })
207
+ .then((response) => ({
208
+ ...response,
209
+ body: new UserInstance(operationVersion, response.body, instance._solution.organizationSid, instance._solution.id),
210
+ }));
211
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
212
+ return operationPromise;
213
+ }
116
214
  update(params, headers, callback) {
117
215
  if (params === null || params === undefined) {
118
216
  throw new Error('Required parameter "params" missing.');
@@ -183,13 +281,22 @@ class UserInstance {
183
281
  this.externalId = payload.externalId;
184
282
  this.userName = payload.userName;
185
283
  this.displayName = payload.displayName;
186
- this.name = payload.name;
187
- this.emails = payload.emails;
284
+ this.name =
285
+ payload.name !== null && payload.name !== undefined
286
+ ? new ScimName(payload.name)
287
+ : null;
288
+ this.emails =
289
+ payload.emails !== null && payload.emails !== undefined
290
+ ? payload.emails.map((payload) => new ScimEmailAddress(payload))
291
+ : null;
188
292
  this.active = payload.active;
189
293
  this.locale = payload.locale;
190
294
  this.timezone = payload.timezone;
191
295
  this.schemas = payload.schemas;
192
- this.meta = payload.meta;
296
+ this.meta =
297
+ payload.meta !== null && payload.meta !== undefined
298
+ ? new ScimMeta(payload.meta)
299
+ : null;
193
300
  this.detail = payload.detail;
194
301
  this.scimType = payload.scimType;
195
302
  this.status = payload.status;
@@ -243,6 +350,12 @@ class UserInstance {
243
350
  fetchWithHttpInfo(callback) {
244
351
  return this._proxy.fetchWithHttpInfo(callback);
245
352
  }
353
+ patch(params, callback) {
354
+ return this._proxy.patch(params, callback);
355
+ }
356
+ patchWithHttpInfo(params, callback) {
357
+ return this._proxy.patchWithHttpInfo(params, callback);
358
+ }
246
359
  update(params, callback) {
247
360
  return this._proxy.update(params, callback);
248
361
  }
@@ -7,17 +7,20 @@ export declare class PricingV1MessagingMessagingCountryInstanceInboundSmsPrices
7
7
  "basePrice"?: number;
8
8
  "currentPrice"?: number;
9
9
  "numberType"?: string;
10
+ constructor(payload: any);
10
11
  }
11
12
  export declare class PricingV1MessagingMessagingCountryInstanceOutboundSmsPrices {
12
13
  "carrier"?: string;
13
14
  "mcc"?: string;
14
15
  "mnc"?: string;
15
16
  "prices"?: Array<PricingV1MessagingMessagingCountryInstanceOutboundSmsPricesPrices>;
17
+ constructor(payload: any);
16
18
  }
17
19
  export declare class PricingV1MessagingMessagingCountryInstanceOutboundSmsPricesPrices {
18
20
  "basePrice"?: number;
19
21
  "currentPrice"?: number;
20
22
  "numberType"?: string;
23
+ constructor(payload: any);
21
24
  }
22
25
  /**
23
26
  * Options to pass to each
@@ -24,12 +24,28 @@ const deserialize = require("../../../../base/deserialize");
24
24
  const serialize = require("../../../../base/serialize");
25
25
  const utility_1 = require("../../../../base/utility");
26
26
  class PricingV1MessagingMessagingCountryInstanceInboundSmsPrices {
27
+ constructor(payload) {
28
+ this.basePrice = payload["base_price"];
29
+ this.currentPrice = payload["current_price"];
30
+ this.numberType = payload["number_type"];
31
+ }
27
32
  }
28
33
  exports.PricingV1MessagingMessagingCountryInstanceInboundSmsPrices = PricingV1MessagingMessagingCountryInstanceInboundSmsPrices;
29
34
  class PricingV1MessagingMessagingCountryInstanceOutboundSmsPrices {
35
+ constructor(payload) {
36
+ this.carrier = payload["carrier"];
37
+ this.mcc = payload["mcc"];
38
+ this.mnc = payload["mnc"];
39
+ this.prices = payload["prices"];
40
+ }
30
41
  }
31
42
  exports.PricingV1MessagingMessagingCountryInstanceOutboundSmsPrices = PricingV1MessagingMessagingCountryInstanceOutboundSmsPrices;
32
43
  class PricingV1MessagingMessagingCountryInstanceOutboundSmsPricesPrices {
44
+ constructor(payload) {
45
+ this.basePrice = payload["base_price"];
46
+ this.currentPrice = payload["current_price"];
47
+ this.numberType = payload["number_type"];
48
+ }
33
49
  }
34
50
  exports.PricingV1MessagingMessagingCountryInstanceOutboundSmsPricesPrices = PricingV1MessagingMessagingCountryInstanceOutboundSmsPricesPrices;
35
51
  class CountryContextImpl {
@@ -91,8 +107,16 @@ class CountryInstance {
91
107
  this._version = _version;
92
108
  this.country = payload.country;
93
109
  this.isoCountry = payload.iso_country;
94
- this.outboundSmsPrices = payload.outbound_sms_prices;
95
- this.inboundSmsPrices = payload.inbound_sms_prices;
110
+ this.outboundSmsPrices =
111
+ payload.outbound_sms_prices !== null &&
112
+ payload.outbound_sms_prices !== undefined
113
+ ? payload.outbound_sms_prices.map((payload) => new PricingV1MessagingMessagingCountryInstanceOutboundSmsPrices(payload))
114
+ : null;
115
+ this.inboundSmsPrices =
116
+ payload.inbound_sms_prices !== null &&
117
+ payload.inbound_sms_prices !== undefined
118
+ ? payload.inbound_sms_prices.map((payload) => new PricingV1MessagingMessagingCountryInstanceInboundSmsPrices(payload))
119
+ : null;
96
120
  this.priceUnit = payload.price_unit;
97
121
  this.url = payload.url;
98
122
  this._solution = { isoCountry: isoCountry || this.isoCountry };
@@ -7,6 +7,7 @@ export declare class PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPr
7
7
  "basePrice"?: number;
8
8
  "currentPrice"?: number;
9
9
  "numberType"?: string;
10
+ constructor(payload: any);
10
11
  }
11
12
  /**
12
13
  * Options to pass to each
@@ -24,6 +24,11 @@ const deserialize = require("../../../../base/deserialize");
24
24
  const serialize = require("../../../../base/serialize");
25
25
  const utility_1 = require("../../../../base/utility");
26
26
  class PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPrices {
27
+ constructor(payload) {
28
+ this.basePrice = payload["base_price"];
29
+ this.currentPrice = payload["current_price"];
30
+ this.numberType = payload["number_type"];
31
+ }
27
32
  }
28
33
  exports.PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPrices = PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPrices;
29
34
  class CountryContextImpl {
@@ -85,7 +90,11 @@ class CountryInstance {
85
90
  this._version = _version;
86
91
  this.country = payload.country;
87
92
  this.isoCountry = payload.iso_country;
88
- this.phoneNumberPrices = payload.phone_number_prices;
93
+ this.phoneNumberPrices =
94
+ payload.phone_number_prices !== null &&
95
+ payload.phone_number_prices !== undefined
96
+ ? payload.phone_number_prices.map((payload) => new PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPrices(payload))
97
+ : null;
89
98
  this.priceUnit = payload.price_unit;
90
99
  this.url = payload.url;
91
100
  this._solution = { isoCountry: isoCountry || this.isoCountry };