twilio 5.12.2 → 5.13.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 (85) hide show
  1. package/README.md +1 -0
  2. package/lib/rest/api/v2010/account/call/payment.d.ts +6 -2
  3. package/lib/rest/api/v2010/account/call/payment.js +8 -0
  4. package/lib/rest/api/v2010/account/call/transcription.d.ts +4 -0
  5. package/lib/rest/api/v2010/account/call/transcription.js +8 -0
  6. package/lib/rest/api/v2010/account/token.d.ts +1 -0
  7. package/lib/rest/api/v2010/account/token.js +10 -1
  8. package/lib/rest/assistants/v1/assistant/feedback.d.ts +1 -0
  9. package/lib/rest/assistants/v1/assistant/feedback.js +6 -0
  10. package/lib/rest/assistants/v1/assistant/message.d.ts +1 -0
  11. package/lib/rest/assistants/v1/assistant/message.js +7 -0
  12. package/lib/rest/assistants/v1/assistant.d.ts +6 -0
  13. package/lib/rest/assistants/v1/assistant.js +58 -2
  14. package/lib/rest/assistants/v1/knowledge.d.ts +3 -0
  15. package/lib/rest/assistants/v1/knowledge.js +24 -0
  16. package/lib/rest/assistants/v1/tool.d.ts +4 -0
  17. package/lib/rest/assistants/v1/tool.js +40 -1
  18. package/lib/rest/content/v1/content/approvalCreate.d.ts +1 -0
  19. package/lib/rest/content/v1/content/approvalCreate.js +4 -0
  20. package/lib/rest/content/v1/content.d.ts +27 -0
  21. package/lib/rest/content/v1/content.js +171 -0
  22. package/lib/rest/flexApi/v1/createFlexInstance.d.ts +2 -0
  23. package/lib/rest/flexApi/v1/createFlexInstance.js +6 -0
  24. package/lib/rest/iam/v1/oAuthApp.d.ts +4 -0
  25. package/lib/rest/iam/v1/oAuthApp.js +28 -1
  26. package/lib/rest/intelligence/v2/operatorType.d.ts +6 -0
  27. package/lib/rest/intelligence/v2/operatorType.js +4 -0
  28. package/lib/rest/knowledge/v1/knowledge.d.ts +3 -0
  29. package/lib/rest/knowledge/v1/knowledge.js +23 -0
  30. package/lib/rest/lookups/v2/bucket.d.ts +1 -0
  31. package/lib/rest/lookups/v2/bucket.js +4 -0
  32. package/lib/rest/lookups/v2/lookupOverride.d.ts +1 -0
  33. package/lib/rest/lookups/v2/lookupOverride.js +4 -0
  34. package/lib/rest/lookups/v2/phoneNumber.d.ts +9 -0
  35. package/lib/rest/lookups/v2/phoneNumber.js +94 -8
  36. package/lib/rest/lookups/v2/query.d.ts +15 -0
  37. package/lib/rest/lookups/v2/query.js +113 -1
  38. package/lib/rest/lookups/v2/rateLimit.d.ts +1 -0
  39. package/lib/rest/lookups/v2/rateLimit.js +11 -1
  40. package/lib/rest/marketplace/v1/installedAddOn/installedAddOnUsage.d.ts +2 -0
  41. package/lib/rest/marketplace/v1/installedAddOn/installedAddOnUsage.js +13 -1
  42. package/lib/rest/marketplace/v1/referralConversion.d.ts +1 -0
  43. package/lib/rest/marketplace/v1/referralConversion.js +3 -0
  44. package/lib/rest/messaging/v1/service/usAppToPerson.d.ts +78 -5
  45. package/lib/rest/messaging/v1/service/usAppToPerson.js +60 -20
  46. package/lib/rest/messaging/v1/tollfreeVerification.d.ts +26 -24
  47. package/lib/rest/messaging/v2/channelsSender.d.ts +14 -0
  48. package/lib/rest/messaging/v2/channelsSender.js +114 -6
  49. package/lib/rest/numbers/v1/portingPortIn.d.ts +5 -0
  50. package/lib/rest/numbers/v1/portingPortIn.js +67 -2
  51. package/lib/rest/numbers/v2/application.d.ts +3 -0
  52. package/lib/rest/numbers/v2/application.js +12 -0
  53. package/lib/rest/previewIam/versionless/organization/roleAssignment.d.ts +1 -0
  54. package/lib/rest/previewIam/versionless/organization/roleAssignment.js +5 -0
  55. package/lib/rest/previewIam/versionless/organization/user.d.ts +4 -0
  56. package/lib/rest/previewIam/versionless/organization/user.js +45 -3
  57. package/lib/rest/pricing/v1/messaging/country.d.ts +3 -0
  58. package/lib/rest/pricing/v1/messaging/country.js +26 -2
  59. package/lib/rest/pricing/v1/phoneNumber/country.d.ts +1 -0
  60. package/lib/rest/pricing/v1/phoneNumber/country.js +10 -1
  61. package/lib/rest/pricing/v1/voice/country.d.ts +2 -0
  62. package/lib/rest/pricing/v1/voice/country.js +21 -2
  63. package/lib/rest/pricing/v1/voice/number.d.ts +2 -0
  64. package/lib/rest/pricing/v1/voice/number.js +19 -2
  65. package/lib/rest/pricing/v2/country.d.ts +2 -0
  66. package/lib/rest/pricing/v2/country.js +22 -2
  67. package/lib/rest/pricing/v2/number.d.ts +2 -0
  68. package/lib/rest/pricing/v2/number.js +22 -2
  69. package/lib/rest/pricing/v2/voice/country.d.ts +2 -0
  70. package/lib/rest/pricing/v2/voice/country.js +22 -2
  71. package/lib/rest/pricing/v2/voice/number.d.ts +2 -0
  72. package/lib/rest/pricing/v2/voice/number.js +20 -2
  73. package/lib/rest/verify/v2/service/approveChallenge.d.ts +2 -0
  74. package/lib/rest/verify/v2/service/approveChallenge.js +13 -0
  75. package/lib/rest/verify/v2/service/newChallenge.d.ts +1 -0
  76. package/lib/rest/verify/v2/service/newChallenge.js +4 -0
  77. package/lib/rest/verify/v2/service/newFactor.d.ts +3 -0
  78. package/lib/rest/verify/v2/service/newFactor.js +16 -0
  79. package/lib/rest/verify/v2/service/newVerifyFactor.d.ts +2 -0
  80. package/lib/rest/verify/v2/service/newVerifyFactor.js +12 -0
  81. package/lib/rest/video/v1/room/participant/subscribeRules.d.ts +1 -0
  82. package/lib/rest/video/v1/room/participant/subscribeRules.js +12 -1
  83. package/lib/rest/video/v1/room/recordingRules.d.ts +1 -0
  84. package/lib/rest/video/v1/room/recordingRules.js +11 -1
  85. package/package.json +4 -4
