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,246 @@
1
+ import { inspect, InspectOptions } from "util";
2
+ import TokenPage, { TokenPaginationPayload } from "../../../base/TokenPage";
3
+ import Response from "../../../http/response";
4
+ import V1 from "../V1";
5
+ import { ApiResponse } from "../../../base/ApiResponse";
6
+ /**
7
+ * Options to pass to each
8
+ */
9
+ export interface RevisionListInstanceEachOptions {
10
+ /** The maximum number of items to return per page, maximum of 1000. */
11
+ pageSize?: number;
12
+ /** The token for the page of results to retrieve. */
13
+ pageToken?: string;
14
+ /** Compression algorithms supported by the client (e.g., gzip, deflate, br) */
15
+ acceptEncoding?: string;
16
+ /** Function to process each record. If this and a positional callback are passed, this one will be used */
17
+ callback?: (item: RevisionInstance, done: (err?: Error) => void) => void;
18
+ /** Function to be called upon completion of streaming */
19
+ done?: Function;
20
+ /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
21
+ limit?: number;
22
+ }
23
+ /**
24
+ * Options to pass to list
25
+ */
26
+ export interface RevisionListInstanceOptions {
27
+ /** The maximum number of items to return per page, maximum of 1000. */
28
+ pageSize?: number;
29
+ /** The token for the page of results to retrieve. */
30
+ pageToken?: string;
31
+ /** Compression algorithms supported by the client (e.g., gzip, deflate, br) */
32
+ acceptEncoding?: string;
33
+ /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
34
+ limit?: number;
35
+ }
36
+ /**
37
+ * Options to pass to page
38
+ */
39
+ export interface RevisionListInstancePageOptions {
40
+ /** The maximum number of items to return per page, maximum of 1000. */
41
+ pageSize?: number;
42
+ /** The token for the page of results to retrieve. */
43
+ pageToken?: string;
44
+ /** Compression algorithms supported by the client (e.g., gzip, deflate, br) */
45
+ acceptEncoding?: string;
46
+ }
47
+ export interface RevisionSolution {
48
+ storeId: string;
49
+ profileId: string;
50
+ observationId: string;
51
+ }
52
+ export interface RevisionListInstance {
53
+ _version: V1;
54
+ _solution: RevisionSolution;
55
+ _uri: string;
56
+ /**
57
+ * Streams RevisionInstance records from the API.
58
+ *
59
+ * This operation lazily loads records as efficiently as possible until the limit
60
+ * is reached.
61
+ *
62
+ * The results are passed into the callback function, so this operation is memory
63
+ * efficient.
64
+ *
65
+ * If a function is passed as the first argument, it will be used as the callback
66
+ * function.
67
+ *
68
+ * @param { RevisionListInstanceEachOptions } [params] - Options for request
69
+ * @param { function } [callback] - Function to process each record
70
+ */
71
+ each(callback?: (item: RevisionInstance, done: (err?: Error) => void) => void): void;
72
+ each(params: RevisionListInstanceEachOptions, callback?: (item: RevisionInstance, done: (err?: Error) => void) => void): void;
73
+ /**
74
+ * Streams RevisionInstance records from the API with HTTP metadata captured per page.
75
+ *
76
+ * This operation lazily loads records as efficiently as possible until the limit
77
+ * is reached. HTTP metadata (status code, headers) is captured for each page request.
78
+ *
79
+ * The results are passed into the callback function, so this operation is memory
80
+ * efficient.
81
+ *
82
+ * If a function is passed as the first argument, it will be used as the callback
83
+ * function.
84
+ *
85
+ * @param { RevisionListInstanceEachOptions } [params] - Options for request
86
+ * @param { function } [callback] - Function to process each record
87
+ */
88
+ eachWithHttpInfo(callback?: (item: RevisionInstance, done: (err?: Error) => void) => void): void;
89
+ eachWithHttpInfo(params: RevisionListInstanceEachOptions, callback?: (item: RevisionInstance, done: (err?: Error) => void) => void): void;
90
+ /**
91
+ * Retrieve a single target page of RevisionInstance records from the API.
92
+ *
93
+ * The request is executed immediately.
94
+ *
95
+ * @param { string } [targetUrl] - API-generated URL for the requested results page
96
+ * @param { function } [callback] - Callback to handle list of records
97
+ */
98
+ getPage(targetUrl: string, callback?: (error: Error | null, items: RevisionPage) => any): Promise<RevisionPage>;
99
+ /**
100
+ * Retrieve a single target page of RevisionInstance records from the API with HTTP metadata.
101
+ *
102
+ * The request is executed immediately.
103
+ *
104
+ * @param { string } [targetUrl] - API-generated URL for the requested results page
105
+ * @param { function } [callback] - Callback to handle list of records with metadata
106
+ */
107
+ getPageWithHttpInfo(targetUrl: string, callback?: (error: Error | null, items: ApiResponse<RevisionPage>) => any): Promise<ApiResponse<RevisionPage>>;
108
+ /**
109
+ * Lists RevisionInstance records from the API as a list.
110
+ *
111
+ * If a function is passed as the first argument, it will be used as the callback
112
+ * function.
113
+ *
114
+ * @param { RevisionListInstanceOptions } [params] - Options for request
115
+ * @param { function } [callback] - Callback to handle list of records
116
+ */
117
+ list(callback?: (error: Error | null, items: RevisionInstance[]) => any): Promise<RevisionInstance[]>;
118
+ list(params: RevisionListInstanceOptions, callback?: (error: Error | null, items: RevisionInstance[]) => any): Promise<RevisionInstance[]>;
119
+ /**
120
+ * Lists RevisionInstance records from the API as a list with HTTP metadata.
121
+ *
122
+ * Returns all records along with HTTP metadata from the first page fetched.
123
+ *
124
+ * If a function is passed as the first argument, it will be used as the callback
125
+ * function.
126
+ *
127
+ * @param { RevisionListInstanceOptions } [params] - Options for request
128
+ * @param { function } [callback] - Callback to handle list of records with metadata
129
+ */
130
+ listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<RevisionInstance[]>) => any): Promise<ApiResponse<RevisionInstance[]>>;
131
+ listWithHttpInfo(params: RevisionListInstanceOptions, callback?: (error: Error | null, items: ApiResponse<RevisionInstance[]>) => any): Promise<ApiResponse<RevisionInstance[]>>;
132
+ /**
133
+ * Retrieve a single page of RevisionInstance records from the API.
134
+ *
135
+ * The request is executed immediately.
136
+ *
137
+ * If a function is passed as the first argument, it will be used as the callback
138
+ * function.
139
+ *
140
+ * @param { RevisionListInstancePageOptions } [params] - Options for request
141
+ * @param { function } [callback] - Callback to handle list of records
142
+ */
143
+ page(callback?: (error: Error | null, items: RevisionPage) => any): Promise<RevisionPage>;
144
+ page(params: RevisionListInstancePageOptions, callback?: (error: Error | null, items: RevisionPage) => any): Promise<RevisionPage>;
145
+ /**
146
+ * Retrieve a single page of RevisionInstance records from the API with HTTP metadata.
147
+ *
148
+ * The request is executed immediately.
149
+ *
150
+ * If a function is passed as the first argument, it will be used as the callback
151
+ * function.
152
+ *
153
+ * @param { RevisionListInstancePageOptions } [params] - Options for request
154
+ * @param { function } [callback] - Callback to handle list of records with metadata
155
+ */
156
+ pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse<RevisionPage>) => any): Promise<ApiResponse<RevisionPage>>;
157
+ pageWithHttpInfo(params: RevisionListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse<RevisionPage>) => any): Promise<ApiResponse<RevisionPage>>;
158
+ /**
159
+ * Provide a user-friendly representation
160
+ */
161
+ toJSON(): any;
162
+ [inspect.custom](_depth: any, options: InspectOptions): any;
163
+ }
164
+ export declare function RevisionListInstance(version: V1, storeId: string, profileId: string, observationId: string): RevisionListInstance;
165
+ interface RevisionPayload extends TokenPaginationPayload {
166
+ revisions: RevisionResource[];
167
+ }
168
+ interface RevisionResource {
169
+ content: string;
170
+ occurredAt: Date;
171
+ source: string;
172
+ conversationIds: Array<string>;
173
+ id: string;
174
+ createdAt: Date;
175
+ updatedAt: Date;
176
+ }
177
+ /**
178
+ * A transient and mutable observation memory associated with a profile.
179
+ */
180
+ export declare class RevisionInstance {
181
+ protected _version: V1;
182
+ constructor(_version: V1, _payload: RevisionResource, storeId: string, profileId: string, observationId: string);
183
+ /**
184
+ * The main content of the observation.
185
+ */
186
+ content: string;
187
+ /**
188
+ * The timestamp when the observation originally occurred.
189
+ */
190
+ occurredAt: Date;
191
+ /**
192
+ * 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.
193
+ */
194
+ source: string;
195
+ /**
196
+ * Array of conversation IDs associated with this observation.
197
+ */
198
+ conversationIds: Array<string>;
199
+ /**
200
+ * A unique identifier for the observation using Twilio Type ID (TTID) format.
201
+ */
202
+ id: string;
203
+ /**
204
+ * The timestamp when the observation was created.
205
+ */
206
+ createdAt: Date;
207
+ /**
208
+ * The timestamp when the observation was last updated.
209
+ */
210
+ updatedAt: Date;
211
+ /**
212
+ * Provide a user-friendly representation
213
+ *
214
+ * @returns Object
215
+ */
216
+ toJSON(): {
217
+ content: string;
218
+ occurredAt: Date;
219
+ source: string;
220
+ conversationIds: string[];
221
+ id: string;
222
+ createdAt: Date;
223
+ updatedAt: Date;
224
+ };
225
+ [inspect.custom](_depth: any, options: InspectOptions): string;
226
+ }
227
+ export declare class RevisionPage extends TokenPage<V1, RevisionPayload, RevisionResource, RevisionInstance> {
228
+ /**
229
+ * Initialize the RevisionPage
230
+ *
231
+ * @param version - Version of the resource
232
+ * @param response - Response from the API
233
+ * @param uri - URI of the resource
234
+ * @param params - Query parameters
235
+ * @param solution - Path solution
236
+ */
237
+ constructor(version: V1, response: Response<string>, uri: string, params: any, solution: RevisionSolution);
238
+ /**
239
+ * Build an instance of RevisionInstance
240
+ *
241
+ * @param payload - Payload response from the API
242
+ */
243
+ getInstance(payload: RevisionResource): RevisionInstance;
244
+ [inspect.custom](depth: any, options: InspectOptions): string;
245
+ }
246
+ export {};
@@ -0,0 +1,195 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.RevisionPage = exports.RevisionInstance = void 0;
20
+ exports.RevisionListInstance = RevisionListInstance;
21
+ const util_1 = require("util");
22
+ const TokenPage_1 = __importDefault(require("../../../base/TokenPage"));
23
+ const deserialize = require("../../../base/deserialize");
24
+ const serialize = require("../../../base/serialize");
25
+ const utility_1 = require("../../../base/utility");
26
+ function RevisionListInstance(version, storeId, profileId, observationId) {
27
+ if (!(0, utility_1.isValidPathParam)(storeId)) {
28
+ throw new Error("Parameter 'storeId' is not valid.");
29
+ }
30
+ if (!(0, utility_1.isValidPathParam)(profileId)) {
31
+ throw new Error("Parameter 'profileId' is not valid.");
32
+ }
33
+ if (!(0, utility_1.isValidPathParam)(observationId)) {
34
+ throw new Error("Parameter 'observationId' is not valid.");
35
+ }
36
+ const instance = {};
37
+ instance._version = version;
38
+ instance._solution = { storeId, profileId, observationId };
39
+ instance._uri = `/Stores/${storeId}/Profiles/${profileId}/Observations/${observationId}/Revisions`;
40
+ instance.page = function page(params, callback) {
41
+ if (params instanceof Function) {
42
+ callback = params;
43
+ params = {};
44
+ }
45
+ else {
46
+ params = params || {};
47
+ }
48
+ let data = {};
49
+ if (params["pageSize"] !== undefined)
50
+ data["pageSize"] = params["pageSize"];
51
+ if (params["pageToken"] !== undefined)
52
+ data["pageToken"] = params["pageToken"];
53
+ const headers = {};
54
+ headers["Accept"] = "application/json";
55
+ if (params["acceptEncoding"] !== undefined)
56
+ headers["Accept-Encoding"] = params["acceptEncoding"];
57
+ let operationVersion = version, operationPromise = operationVersion.page({
58
+ uri: instance._uri,
59
+ method: "get",
60
+ params: data,
61
+ headers,
62
+ });
63
+ operationPromise = operationPromise.then((payload) => new RevisionPage(operationVersion, payload, instance._uri, data, instance._solution));
64
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
65
+ return operationPromise;
66
+ };
67
+ instance.each = instance._version.each;
68
+ instance.list = instance._version.list;
69
+ instance.getPage = function getPage(targetUrl, callback) {
70
+ const operationPromise = instance._version._domain.twilio.request({
71
+ method: "get",
72
+ uri: targetUrl,
73
+ });
74
+ let pagePromise = operationPromise.then((payload) => new RevisionPage(instance._version, payload, instance._uri, {}, instance._solution));
75
+ pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
76
+ return pagePromise;
77
+ };
78
+ instance.pageWithHttpInfo = function pageWithHttpInfo(params, callback) {
79
+ if (params instanceof Function) {
80
+ callback = params;
81
+ params = {};
82
+ }
83
+ else {
84
+ params = params || {};
85
+ }
86
+ let data = {};
87
+ if (params["pageSize"] !== undefined)
88
+ data["pageSize"] = params["pageSize"];
89
+ if (params["pageToken"] !== undefined)
90
+ data["pageToken"] = params["pageToken"];
91
+ const headers = {};
92
+ headers["Accept"] = "application/json";
93
+ if (params["acceptEncoding"] !== undefined)
94
+ headers["Accept-Encoding"] = params["acceptEncoding"];
95
+ let operationVersion = version;
96
+ // For page operations, use page() directly as it already returns { statusCode, body, headers }
97
+ // IMPORTANT: Pass full response to Page constructor, not response.body
98
+ let operationPromise = operationVersion
99
+ .page({ uri: instance._uri, method: "get", params: data, headers })
100
+ .then((response) => ({
101
+ statusCode: response.statusCode,
102
+ headers: response.headers,
103
+ body: new RevisionPage(operationVersion, response, instance._uri, data, instance._solution),
104
+ }));
105
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
106
+ return operationPromise;
107
+ };
108
+ instance.each = instance._version.each;
109
+ instance.eachWithHttpInfo = instance._version.eachWithHttpInfo;
110
+ instance.list = instance._version.list;
111
+ instance.listWithHttpInfo = instance._version.listWithHttpInfo;
112
+ instance.getPageWithHttpInfo = function getPageWithHttpInfo(targetUrl, callback) {
113
+ // Use request() directly as it already returns { statusCode, body, headers }
114
+ const operationPromise = instance._version._domain.twilio.request({
115
+ method: "get",
116
+ uri: targetUrl,
117
+ });
118
+ let pagePromise = operationPromise.then((response) => ({
119
+ statusCode: response.statusCode,
120
+ headers: response.headers,
121
+ body: new RevisionPage(instance._version, response, instance._uri, {}, instance._solution),
122
+ }));
123
+ pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
124
+ return pagePromise;
125
+ };
126
+ instance.toJSON = function toJSON() {
127
+ return instance._solution;
128
+ };
129
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
130
+ return (0, util_1.inspect)(instance.toJSON(), options);
131
+ };
132
+ return instance;
133
+ }
134
+ /**
135
+ * A transient and mutable observation memory associated with a profile.
136
+ */
137
+ class RevisionInstance {
138
+ constructor(_version, _payload, storeId, profileId, observationId) {
139
+ this._version = _version;
140
+ const payload = _payload;
141
+ this.content = payload.content;
142
+ this.occurredAt = deserialize.iso8601DateTime(payload.occurredAt);
143
+ this.source = payload.source;
144
+ this.conversationIds = payload.conversationIds;
145
+ this.id = payload.id;
146
+ this.createdAt = deserialize.iso8601DateTime(payload.createdAt);
147
+ this.updatedAt = deserialize.iso8601DateTime(payload.updatedAt);
148
+ }
149
+ /**
150
+ * Provide a user-friendly representation
151
+ *
152
+ * @returns Object
153
+ */
154
+ toJSON() {
155
+ return {
156
+ content: this.content,
157
+ occurredAt: this.occurredAt,
158
+ source: this.source,
159
+ conversationIds: this.conversationIds,
160
+ id: this.id,
161
+ createdAt: this.createdAt,
162
+ updatedAt: this.updatedAt,
163
+ };
164
+ }
165
+ [util_1.inspect.custom](_depth, options) {
166
+ return (0, util_1.inspect)(this.toJSON(), options);
167
+ }
168
+ }
169
+ exports.RevisionInstance = RevisionInstance;
170
+ class RevisionPage extends TokenPage_1.default {
171
+ /**
172
+ * Initialize the RevisionPage
173
+ *
174
+ * @param version - Version of the resource
175
+ * @param response - Response from the API
176
+ * @param uri - URI of the resource
177
+ * @param params - Query parameters
178
+ * @param solution - Path solution
179
+ */
180
+ constructor(version, response, uri, params, solution) {
181
+ super(version, response, uri, params, solution);
182
+ }
183
+ /**
184
+ * Build an instance of RevisionInstance
185
+ *
186
+ * @param payload - Payload response from the API
187
+ */
188
+ getInstance(payload) {
189
+ return new RevisionInstance(this._version, payload, this._solution.storeId, this._solution.profileId, this._solution.observationId);
190
+ }
191
+ [util_1.inspect.custom](depth, options) {
192
+ return (0, util_1.inspect)(this.toJSON(), options);
193
+ }
194
+ }
195
+ exports.RevisionPage = RevisionPage;