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,280 @@
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.ImportInstance = exports.ImportContextImpl = exports.FetchProfileImportV2200ResponseSummary = exports.CreateProfilesImportV2Request = exports.ColumnMappingItem = void 0;
17
+ exports.ImportListInstance = ImportListInstance;
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
+ * Mapping of a CSV header column to the trait fields
24
+ */
25
+ class ColumnMappingItem {
26
+ constructor(payload) {
27
+ this.columnName = payload["columnName"];
28
+ this.traitGroup = payload["traitGroup"];
29
+ this.traitName = payload["traitName"];
30
+ }
31
+ }
32
+ exports.ColumnMappingItem = ColumnMappingItem;
33
+ class CreateProfilesImportV2Request {
34
+ constructor(payload) {
35
+ this.filename = payload["filename"];
36
+ this.fileSize = payload["fileSize"];
37
+ this.columnMappings = payload["columnMappings"];
38
+ }
39
+ }
40
+ exports.CreateProfilesImportV2Request = CreateProfilesImportV2Request;
41
+ /**
42
+ * Summary statistics of the import operation
43
+ */
44
+ class FetchProfileImportV2200ResponseSummary {
45
+ constructor(payload) {
46
+ this.errors = payload["errors"];
47
+ this.warnings = payload["warnings"];
48
+ }
49
+ }
50
+ exports.FetchProfileImportV2200ResponseSummary = FetchProfileImportV2200ResponseSummary;
51
+ class ImportContextImpl {
52
+ constructor(_version, storeId, importId) {
53
+ this._version = _version;
54
+ if (!(0, utility_1.isValidPathParam)(storeId)) {
55
+ throw new Error("Parameter 'storeId' is not valid.");
56
+ }
57
+ if (!(0, utility_1.isValidPathParam)(importId)) {
58
+ throw new Error("Parameter 'importId' is not valid.");
59
+ }
60
+ this._solution = { storeId, importId };
61
+ this._uri = `/Stores/${storeId}/Profiles/Imports/${importId}`;
62
+ }
63
+ fetch(callback) {
64
+ const headers = {};
65
+ headers["Accept"] = "application/json";
66
+ const instance = this;
67
+ let operationVersion = instance._version, operationPromise = operationVersion.fetch({
68
+ uri: instance._uri,
69
+ method: "get",
70
+ headers,
71
+ });
72
+ operationPromise = operationPromise.then((payload) => new ImportInstance(operationVersion, payload, instance._solution.storeId, instance._solution.importId));
73
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
74
+ return operationPromise;
75
+ }
76
+ fetchWithHttpInfo(callback) {
77
+ const headers = {};
78
+ headers["Accept"] = "application/json";
79
+ const instance = this;
80
+ let operationVersion = instance._version;
81
+ // CREATE, FETCH, UPDATE operations
82
+ let operationPromise = operationVersion
83
+ .fetchWithResponseInfo({
84
+ uri: instance._uri,
85
+ method: "get",
86
+ headers,
87
+ })
88
+ .then((response) => ({
89
+ ...response,
90
+ body: new ImportInstance(operationVersion, response.body, instance._solution.storeId, instance._solution.importId),
91
+ }));
92
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
93
+ return operationPromise;
94
+ }
95
+ /**
96
+ * Provide a user-friendly representation
97
+ *
98
+ * @returns Object
99
+ */
100
+ toJSON() {
101
+ return this._solution;
102
+ }
103
+ [util_1.inspect.custom](_depth, options) {
104
+ return (0, util_1.inspect)(this.toJSON(), options);
105
+ }
106
+ }
107
+ exports.ImportContextImpl = ImportContextImpl;
108
+ class ImportInstance {
109
+ constructor(_version, _payload, storeId, importId) {
110
+ this._version = _version;
111
+ const payload = _payload;
112
+ this.status = payload.status;
113
+ this.filename = payload.filename;
114
+ this.createdAt = deserialize.iso8601DateTime(payload.createdAt);
115
+ this.updatedAt = deserialize.iso8601DateTime(payload.updatedAt);
116
+ this.fileSize = deserialize.integer(payload.fileSize);
117
+ this.columnMappings =
118
+ payload.columnMappings !== null && payload.columnMappings !== undefined
119
+ ? payload.columnMappings.map((payload) => new ColumnMappingItem(payload))
120
+ : null;
121
+ this.summary =
122
+ payload.summary !== null && payload.summary !== undefined
123
+ ? new FetchProfileImportV2200ResponseSummary(payload.summary)
124
+ : null;
125
+ this.importId = payload.importId;
126
+ this.url = payload.url;
127
+ this.imports = payload.imports;
128
+ this._solution = { storeId, importId: importId };
129
+ }
130
+ get _proxy() {
131
+ this._context =
132
+ this._context ||
133
+ new ImportContextImpl(this._version, this._solution.storeId, this._solution.importId);
134
+ return this._context;
135
+ }
136
+ /**
137
+ * Fetch a ImportInstance
138
+ *
139
+ * @param callback - Callback to handle processed record
140
+ *
141
+ * @returns Resolves to processed ImportInstance
142
+ */
143
+ fetch(callback) {
144
+ return this._proxy.fetch(callback);
145
+ }
146
+ /**
147
+ * Fetch a ImportInstance and return HTTP info
148
+ *
149
+ * @param callback - Callback to handle processed record
150
+ *
151
+ * @returns Resolves to processed ImportInstance with HTTP metadata
152
+ */
153
+ fetchWithHttpInfo(callback) {
154
+ return this._proxy.fetchWithHttpInfo(callback);
155
+ }
156
+ /**
157
+ * Provide a user-friendly representation
158
+ *
159
+ * @returns Object
160
+ */
161
+ toJSON() {
162
+ return {
163
+ status: this.status,
164
+ filename: this.filename,
165
+ createdAt: this.createdAt,
166
+ updatedAt: this.updatedAt,
167
+ fileSize: this.fileSize,
168
+ columnMappings: this.columnMappings,
169
+ summary: this.summary,
170
+ importId: this.importId,
171
+ url: this.url,
172
+ imports: this.imports,
173
+ };
174
+ }
175
+ [util_1.inspect.custom](_depth, options) {
176
+ return (0, util_1.inspect)(this.toJSON(), options);
177
+ }
178
+ }
179
+ exports.ImportInstance = ImportInstance;
180
+ function ImportListInstance(version, storeId) {
181
+ if (!(0, utility_1.isValidPathParam)(storeId)) {
182
+ throw new Error("Parameter 'storeId' is not valid.");
183
+ }
184
+ const instance = ((importId) => instance.get(importId));
185
+ instance.get = function get(importId) {
186
+ return new ImportContextImpl(version, storeId, importId);
187
+ };
188
+ instance._version = version;
189
+ instance._solution = { storeId };
190
+ instance._uri = `/Stores/${storeId}/Profiles/Imports`;
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 ImportInstance(operationVersion, payload, instance._solution.storeId));
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 ImportInstance(operationVersion, response.body, instance._solution.storeId),
235
+ }));
236
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
237
+ return operationPromise;
238
+ };
239
+ instance.list = function list(callback) {
240
+ const headers = {};
241
+ const data = {};
242
+ headers["Accept"] = "application/json";
243
+ let operationVersion = version, operationPromise = operationVersion.fetch({
244
+ uri: instance._uri,
245
+ method: "get",
246
+ headers,
247
+ });
248
+ // Array items are primitives (strings, numbers), return them directly
249
+ operationPromise = operationPromise.then((payload) => payload["imports"] || []);
250
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
251
+ return operationPromise;
252
+ };
253
+ instance.listWithHttpInfo = function listWithHttpInfo(callback) {
254
+ const headers = {};
255
+ const data = {};
256
+ headers["Accept"] = "application/json";
257
+ let operationVersion = version;
258
+ // Array items are primitives (strings, numbers), return them directly
259
+ let operationPromise = operationVersion
260
+ .fetchWithResponseInfo({
261
+ uri: instance._uri,
262
+ method: "get",
263
+ headers,
264
+ })
265
+ .then((response) => ({
266
+ statusCode: response.statusCode,
267
+ headers: response.headers,
268
+ body: response.body["imports"] || [],
269
+ }));
270
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
271
+ return operationPromise;
272
+ };
273
+ instance.toJSON = function toJSON() {
274
+ return instance._solution;
275
+ };
276
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
277
+ return (0, util_1.inspect)(instance.toJSON(), options);
278
+ };
279
+ return instance;
280
+ }
@@ -0,0 +1,82 @@
1
+ import { inspect, InspectOptions } from "util";
2
+ import V1 from "../V1";
3
+ import { ApiResponse } from "../../../base/ApiResponse";
4
+ /**
5
+ * Represents a single identifier value paired with its `idType`. Write operations obey limits, uniqueness, and normalization rules configured via identifier settings.
6
+ */
7
+ export declare class Identifier {
8
+ /**
9
+ * Identifier type as configured in the service\'s Identity Resolution Settings.
10
+ */
11
+ "idType": string;
12
+ /**
13
+ * Raw value captured for the identifier. The service may normalize this value according to the `normalization` rule defined in the identifier settings before storage or matching (for example E.164 formatting for phone numbers).
14
+ */
15
+ "value": string;
16
+ constructor(payload: any);
17
+ }
18
+ /**
19
+ * Options to pass to create a LookupInstance
20
+ */
21
+ export interface LookupListInstanceCreateOptions {
22
+ /** */
23
+ identifier: Identifier;
24
+ }
25
+ export interface LookupSolution {
26
+ storeId: string;
27
+ }
28
+ export interface LookupListInstance {
29
+ _version: V1;
30
+ _solution: LookupSolution;
31
+ _uri: string;
32
+ /**
33
+ * Create a LookupInstance
34
+ *
35
+ * @param params - Body for request
36
+ * @param headers - header params for request
37
+ * @param callback - Callback to handle processed record
38
+ *
39
+ * @returns Resolves to processed LookupInstance
40
+ */
41
+ create(params: Identifier, headers?: any, callback?: (error: Error | null, item?: LookupInstance) => any): Promise<LookupInstance>;
42
+ /**
43
+ * Create a LookupInstance and return HTTP info
44
+ *
45
+ * @param params - Body for request
46
+ * @param headers - header params for request
47
+ * @param callback - Callback to handle processed record
48
+ *
49
+ * @returns Resolves to processed LookupInstance with HTTP metadata
50
+ */
51
+ createWithHttpInfo(params: Identifier, headers?: any, callback?: (error: Error | null, item?: ApiResponse<LookupInstance>) => any): Promise<ApiResponse<LookupInstance>>;
52
+ /**
53
+ * Provide a user-friendly representation
54
+ */
55
+ toJSON(): any;
56
+ [inspect.custom](_depth: any, options: InspectOptions): any;
57
+ }
58
+ export declare function LookupListInstance(version: V1, storeId: string): LookupListInstance;
59
+ interface LookupResource {
60
+ normalizedValue: string;
61
+ profiles: Array<string>;
62
+ }
63
+ export declare class LookupInstance {
64
+ protected _version: V1;
65
+ constructor(_version: V1, _payload: LookupResource, storeId: string);
66
+ /**
67
+ * Identifier value after normalization that was used for the lookup.
68
+ */
69
+ normalizedValue: string;
70
+ profiles: Array<string>;
71
+ /**
72
+ * Provide a user-friendly representation
73
+ *
74
+ * @returns Object
75
+ */
76
+ toJSON(): {
77
+ normalizedValue: string;
78
+ profiles: string[];
79
+ };
80
+ [inspect.custom](_depth: any, options: InspectOptions): string;
81
+ }
82
+ export {};
@@ -0,0 +1,118 @@
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.LookupInstance = exports.Identifier = void 0;
17
+ exports.LookupListInstance = LookupListInstance;
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
+ * Represents a single identifier value paired with its `idType`. Write operations obey limits, uniqueness, and normalization rules configured via identifier settings.
24
+ */
25
+ class Identifier {
26
+ constructor(payload) {
27
+ this.idType = payload["idType"];
28
+ this.value = payload["value"];
29
+ }
30
+ }
31
+ exports.Identifier = Identifier;
32
+ function LookupListInstance(version, storeId) {
33
+ if (!(0, utility_1.isValidPathParam)(storeId)) {
34
+ throw new Error("Parameter 'storeId' is not valid.");
35
+ }
36
+ const instance = {};
37
+ instance._version = version;
38
+ instance._solution = { storeId };
39
+ instance._uri = `/Stores/${storeId}/Profiles/Lookup`;
40
+ instance.create = function create(params, headers, callback) {
41
+ if (params === null || params === undefined) {
42
+ throw new Error('Required parameter "params" missing.');
43
+ }
44
+ let data = {};
45
+ data = params;
46
+ if (headers === null || headers === undefined) {
47
+ headers = {};
48
+ }
49
+ headers["Content-Type"] = "application/json";
50
+ headers["Accept"] = "application/json";
51
+ let operationVersion = version, operationPromise = operationVersion.create({
52
+ uri: instance._uri,
53
+ method: "post",
54
+ data,
55
+ headers,
56
+ });
57
+ operationPromise = operationPromise.then((payload) => new LookupInstance(operationVersion, payload, instance._solution.storeId));
58
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
59
+ return operationPromise;
60
+ };
61
+ instance.createWithHttpInfo = function createWithHttpInfo(params, headers, callback) {
62
+ if (params === null || params === undefined) {
63
+ throw new Error('Required parameter "params" missing.');
64
+ }
65
+ let data = {};
66
+ data = params;
67
+ if (headers === null || headers === undefined) {
68
+ headers = {};
69
+ }
70
+ headers["Content-Type"] = "application/json";
71
+ headers["Accept"] = "application/json";
72
+ let operationVersion = version;
73
+ // CREATE, FETCH, UPDATE operations
74
+ let operationPromise = operationVersion
75
+ .createWithResponseInfo({
76
+ uri: instance._uri,
77
+ method: "post",
78
+ data,
79
+ headers,
80
+ })
81
+ .then((response) => ({
82
+ ...response,
83
+ body: new LookupInstance(operationVersion, response.body, instance._solution.storeId),
84
+ }));
85
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
86
+ return operationPromise;
87
+ };
88
+ instance.toJSON = function toJSON() {
89
+ return instance._solution;
90
+ };
91
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
92
+ return (0, util_1.inspect)(instance.toJSON(), options);
93
+ };
94
+ return instance;
95
+ }
96
+ class LookupInstance {
97
+ constructor(_version, _payload, storeId) {
98
+ this._version = _version;
99
+ const payload = _payload;
100
+ this.normalizedValue = payload.normalizedValue;
101
+ this.profiles = payload.profiles;
102
+ }
103
+ /**
104
+ * Provide a user-friendly representation
105
+ *
106
+ * @returns Object
107
+ */
108
+ toJSON() {
109
+ return {
110
+ normalizedValue: this.normalizedValue,
111
+ profiles: this.profiles,
112
+ };
113
+ }
114
+ [util_1.inspect.custom](_depth, options) {
115
+ return (0, util_1.inspect)(this.toJSON(), options);
116
+ }
117
+ }
118
+ exports.LookupInstance = LookupInstance;