package/README.md CHANGED
@@ -383,3 +383,4 @@ npm run test:javascript -- -m .\*client.\*
383
383
  [npm-install-size-url]: https://packagephobia.com/result?p=twilio
384
384
  [npm-url]: https://npmjs.org/package/twilio
385
385
  [npm-version-image]: https://img.shields.io/npm/v/twilio.svg
386
+
@@ -6,9 +6,9 @@ import { ApiResponse } from "../../../../../base/ApiResponse";
6
6
  */
7
7
  export type PaymentBankAccountType = "consumer-checking" | "consumer-savings" | "commercial-checking";
8
8
  /**
9
- * The piece of payment information that you wish the caller to enter. Must be one of `payment-card-number`, `expiration-date`, `security-code`, `postal-code`, `bank-routing-number`, or `bank-account-number`.
9
+ * The piece of payment information that you wish the caller to enter. Must be one of `payment-card-number`, `expiration-date`, `security-code`, `postal-code`, `bank-routing-number`, `bank-account-number`, or their `-matcher` variants for input confirmation when `RequireMatchingInputs` is enabled.
10
10
  */
11
- export type PaymentCapture = "payment-card-number" | "expiration-date" | "security-code" | "postal-code" | "bank-routing-number" | "bank-account-number";
11
+ export type PaymentCapture = "payment-card-number" | "expiration-date" | "security-code" | "postal-code" | "bank-routing-number" | "bank-account-number" | "payment-card-number-matcher" | "expiration-date-matcher" | "security-code-matcher" | "postal-code-matcher";
12
12
  /**
13
13
  * Type of payment being captured. One of `credit-card` or `ach-debit`. The default value is `credit-card`.
14
14
  */
