twilio 6.0.0 → 6.0.2

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 (121) hide show
  1. package/lib/rest/ConversationsBase.d.ts +3 -0
  2. package/lib/rest/ConversationsBase.js +5 -0
  3. package/lib/rest/InsightsBase.d.ts +3 -0
  4. package/lib/rest/InsightsBase.js +5 -0
  5. package/lib/rest/IntelligenceBase.d.ts +3 -0
  6. package/lib/rest/IntelligenceBase.js +5 -0
  7. package/lib/rest/KnowledgeBase.d.ts +3 -0
  8. package/lib/rest/KnowledgeBase.js +5 -0
  9. package/lib/rest/Memory.d.ts +4 -0
  10. package/lib/rest/Memory.js +8 -0
  11. package/lib/rest/MemoryBase.d.ts +13 -0
  12. package/lib/rest/MemoryBase.js +31 -0
  13. package/lib/rest/Twilio.d.ts +5 -0
  14. package/lib/rest/Twilio.js +5 -0
  15. package/lib/rest/VoiceBase.d.ts +3 -0
  16. package/lib/rest/VoiceBase.js +5 -0
  17. package/lib/rest/api/v2010/account/call/recording.d.ts +2 -0
  18. package/lib/rest/api/v2010/account/call/recording.js +4 -0
  19. package/lib/rest/api/v2010/account/call/transcription.d.ts +1 -1
  20. package/lib/rest/api/v2010/account/call/transcription.js +6 -4
  21. package/lib/rest/api/v2010/account/call.d.ts +2 -0
  22. package/lib/rest/api/v2010/account/call.js +4 -0
  23. package/lib/rest/api/v2010/account/conference/participant.d.ts +2 -0
  24. package/lib/rest/api/v2010/account/conference/participant.js +4 -0
  25. package/lib/rest/conversations/V2.d.ts +38 -0
  26. package/lib/rest/conversations/V2.js +72 -0
  27. package/lib/rest/conversations/v2/action.d.ts +241 -0
  28. package/lib/rest/conversations/v2/action.js +246 -0
  29. package/lib/rest/conversations/v2/communication.d.ts +479 -0
  30. package/lib/rest/conversations/v2/communication.js +436 -0
  31. package/lib/rest/conversations/v2/configuration.d.ts +906 -0
  32. package/lib/rest/conversations/v2/configuration.js +619 -0
  33. package/lib/rest/conversations/v2/conversation.d.ts +936 -0
  34. package/lib/rest/conversations/v2/conversation.js +664 -0
  35. package/lib/rest/conversations/v2/operation.d.ts +167 -0
  36. package/lib/rest/conversations/v2/operation.js +170 -0
  37. package/lib/rest/conversations/v2/participant.d.ts +469 -0
  38. package/lib/rest/conversations/v2/participant.js +442 -0
  39. package/lib/rest/flexApi/v1/plugin/pluginVersions.d.ts +1 -1
  40. package/lib/rest/flexApi/v1/plugin/pluginVersions.js +8 -6
  41. package/lib/rest/insights/V3.d.ts +20 -0
  42. package/lib/rest/insights/V3.js +42 -0
  43. package/lib/rest/insights/v1/call/callSummary.d.ts +10 -10
  44. package/lib/rest/insights/v1/call/event.d.ts +4 -4
  45. package/lib/rest/insights/v1/callSummaries.d.ts +12 -9
  46. package/lib/rest/insights/v3/metadata.d.ts +115 -0
  47. package/lib/rest/insights/v3/metadata.js +118 -0
  48. package/lib/rest/insights/v3/query.d.ts +180 -0
  49. package/lib/rest/insights/v3/query.js +214 -0
  50. package/lib/rest/intelligence/V3.d.ts +35 -0
  51. package/lib/rest/intelligence/V3.js +65 -0
  52. package/lib/rest/intelligence/v3/configuration.d.ts +693 -0
  53. package/lib/rest/intelligence/v3/configuration.js +528 -0
  54. package/lib/rest/intelligence/v3/conversation.d.ts +478 -0
  55. package/lib/rest/intelligence/v3/conversation.js +342 -0
  56. package/lib/rest/intelligence/v3/operator.d.ts +619 -0
  57. package/lib/rest/intelligence/v3/operator.js +493 -0
  58. package/lib/rest/intelligence/v3/operatorResult.d.ts +543 -0
  59. package/lib/rest/intelligence/v3/operatorResult.js +478 -0
  60. package/lib/rest/intelligence/v3/version.d.ts +469 -0
  61. package/lib/rest/intelligence/v3/version.js +341 -0
  62. package/lib/rest/knowledge/V2.d.ts +31 -0
  63. package/lib/rest/knowledge/V2.js +62 -0
  64. package/lib/rest/knowledge/v2/chunk.d.ts +209 -0
  65. package/lib/rest/knowledge/v2/chunk.js +178 -0
  66. package/lib/rest/knowledge/v2/knowledge.d.ts +507 -0
  67. package/lib/rest/knowledge/v2/knowledge.js +466 -0
  68. package/lib/rest/knowledge/v2/knowledgeBasis.d.ts +484 -0
  69. package/lib/rest/knowledge/v2/knowledgeBasis.js +441 -0
  70. package/lib/rest/knowledge/v2/operation.d.ts +162 -0
  71. package/lib/rest/knowledge/v2/operation.js +175 -0
  72. package/lib/rest/knowledge/v2/search.d.ts +180 -0
  73. package/lib/rest/knowledge/v2/search.js +174 -0
  74. package/lib/rest/memory/V1.d.ts +76 -0
  75. package/lib/rest/memory/V1.js +140 -0
  76. package/lib/rest/memory/v1/bulk.d.ts +129 -0
  77. package/lib/rest/memory/v1/bulk.js +158 -0
  78. package/lib/rest/memory/v1/conversationSummary.d.ts +531 -0
  79. package/lib/rest/memory/v1/conversationSummary.js +473 -0
  80. package/lib/rest/memory/v1/dataMapping.d.ts +630 -0
  81. package/lib/rest/memory/v1/dataMapping.js +512 -0
  82. package/lib/rest/memory/v1/event.d.ts +153 -0
  83. package/lib/rest/memory/v1/event.js +159 -0
  84. package/lib/rest/memory/v1/identifier.d.ts +362 -0
  85. package/lib/rest/memory/v1/identifier.js +369 -0
  86. package/lib/rest/memory/v1/identityResolutionSetting.d.ts +247 -0
  87. package/lib/rest/memory/v1/identityResolutionSetting.js +229 -0
  88. package/lib/rest/memory/v1/import.d.ts +292 -0
  89. package/lib/rest/memory/v1/import.js +280 -0
  90. package/lib/rest/memory/v1/lookup.d.ts +82 -0
  91. package/lib/rest/memory/v1/lookup.js +118 -0
  92. package/lib/rest/memory/v1/observation.d.ts +521 -0
  93. package/lib/rest/memory/v1/observation.js +477 -0
  94. package/lib/rest/memory/v1/operation.d.ts +162 -0
  95. package/lib/rest/memory/v1/operation.js +175 -0
  96. package/lib/rest/memory/v1/profile.d.ts +548 -0
  97. package/lib/rest/memory/v1/profile.js +531 -0
  98. package/lib/rest/memory/v1/recall.d.ts +306 -0
  99. package/lib/rest/memory/v1/recall.js +234 -0
  100. package/lib/rest/memory/v1/revision.d.ts +246 -0
  101. package/lib/rest/memory/v1/revision.js +195 -0
  102. package/lib/rest/memory/v1/store.d.ts +544 -0
  103. package/lib/rest/memory/v1/store.js +534 -0
  104. package/lib/rest/memory/v1/trait.d.ts +233 -0
  105. package/lib/rest/memory/v1/trait.js +190 -0
  106. package/lib/rest/memory/v1/traitGroup.d.ts +758 -0
  107. package/lib/rest/memory/v1/traitGroup.js +555 -0
  108. package/lib/rest/messaging/v2/channelsSender.d.ts +8 -0
  109. package/lib/rest/messaging/v2/channelsSender.js +2 -0
  110. package/lib/rest/previewIam/versionless/organization/roleAssignment.d.ts +32 -0
  111. package/lib/rest/previewIam/versionless/organization/roleAssignment.js +14 -0
  112. package/lib/rest/studio/v2/flow.d.ts +4 -0
  113. package/lib/rest/studio/v2/flow.js +8 -0
  114. package/lib/rest/verify/v2/service/webhook.d.ts +2 -2
  115. package/lib/rest/verify/v2/service/webhook.js +8 -8
  116. package/lib/rest/voice/V3.d.ts +15 -0
  117. package/lib/rest/voice/V3.js +37 -0
  118. package/lib/rest/voice/v3/transcription.d.ts +378 -0
  119. package/lib/rest/voice/v3/transcription.js +264 -0
  120. package/lib/twiml/VoiceResponse.d.ts +8 -0
  121. package/package.json +1 -1
