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,306 @@
1
+ import { inspect, InspectOptions } from "util";
2
+ import V1 from "../V1";
3
+ import { ApiResponse } from "../../../base/ApiResponse";
4
+ /**
5
+ * A single communication within a conversation across channels including SMS, Voice, Email, etc. Contains fields that are relevant to an agent to maintain session memory.
6
+ */
7
+ export declare class Communication {
8
+ /**
9
+ * Unique communication identifier.
10
+ */
11
+ "id": string;
12
+ /**
13
+ * Channel-specific ID (optional).
14
+ */
15
+ "channelId"?: string;
16
+ "content": CommunicationContent;
17
+ /**
18
+ * When communication was created.
19
+ */
20
+ "createdAt"?: Date;
21
+ /**
22
+ * When communication was last updated.
23
+ */
24
+ "updatedAt"?: Date;
25
+ "author": Participant;
26
+ /**
27
+ * Communication recipients
28
+ */
29
+ "recipients": Array<CommunicationRecipients>;
30
+ constructor(payload: any);
31
+ }
32
+ /**
33
+ * Content of a communication.
34
+ */
35
+ export declare class CommunicationContent {
36
+ /**
37
+ * Primary text content (optional).
38
+ */
39
+ "text"?: string;
40
+ constructor(payload: any);
41
+ }
42
+ export declare class CommunicationRecipients {
43
+ /**
44
+ * Participant identifier.
45
+ */
46
+ "id": string;
47
+ /**
48
+ * Participant display name
49
+ */
50
+ "name": string;
51
+ "type"?: ParticipantType;
52
+ /**
53
+ * The canonical profile ID.
54
+ */
55
+ "profileId"?: string;
56
+ /**
57
+ * Address of the Participant (e.g., phone number, email address)
58
+ */
59
+ "address": string;
60
+ /**
61
+ * The channel on which the message originated
62
+ */
63
+ "channel": string;
64
+ /**
65
+ * Delivery status of the Communication to this recipient
66
+ */
67
+ "deliveryStatus"?: string;
68
+ constructor(payload: any);
69
+ }
70
+ /**
71
+ * Request payload for retrieving profile memories with advanced filtering and semantic search.
72
+ */
73
+ export declare class MemoryRetrievalRequest {
74
+ /**
75
+ * A unique identifier for the conversation using Twilio Type ID (TTID) format.
76
+ */
77
+ "conversationId"?: string;
78
+ /**
79
+ * Hybrid search query for finding relevant memories. Omit to use query expansion to generate query from previous 10 communications in conversation.
80
+ */
81
+ "query"?: string;
82
+ /**
83
+ * Start date for filtering memories (inclusive).
84
+ */
85
+ "beginDate"?: Date;
86
+ /**
87
+ * End date for filtering memories (exclusive).
88
+ */
89
+ "endDate"?: Date;
90
+ /**
91
+ * Maximum number of conversational session memories to return. If omitted or set to 0, no session memories will be fetched.
92
+ */
93
+ "communicationsLimit"?: number;
94
+ /**
95
+ * Maximum number of observation memories to return. If omitted, defaults to 20. If set to 0, no observation memories will be fetched.
96
+ */
97
+ "observationsLimit"?: number;
98
+ /**
99
+ * Maximum number of summary memories to return. If omitted, defaults to 5. If set to 0, no summary memories will be fetched.
100
+ */
101
+ "summariesLimit"?: number;
102
+ /**
103
+ * Minimum relevance score threshold for observations and summaries to be returned. Only memories with a relevance score greater than or equal to this threshold will be included in the response. This threshold only applies when results are ranked by relevance. When results are returned in most-recent order, this field has no effect.
104
+ */
105
+ "relevanceThreshold"?: number;
106
+ constructor(payload: any);
107
+ }
108
+ /**
109
+ * Metadata about the retrieval operation.
110
+ */
111
+ export declare class MemoryRetrievalResponseMeta {
112
+ /**
113
+ * Query execution time in milliseconds.
114
+ */
115
+ "queryTime": number;
116
+ constructor(payload: any);
117
+ }
118
+ export declare class Participant {
119
+ /**
120
+ * Participant identifier.
121
+ */
122
+ "id": string;
123
+ /**
124
+ * Participant display name
125
+ */
126
+ "name": string;
127
+ "type"?: ParticipantType;
128
+ /**
129
+ * The canonical profile ID.
130
+ */
131
+ "profileId"?: string;
132
+ /**
133
+ * Address of the Participant (e.g., phone number, email address)
134
+ */
135
+ "address": string;
136
+ /**
137
+ * The channel on which the message originated
138
+ */
139
+ "channel": string;
140
+ constructor(payload: any);
141
+ }
142
+ /**
143
+ * Type of Participant in the Conversation
144
+ */
145
+ export type ParticipantType = "HUMAN_AGENT" | "CUSTOMER" | "AI_AGENT" | "AGENT" | "UNKNOWN";
146
+ /**
147
+ * A transient and mutable observation memory associated with a profile.
148
+ */
149
+ export declare class RecallObservationInfo {
150
+ /**
151
+ * The main content of the observation.
152
+ */
153
+ "content": string;
154
+ /**
155
+ * The timestamp when the observation originally occurred.
156
+ */
157
+ "occurredAt": Date;
158
+ /**
159
+ * The source system that generated this observation. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters.
160
+ */
161
+ "source": string;
162
+ /**
163
+ * Array of conversation IDs associated with this observation.
164
+ */
165
+ "conversationIds"?: Array<string>;
166
+ /**
167
+ * A unique identifier for the observation using Twilio Type ID (TTID) format.
168
+ */
169
+ "id": string;
170
+ /**
171
+ * The timestamp when the observation was created.
172
+ */
173
+ "createdAt": Date;
174
+ /**
175
+ * The timestamp when the observation was last updated.
176
+ */
177
+ "updatedAt": Date;
178
+ /**
179
+ * The relevance score of the observation in relation to the query. Higher values indicate greater relevance. This field is omitted when results are returned in most-recent order. This may occur when no query is provided and one cannot be inferred from the conversation context, or when the system defaults to chronological retrieval to ensure high availability.
180
+ */
181
+ "score"?: number;
182
+ constructor(payload: any);
183
+ }
184
+ /**
185
+ * A summary memory derived from conversations.
186
+ */
187
+ export declare class RecallSummaryInfo {
188
+ /**
189
+ * The source system that generated the summary. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters.
190
+ */
191
+ "source"?: string;
192
+ /**
193
+ * The main content of the summary.
194
+ */
195
+ "content": string;
196
+ /**
197
+ * The timestamp when the summary was originally created.
198
+ */
199
+ "occurredAt": Date;
200
+ /**
201
+ * A unique identifier for the conversation using Twilio Type ID (TTID) format.
202
+ */
203
+ "conversationId": string;
204
+ /**
205
+ * A unique identifier for the summary using Twilio Type ID (TTID) format.
206
+ */
207
+ "id": string;
208
+ /**
209
+ * The timestamp when the summary was created.
210
+ */
211
+ "createdAt": Date;
212
+ /**
213
+ * The timestamp when the summary was last updated.
214
+ */
215
+ "updatedAt": Date;
216
+ /**
217
+ * The relevance score of the summary in relation to the query. Higher values indicate greater relevance. This field is omitted when results are returned in most-recent order. This may occur when no query is provided and one cannot be inferred from the conversation context, or when the system defaults to chronological retrieval to ensure high availability.
218
+ */
219
+ "score"?: number;
220
+ constructor(payload: any);
221
+ }
222
+ /**
223
+ * Options to pass to create a RecallInstance
224
+ */
225
+ export interface RecallListInstanceCreateOptions {
226
+ /** */
227
+ memoryRetrievalRequest: MemoryRetrievalRequest;
228
+ /** Compression algorithms supported by the client (e.g., gzip, deflate, br) */
229
+ acceptEncoding?: string;
230
+ /** Compression algorithm used for the request body (e.g., gzip, deflate, br) */
231
+ contentEncoding?: "gzip" | "deflate" | "br" | "compress";
232
+ }
233
+ export interface RecallSolution {
234
+ storeId: string;
235
+ profileId: string;
236
+ }
237
+ export interface RecallListInstance {
238
+ _version: V1;
239
+ _solution: RecallSolution;
240
+ _uri: string;
241
+ /**
242
+ * Create a RecallInstance
243
+ *
244
+ * @param params - Body for request
245
+ * @param headers - header params for request
246
+ * @param callback - Callback to handle processed record
247
+ *
248
+ * @returns Resolves to processed RecallInstance
249
+ */
250
+ create(params: MemoryRetrievalRequest, headers?: any, callback?: (error: Error | null, item?: RecallInstance) => any): Promise<RecallInstance>;
251
+ /**
252
+ * Create a RecallInstance and return HTTP info
253
+ *
254
+ * @param params - Body for request
255
+ * @param headers - header params for request
256
+ * @param callback - Callback to handle processed record
257
+ *
258
+ * @returns Resolves to processed RecallInstance with HTTP metadata
259
+ */
260
+ createWithHttpInfo(params: MemoryRetrievalRequest, headers?: any, callback?: (error: Error | null, item?: ApiResponse<RecallInstance>) => any): Promise<ApiResponse<RecallInstance>>;
261
+ /**
262
+ * Provide a user-friendly representation
263
+ */
264
+ toJSON(): any;
265
+ [inspect.custom](_depth: any, options: InspectOptions): any;
266
+ }
267
+ export declare function RecallListInstance(version: V1, storeId: string, profileId: string): RecallListInstance;
268
+ interface RecallResource {
269
+ observations: Array<RecallObservationInfo>;
270
+ summaries: Array<RecallSummaryInfo>;
271
+ communications: Array<Communication>;
272
+ meta: MemoryRetrievalResponseMeta;
273
+ }
274
+ /**
275
+ * Response containing retrieved profile memories organized by type.
276
+ */
277
+ export declare class RecallInstance {
278
+ protected _version: V1;
279
+ constructor(_version: V1, _payload: RecallResource, storeId: string, profileId: string);
280
+ /**
281
+ * Array of observation memories.
282
+ */
283
+ observations: Array<RecallObservationInfo>;
284
+ /**
285
+ * Array of summary memories derived from observations at the end of conversations.
286
+ */
287
+ summaries: Array<RecallSummaryInfo>;
288
+ /**
289
+ * Array of recent communication context.
290
+ */
291
+ communications: Array<Communication>;
292
+ meta: MemoryRetrievalResponseMeta;
293
+ /**
294
+ * Provide a user-friendly representation
295
+ *
296
+ * @returns Object
297
+ */
298
+ toJSON(): {
299
+ observations: RecallObservationInfo[];
300
+ summaries: RecallSummaryInfo[];
301
+ communications: Communication[];
302
+ meta: MemoryRetrievalResponseMeta;
303
+ };
304
+ [inspect.custom](_depth: any, options: InspectOptions): string;
305
+ }
306
+ export {};
@@ -0,0 +1,234 @@
1
+ "use strict";
2
+ /*
3
+ * This code was generated by
4
+ * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
5
+ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
+ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
+ *
8
+ * Twilio Memory API
9
+ * APIs for managing memory stores, profiles, events, and conversational intelligence capabilities.
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.RecallInstance = exports.RecallSummaryInfo = exports.RecallObservationInfo = exports.Participant = exports.MemoryRetrievalResponseMeta = exports.MemoryRetrievalRequest = exports.CommunicationRecipients = exports.CommunicationContent = exports.Communication = void 0;
17
+ exports.RecallListInstance = RecallListInstance;
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
+ * A single communication within a conversation across channels including SMS, Voice, Email, etc. Contains fields that are relevant to an agent to maintain session memory.
24
+ */
25
+ class Communication {
26
+ constructor(payload) {
27
+ this.id = payload["id"];
28
+ this.channelId = payload["channelId"];
29
+ this.content = payload["content"];
30
+ this.createdAt = payload["createdAt"];
31
+ this.updatedAt = payload["updatedAt"];
32
+ this.author = payload["author"];
33
+ this.recipients = payload["recipients"];
34
+ }
35
+ }
36
+ exports.Communication = Communication;
37
+ /**
38
+ * Content of a communication.
39
+ */
40
+ class CommunicationContent {
41
+ constructor(payload) {
42
+ this.text = payload["text"];
43
+ }
44
+ }
45
+ exports.CommunicationContent = CommunicationContent;
46
+ class CommunicationRecipients {
47
+ constructor(payload) {
48
+ this.id = payload["id"];
49
+ this.name = payload["name"];
50
+ this.type = payload["type"];
51
+ this.profileId = payload["profileId"];
52
+ this.address = payload["address"];
53
+ this.channel = payload["channel"];
54
+ this.deliveryStatus = payload["deliveryStatus"];
55
+ }
56
+ }
57
+ exports.CommunicationRecipients = CommunicationRecipients;
58
+ /**
59
+ * Request payload for retrieving profile memories with advanced filtering and semantic search.
60
+ */
61
+ class MemoryRetrievalRequest {
62
+ constructor(payload) {
63
+ this.conversationId = payload["conversationId"];
64
+ this.query = payload["query"];
65
+ this.beginDate = payload["beginDate"];
66
+ this.endDate = payload["endDate"];
67
+ this.communicationsLimit = payload["communicationsLimit"];
68
+ this.observationsLimit = payload["observationsLimit"];
69
+ this.summariesLimit = payload["summariesLimit"];
70
+ this.relevanceThreshold = payload["relevanceThreshold"];
71
+ }
72
+ }
73
+ exports.MemoryRetrievalRequest = MemoryRetrievalRequest;
74
+ /**
75
+ * Metadata about the retrieval operation.
76
+ */
77
+ class MemoryRetrievalResponseMeta {
78
+ constructor(payload) {
79
+ this.queryTime = payload["queryTime"];
80
+ }
81
+ }
82
+ exports.MemoryRetrievalResponseMeta = MemoryRetrievalResponseMeta;
83
+ class Participant {
84
+ constructor(payload) {
85
+ this.id = payload["id"];
86
+ this.name = payload["name"];
87
+ this.type = payload["type"];
88
+ this.profileId = payload["profileId"];
89
+ this.address = payload["address"];
90
+ this.channel = payload["channel"];
91
+ }
92
+ }
93
+ exports.Participant = Participant;
94
+ /**
95
+ * A transient and mutable observation memory associated with a profile.
96
+ */
97
+ class RecallObservationInfo {
98
+ constructor(payload) {
99
+ this.content = payload["content"];
100
+ this.occurredAt = payload["occurredAt"];
101
+ this.source = payload["source"];
102
+ this.conversationIds = payload["conversationIds"];
103
+ this.id = payload["id"];
104
+ this.createdAt = payload["createdAt"];
105
+ this.updatedAt = payload["updatedAt"];
106
+ this.score = payload["score"];
107
+ }
108
+ }
109
+ exports.RecallObservationInfo = RecallObservationInfo;
110
+ /**
111
+ * A summary memory derived from conversations.
112
+ */
113
+ class RecallSummaryInfo {
114
+ constructor(payload) {
115
+ this.source = payload["source"];
116
+ this.content = payload["content"];
117
+ this.occurredAt = payload["occurredAt"];
118
+ this.conversationId = payload["conversationId"];
119
+ this.id = payload["id"];
120
+ this.createdAt = payload["createdAt"];
121
+ this.updatedAt = payload["updatedAt"];
122
+ this.score = payload["score"];
123
+ }
124
+ }
125
+ exports.RecallSummaryInfo = RecallSummaryInfo;
126
+ function RecallListInstance(version, storeId, profileId) {
127
+ if (!(0, utility_1.isValidPathParam)(storeId)) {
128
+ throw new Error("Parameter 'storeId' is not valid.");
129
+ }
130
+ if (!(0, utility_1.isValidPathParam)(profileId)) {
131
+ throw new Error("Parameter 'profileId' is not valid.");
132
+ }
133
+ const instance = {};
134
+ instance._version = version;
135
+ instance._solution = { storeId, profileId };
136
+ instance._uri = `/Stores/${storeId}/Profiles/${profileId}/Recall`;
137
+ instance.create = function create(params, headers, callback) {
138
+ if (params === null || params === undefined) {
139
+ throw new Error('Required parameter "params" missing.');
140
+ }
141
+ let data = {};
142
+ data = params;
143
+ if (headers === null || headers === undefined) {
144
+ headers = {};
145
+ }
146
+ headers["Content-Type"] = "application/json";
147
+ headers["Accept"] = "application/json";
148
+ let operationVersion = version, operationPromise = operationVersion.create({
149
+ uri: instance._uri,
150
+ method: "post",
151
+ data,
152
+ headers,
153
+ });
154
+ operationPromise = operationPromise.then((payload) => new RecallInstance(operationVersion, payload, instance._solution.storeId, instance._solution.profileId));
155
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
156
+ return operationPromise;
157
+ };
158
+ instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
159
+ if (params === null || params === undefined) {
160
+ throw new Error('Required parameter "params" missing.');
161
+ }
162
+ let data = {};
163
+ data = params;
164
+ if (headers === null || headers === undefined) {
165
+ headers = {};
166
+ }
167
+ headers["Content-Type"] = "application/json";
168
+ headers["Accept"] = "application/json";
169
+ let operationVersion = version;
170
+ // CREATE, FETCH, UPDATE operations
171
+ let operationPromise = operationVersion
172
+ .createWithResponseInfo({
173
+ uri: instance._uri,
174
+ method: "post",
175
+ data,
176
+ headers,
177
+ })
178
+ .then((response) => ({
179
+ ...response,
180
+ body: new RecallInstance(operationVersion, response.body, instance._solution.storeId, instance._solution.profileId),
181
+ }));
182
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
183
+ return operationPromise;
184
+ };
185
+ instance.toJSON = function toJSON() {
186
+ return instance._solution;
187
+ };
188
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
189
+ return (0, util_1.inspect)(instance.toJSON(), options);
190
+ };
191
+ return instance;
192
+ }
193
+ /**
194
+ * Response containing retrieved profile memories organized by type.
195
+ */
196
+ class RecallInstance {
197
+ constructor(_version, _payload, storeId, profileId) {
198
+ this._version = _version;
199
+ const payload = _payload;
200
+ this.observations =
201
+ payload.observations !== null && payload.observations !== undefined
202
+ ? payload.observations.map((payload) => new RecallObservationInfo(payload))
203
+ : null;
204
+ this.summaries =
205
+ payload.summaries !== null && payload.summaries !== undefined
206
+ ? payload.summaries.map((payload) => new RecallSummaryInfo(payload))
207
+ : null;
208
+ this.communications =
209
+ payload.communications !== null && payload.communications !== undefined
210
+ ? payload.communications.map((payload) => new Communication(payload))
211
+ : null;
212
+ this.meta =
213
+ payload.meta !== null && payload.meta !== undefined
214
+ ? new MemoryRetrievalResponseMeta(payload.meta)
215
+ : null;
216
+ }
217
+ /**
218
+ * Provide a user-friendly representation
219
+ *
220
+ * @returns Object
221
+ */
222
+ toJSON() {
223
+ return {
224
+ observations: this.observations,
225
+ summaries: this.summaries,
226
+ communications: this.communications,
227
+ meta: this.meta,
228
+ };
229
+ }
230
+ [util_1.inspect.custom](_depth, options) {
231
+ return (0, util_1.inspect)(this.toJSON(), options);
232
+ }
233
+ }
234
+ exports.RecallInstance = RecallInstance;