@@ -70,6 +70,10 @@ export interface PaymentListInstanceCreateOptions {
70
70
  tokenType?: PaymentTokenType;
71
71
  /** Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` */
72
72
  validCardTypes?: string;
73
+ /** A comma-separated list of payment information fields that require the caller to enter the same value twice for confirmation. Supported values are `payment-card-number`, `expiration-date`, `security-code`, and `postal-code`. */
74
+ requireMatchingInputs?: string;
75
+ /** Whether to prompt the caller to confirm their payment information before submitting to the payment gateway. If `true`, the caller will hear the last 4 digits of their card or account number and must press 1 to confirm or 2 to cancel. Default is `false`. */
76
+ confirmation?: string;
73
77
  }
74
78
  export interface PaymentContext {
75
79
  /**
@@ -219,6 +219,10 @@ function PaymentListInstance(version, accountSid, callSid) {
219
219
  data["TokenType"] = params["tokenType"];
220
220
  if (params["validCardTypes"] !== undefined)
221
221
  data["ValidCardTypes"] = params["validCardTypes"];
222
+ if (params["requireMatchingInputs"] !== undefined)
223
+ data["RequireMatchingInputs"] = params["requireMatchingInputs"];
224
+ if (params["confirmation"] !== undefined)
225
+ data["Confirmation"] = params["confirmation"];
222
226
  const headers = {};
223
227
  headers["Content-Type"] = "application/x-www-form-urlencoded";
224
228
  headers["Accept"] = "application/json";
@@ -275,6 +279,10 @@ function PaymentListInstance(version, accountSid, callSid) {
275
279
  data["TokenType"] = params["tokenType"];
276
280
  if (params["validCardTypes"] !== undefined)
277
281
  data["ValidCardTypes"] = params["validCardTypes"];
282
+ if (params["requireMatchingInputs"] !== undefined)
283
+ data["RequireMatchingInputs"] = params["requireMatchingInputs"];
284
+ if (params["confirmation"] !== undefined)
285
+ data["Confirmation"] = params["confirmation"];
278
286
  const headers = {};
279
287
  headers["Content-Type"] = "application/x-www-form-urlencoded";
280
288
  headers["Accept"] = "application/json";
@@ -49,6 +49,10 @@ export interface TranscriptionListInstanceCreateOptions {
49
49
  enableAutomaticPunctuation?: boolean;
50
50
  /** The SID or unique name of the [Intelligence Service](https://www.twilio.com/docs/conversational-intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators */
51
51
  intelligenceService?: string;
52
+ /** The ID of the Conversations Configuration for customizing conversation behavior in Intelligence Service */
53
+ conversationConfiguration?: string;
54
+ /** The ID of the Conversation for associating this Transcription with an existing Conversation in Intelligence Service */
55
+ conversationId?: string;
52
56
  /** Whether the callback includes raw provider data. */
53
57
  enableProviderData?: boolean;
54
58
  }