@@ -0,0 +1,241 @@
1
+ import { inspect, InspectOptions } from "util";
2
+ import V2 from "../V2";
3
+ import { ApiResponse } from "../../../base/ApiResponse";
4
+ /**
5
+ * Content for a SEND_MESSAGE action.
6
+ */
7
+ export declare class ConversationsV2SendMessageContent {
8
+ /**
9
+ * Plain text message body.
10
+ */
11
+ "text"?: string;
12
+ /**
13
+ * Content template ID (HX... format). When provided, the template is rendered with the variables map and sent to the recipient.
14
+ */
15
+ "contentId"?: string;
16
+ /**
17
+ * Variables to substitute into the content template.
18
+ */
19
+ "variables"?: {
20
+ [key: string]: string;
21
+ };
22
+ /**
23
+ * URLs of media attachments to include with the message.
24
+ */
25
+ "mediaUrls"?: Array<string>;
26
+ constructor(payload: any);
27
+ }
28
+ /**
29
+ * Identifies a participant for an Action. Supports three resolution modes: 1. participantId + channel: Resolves address from participant\'s registered addresses 2. participantId only: Resolves when participant has exactly one address 3. address + channel: Uses explicit address
30
+ */
31
+ export declare class ConversationsV2SendMessageParticipant {
32
+ /**
33
+ * Participant ID to resolve address from.
34
+ */
35
+ "participantId"?: string;
36
+ /**
37
+ * Explicit address formatted according to channel type.
38
+ */
39
+ "address"?: string;
40
+ /**
41
+ * Channel type for address resolution.
42
+ */
43
+ "channel"?: string;
44
+ constructor(payload: any);
45
+ }
46
+ export declare class ConversationsV2SendMessagePayload {
47
+ "from": ConversationsV2SendMessageParticipant;
48
+ /**
49
+ * The recipients of this action.
50
+ */
51
+ "to": Array<ConversationsV2SendMessageParticipant>;
52
+ "content": ConversationsV2SendMessageContent;
53
+ /**
54
+ * Channel-specific parameters forwarded as-is to the downstream sending service. Allows passing backend-specific fields without requiring API changes.
55
+ */
56
+ "channelSettings"?: {
57
+ [key: string]: any;
58
+ };
59
+ constructor(payload: any);
60
+ }
61
+ export declare class CreateConversationActionRequest {
62
+ /**
63
+ * Action type discriminator. Accepted values: SEND_MESSAGE.
64
+ */
65
+ "type": string;
66
+ "payload": ConversationsV2SendMessagePayload;
67
+ constructor(payload: any);
68
+ }
69
+ /**
70
+ * Options to pass to create a ActionInstance
71
+ */
72
+ export interface ActionListInstanceCreateOptions {
73
+ /** The action to perform. */
74
+ createConversationActionRequest: CreateConversationActionRequest;
75
+ }
76
+ export interface ActionContext {
77
+ /**
78
+ * Fetch a ActionInstance
79
+ *
80
+ * @param callback - Callback to handle processed record
81
+ *
82
+ * @returns Resolves to processed ActionInstance
83
+ */
84
+ fetch(callback?: (error: Error | null, item?: ActionInstance) => any): Promise<ActionInstance>;
85
+ /**
86
+ * Fetch a ActionInstance and return HTTP info
87
+ *
88
+ * @param callback - Callback to handle processed record
89
+ *
90
+ * @returns Resolves to processed ActionInstance with HTTP metadata
91
+ */
92
+ fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ActionInstance>) => any): Promise<ApiResponse<ActionInstance>>;
93
+ /**
94
+ * Provide a user-friendly representation
95
+ */
96
+ toJSON(): any;
97
+ [inspect.custom](_depth: any, options: InspectOptions): any;
98
+ }
99
+ export interface ActionContextSolution {
100
+ conversationId: string;
101
+ actionId: string;
102
+ }
103
+ export declare class ActionContextImpl implements ActionContext {
104
+ protected _version: V2;
105
+ protected _solution: ActionContextSolution;
106
+ protected _uri: string;
107
+ constructor(_version: V2, conversationId: string, actionId: string);
108
+ fetch(callback?: (error: Error | null, item?: ActionInstance) => any): Promise<ActionInstance>;
109
+ fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ActionInstance>) => any): Promise<ApiResponse<ActionInstance>>;
110
+ /**
111
+ * Provide a user-friendly representation
112
+ *
113
+ * @returns Object
114
+ */
115
+ toJSON(): ActionContextSolution;
116
+ [inspect.custom](_depth: any, options: InspectOptions): string;
117
+ }
118
+ interface ActionResource {
119
+ id: string;
120
+ type: string;
121
+ status: string;
122
+ conversationId: string;
123
+ related: {
124
+ [key: string]: string;
125
+ };
126
+ createdAt: Date;
127
+ updatedAt: Date;
128
+ completedAt: Date;
129
+ }
130
+ export declare class ActionInstance {
131
+ protected _version: V2;
132
+ protected _solution: ActionContextSolution;
133
+ protected _context?: ActionContext;
134
+ constructor(_version: V2, _payload: ActionResource, conversationId: string, actionId?: string);
135
+ /**
136
+ * Unique identifier for this Action.
137
+ */
138
+ id: string;
139
+ /**
140
+ * The type of action. Accepted values: SEND_MESSAGE.
141
+ */
142
+ type: string;
143
+ /**
144
+ * Current status of the Action. - PENDING: Action accepted, awaiting downstream confirmation - COMPLETED: Downstream backend confirmed the action - FAILED: Downstream backend reported a failure
145
+ */
146
+ status: string;
147
+ /**
148
+ * The conversation this action belongs to.
149
+ */
150
+ conversationId: string;
151
+ /**
152
+ * Named identifiers from downstream. For SEND_MESSAGE: - messageSid: The downstream message SID (present when PENDING or COMPLETED) - communicationId: The Communication ID (present when COMPLETED)
153
+ */
154
+ related: {
155
+ [key: string]: string;
156
+ };
157
+ /**
158
+ * Timestamp when the action was created.
159
+ */
160
+ createdAt: Date;
161
+ /**
162
+ * Timestamp when the action was last updated.
163
+ */
164
+ updatedAt: Date;
165
+ /**
166
+ * Timestamp when the action reached a terminal status.
167
+ */
168
+ completedAt: Date;
169
+ private get _proxy();
170
+ /**
171
+ * Fetch a ActionInstance
172
+ *
173
+ * @param callback - Callback to handle processed record
174
+ *
175
+ * @returns Resolves to processed ActionInstance
176
+ */
177
+ fetch(callback?: (error: Error | null, item?: ActionInstance) => any): Promise<ActionInstance>;
178
+ /**
179
+ * Fetch a ActionInstance and return HTTP info
180
+ *
181
+ * @param callback - Callback to handle processed record
182
+ *
183
+ * @returns Resolves to processed ActionInstance with HTTP metadata
184
+ */
185
+ fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<ActionInstance>) => any): Promise<ApiResponse<ActionInstance>>;
186
+ /**
187
+ * Provide a user-friendly representation
188
+ *
189
+ * @returns Object
190
+ */
191
+ toJSON(): {
192
+ id: string;
193
+ type: string;
194
+ status: string;
195
+ conversationId: string;
196
+ related: {
197
+ [key: string]: string;
198
+ };
199
+ createdAt: Date;
200
+ updatedAt: Date;
201
+ completedAt: Date;
202
+ };
203
+ [inspect.custom](_depth: any, options: InspectOptions): string;
204
+ }
205
+ export interface ActionSolution {
206
+ conversationId: string;
207
+ }
208
+ export interface ActionListInstance {
209
+ _version: V2;
210
+ _solution: ActionSolution;
211
+ _uri: string;
212
+ (actionId: string): ActionContext;
213
+ get(actionId: string): ActionContext;
214
+ /**
215
+ * Create a ActionInstance
216
+ *
217
+ * @param params - Body for request
218
+ * @param headers - header params for request
219
+ * @param callback - Callback to handle processed record
220
+ *
221
+ * @returns Resolves to processed ActionInstance
222
+ */
223
+ create(params: CreateConversationActionRequest, headers?: any, callback?: (error: Error | null, item?: ActionInstance) => any): Promise<ActionInstance>;
224
+ /**
225
+ * Create a ActionInstance and return HTTP info
226
+ *
227
+ * @param params - Body for request
228
+ * @param headers - header params for request
229
+ * @param callback - Callback to handle processed record
230
+ *
231
+ * @returns Resolves to processed ActionInstance with HTTP metadata
232
+ */
233
+ createWithHttpInfo(params: CreateConversationActionRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse<ActionInstance>) => any): Promise<ApiResponse<ActionInstance>>;
234
+ /**
235
+ * Provide a user-friendly representation
236
+ */
237
+ toJSON(): any;
238
+ [inspect.custom](_depth: any, options: InspectOptions): any;
239
+ }
240
+ export declare function ActionListInstance(version: V2, conversationId: string): ActionListInstance;
241
+ export {};
@@ -0,0 +1,246 @@
1
+ "use strict";
2
+ /*
3
+ * This code was generated by
4
+ * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
5
+ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
+ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
+ *
8
+ * Conversation Orchestrator
9
+ * Manage configurations, conversations, participants, and communications. Create configurations to define capture rules and channel settings, then use conversations to group related communications.
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.ActionInstance = exports.ActionContextImpl = exports.CreateConversationActionRequest = exports.ConversationsV2SendMessagePayload = exports.ConversationsV2SendMessageParticipant = exports.ConversationsV2SendMessageContent = void 0;
17
+ exports.ActionListInstance = ActionListInstance;
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
+ /**
23
+ * Content for a SEND_MESSAGE action.
24
+ */
25
+ class ConversationsV2SendMessageContent {
26
+ constructor(payload) {
27
+ this.text = payload["text"];
28
+ this.contentId = payload["contentId"];
29
+ this.variables = payload["variables"];
30
+ this.mediaUrls = payload["mediaUrls"];
31
+ }
32
+ }
33
+ exports.ConversationsV2SendMessageContent = ConversationsV2SendMessageContent;
34
+ /**
35
+ * Identifies a participant for an Action. Supports three resolution modes: 1. participantId + channel: Resolves address from participant\'s registered addresses 2. participantId only: Resolves when participant has exactly one address 3. address + channel: Uses explicit address
36
+ */
37
+ class ConversationsV2SendMessageParticipant {
38
+ constructor(payload) {
39
+ this.participantId = payload["participantId"];
40
+ this.address = payload["address"];
41
+ this.channel = payload["channel"];
42
+ }
43
+ }
44
+ exports.ConversationsV2SendMessageParticipant = ConversationsV2SendMessageParticipant;
45
+ class ConversationsV2SendMessagePayload {
46
+ constructor(payload) {
47
+ this.from = payload["from"];
48
+ this.to = payload["to"];
49
+ this.content = payload["content"];
50
+ this.channelSettings = payload["channelSettings"];
51
+ }
52
+ }
53
+ exports.ConversationsV2SendMessagePayload = ConversationsV2SendMessagePayload;
54
+ class CreateConversationActionRequest {
55
+ constructor(payload) {
56
+ this.type = payload["type"];
57
+ this.payload = payload["payload"];
58
+ }
59
+ }
60
+ exports.CreateConversationActionRequest = CreateConversationActionRequest;
61
+ class ActionContextImpl {
62
+ constructor(_version, conversationId, actionId) {
63
+ this._version = _version;
64
+ if (!(0, utility_1.isValidPathParam)(conversationId)) {
65
+ throw new Error("Parameter 'conversationId' is not valid.");
66
+ }
67
+ if (!(0, utility_1.isValidPathParam)(actionId)) {
68
+ throw new Error("Parameter 'actionId' is not valid.");
69
+ }
70
+ this._solution = { conversationId, actionId };
71
+ this._uri = `/Conversations/${conversationId}/Actions/${actionId}`;
72
+ }
73
+ fetch(callback) {
74
+ const headers = {};
75
+ headers["Accept"] = "application/json";
76
+ const instance = this;
77
+ let operationVersion = instance._version, operationPromise = operationVersion.fetch({
78
+ uri: instance._uri,
79
+ method: "get",
80
+ headers,
81
+ });
82
+ operationPromise = operationPromise.then((payload) => new ActionInstance(operationVersion, payload, instance._solution.conversationId, instance._solution.actionId));
83
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
84
+ return operationPromise;
85
+ }
86
+ fetchWithHttpInfo(callback) {
87
+ const headers = {};
88
+ headers["Accept"] = "application/json";
89
+ const instance = this;
90
+ let operationVersion = instance._version;
91
+ // CREATE, FETCH, UPDATE operations
92
+ let operationPromise = operationVersion
93
+ .fetchWithResponseInfo({
94
+ uri: instance._uri,
95
+ method: "get",
96
+ headers,
97
+ })
98
+ .then((response) => ({
99
+ ...response,
100
+ body: new ActionInstance(operationVersion, response.body, instance._solution.conversationId, instance._solution.actionId),
101
+ }));
102
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
103
+ return operationPromise;
104
+ }
105
+ /**
106
+ * Provide a user-friendly representation
107
+ *
108
+ * @returns Object
109
+ */
110
+ toJSON() {
111
+ return this._solution;
112
+ }
113
+ [util_1.inspect.custom](_depth, options) {
114
+ return (0, util_1.inspect)(this.toJSON(), options);
115
+ }
116
+ }
117
+ exports.ActionContextImpl = ActionContextImpl;
118
+ class ActionInstance {
119
+ constructor(_version, _payload, conversationId, actionId) {
120
+ this._version = _version;
121
+ const payload = _payload;
122
+ this.id = payload.id;
123
+ this.type = payload.type;
124
+ this.status = payload.status;
125
+ this.conversationId = payload.conversationId;
126
+ this.related = payload.related;
127
+ this.createdAt = deserialize.iso8601DateTime(payload.createdAt);
128
+ this.updatedAt = deserialize.iso8601DateTime(payload.updatedAt);
129
+ this.completedAt = deserialize.iso8601DateTime(payload.completedAt);
130
+ this._solution = { conversationId, actionId: actionId };
131
+ }
132
+ get _proxy() {
133
+ this._context =
134
+ this._context ||
135
+ new ActionContextImpl(this._version, this._solution.conversationId, this._solution.actionId);
136
+ return this._context;
137
+ }
138
+ /**
139
+ * Fetch a ActionInstance
140
+ *
141
+ * @param callback - Callback to handle processed record
142
+ *
143
+ * @returns Resolves to processed ActionInstance
144
+ */
145
+ fetch(callback) {
146
+ return this._proxy.fetch(callback);
147
+ }
148
+ /**
149
+ * Fetch a ActionInstance and return HTTP info
150
+ *
151
+ * @param callback - Callback to handle processed record
152
+ *
153
+ * @returns Resolves to processed ActionInstance with HTTP metadata
154
+ */
155
+ fetchWithHttpInfo(callback) {
156
+ return this._proxy.fetchWithHttpInfo(callback);
157
+ }
158
+ /**
159
+ * Provide a user-friendly representation
160
+ *
161
+ * @returns Object
162
+ */
163
+ toJSON() {
164
+ return {
165
+ id: this.id,
166
+ type: this.type,
167
+ status: this.status,
168
+ conversationId: this.conversationId,
169
+ related: this.related,
170
+ createdAt: this.createdAt,
171
+ updatedAt: this.updatedAt,
172
+ completedAt: this.completedAt,
173
+ };
174
+ }
175
+ [util_1.inspect.custom](_depth, options) {
176
+ return (0, util_1.inspect)(this.toJSON(), options);
177
+ }
178
+ }
179
+ exports.ActionInstance = ActionInstance;
180
+ function ActionListInstance(version, conversationId) {
181
+ if (!(0, utility_1.isValidPathParam)(conversationId)) {
182
+ throw new Error("Parameter 'conversationId' is not valid.");
183
+ }
184
+ const instance = ((actionId) => instance.get(actionId));
185
+ instance.get = function get(actionId) {
186
+ return new ActionContextImpl(version, conversationId, actionId);
187
+ };
188
+ instance._version = version;
189
+ instance._solution = { conversationId };
190
+ instance._uri = `/Conversations/${conversationId}/Actions`;
191
+ instance.create = function create(params, headers, callback) {
192
+ if (params === null || params === undefined) {
193
+ throw new Error('Required parameter "params" missing.');
194
+ }
195
+ let data = {};
196
+ data = params;
197
+ if (headers === null || headers === undefined) {
198
+ headers = {};
199
+ }
200
+ headers["Content-Type"] = "application/json";
201
+ headers["Accept"] = "application/json";
202
+ let operationVersion = version, operationPromise = operationVersion.create({
203
+ uri: instance._uri,
204
+ method: "post",
205
+ data,
206
+ headers,
207
+ });
208
+ operationPromise = operationPromise.then((payload) => new ActionInstance(operationVersion, payload, instance._solution.conversationId));
209
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
210
+ return operationPromise;
211
+ };
212
+ instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
213
+ if (params === null || params === undefined) {
214
+ throw new Error('Required parameter "params" missing.');
215
+ }
216
+ let data = {};
217
+ data = params;
218
+ if (headers === null || headers === undefined) {
219
+ headers = {};
220
+ }
221
+ headers["Content-Type"] = "application/json";
222
+ headers["Accept"] = "application/json";
223
+ let operationVersion = version;
224
+ // CREATE, FETCH, UPDATE operations
225
+ let operationPromise = operationVersion
226
+ .createWithResponseInfo({
227
+ uri: instance._uri,
228
+ method: "post",
229
+ data,
230
+ headers,
231
+ })
232
+ .then((response) => ({
233
+ ...response,
234
+ body: new ActionInstance(operationVersion, response.body, instance._solution.conversationId),
235
+ }));
236
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
237
+ return operationPromise;
238
+ };
239
+ instance.toJSON = function toJSON() {
240
+ return instance._solution;
241
+ };
242
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
243
+ return (0, util_1.inspect)(instance.toJSON(), options);
244
+ };
245
+ return instance;
246
+ }