@@ -195,6 +195,10 @@ function TranscriptionListInstance(version, accountSid, callSid) {
195
195
  data["EnableAutomaticPunctuation"] = serialize.bool(params["enableAutomaticPunctuation"]);
196
196
  if (params["intelligenceService"] !== undefined)
197
197
  data["IntelligenceService"] = params["intelligenceService"];
198
+ if (params["conversationConfiguration"] !== undefined)
199
+ data["ConversationConfiguration"] = params["conversationConfiguration"];
200
+ if (params["conversationId"] !== undefined)
201
+ data["ConversationId"] = params["conversationId"];
198
202
  if (params["enableProviderData"] !== undefined)
199
203
  data["EnableProviderData"] = serialize.bool(params["enableProviderData"]);
200
204
  const headers = {};
@@ -247,6 +251,10 @@ function TranscriptionListInstance(version, accountSid, callSid) {
247
251
  data["EnableAutomaticPunctuation"] = serialize.bool(params["enableAutomaticPunctuation"]);
248
252
  if (params["intelligenceService"] !== undefined)
249
253
  data["IntelligenceService"] = params["intelligenceService"];
254
+ if (params["conversationConfiguration"] !== undefined)
255
+ data["ConversationConfiguration"] = params["conversationConfiguration"];
256
+ if (params["conversationId"] !== undefined)
257
+ data["ConversationId"] = params["conversationId"];
250
258
  if (params["enableProviderData"] !== undefined)
251
259
  data["EnableProviderData"] = serialize.bool(params["enableProviderData"]);
252
260
  const headers = {};
@@ -6,6 +6,7 @@ export declare class ApiV2010AccountTokenIceServers {
6
6
  "username"?: string;
7
7
  "url"?: string;
8
8
  "urls"?: string;
9
+ constructor(payload: any);
9
10
  }
10
11
  /**
11
12
  * Options to pass to create a TokenInstance
@@ -20,6 +20,12 @@ const deserialize = require("../../../../base/deserialize");
20
20
  const serialize = require("../../../../base/serialize");
21
21
  const utility_1 = require("../../../../base/utility");
22
22
  class ApiV2010AccountTokenIceServers {
23
+ constructor(payload) {
24
+ this.credential = payload["credential"];
25
+ this.username = payload["username"];
26
+ this.url = payload["url"];
27
+ this.urls = payload["urls"];
28
+ }
23
29
  }
24
30
  exports.ApiV2010AccountTokenIceServers = ApiV2010AccountTokenIceServers;
25
31
  function TokenListInstance(version, accountSid) {
@@ -98,7 +104,10 @@ class TokenInstance {
98
104
  this.accountSid = payload.account_sid;
99
105
  this.dateCreated = deserialize.rfc2822DateTime(payload.date_created);
100
106
  this.dateUpdated = deserialize.rfc2822DateTime(payload.date_updated);
101
- this.iceServers = payload.ice_servers;
107
+ this.iceServers =
108
+ payload.ice_servers !== null && payload.ice_servers !== undefined
109
+ ? payload.ice_servers.map((payload) => new ApiV2010AccountTokenIceServers(payload))
110
+ : null;
102
111
  this.password = payload.password;
103
112
  this.ttl = payload.ttl;
104
113
  this.username = payload.username;
@@ -20,6 +20,7 @@ export declare class AssistantsV1ServiceCreateFeedbackRequest {
20
20
  * The text to be given as feedback.
21
21
  */
22
22
  "text"?: string;
23
+ constructor(payload: any);
23
24
  }
24
25
  /**
25
26
  * Options to pass to create a FeedbackInstance
@@ -24,6 +24,12 @@ const deserialize = require("../../../../base/deserialize");
24
24
  const serialize = require("../../../../base/serialize");
25
25
  const utility_1 = require("../../../../base/utility");
26
26
  class AssistantsV1ServiceCreateFeedbackRequest {
27
+ constructor(payload) {
28
+ this.messageId = payload["message_id"];
29
+ this.score = payload["score"];
30
+ this.sessionId = payload["session_id"];
31
+ this.text = payload["text"];
32
+ }
27
33
  }
28
34
  exports.AssistantsV1ServiceCreateFeedbackRequest = AssistantsV1ServiceCreateFeedbackRequest;
29
35
  function FeedbackListInstance(version, id) {
@@ -22,6 +22,7 @@ export declare class AssistantsV1ServiceAssistantSendMessageRequest {
22
22
  * one of the modes \'chat\', \'email\' or \'voice\'
23
23
  */
24
24
  "mode"?: string;
25
+ constructor(payload: any);
25
26
  }
26
27
  /**
27
28
  * Options to pass to create a MessageInstance
@@ -20,6 +20,13 @@ const deserialize = require("../../../../base/deserialize");
20
20
  const serialize = require("../../../../base/serialize");
21
21
  const utility_1 = require("../../../../base/utility");
22
22
  class AssistantsV1ServiceAssistantSendMessageRequest {
23
+ constructor(payload) {
24
+ this.identity = payload["identity"];
25
+ this.sessionId = payload["session_id"];
26
+ this.body = payload["body"];
27
+ this.webhook = payload["webhook"];
28
+ this.mode = payload["mode"];
29
+ }
23
30
  }
24
31
  exports.AssistantsV1ServiceAssistantSendMessageRequest = AssistantsV1ServiceAssistantSendMessageRequest;
25
32
  function MessageListInstance(version, id) {
@@ -22,6 +22,7 @@ export declare class AssistantsV1ServiceCreateAssistantRequest {
22
22
  */
23
23
  "personalityPrompt"?: string;
24
24
  "segmentCredential"?: AssistantsV1ServiceSegmentCredential;
25
+ constructor(payload: any);
25
26
  }
26
27
  export declare class AssistantsV1ServiceCustomerAi {
27
28
  /**
@@ -32,6 +33,7 @@ export declare class AssistantsV1ServiceCustomerAi {
32
33
  * True if the personalization engine is enabled.
33
34
  */
34
35
  "personalizationEngineEnabled": boolean;
36
+ constructor(payload: any);
35
37
  }
36
38
  export declare class AssistantsV1ServiceKnowledge {
37
39
  /**
@@ -78,6 +80,7 @@ export declare class AssistantsV1ServiceKnowledge {
78
80
  * The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
79
81
  */
80
82
  "dateUpdated": Date;
83
+ constructor(payload: any);
81
84
  }
82
85
  export declare class AssistantsV1ServiceSegmentCredential {
83
86
  /**
@@ -92,6 +95,7 @@ export declare class AssistantsV1ServiceSegmentCredential {
92
95
  * The write key.
93
96
  */
94
97
  "writeKey"?: string;
98
+ constructor(payload: any);
95
99
  }
96
100
  export declare class AssistantsV1ServiceTool {
97
101
  /**
@@ -138,6 +142,7 @@ export declare class AssistantsV1ServiceTool {
138
142
  * The date and time in GMT when the Tool was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
139
143
  */
140
144
  "dateUpdated": Date;
145
+ constructor(payload: any);
141
146
  }
142
147
  export declare class AssistantsV1ServiceUpdateAssistantRequest {
143
148
  "customerAi"?: AssistantsV1ServiceCustomerAi;
@@ -154,6 +159,7 @@ export declare class AssistantsV1ServiceUpdateAssistantRequest {
154
159
  */
155
160
  "personalityPrompt"?: string;
156
161
  "segmentCredential"?: AssistantsV1ServiceSegmentCredential;
162
+ constructor(payload: any);
157
163
  }
158
164
  /**
159
165
  * Options to pass to update a AssistantInstance
@@ -28,21 +28,71 @@ const assistantsTool_1 = require("./assistant/assistantsTool");
28
28
  const feedback_1 = require("./assistant/feedback");
29
29
  const message_1 = require("./assistant/message");
30
30
  class AssistantsV1ServiceCreateAssistantRequest {
31
+ constructor(payload) {
32
+ this.customerAi = payload["customer_ai"];
33
+ this.name = payload["name"];
34
+ this.owner = payload["owner"];
35
+ this.personalityPrompt = payload["personality_prompt"];
36
+ this.segmentCredential = payload["segment_credential"];
37
+ }
31
38
  }
32
39
  exports.AssistantsV1ServiceCreateAssistantRequest = AssistantsV1ServiceCreateAssistantRequest;
33
40
  class AssistantsV1ServiceCustomerAi {
41
+ constructor(payload) {
42
+ this.perceptionEngineEnabled = payload["perception_engine_enabled"];
43
+ this.personalizationEngineEnabled =
44
+ payload["personalization_engine_enabled"];
45
+ }
34
46
  }
35
47
  exports.AssistantsV1ServiceCustomerAi = AssistantsV1ServiceCustomerAi;
36
48
  class AssistantsV1ServiceKnowledge {
49
+ constructor(payload) {
50
+ this.description = payload["description"];
51
+ this.id = payload["id"];
52
+ this.accountSid = payload["account_sid"];
53
+ this.knowledgeSourceDetails = payload["knowledge_source_details"];
54
+ this.name = payload["name"];
55
+ this.status = payload["status"];
56
+ this.type = payload["type"];
57
+ this.url = payload["url"];
58
+ this.embeddingModel = payload["embedding_model"];
59
+ this.dateCreated = payload["date_created"];
60
+ this.dateUpdated = payload["date_updated"];
61
+ }
37
62
  }
38
63
  exports.AssistantsV1ServiceKnowledge = AssistantsV1ServiceKnowledge;
39
64
  class AssistantsV1ServiceSegmentCredential {
65
+ constructor(payload) {
66
+ this.profileApiKey = payload["profile_api_key"];
67
+ this.spaceId = payload["space_id"];
68
+ this.writeKey = payload["write_key"];
69
+ }
40
70
  }
41
71
  exports.AssistantsV1ServiceSegmentCredential = AssistantsV1ServiceSegmentCredential;
42
72
  class AssistantsV1ServiceTool {
73
+ constructor(payload) {
74
+ this.accountSid = payload["account_sid"];
75
+ this.description = payload["description"];
76
+ this.enabled = payload["enabled"];
77
+ this.id = payload["id"];
78
+ this.meta = payload["meta"];
79
+ this.name = payload["name"];
80
+ this.requiresAuth = payload["requires_auth"];
81
+ this.type = payload["type"];
82
+ this.url = payload["url"];
83
+ this.dateCreated = payload["date_created"];
84
+ this.dateUpdated = payload["date_updated"];
85
+ }
43
86
  }
44
87
  exports.AssistantsV1ServiceTool = AssistantsV1ServiceTool;
45
88
  class AssistantsV1ServiceUpdateAssistantRequest {
89
+ constructor(payload) {
90
+ this.customerAi = payload["customer_ai"];
91
+ this.name = payload["name"];
92
+ this.owner = payload["owner"];
93
+ this.personalityPrompt = payload["personality_prompt"];
94
+ this.segmentCredential = payload["segment_credential"];
95
+ }
46
96
  }
47
97
  exports.AssistantsV1ServiceUpdateAssistantRequest = AssistantsV1ServiceUpdateAssistantRequest;
48
98
  class AssistantContextImpl {
@@ -217,8 +267,14 @@ class AssistantInstance {
217
267
  this.personalityPrompt = payload.personality_prompt;
218
268
  this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
219
269
  this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
220
- this.knowledge = payload.knowledge;
221
- this.tools = payload.tools;
270
+ this.knowledge =
271
+ payload.knowledge !== null && payload.knowledge !== undefined
272
+ ? payload.knowledge.map((payload) => new AssistantsV1ServiceKnowledge(payload))
273
+ : null;
274
+ this.tools =
275
+ payload.tools !== null && payload.tools !== undefined
276
+ ? payload.tools.map((payload) => new AssistantsV1ServiceTool(payload))
277
+ : null;
222
278
  this._solution = { id: id || this.id };
223
279
  }
224
280
  get _proxy() {
@@ -31,6 +31,7 @@ export declare class AssistantsV1ServiceCreateKnowledgeRequest {
31
31
  * The embedding model to be used for the knowledge source. It\'s required for \'Database\' type but disallowed for other types.
32
32
  */
33
33
  "embeddingModel"?: string;
34
+ constructor(payload: any);
34
35
  }
35
36
  export declare class AssistantsV1ServiceCreatePolicyRequest {
36
37
  /**
@@ -50,6 +51,7 @@ export declare class AssistantsV1ServiceCreatePolicyRequest {
50
51
  * The description of the policy.
51
52
  */
52
53
  "type"?: string;
54
+ constructor(payload: any);
53
55
  }
54
56
  export declare class AssistantsV1ServiceUpdateKnowledgeRequest {
55
57
  /**
@@ -73,6 +75,7 @@ export declare class AssistantsV1ServiceUpdateKnowledgeRequest {
73
75
  * The embedding model to be used for the knowledge source. It\'s only applicable to \'Database\' type.
74
76
  */
75
77
  "embeddingModel"?: string;
78
+ constructor(payload: any);
76
79
  }
77
80
  /**
78
81
  * Options to pass to update a KnowledgeInstance
@@ -26,12 +26,36 @@ const utility_1 = require("../../../base/utility");
26
26
  const chunk_1 = require("./knowledge/chunk");
27
27
  const knowledgeStatus_1 = require("./knowledge/knowledgeStatus");
28
28
  class AssistantsV1ServiceCreateKnowledgeRequest {
29
+ constructor(payload) {
30
+ this.assistantId = payload["assistant_id"];
31
+ this.description = payload["description"];
32
+ this.knowledgeSourceDetails = payload["knowledge_source_details"];
33
+ this.name = payload["name"];
34
+ this.policy = payload["policy"];
35
+ this.type = payload["type"];
36
+ this.embeddingModel = payload["embedding_model"];
37
+ }
29
38
  }
30
39
  exports.AssistantsV1ServiceCreateKnowledgeRequest = AssistantsV1ServiceCreateKnowledgeRequest;
31
40
  class AssistantsV1ServiceCreatePolicyRequest {
41
+ constructor(payload) {
42
+ this.description = payload["description"];
43
+ this.id = payload["id"];
44
+ this.name = payload["name"];
45
+ this.policyDetails = payload["policy_details"];
46
+ this.type = payload["type"];
47
+ }
32
48
  }
33
49
  exports.AssistantsV1ServiceCreatePolicyRequest = AssistantsV1ServiceCreatePolicyRequest;
34
50
  class AssistantsV1ServiceUpdateKnowledgeRequest {
51
+ constructor(payload) {
52
+ this.description = payload["description"];
53
+ this.knowledgeSourceDetails = payload["knowledge_source_details"];
54
+ this.name = payload["name"];
55
+ this.policy = payload["policy"];
56
+ this.type = payload["type"];
57
+ this.embeddingModel = payload["embedding_model"];
58
+ }
35
59
  }
36
60
  exports.AssistantsV1ServiceUpdateKnowledgeRequest = AssistantsV1ServiceUpdateKnowledgeRequest;
37
61
  class KnowledgeContextImpl {
@@ -21,6 +21,7 @@ export declare class AssistantsV1ServiceCreatePolicyRequest {
21
21
  * The description of the policy.
22
22
  */
23
23
  "type"?: string;
24
+ constructor(payload: any);
24
25
  }
25
26
  export declare class AssistantsV1ServiceCreateToolRequest {
26
27
  /**
@@ -48,6 +49,7 @@ export declare class AssistantsV1ServiceCreateToolRequest {
48
49
  * The description of the tool.
49
50
  */
50
51
  "type": string;
52
+ constructor(payload: any);
51
53
  }
52
54
  export declare class AssistantsV1ServicePolicy {
53
55
  /**
@@ -86,6 +88,7 @@ export declare class AssistantsV1ServicePolicy {
86
88
  * The date and time in GMT when the Policy was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
87
89
  */
88
90
  "dateUpdated"?: Date;
91
+ constructor(payload: any);
89
92
  }
90
93
  export declare class AssistantsV1ServiceUpdateToolRequest {
91
94
  /**
@@ -113,6 +116,7 @@ export declare class AssistantsV1ServiceUpdateToolRequest {
113
116
  * The type of the tool.
114
117
  */
115
118
  "type"?: string;
119
+ constructor(payload: any);
116
120
  }
117
121
  /**
118
122
  * Options to pass to update a ToolInstance
@@ -24,15 +24,51 @@ const deserialize = require("../../../base/deserialize");
24
24
  const serialize = require("../../../base/serialize");
25
25
  const utility_1 = require("../../../base/utility");
26
26
  class AssistantsV1ServiceCreatePolicyRequest {
27
+ constructor(payload) {
28
+ this.description = payload["description"];
29
+ this.id = payload["id"];
30
+ this.name = payload["name"];
31
+ this.policyDetails = payload["policy_details"];
32
+ this.type = payload["type"];
33
+ }
27
34
  }
28
35
  exports.AssistantsV1ServiceCreatePolicyRequest = AssistantsV1ServiceCreatePolicyRequest;
29
36
  class AssistantsV1ServiceCreateToolRequest {
37
+ constructor(payload) {
38
+ this.assistantId = payload["assistant_id"];
39
+ this.description = payload["description"];
40
+ this.enabled = payload["enabled"];
41
+ this.meta = payload["meta"];
42
+ this.name = payload["name"];
43
+ this.policy = payload["policy"];
44
+ this.type = payload["type"];
45
+ }
30
46
  }
31
47
  exports.AssistantsV1ServiceCreateToolRequest = AssistantsV1ServiceCreateToolRequest;
32
48
  class AssistantsV1ServicePolicy {
49
+ constructor(payload) {
50
+ this.id = payload["id"];
51
+ this.name = payload["name"];
52
+ this.description = payload["description"];
53
+ this.accountSid = payload["account_sid"];
54
+ this.userSid = payload["user_sid"];
55
+ this.type = payload["type"];
56
+ this.policyDetails = payload["policy_details"];
57
+ this.dateCreated = payload["date_created"];
58
+ this.dateUpdated = payload["date_updated"];
59
+ }
33
60
  }
34
61
  exports.AssistantsV1ServicePolicy = AssistantsV1ServicePolicy;
35
62
  class AssistantsV1ServiceUpdateToolRequest {
63
+ constructor(payload) {
64
+ this.assistantId = payload["assistant_id"];
65
+ this.description = payload["description"];
66
+ this.enabled = payload["enabled"];
67
+ this.meta = payload["meta"];
68
+ this.name = payload["name"];
69
+ this.policy = payload["policy"];
70
+ this.type = payload["type"];
71
+ }
36
72
  }
37
73
  exports.AssistantsV1ServiceUpdateToolRequest = AssistantsV1ServiceUpdateToolRequest;
38
74
  class ToolContextImpl {
@@ -186,7 +222,10 @@ class ToolInstance {
186
222
  this.url = payload.url;
187
223
  this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
188
224
  this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
189
- this.policies = payload.policies;
225
+ this.policies =
226
+ payload.policies !== null && payload.policies !== undefined
227
+ ? payload.policies.map((payload) => new AssistantsV1ServicePolicy(payload))
228
+ : null;
190
229
  this._solution = { id: id || this.id };
191
230
  }
192
231
  get _proxy() {
@@ -13,6 +13,7 @@ export declare class ContentApprovalRequest {
13
13
  * A WhatsApp recognized template category.
14
14
  */
15
15
  "category": string;
16
+ constructor(payload: any);
16
17
  }
17
18
  /**
18
19
  * Options to pass to create a ApprovalCreateInstance
@@ -23,6 +23,10 @@ const utility_1 = require("../../../../base/utility");
23
23
  * Content approval request body
24
24
  */
25
25
  class ContentApprovalRequest {
26
+ constructor(payload) {
27
+ this.name = payload["name"];
28
+ this.category = payload["category"];
29
+ }
26
30
  }
27
31
  exports.ContentApprovalRequest = ContentApprovalRequest;
28
32
  function ApprovalCreateListInstance(version, contentSid) {