@aws-sdk/client-opensearchserverless 3.489.0 → 3.495.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist-cjs/OpenSearchServerless.js +1 -85
  2. package/dist-cjs/OpenSearchServerlessClient.js +1 -43
  3. package/dist-cjs/commands/BatchGetCollectionCommand.js +1 -28
  4. package/dist-cjs/commands/BatchGetEffectiveLifecyclePolicyCommand.js +1 -28
  5. package/dist-cjs/commands/BatchGetLifecyclePolicyCommand.js +1 -28
  6. package/dist-cjs/commands/BatchGetVpcEndpointCommand.js +1 -28
  7. package/dist-cjs/commands/CreateAccessPolicyCommand.js +1 -28
  8. package/dist-cjs/commands/CreateCollectionCommand.js +1 -28
  9. package/dist-cjs/commands/CreateLifecyclePolicyCommand.js +1 -28
  10. package/dist-cjs/commands/CreateSecurityConfigCommand.js +1 -28
  11. package/dist-cjs/commands/CreateSecurityPolicyCommand.js +1 -28
  12. package/dist-cjs/commands/CreateVpcEndpointCommand.js +1 -28
  13. package/dist-cjs/commands/DeleteAccessPolicyCommand.js +1 -28
  14. package/dist-cjs/commands/DeleteCollectionCommand.js +1 -28
  15. package/dist-cjs/commands/DeleteLifecyclePolicyCommand.js +1 -28
  16. package/dist-cjs/commands/DeleteSecurityConfigCommand.js +1 -28
  17. package/dist-cjs/commands/DeleteSecurityPolicyCommand.js +1 -28
  18. package/dist-cjs/commands/DeleteVpcEndpointCommand.js +1 -28
  19. package/dist-cjs/commands/GetAccessPolicyCommand.js +1 -28
  20. package/dist-cjs/commands/GetAccountSettingsCommand.js +1 -28
  21. package/dist-cjs/commands/GetPoliciesStatsCommand.js +1 -28
  22. package/dist-cjs/commands/GetSecurityConfigCommand.js +1 -28
  23. package/dist-cjs/commands/GetSecurityPolicyCommand.js +1 -28
  24. package/dist-cjs/commands/ListAccessPoliciesCommand.js +1 -28
  25. package/dist-cjs/commands/ListCollectionsCommand.js +1 -28
  26. package/dist-cjs/commands/ListLifecyclePoliciesCommand.js +1 -28
  27. package/dist-cjs/commands/ListSecurityConfigsCommand.js +1 -28
  28. package/dist-cjs/commands/ListSecurityPoliciesCommand.js +1 -28
  29. package/dist-cjs/commands/ListTagsForResourceCommand.js +1 -28
  30. package/dist-cjs/commands/ListVpcEndpointsCommand.js +1 -28
  31. package/dist-cjs/commands/TagResourceCommand.js +1 -28
  32. package/dist-cjs/commands/UntagResourceCommand.js +1 -28
  33. package/dist-cjs/commands/UpdateAccessPolicyCommand.js +1 -28
  34. package/dist-cjs/commands/UpdateAccountSettingsCommand.js +1 -28
  35. package/dist-cjs/commands/UpdateCollectionCommand.js +1 -28
  36. package/dist-cjs/commands/UpdateLifecyclePolicyCommand.js +1 -28
  37. package/dist-cjs/commands/UpdateSecurityConfigCommand.js +1 -28
  38. package/dist-cjs/commands/UpdateSecurityPolicyCommand.js +1 -28
  39. package/dist-cjs/commands/UpdateVpcEndpointCommand.js +1 -28
  40. package/dist-cjs/commands/index.js +1 -40
  41. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  42. package/dist-cjs/extensionConfiguration.js +1 -2
  43. package/dist-cjs/index.js +3183 -11
  44. package/dist-cjs/models/OpenSearchServerlessServiceException.js +1 -12
  45. package/dist-cjs/models/index.js +1 -4
  46. package/dist-cjs/models/models_0.js +1 -123
  47. package/dist-cjs/pagination/Interfaces.js +1 -2
  48. package/dist-cjs/pagination/ListAccessPoliciesPaginator.js +1 -7
  49. package/dist-cjs/pagination/ListCollectionsPaginator.js +1 -7
  50. package/dist-cjs/pagination/ListLifecyclePoliciesPaginator.js +1 -7
  51. package/dist-cjs/pagination/ListSecurityConfigsPaginator.js +1 -7
  52. package/dist-cjs/pagination/ListSecurityPoliciesPaginator.js +1 -7
  53. package/dist-cjs/pagination/ListVpcEndpointsPaginator.js +1 -7
  54. package/dist-cjs/pagination/index.js +1 -10
  55. package/dist-cjs/protocols/Aws_json1_0.js +1 -2101
  56. package/dist-cjs/runtimeExtensions.js +1 -22
  57. package/package.json +40 -40
@@ -1,2101 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_DeleteLifecyclePolicyCommand = exports.de_DeleteCollectionCommand = exports.de_DeleteAccessPolicyCommand = exports.de_CreateVpcEndpointCommand = exports.de_CreateSecurityPolicyCommand = exports.de_CreateSecurityConfigCommand = exports.de_CreateLifecyclePolicyCommand = exports.de_CreateCollectionCommand = exports.de_CreateAccessPolicyCommand = exports.de_BatchGetVpcEndpointCommand = exports.de_BatchGetLifecyclePolicyCommand = exports.de_BatchGetEffectiveLifecyclePolicyCommand = exports.de_BatchGetCollectionCommand = exports.se_UpdateVpcEndpointCommand = exports.se_UpdateSecurityPolicyCommand = exports.se_UpdateSecurityConfigCommand = exports.se_UpdateLifecyclePolicyCommand = exports.se_UpdateCollectionCommand = exports.se_UpdateAccountSettingsCommand = exports.se_UpdateAccessPolicyCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_ListVpcEndpointsCommand = exports.se_ListTagsForResourceCommand = exports.se_ListSecurityPoliciesCommand = exports.se_ListSecurityConfigsCommand = exports.se_ListLifecyclePoliciesCommand = exports.se_ListCollectionsCommand = exports.se_ListAccessPoliciesCommand = exports.se_GetSecurityPolicyCommand = exports.se_GetSecurityConfigCommand = exports.se_GetPoliciesStatsCommand = exports.se_GetAccountSettingsCommand = exports.se_GetAccessPolicyCommand = exports.se_DeleteVpcEndpointCommand = exports.se_DeleteSecurityPolicyCommand = exports.se_DeleteSecurityConfigCommand = exports.se_DeleteLifecyclePolicyCommand = exports.se_DeleteCollectionCommand = exports.se_DeleteAccessPolicyCommand = exports.se_CreateVpcEndpointCommand = exports.se_CreateSecurityPolicyCommand = exports.se_CreateSecurityConfigCommand = exports.se_CreateLifecyclePolicyCommand = exports.se_CreateCollectionCommand = exports.se_CreateAccessPolicyCommand = exports.se_BatchGetVpcEndpointCommand = exports.se_BatchGetLifecyclePolicyCommand = exports.se_BatchGetEffectiveLifecyclePolicyCommand = exports.se_BatchGetCollectionCommand = void 0;
4
- exports.de_UpdateVpcEndpointCommand = exports.de_UpdateSecurityPolicyCommand = exports.de_UpdateSecurityConfigCommand = exports.de_UpdateLifecyclePolicyCommand = exports.de_UpdateCollectionCommand = exports.de_UpdateAccountSettingsCommand = exports.de_UpdateAccessPolicyCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_ListVpcEndpointsCommand = exports.de_ListTagsForResourceCommand = exports.de_ListSecurityPoliciesCommand = exports.de_ListSecurityConfigsCommand = exports.de_ListLifecyclePoliciesCommand = exports.de_ListCollectionsCommand = exports.de_ListAccessPoliciesCommand = exports.de_GetSecurityPolicyCommand = exports.de_GetSecurityConfigCommand = exports.de_GetPoliciesStatsCommand = exports.de_GetAccountSettingsCommand = exports.de_GetAccessPolicyCommand = exports.de_DeleteVpcEndpointCommand = exports.de_DeleteSecurityPolicyCommand = exports.de_DeleteSecurityConfigCommand = void 0;
5
- const protocol_http_1 = require("@smithy/protocol-http");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- const uuid_1 = require("uuid");
8
- const models_0_1 = require("../models/models_0");
9
- const OpenSearchServerlessServiceException_1 = require("../models/OpenSearchServerlessServiceException");
10
- const se_BatchGetCollectionCommand = async (input, context) => {
11
- const headers = sharedHeaders("BatchGetCollection");
12
- let body;
13
- body = JSON.stringify((0, smithy_client_1._json)(input));
14
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
15
- };
16
- exports.se_BatchGetCollectionCommand = se_BatchGetCollectionCommand;
17
- const se_BatchGetEffectiveLifecyclePolicyCommand = async (input, context) => {
18
- const headers = sharedHeaders("BatchGetEffectiveLifecyclePolicy");
19
- let body;
20
- body = JSON.stringify((0, smithy_client_1._json)(input));
21
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
- };
23
- exports.se_BatchGetEffectiveLifecyclePolicyCommand = se_BatchGetEffectiveLifecyclePolicyCommand;
24
- const se_BatchGetLifecyclePolicyCommand = async (input, context) => {
25
- const headers = sharedHeaders("BatchGetLifecyclePolicy");
26
- let body;
27
- body = JSON.stringify((0, smithy_client_1._json)(input));
28
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
29
- };
30
- exports.se_BatchGetLifecyclePolicyCommand = se_BatchGetLifecyclePolicyCommand;
31
- const se_BatchGetVpcEndpointCommand = async (input, context) => {
32
- const headers = sharedHeaders("BatchGetVpcEndpoint");
33
- let body;
34
- body = JSON.stringify((0, smithy_client_1._json)(input));
35
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
36
- };
37
- exports.se_BatchGetVpcEndpointCommand = se_BatchGetVpcEndpointCommand;
38
- const se_CreateAccessPolicyCommand = async (input, context) => {
39
- const headers = sharedHeaders("CreateAccessPolicy");
40
- let body;
41
- body = JSON.stringify(se_CreateAccessPolicyRequest(input, context));
42
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
43
- };
44
- exports.se_CreateAccessPolicyCommand = se_CreateAccessPolicyCommand;
45
- const se_CreateCollectionCommand = async (input, context) => {
46
- const headers = sharedHeaders("CreateCollection");
47
- let body;
48
- body = JSON.stringify(se_CreateCollectionRequest(input, context));
49
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
50
- };
51
- exports.se_CreateCollectionCommand = se_CreateCollectionCommand;
52
- const se_CreateLifecyclePolicyCommand = async (input, context) => {
53
- const headers = sharedHeaders("CreateLifecyclePolicy");
54
- let body;
55
- body = JSON.stringify(se_CreateLifecyclePolicyRequest(input, context));
56
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
57
- };
58
- exports.se_CreateLifecyclePolicyCommand = se_CreateLifecyclePolicyCommand;
59
- const se_CreateSecurityConfigCommand = async (input, context) => {
60
- const headers = sharedHeaders("CreateSecurityConfig");
61
- let body;
62
- body = JSON.stringify(se_CreateSecurityConfigRequest(input, context));
63
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
64
- };
65
- exports.se_CreateSecurityConfigCommand = se_CreateSecurityConfigCommand;
66
- const se_CreateSecurityPolicyCommand = async (input, context) => {
67
- const headers = sharedHeaders("CreateSecurityPolicy");
68
- let body;
69
- body = JSON.stringify(se_CreateSecurityPolicyRequest(input, context));
70
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
71
- };
72
- exports.se_CreateSecurityPolicyCommand = se_CreateSecurityPolicyCommand;
73
- const se_CreateVpcEndpointCommand = async (input, context) => {
74
- const headers = sharedHeaders("CreateVpcEndpoint");
75
- let body;
76
- body = JSON.stringify(se_CreateVpcEndpointRequest(input, context));
77
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
78
- };
79
- exports.se_CreateVpcEndpointCommand = se_CreateVpcEndpointCommand;
80
- const se_DeleteAccessPolicyCommand = async (input, context) => {
81
- const headers = sharedHeaders("DeleteAccessPolicy");
82
- let body;
83
- body = JSON.stringify(se_DeleteAccessPolicyRequest(input, context));
84
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
85
- };
86
- exports.se_DeleteAccessPolicyCommand = se_DeleteAccessPolicyCommand;
87
- const se_DeleteCollectionCommand = async (input, context) => {
88
- const headers = sharedHeaders("DeleteCollection");
89
- let body;
90
- body = JSON.stringify(se_DeleteCollectionRequest(input, context));
91
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
92
- };
93
- exports.se_DeleteCollectionCommand = se_DeleteCollectionCommand;
94
- const se_DeleteLifecyclePolicyCommand = async (input, context) => {
95
- const headers = sharedHeaders("DeleteLifecyclePolicy");
96
- let body;
97
- body = JSON.stringify(se_DeleteLifecyclePolicyRequest(input, context));
98
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
99
- };
100
- exports.se_DeleteLifecyclePolicyCommand = se_DeleteLifecyclePolicyCommand;
101
- const se_DeleteSecurityConfigCommand = async (input, context) => {
102
- const headers = sharedHeaders("DeleteSecurityConfig");
103
- let body;
104
- body = JSON.stringify(se_DeleteSecurityConfigRequest(input, context));
105
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
106
- };
107
- exports.se_DeleteSecurityConfigCommand = se_DeleteSecurityConfigCommand;
108
- const se_DeleteSecurityPolicyCommand = async (input, context) => {
109
- const headers = sharedHeaders("DeleteSecurityPolicy");
110
- let body;
111
- body = JSON.stringify(se_DeleteSecurityPolicyRequest(input, context));
112
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
113
- };
114
- exports.se_DeleteSecurityPolicyCommand = se_DeleteSecurityPolicyCommand;
115
- const se_DeleteVpcEndpointCommand = async (input, context) => {
116
- const headers = sharedHeaders("DeleteVpcEndpoint");
117
- let body;
118
- body = JSON.stringify(se_DeleteVpcEndpointRequest(input, context));
119
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
120
- };
121
- exports.se_DeleteVpcEndpointCommand = se_DeleteVpcEndpointCommand;
122
- const se_GetAccessPolicyCommand = async (input, context) => {
123
- const headers = sharedHeaders("GetAccessPolicy");
124
- let body;
125
- body = JSON.stringify((0, smithy_client_1._json)(input));
126
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
127
- };
128
- exports.se_GetAccessPolicyCommand = se_GetAccessPolicyCommand;
129
- const se_GetAccountSettingsCommand = async (input, context) => {
130
- const headers = sharedHeaders("GetAccountSettings");
131
- let body;
132
- body = JSON.stringify((0, smithy_client_1._json)(input));
133
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
134
- };
135
- exports.se_GetAccountSettingsCommand = se_GetAccountSettingsCommand;
136
- const se_GetPoliciesStatsCommand = async (input, context) => {
137
- const headers = sharedHeaders("GetPoliciesStats");
138
- let body;
139
- body = JSON.stringify((0, smithy_client_1._json)(input));
140
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
141
- };
142
- exports.se_GetPoliciesStatsCommand = se_GetPoliciesStatsCommand;
143
- const se_GetSecurityConfigCommand = async (input, context) => {
144
- const headers = sharedHeaders("GetSecurityConfig");
145
- let body;
146
- body = JSON.stringify((0, smithy_client_1._json)(input));
147
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
148
- };
149
- exports.se_GetSecurityConfigCommand = se_GetSecurityConfigCommand;
150
- const se_GetSecurityPolicyCommand = async (input, context) => {
151
- const headers = sharedHeaders("GetSecurityPolicy");
152
- let body;
153
- body = JSON.stringify((0, smithy_client_1._json)(input));
154
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
155
- };
156
- exports.se_GetSecurityPolicyCommand = se_GetSecurityPolicyCommand;
157
- const se_ListAccessPoliciesCommand = async (input, context) => {
158
- const headers = sharedHeaders("ListAccessPolicies");
159
- let body;
160
- body = JSON.stringify((0, smithy_client_1._json)(input));
161
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
162
- };
163
- exports.se_ListAccessPoliciesCommand = se_ListAccessPoliciesCommand;
164
- const se_ListCollectionsCommand = async (input, context) => {
165
- const headers = sharedHeaders("ListCollections");
166
- let body;
167
- body = JSON.stringify((0, smithy_client_1._json)(input));
168
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
169
- };
170
- exports.se_ListCollectionsCommand = se_ListCollectionsCommand;
171
- const se_ListLifecyclePoliciesCommand = async (input, context) => {
172
- const headers = sharedHeaders("ListLifecyclePolicies");
173
- let body;
174
- body = JSON.stringify((0, smithy_client_1._json)(input));
175
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
176
- };
177
- exports.se_ListLifecyclePoliciesCommand = se_ListLifecyclePoliciesCommand;
178
- const se_ListSecurityConfigsCommand = async (input, context) => {
179
- const headers = sharedHeaders("ListSecurityConfigs");
180
- let body;
181
- body = JSON.stringify((0, smithy_client_1._json)(input));
182
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
183
- };
184
- exports.se_ListSecurityConfigsCommand = se_ListSecurityConfigsCommand;
185
- const se_ListSecurityPoliciesCommand = async (input, context) => {
186
- const headers = sharedHeaders("ListSecurityPolicies");
187
- let body;
188
- body = JSON.stringify((0, smithy_client_1._json)(input));
189
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
190
- };
191
- exports.se_ListSecurityPoliciesCommand = se_ListSecurityPoliciesCommand;
192
- const se_ListTagsForResourceCommand = async (input, context) => {
193
- const headers = sharedHeaders("ListTagsForResource");
194
- let body;
195
- body = JSON.stringify((0, smithy_client_1._json)(input));
196
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
197
- };
198
- exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
199
- const se_ListVpcEndpointsCommand = async (input, context) => {
200
- const headers = sharedHeaders("ListVpcEndpoints");
201
- let body;
202
- body = JSON.stringify((0, smithy_client_1._json)(input));
203
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
204
- };
205
- exports.se_ListVpcEndpointsCommand = se_ListVpcEndpointsCommand;
206
- const se_TagResourceCommand = async (input, context) => {
207
- const headers = sharedHeaders("TagResource");
208
- let body;
209
- body = JSON.stringify((0, smithy_client_1._json)(input));
210
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
211
- };
212
- exports.se_TagResourceCommand = se_TagResourceCommand;
213
- const se_UntagResourceCommand = async (input, context) => {
214
- const headers = sharedHeaders("UntagResource");
215
- let body;
216
- body = JSON.stringify((0, smithy_client_1._json)(input));
217
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
218
- };
219
- exports.se_UntagResourceCommand = se_UntagResourceCommand;
220
- const se_UpdateAccessPolicyCommand = async (input, context) => {
221
- const headers = sharedHeaders("UpdateAccessPolicy");
222
- let body;
223
- body = JSON.stringify(se_UpdateAccessPolicyRequest(input, context));
224
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
225
- };
226
- exports.se_UpdateAccessPolicyCommand = se_UpdateAccessPolicyCommand;
227
- const se_UpdateAccountSettingsCommand = async (input, context) => {
228
- const headers = sharedHeaders("UpdateAccountSettings");
229
- let body;
230
- body = JSON.stringify((0, smithy_client_1._json)(input));
231
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
232
- };
233
- exports.se_UpdateAccountSettingsCommand = se_UpdateAccountSettingsCommand;
234
- const se_UpdateCollectionCommand = async (input, context) => {
235
- const headers = sharedHeaders("UpdateCollection");
236
- let body;
237
- body = JSON.stringify(se_UpdateCollectionRequest(input, context));
238
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
239
- };
240
- exports.se_UpdateCollectionCommand = se_UpdateCollectionCommand;
241
- const se_UpdateLifecyclePolicyCommand = async (input, context) => {
242
- const headers = sharedHeaders("UpdateLifecyclePolicy");
243
- let body;
244
- body = JSON.stringify(se_UpdateLifecyclePolicyRequest(input, context));
245
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
246
- };
247
- exports.se_UpdateLifecyclePolicyCommand = se_UpdateLifecyclePolicyCommand;
248
- const se_UpdateSecurityConfigCommand = async (input, context) => {
249
- const headers = sharedHeaders("UpdateSecurityConfig");
250
- let body;
251
- body = JSON.stringify(se_UpdateSecurityConfigRequest(input, context));
252
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
253
- };
254
- exports.se_UpdateSecurityConfigCommand = se_UpdateSecurityConfigCommand;
255
- const se_UpdateSecurityPolicyCommand = async (input, context) => {
256
- const headers = sharedHeaders("UpdateSecurityPolicy");
257
- let body;
258
- body = JSON.stringify(se_UpdateSecurityPolicyRequest(input, context));
259
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
260
- };
261
- exports.se_UpdateSecurityPolicyCommand = se_UpdateSecurityPolicyCommand;
262
- const se_UpdateVpcEndpointCommand = async (input, context) => {
263
- const headers = sharedHeaders("UpdateVpcEndpoint");
264
- let body;
265
- body = JSON.stringify(se_UpdateVpcEndpointRequest(input, context));
266
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
267
- };
268
- exports.se_UpdateVpcEndpointCommand = se_UpdateVpcEndpointCommand;
269
- const de_BatchGetCollectionCommand = async (output, context) => {
270
- if (output.statusCode >= 300) {
271
- return de_BatchGetCollectionCommandError(output, context);
272
- }
273
- const data = await parseBody(output.body, context);
274
- let contents = {};
275
- contents = (0, smithy_client_1._json)(data);
276
- const response = {
277
- $metadata: deserializeMetadata(output),
278
- ...contents,
279
- };
280
- return response;
281
- };
282
- exports.de_BatchGetCollectionCommand = de_BatchGetCollectionCommand;
283
- const de_BatchGetCollectionCommandError = async (output, context) => {
284
- const parsedOutput = {
285
- ...output,
286
- body: await parseErrorBody(output.body, context),
287
- };
288
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
289
- switch (errorCode) {
290
- case "InternalServerException":
291
- case "com.amazonaws.opensearchserverless#InternalServerException":
292
- throw await de_InternalServerExceptionRes(parsedOutput, context);
293
- case "ValidationException":
294
- case "com.amazonaws.opensearchserverless#ValidationException":
295
- throw await de_ValidationExceptionRes(parsedOutput, context);
296
- default:
297
- const parsedBody = parsedOutput.body;
298
- return throwDefaultError({
299
- output,
300
- parsedBody,
301
- errorCode,
302
- });
303
- }
304
- };
305
- const de_BatchGetEffectiveLifecyclePolicyCommand = async (output, context) => {
306
- if (output.statusCode >= 300) {
307
- return de_BatchGetEffectiveLifecyclePolicyCommandError(output, context);
308
- }
309
- const data = await parseBody(output.body, context);
310
- let contents = {};
311
- contents = (0, smithy_client_1._json)(data);
312
- const response = {
313
- $metadata: deserializeMetadata(output),
314
- ...contents,
315
- };
316
- return response;
317
- };
318
- exports.de_BatchGetEffectiveLifecyclePolicyCommand = de_BatchGetEffectiveLifecyclePolicyCommand;
319
- const de_BatchGetEffectiveLifecyclePolicyCommandError = async (output, context) => {
320
- const parsedOutput = {
321
- ...output,
322
- body: await parseErrorBody(output.body, context),
323
- };
324
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
325
- switch (errorCode) {
326
- case "InternalServerException":
327
- case "com.amazonaws.opensearchserverless#InternalServerException":
328
- throw await de_InternalServerExceptionRes(parsedOutput, context);
329
- case "ValidationException":
330
- case "com.amazonaws.opensearchserverless#ValidationException":
331
- throw await de_ValidationExceptionRes(parsedOutput, context);
332
- default:
333
- const parsedBody = parsedOutput.body;
334
- return throwDefaultError({
335
- output,
336
- parsedBody,
337
- errorCode,
338
- });
339
- }
340
- };
341
- const de_BatchGetLifecyclePolicyCommand = async (output, context) => {
342
- if (output.statusCode >= 300) {
343
- return de_BatchGetLifecyclePolicyCommandError(output, context);
344
- }
345
- const data = await parseBody(output.body, context);
346
- let contents = {};
347
- contents = de_BatchGetLifecyclePolicyResponse(data, context);
348
- const response = {
349
- $metadata: deserializeMetadata(output),
350
- ...contents,
351
- };
352
- return response;
353
- };
354
- exports.de_BatchGetLifecyclePolicyCommand = de_BatchGetLifecyclePolicyCommand;
355
- const de_BatchGetLifecyclePolicyCommandError = async (output, context) => {
356
- const parsedOutput = {
357
- ...output,
358
- body: await parseErrorBody(output.body, context),
359
- };
360
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
361
- switch (errorCode) {
362
- case "InternalServerException":
363
- case "com.amazonaws.opensearchserverless#InternalServerException":
364
- throw await de_InternalServerExceptionRes(parsedOutput, context);
365
- case "ValidationException":
366
- case "com.amazonaws.opensearchserverless#ValidationException":
367
- throw await de_ValidationExceptionRes(parsedOutput, context);
368
- default:
369
- const parsedBody = parsedOutput.body;
370
- return throwDefaultError({
371
- output,
372
- parsedBody,
373
- errorCode,
374
- });
375
- }
376
- };
377
- const de_BatchGetVpcEndpointCommand = async (output, context) => {
378
- if (output.statusCode >= 300) {
379
- return de_BatchGetVpcEndpointCommandError(output, context);
380
- }
381
- const data = await parseBody(output.body, context);
382
- let contents = {};
383
- contents = (0, smithy_client_1._json)(data);
384
- const response = {
385
- $metadata: deserializeMetadata(output),
386
- ...contents,
387
- };
388
- return response;
389
- };
390
- exports.de_BatchGetVpcEndpointCommand = de_BatchGetVpcEndpointCommand;
391
- const de_BatchGetVpcEndpointCommandError = async (output, context) => {
392
- const parsedOutput = {
393
- ...output,
394
- body: await parseErrorBody(output.body, context),
395
- };
396
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
397
- switch (errorCode) {
398
- case "InternalServerException":
399
- case "com.amazonaws.opensearchserverless#InternalServerException":
400
- throw await de_InternalServerExceptionRes(parsedOutput, context);
401
- case "ValidationException":
402
- case "com.amazonaws.opensearchserverless#ValidationException":
403
- throw await de_ValidationExceptionRes(parsedOutput, context);
404
- default:
405
- const parsedBody = parsedOutput.body;
406
- return throwDefaultError({
407
- output,
408
- parsedBody,
409
- errorCode,
410
- });
411
- }
412
- };
413
- const de_CreateAccessPolicyCommand = async (output, context) => {
414
- if (output.statusCode >= 300) {
415
- return de_CreateAccessPolicyCommandError(output, context);
416
- }
417
- const data = await parseBody(output.body, context);
418
- let contents = {};
419
- contents = de_CreateAccessPolicyResponse(data, context);
420
- const response = {
421
- $metadata: deserializeMetadata(output),
422
- ...contents,
423
- };
424
- return response;
425
- };
426
- exports.de_CreateAccessPolicyCommand = de_CreateAccessPolicyCommand;
427
- const de_CreateAccessPolicyCommandError = async (output, context) => {
428
- const parsedOutput = {
429
- ...output,
430
- body: await parseErrorBody(output.body, context),
431
- };
432
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
433
- switch (errorCode) {
434
- case "ConflictException":
435
- case "com.amazonaws.opensearchserverless#ConflictException":
436
- throw await de_ConflictExceptionRes(parsedOutput, context);
437
- case "InternalServerException":
438
- case "com.amazonaws.opensearchserverless#InternalServerException":
439
- throw await de_InternalServerExceptionRes(parsedOutput, context);
440
- case "ServiceQuotaExceededException":
441
- case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException":
442
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
443
- case "ValidationException":
444
- case "com.amazonaws.opensearchserverless#ValidationException":
445
- throw await de_ValidationExceptionRes(parsedOutput, context);
446
- default:
447
- const parsedBody = parsedOutput.body;
448
- return throwDefaultError({
449
- output,
450
- parsedBody,
451
- errorCode,
452
- });
453
- }
454
- };
455
- const de_CreateCollectionCommand = async (output, context) => {
456
- if (output.statusCode >= 300) {
457
- return de_CreateCollectionCommandError(output, context);
458
- }
459
- const data = await parseBody(output.body, context);
460
- let contents = {};
461
- contents = (0, smithy_client_1._json)(data);
462
- const response = {
463
- $metadata: deserializeMetadata(output),
464
- ...contents,
465
- };
466
- return response;
467
- };
468
- exports.de_CreateCollectionCommand = de_CreateCollectionCommand;
469
- const de_CreateCollectionCommandError = async (output, context) => {
470
- const parsedOutput = {
471
- ...output,
472
- body: await parseErrorBody(output.body, context),
473
- };
474
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
475
- switch (errorCode) {
476
- case "ConflictException":
477
- case "com.amazonaws.opensearchserverless#ConflictException":
478
- throw await de_ConflictExceptionRes(parsedOutput, context);
479
- case "InternalServerException":
480
- case "com.amazonaws.opensearchserverless#InternalServerException":
481
- throw await de_InternalServerExceptionRes(parsedOutput, context);
482
- case "OcuLimitExceededException":
483
- case "com.amazonaws.opensearchserverless#OcuLimitExceededException":
484
- throw await de_OcuLimitExceededExceptionRes(parsedOutput, context);
485
- case "ServiceQuotaExceededException":
486
- case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException":
487
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
488
- case "ValidationException":
489
- case "com.amazonaws.opensearchserverless#ValidationException":
490
- throw await de_ValidationExceptionRes(parsedOutput, context);
491
- default:
492
- const parsedBody = parsedOutput.body;
493
- return throwDefaultError({
494
- output,
495
- parsedBody,
496
- errorCode,
497
- });
498
- }
499
- };
500
- const de_CreateLifecyclePolicyCommand = async (output, context) => {
501
- if (output.statusCode >= 300) {
502
- return de_CreateLifecyclePolicyCommandError(output, context);
503
- }
504
- const data = await parseBody(output.body, context);
505
- let contents = {};
506
- contents = de_CreateLifecyclePolicyResponse(data, context);
507
- const response = {
508
- $metadata: deserializeMetadata(output),
509
- ...contents,
510
- };
511
- return response;
512
- };
513
- exports.de_CreateLifecyclePolicyCommand = de_CreateLifecyclePolicyCommand;
514
- const de_CreateLifecyclePolicyCommandError = async (output, context) => {
515
- const parsedOutput = {
516
- ...output,
517
- body: await parseErrorBody(output.body, context),
518
- };
519
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
520
- switch (errorCode) {
521
- case "ConflictException":
522
- case "com.amazonaws.opensearchserverless#ConflictException":
523
- throw await de_ConflictExceptionRes(parsedOutput, context);
524
- case "InternalServerException":
525
- case "com.amazonaws.opensearchserverless#InternalServerException":
526
- throw await de_InternalServerExceptionRes(parsedOutput, context);
527
- case "ServiceQuotaExceededException":
528
- case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException":
529
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
530
- case "ValidationException":
531
- case "com.amazonaws.opensearchserverless#ValidationException":
532
- throw await de_ValidationExceptionRes(parsedOutput, context);
533
- default:
534
- const parsedBody = parsedOutput.body;
535
- return throwDefaultError({
536
- output,
537
- parsedBody,
538
- errorCode,
539
- });
540
- }
541
- };
542
- const de_CreateSecurityConfigCommand = async (output, context) => {
543
- if (output.statusCode >= 300) {
544
- return de_CreateSecurityConfigCommandError(output, context);
545
- }
546
- const data = await parseBody(output.body, context);
547
- let contents = {};
548
- contents = (0, smithy_client_1._json)(data);
549
- const response = {
550
- $metadata: deserializeMetadata(output),
551
- ...contents,
552
- };
553
- return response;
554
- };
555
- exports.de_CreateSecurityConfigCommand = de_CreateSecurityConfigCommand;
556
- const de_CreateSecurityConfigCommandError = async (output, context) => {
557
- const parsedOutput = {
558
- ...output,
559
- body: await parseErrorBody(output.body, context),
560
- };
561
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
562
- switch (errorCode) {
563
- case "ConflictException":
564
- case "com.amazonaws.opensearchserverless#ConflictException":
565
- throw await de_ConflictExceptionRes(parsedOutput, context);
566
- case "InternalServerException":
567
- case "com.amazonaws.opensearchserverless#InternalServerException":
568
- throw await de_InternalServerExceptionRes(parsedOutput, context);
569
- case "ServiceQuotaExceededException":
570
- case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException":
571
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
572
- case "ValidationException":
573
- case "com.amazonaws.opensearchserverless#ValidationException":
574
- throw await de_ValidationExceptionRes(parsedOutput, context);
575
- default:
576
- const parsedBody = parsedOutput.body;
577
- return throwDefaultError({
578
- output,
579
- parsedBody,
580
- errorCode,
581
- });
582
- }
583
- };
584
- const de_CreateSecurityPolicyCommand = async (output, context) => {
585
- if (output.statusCode >= 300) {
586
- return de_CreateSecurityPolicyCommandError(output, context);
587
- }
588
- const data = await parseBody(output.body, context);
589
- let contents = {};
590
- contents = de_CreateSecurityPolicyResponse(data, context);
591
- const response = {
592
- $metadata: deserializeMetadata(output),
593
- ...contents,
594
- };
595
- return response;
596
- };
597
- exports.de_CreateSecurityPolicyCommand = de_CreateSecurityPolicyCommand;
598
- const de_CreateSecurityPolicyCommandError = async (output, context) => {
599
- const parsedOutput = {
600
- ...output,
601
- body: await parseErrorBody(output.body, context),
602
- };
603
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
604
- switch (errorCode) {
605
- case "ConflictException":
606
- case "com.amazonaws.opensearchserverless#ConflictException":
607
- throw await de_ConflictExceptionRes(parsedOutput, context);
608
- case "InternalServerException":
609
- case "com.amazonaws.opensearchserverless#InternalServerException":
610
- throw await de_InternalServerExceptionRes(parsedOutput, context);
611
- case "ServiceQuotaExceededException":
612
- case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException":
613
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
614
- case "ValidationException":
615
- case "com.amazonaws.opensearchserverless#ValidationException":
616
- throw await de_ValidationExceptionRes(parsedOutput, context);
617
- default:
618
- const parsedBody = parsedOutput.body;
619
- return throwDefaultError({
620
- output,
621
- parsedBody,
622
- errorCode,
623
- });
624
- }
625
- };
626
- const de_CreateVpcEndpointCommand = async (output, context) => {
627
- if (output.statusCode >= 300) {
628
- return de_CreateVpcEndpointCommandError(output, context);
629
- }
630
- const data = await parseBody(output.body, context);
631
- let contents = {};
632
- contents = (0, smithy_client_1._json)(data);
633
- const response = {
634
- $metadata: deserializeMetadata(output),
635
- ...contents,
636
- };
637
- return response;
638
- };
639
- exports.de_CreateVpcEndpointCommand = de_CreateVpcEndpointCommand;
640
- const de_CreateVpcEndpointCommandError = async (output, context) => {
641
- const parsedOutput = {
642
- ...output,
643
- body: await parseErrorBody(output.body, context),
644
- };
645
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
646
- switch (errorCode) {
647
- case "ConflictException":
648
- case "com.amazonaws.opensearchserverless#ConflictException":
649
- throw await de_ConflictExceptionRes(parsedOutput, context);
650
- case "InternalServerException":
651
- case "com.amazonaws.opensearchserverless#InternalServerException":
652
- throw await de_InternalServerExceptionRes(parsedOutput, context);
653
- case "ServiceQuotaExceededException":
654
- case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException":
655
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
656
- case "ValidationException":
657
- case "com.amazonaws.opensearchserverless#ValidationException":
658
- throw await de_ValidationExceptionRes(parsedOutput, context);
659
- default:
660
- const parsedBody = parsedOutput.body;
661
- return throwDefaultError({
662
- output,
663
- parsedBody,
664
- errorCode,
665
- });
666
- }
667
- };
668
- const de_DeleteAccessPolicyCommand = async (output, context) => {
669
- if (output.statusCode >= 300) {
670
- return de_DeleteAccessPolicyCommandError(output, context);
671
- }
672
- const data = await parseBody(output.body, context);
673
- let contents = {};
674
- contents = (0, smithy_client_1._json)(data);
675
- const response = {
676
- $metadata: deserializeMetadata(output),
677
- ...contents,
678
- };
679
- return response;
680
- };
681
- exports.de_DeleteAccessPolicyCommand = de_DeleteAccessPolicyCommand;
682
- const de_DeleteAccessPolicyCommandError = async (output, context) => {
683
- const parsedOutput = {
684
- ...output,
685
- body: await parseErrorBody(output.body, context),
686
- };
687
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
688
- switch (errorCode) {
689
- case "ConflictException":
690
- case "com.amazonaws.opensearchserverless#ConflictException":
691
- throw await de_ConflictExceptionRes(parsedOutput, context);
692
- case "InternalServerException":
693
- case "com.amazonaws.opensearchserverless#InternalServerException":
694
- throw await de_InternalServerExceptionRes(parsedOutput, context);
695
- case "ResourceNotFoundException":
696
- case "com.amazonaws.opensearchserverless#ResourceNotFoundException":
697
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
698
- case "ValidationException":
699
- case "com.amazonaws.opensearchserverless#ValidationException":
700
- throw await de_ValidationExceptionRes(parsedOutput, context);
701
- default:
702
- const parsedBody = parsedOutput.body;
703
- return throwDefaultError({
704
- output,
705
- parsedBody,
706
- errorCode,
707
- });
708
- }
709
- };
710
- const de_DeleteCollectionCommand = async (output, context) => {
711
- if (output.statusCode >= 300) {
712
- return de_DeleteCollectionCommandError(output, context);
713
- }
714
- const data = await parseBody(output.body, context);
715
- let contents = {};
716
- contents = (0, smithy_client_1._json)(data);
717
- const response = {
718
- $metadata: deserializeMetadata(output),
719
- ...contents,
720
- };
721
- return response;
722
- };
723
- exports.de_DeleteCollectionCommand = de_DeleteCollectionCommand;
724
- const de_DeleteCollectionCommandError = async (output, context) => {
725
- const parsedOutput = {
726
- ...output,
727
- body: await parseErrorBody(output.body, context),
728
- };
729
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
730
- switch (errorCode) {
731
- case "ConflictException":
732
- case "com.amazonaws.opensearchserverless#ConflictException":
733
- throw await de_ConflictExceptionRes(parsedOutput, context);
734
- case "InternalServerException":
735
- case "com.amazonaws.opensearchserverless#InternalServerException":
736
- throw await de_InternalServerExceptionRes(parsedOutput, context);
737
- case "ResourceNotFoundException":
738
- case "com.amazonaws.opensearchserverless#ResourceNotFoundException":
739
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
740
- case "ValidationException":
741
- case "com.amazonaws.opensearchserverless#ValidationException":
742
- throw await de_ValidationExceptionRes(parsedOutput, context);
743
- default:
744
- const parsedBody = parsedOutput.body;
745
- return throwDefaultError({
746
- output,
747
- parsedBody,
748
- errorCode,
749
- });
750
- }
751
- };
752
- const de_DeleteLifecyclePolicyCommand = async (output, context) => {
753
- if (output.statusCode >= 300) {
754
- return de_DeleteLifecyclePolicyCommandError(output, context);
755
- }
756
- const data = await parseBody(output.body, context);
757
- let contents = {};
758
- contents = (0, smithy_client_1._json)(data);
759
- const response = {
760
- $metadata: deserializeMetadata(output),
761
- ...contents,
762
- };
763
- return response;
764
- };
765
- exports.de_DeleteLifecyclePolicyCommand = de_DeleteLifecyclePolicyCommand;
766
- const de_DeleteLifecyclePolicyCommandError = async (output, context) => {
767
- const parsedOutput = {
768
- ...output,
769
- body: await parseErrorBody(output.body, context),
770
- };
771
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
772
- switch (errorCode) {
773
- case "ConflictException":
774
- case "com.amazonaws.opensearchserverless#ConflictException":
775
- throw await de_ConflictExceptionRes(parsedOutput, context);
776
- case "InternalServerException":
777
- case "com.amazonaws.opensearchserverless#InternalServerException":
778
- throw await de_InternalServerExceptionRes(parsedOutput, context);
779
- case "ResourceNotFoundException":
780
- case "com.amazonaws.opensearchserverless#ResourceNotFoundException":
781
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
782
- case "ValidationException":
783
- case "com.amazonaws.opensearchserverless#ValidationException":
784
- throw await de_ValidationExceptionRes(parsedOutput, context);
785
- default:
786
- const parsedBody = parsedOutput.body;
787
- return throwDefaultError({
788
- output,
789
- parsedBody,
790
- errorCode,
791
- });
792
- }
793
- };
794
- const de_DeleteSecurityConfigCommand = async (output, context) => {
795
- if (output.statusCode >= 300) {
796
- return de_DeleteSecurityConfigCommandError(output, context);
797
- }
798
- const data = await parseBody(output.body, context);
799
- let contents = {};
800
- contents = (0, smithy_client_1._json)(data);
801
- const response = {
802
- $metadata: deserializeMetadata(output),
803
- ...contents,
804
- };
805
- return response;
806
- };
807
- exports.de_DeleteSecurityConfigCommand = de_DeleteSecurityConfigCommand;
808
- const de_DeleteSecurityConfigCommandError = async (output, context) => {
809
- const parsedOutput = {
810
- ...output,
811
- body: await parseErrorBody(output.body, context),
812
- };
813
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
814
- switch (errorCode) {
815
- case "ConflictException":
816
- case "com.amazonaws.opensearchserverless#ConflictException":
817
- throw await de_ConflictExceptionRes(parsedOutput, context);
818
- case "InternalServerException":
819
- case "com.amazonaws.opensearchserverless#InternalServerException":
820
- throw await de_InternalServerExceptionRes(parsedOutput, context);
821
- case "ResourceNotFoundException":
822
- case "com.amazonaws.opensearchserverless#ResourceNotFoundException":
823
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
824
- case "ValidationException":
825
- case "com.amazonaws.opensearchserverless#ValidationException":
826
- throw await de_ValidationExceptionRes(parsedOutput, context);
827
- default:
828
- const parsedBody = parsedOutput.body;
829
- return throwDefaultError({
830
- output,
831
- parsedBody,
832
- errorCode,
833
- });
834
- }
835
- };
836
- const de_DeleteSecurityPolicyCommand = async (output, context) => {
837
- if (output.statusCode >= 300) {
838
- return de_DeleteSecurityPolicyCommandError(output, context);
839
- }
840
- const data = await parseBody(output.body, context);
841
- let contents = {};
842
- contents = (0, smithy_client_1._json)(data);
843
- const response = {
844
- $metadata: deserializeMetadata(output),
845
- ...contents,
846
- };
847
- return response;
848
- };
849
- exports.de_DeleteSecurityPolicyCommand = de_DeleteSecurityPolicyCommand;
850
- const de_DeleteSecurityPolicyCommandError = async (output, context) => {
851
- const parsedOutput = {
852
- ...output,
853
- body: await parseErrorBody(output.body, context),
854
- };
855
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
856
- switch (errorCode) {
857
- case "ConflictException":
858
- case "com.amazonaws.opensearchserverless#ConflictException":
859
- throw await de_ConflictExceptionRes(parsedOutput, context);
860
- case "InternalServerException":
861
- case "com.amazonaws.opensearchserverless#InternalServerException":
862
- throw await de_InternalServerExceptionRes(parsedOutput, context);
863
- case "ResourceNotFoundException":
864
- case "com.amazonaws.opensearchserverless#ResourceNotFoundException":
865
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
866
- case "ValidationException":
867
- case "com.amazonaws.opensearchserverless#ValidationException":
868
- throw await de_ValidationExceptionRes(parsedOutput, context);
869
- default:
870
- const parsedBody = parsedOutput.body;
871
- return throwDefaultError({
872
- output,
873
- parsedBody,
874
- errorCode,
875
- });
876
- }
877
- };
878
- const de_DeleteVpcEndpointCommand = async (output, context) => {
879
- if (output.statusCode >= 300) {
880
- return de_DeleteVpcEndpointCommandError(output, context);
881
- }
882
- const data = await parseBody(output.body, context);
883
- let contents = {};
884
- contents = (0, smithy_client_1._json)(data);
885
- const response = {
886
- $metadata: deserializeMetadata(output),
887
- ...contents,
888
- };
889
- return response;
890
- };
891
- exports.de_DeleteVpcEndpointCommand = de_DeleteVpcEndpointCommand;
892
- const de_DeleteVpcEndpointCommandError = async (output, context) => {
893
- const parsedOutput = {
894
- ...output,
895
- body: await parseErrorBody(output.body, context),
896
- };
897
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
898
- switch (errorCode) {
899
- case "ConflictException":
900
- case "com.amazonaws.opensearchserverless#ConflictException":
901
- throw await de_ConflictExceptionRes(parsedOutput, context);
902
- case "InternalServerException":
903
- case "com.amazonaws.opensearchserverless#InternalServerException":
904
- throw await de_InternalServerExceptionRes(parsedOutput, context);
905
- case "ResourceNotFoundException":
906
- case "com.amazonaws.opensearchserverless#ResourceNotFoundException":
907
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
908
- case "ValidationException":
909
- case "com.amazonaws.opensearchserverless#ValidationException":
910
- throw await de_ValidationExceptionRes(parsedOutput, context);
911
- default:
912
- const parsedBody = parsedOutput.body;
913
- return throwDefaultError({
914
- output,
915
- parsedBody,
916
- errorCode,
917
- });
918
- }
919
- };
920
- const de_GetAccessPolicyCommand = async (output, context) => {
921
- if (output.statusCode >= 300) {
922
- return de_GetAccessPolicyCommandError(output, context);
923
- }
924
- const data = await parseBody(output.body, context);
925
- let contents = {};
926
- contents = de_GetAccessPolicyResponse(data, context);
927
- const response = {
928
- $metadata: deserializeMetadata(output),
929
- ...contents,
930
- };
931
- return response;
932
- };
933
- exports.de_GetAccessPolicyCommand = de_GetAccessPolicyCommand;
934
- const de_GetAccessPolicyCommandError = async (output, context) => {
935
- const parsedOutput = {
936
- ...output,
937
- body: await parseErrorBody(output.body, context),
938
- };
939
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
940
- switch (errorCode) {
941
- case "InternalServerException":
942
- case "com.amazonaws.opensearchserverless#InternalServerException":
943
- throw await de_InternalServerExceptionRes(parsedOutput, context);
944
- case "ResourceNotFoundException":
945
- case "com.amazonaws.opensearchserverless#ResourceNotFoundException":
946
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
947
- case "ValidationException":
948
- case "com.amazonaws.opensearchserverless#ValidationException":
949
- throw await de_ValidationExceptionRes(parsedOutput, context);
950
- default:
951
- const parsedBody = parsedOutput.body;
952
- return throwDefaultError({
953
- output,
954
- parsedBody,
955
- errorCode,
956
- });
957
- }
958
- };
959
- const de_GetAccountSettingsCommand = async (output, context) => {
960
- if (output.statusCode >= 300) {
961
- return de_GetAccountSettingsCommandError(output, context);
962
- }
963
- const data = await parseBody(output.body, context);
964
- let contents = {};
965
- contents = (0, smithy_client_1._json)(data);
966
- const response = {
967
- $metadata: deserializeMetadata(output),
968
- ...contents,
969
- };
970
- return response;
971
- };
972
- exports.de_GetAccountSettingsCommand = de_GetAccountSettingsCommand;
973
- const de_GetAccountSettingsCommandError = async (output, context) => {
974
- const parsedOutput = {
975
- ...output,
976
- body: await parseErrorBody(output.body, context),
977
- };
978
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
979
- switch (errorCode) {
980
- case "InternalServerException":
981
- case "com.amazonaws.opensearchserverless#InternalServerException":
982
- throw await de_InternalServerExceptionRes(parsedOutput, context);
983
- case "ValidationException":
984
- case "com.amazonaws.opensearchserverless#ValidationException":
985
- throw await de_ValidationExceptionRes(parsedOutput, context);
986
- default:
987
- const parsedBody = parsedOutput.body;
988
- return throwDefaultError({
989
- output,
990
- parsedBody,
991
- errorCode,
992
- });
993
- }
994
- };
995
- const de_GetPoliciesStatsCommand = async (output, context) => {
996
- if (output.statusCode >= 300) {
997
- return de_GetPoliciesStatsCommandError(output, context);
998
- }
999
- const data = await parseBody(output.body, context);
1000
- let contents = {};
1001
- contents = (0, smithy_client_1._json)(data);
1002
- const response = {
1003
- $metadata: deserializeMetadata(output),
1004
- ...contents,
1005
- };
1006
- return response;
1007
- };
1008
- exports.de_GetPoliciesStatsCommand = de_GetPoliciesStatsCommand;
1009
- const de_GetPoliciesStatsCommandError = async (output, context) => {
1010
- const parsedOutput = {
1011
- ...output,
1012
- body: await parseErrorBody(output.body, context),
1013
- };
1014
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1015
- switch (errorCode) {
1016
- case "InternalServerException":
1017
- case "com.amazonaws.opensearchserverless#InternalServerException":
1018
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1019
- default:
1020
- const parsedBody = parsedOutput.body;
1021
- return throwDefaultError({
1022
- output,
1023
- parsedBody,
1024
- errorCode,
1025
- });
1026
- }
1027
- };
1028
- const de_GetSecurityConfigCommand = async (output, context) => {
1029
- if (output.statusCode >= 300) {
1030
- return de_GetSecurityConfigCommandError(output, context);
1031
- }
1032
- const data = await parseBody(output.body, context);
1033
- let contents = {};
1034
- contents = (0, smithy_client_1._json)(data);
1035
- const response = {
1036
- $metadata: deserializeMetadata(output),
1037
- ...contents,
1038
- };
1039
- return response;
1040
- };
1041
- exports.de_GetSecurityConfigCommand = de_GetSecurityConfigCommand;
1042
- const de_GetSecurityConfigCommandError = async (output, context) => {
1043
- const parsedOutput = {
1044
- ...output,
1045
- body: await parseErrorBody(output.body, context),
1046
- };
1047
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1048
- switch (errorCode) {
1049
- case "InternalServerException":
1050
- case "com.amazonaws.opensearchserverless#InternalServerException":
1051
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1052
- case "ResourceNotFoundException":
1053
- case "com.amazonaws.opensearchserverless#ResourceNotFoundException":
1054
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1055
- case "ValidationException":
1056
- case "com.amazonaws.opensearchserverless#ValidationException":
1057
- throw await de_ValidationExceptionRes(parsedOutput, context);
1058
- default:
1059
- const parsedBody = parsedOutput.body;
1060
- return throwDefaultError({
1061
- output,
1062
- parsedBody,
1063
- errorCode,
1064
- });
1065
- }
1066
- };
1067
- const de_GetSecurityPolicyCommand = async (output, context) => {
1068
- if (output.statusCode >= 300) {
1069
- return de_GetSecurityPolicyCommandError(output, context);
1070
- }
1071
- const data = await parseBody(output.body, context);
1072
- let contents = {};
1073
- contents = de_GetSecurityPolicyResponse(data, context);
1074
- const response = {
1075
- $metadata: deserializeMetadata(output),
1076
- ...contents,
1077
- };
1078
- return response;
1079
- };
1080
- exports.de_GetSecurityPolicyCommand = de_GetSecurityPolicyCommand;
1081
- const de_GetSecurityPolicyCommandError = async (output, context) => {
1082
- const parsedOutput = {
1083
- ...output,
1084
- body: await parseErrorBody(output.body, context),
1085
- };
1086
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1087
- switch (errorCode) {
1088
- case "InternalServerException":
1089
- case "com.amazonaws.opensearchserverless#InternalServerException":
1090
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1091
- case "ResourceNotFoundException":
1092
- case "com.amazonaws.opensearchserverless#ResourceNotFoundException":
1093
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1094
- case "ValidationException":
1095
- case "com.amazonaws.opensearchserverless#ValidationException":
1096
- throw await de_ValidationExceptionRes(parsedOutput, context);
1097
- default:
1098
- const parsedBody = parsedOutput.body;
1099
- return throwDefaultError({
1100
- output,
1101
- parsedBody,
1102
- errorCode,
1103
- });
1104
- }
1105
- };
1106
- const de_ListAccessPoliciesCommand = async (output, context) => {
1107
- if (output.statusCode >= 300) {
1108
- return de_ListAccessPoliciesCommandError(output, context);
1109
- }
1110
- const data = await parseBody(output.body, context);
1111
- let contents = {};
1112
- contents = (0, smithy_client_1._json)(data);
1113
- const response = {
1114
- $metadata: deserializeMetadata(output),
1115
- ...contents,
1116
- };
1117
- return response;
1118
- };
1119
- exports.de_ListAccessPoliciesCommand = de_ListAccessPoliciesCommand;
1120
- const de_ListAccessPoliciesCommandError = async (output, context) => {
1121
- const parsedOutput = {
1122
- ...output,
1123
- body: await parseErrorBody(output.body, context),
1124
- };
1125
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1126
- switch (errorCode) {
1127
- case "InternalServerException":
1128
- case "com.amazonaws.opensearchserverless#InternalServerException":
1129
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1130
- case "ValidationException":
1131
- case "com.amazonaws.opensearchserverless#ValidationException":
1132
- throw await de_ValidationExceptionRes(parsedOutput, context);
1133
- default:
1134
- const parsedBody = parsedOutput.body;
1135
- return throwDefaultError({
1136
- output,
1137
- parsedBody,
1138
- errorCode,
1139
- });
1140
- }
1141
- };
1142
- const de_ListCollectionsCommand = async (output, context) => {
1143
- if (output.statusCode >= 300) {
1144
- return de_ListCollectionsCommandError(output, context);
1145
- }
1146
- const data = await parseBody(output.body, context);
1147
- let contents = {};
1148
- contents = (0, smithy_client_1._json)(data);
1149
- const response = {
1150
- $metadata: deserializeMetadata(output),
1151
- ...contents,
1152
- };
1153
- return response;
1154
- };
1155
- exports.de_ListCollectionsCommand = de_ListCollectionsCommand;
1156
- const de_ListCollectionsCommandError = async (output, context) => {
1157
- const parsedOutput = {
1158
- ...output,
1159
- body: await parseErrorBody(output.body, context),
1160
- };
1161
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1162
- switch (errorCode) {
1163
- case "InternalServerException":
1164
- case "com.amazonaws.opensearchserverless#InternalServerException":
1165
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1166
- case "ValidationException":
1167
- case "com.amazonaws.opensearchserverless#ValidationException":
1168
- throw await de_ValidationExceptionRes(parsedOutput, context);
1169
- default:
1170
- const parsedBody = parsedOutput.body;
1171
- return throwDefaultError({
1172
- output,
1173
- parsedBody,
1174
- errorCode,
1175
- });
1176
- }
1177
- };
1178
- const de_ListLifecyclePoliciesCommand = async (output, context) => {
1179
- if (output.statusCode >= 300) {
1180
- return de_ListLifecyclePoliciesCommandError(output, context);
1181
- }
1182
- const data = await parseBody(output.body, context);
1183
- let contents = {};
1184
- contents = (0, smithy_client_1._json)(data);
1185
- const response = {
1186
- $metadata: deserializeMetadata(output),
1187
- ...contents,
1188
- };
1189
- return response;
1190
- };
1191
- exports.de_ListLifecyclePoliciesCommand = de_ListLifecyclePoliciesCommand;
1192
- const de_ListLifecyclePoliciesCommandError = async (output, context) => {
1193
- const parsedOutput = {
1194
- ...output,
1195
- body: await parseErrorBody(output.body, context),
1196
- };
1197
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1198
- switch (errorCode) {
1199
- case "InternalServerException":
1200
- case "com.amazonaws.opensearchserverless#InternalServerException":
1201
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1202
- case "ValidationException":
1203
- case "com.amazonaws.opensearchserverless#ValidationException":
1204
- throw await de_ValidationExceptionRes(parsedOutput, context);
1205
- default:
1206
- const parsedBody = parsedOutput.body;
1207
- return throwDefaultError({
1208
- output,
1209
- parsedBody,
1210
- errorCode,
1211
- });
1212
- }
1213
- };
1214
- const de_ListSecurityConfigsCommand = async (output, context) => {
1215
- if (output.statusCode >= 300) {
1216
- return de_ListSecurityConfigsCommandError(output, context);
1217
- }
1218
- const data = await parseBody(output.body, context);
1219
- let contents = {};
1220
- contents = (0, smithy_client_1._json)(data);
1221
- const response = {
1222
- $metadata: deserializeMetadata(output),
1223
- ...contents,
1224
- };
1225
- return response;
1226
- };
1227
- exports.de_ListSecurityConfigsCommand = de_ListSecurityConfigsCommand;
1228
- const de_ListSecurityConfigsCommandError = async (output, context) => {
1229
- const parsedOutput = {
1230
- ...output,
1231
- body: await parseErrorBody(output.body, context),
1232
- };
1233
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1234
- switch (errorCode) {
1235
- case "InternalServerException":
1236
- case "com.amazonaws.opensearchserverless#InternalServerException":
1237
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1238
- case "ValidationException":
1239
- case "com.amazonaws.opensearchserverless#ValidationException":
1240
- throw await de_ValidationExceptionRes(parsedOutput, context);
1241
- default:
1242
- const parsedBody = parsedOutput.body;
1243
- return throwDefaultError({
1244
- output,
1245
- parsedBody,
1246
- errorCode,
1247
- });
1248
- }
1249
- };
1250
- const de_ListSecurityPoliciesCommand = async (output, context) => {
1251
- if (output.statusCode >= 300) {
1252
- return de_ListSecurityPoliciesCommandError(output, context);
1253
- }
1254
- const data = await parseBody(output.body, context);
1255
- let contents = {};
1256
- contents = (0, smithy_client_1._json)(data);
1257
- const response = {
1258
- $metadata: deserializeMetadata(output),
1259
- ...contents,
1260
- };
1261
- return response;
1262
- };
1263
- exports.de_ListSecurityPoliciesCommand = de_ListSecurityPoliciesCommand;
1264
- const de_ListSecurityPoliciesCommandError = async (output, context) => {
1265
- const parsedOutput = {
1266
- ...output,
1267
- body: await parseErrorBody(output.body, context),
1268
- };
1269
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1270
- switch (errorCode) {
1271
- case "InternalServerException":
1272
- case "com.amazonaws.opensearchserverless#InternalServerException":
1273
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1274
- case "ValidationException":
1275
- case "com.amazonaws.opensearchserverless#ValidationException":
1276
- throw await de_ValidationExceptionRes(parsedOutput, context);
1277
- default:
1278
- const parsedBody = parsedOutput.body;
1279
- return throwDefaultError({
1280
- output,
1281
- parsedBody,
1282
- errorCode,
1283
- });
1284
- }
1285
- };
1286
- const de_ListTagsForResourceCommand = async (output, context) => {
1287
- if (output.statusCode >= 300) {
1288
- return de_ListTagsForResourceCommandError(output, context);
1289
- }
1290
- const data = await parseBody(output.body, context);
1291
- let contents = {};
1292
- contents = (0, smithy_client_1._json)(data);
1293
- const response = {
1294
- $metadata: deserializeMetadata(output),
1295
- ...contents,
1296
- };
1297
- return response;
1298
- };
1299
- exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
1300
- const de_ListTagsForResourceCommandError = async (output, context) => {
1301
- const parsedOutput = {
1302
- ...output,
1303
- body: await parseErrorBody(output.body, context),
1304
- };
1305
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1306
- switch (errorCode) {
1307
- case "InternalServerException":
1308
- case "com.amazonaws.opensearchserverless#InternalServerException":
1309
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1310
- case "ResourceNotFoundException":
1311
- case "com.amazonaws.opensearchserverless#ResourceNotFoundException":
1312
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1313
- case "ValidationException":
1314
- case "com.amazonaws.opensearchserverless#ValidationException":
1315
- throw await de_ValidationExceptionRes(parsedOutput, context);
1316
- default:
1317
- const parsedBody = parsedOutput.body;
1318
- return throwDefaultError({
1319
- output,
1320
- parsedBody,
1321
- errorCode,
1322
- });
1323
- }
1324
- };
1325
- const de_ListVpcEndpointsCommand = async (output, context) => {
1326
- if (output.statusCode >= 300) {
1327
- return de_ListVpcEndpointsCommandError(output, context);
1328
- }
1329
- const data = await parseBody(output.body, context);
1330
- let contents = {};
1331
- contents = (0, smithy_client_1._json)(data);
1332
- const response = {
1333
- $metadata: deserializeMetadata(output),
1334
- ...contents,
1335
- };
1336
- return response;
1337
- };
1338
- exports.de_ListVpcEndpointsCommand = de_ListVpcEndpointsCommand;
1339
- const de_ListVpcEndpointsCommandError = async (output, context) => {
1340
- const parsedOutput = {
1341
- ...output,
1342
- body: await parseErrorBody(output.body, context),
1343
- };
1344
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1345
- switch (errorCode) {
1346
- case "InternalServerException":
1347
- case "com.amazonaws.opensearchserverless#InternalServerException":
1348
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1349
- case "ValidationException":
1350
- case "com.amazonaws.opensearchserverless#ValidationException":
1351
- throw await de_ValidationExceptionRes(parsedOutput, context);
1352
- default:
1353
- const parsedBody = parsedOutput.body;
1354
- return throwDefaultError({
1355
- output,
1356
- parsedBody,
1357
- errorCode,
1358
- });
1359
- }
1360
- };
1361
- const de_TagResourceCommand = async (output, context) => {
1362
- if (output.statusCode >= 300) {
1363
- return de_TagResourceCommandError(output, context);
1364
- }
1365
- const data = await parseBody(output.body, context);
1366
- let contents = {};
1367
- contents = (0, smithy_client_1._json)(data);
1368
- const response = {
1369
- $metadata: deserializeMetadata(output),
1370
- ...contents,
1371
- };
1372
- return response;
1373
- };
1374
- exports.de_TagResourceCommand = de_TagResourceCommand;
1375
- const de_TagResourceCommandError = async (output, context) => {
1376
- const parsedOutput = {
1377
- ...output,
1378
- body: await parseErrorBody(output.body, context),
1379
- };
1380
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1381
- switch (errorCode) {
1382
- case "ConflictException":
1383
- case "com.amazonaws.opensearchserverless#ConflictException":
1384
- throw await de_ConflictExceptionRes(parsedOutput, context);
1385
- case "InternalServerException":
1386
- case "com.amazonaws.opensearchserverless#InternalServerException":
1387
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1388
- case "ResourceNotFoundException":
1389
- case "com.amazonaws.opensearchserverless#ResourceNotFoundException":
1390
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1391
- case "ServiceQuotaExceededException":
1392
- case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException":
1393
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1394
- case "ValidationException":
1395
- case "com.amazonaws.opensearchserverless#ValidationException":
1396
- throw await de_ValidationExceptionRes(parsedOutput, context);
1397
- default:
1398
- const parsedBody = parsedOutput.body;
1399
- return throwDefaultError({
1400
- output,
1401
- parsedBody,
1402
- errorCode,
1403
- });
1404
- }
1405
- };
1406
- const de_UntagResourceCommand = async (output, context) => {
1407
- if (output.statusCode >= 300) {
1408
- return de_UntagResourceCommandError(output, context);
1409
- }
1410
- const data = await parseBody(output.body, context);
1411
- let contents = {};
1412
- contents = (0, smithy_client_1._json)(data);
1413
- const response = {
1414
- $metadata: deserializeMetadata(output),
1415
- ...contents,
1416
- };
1417
- return response;
1418
- };
1419
- exports.de_UntagResourceCommand = de_UntagResourceCommand;
1420
- const de_UntagResourceCommandError = async (output, context) => {
1421
- const parsedOutput = {
1422
- ...output,
1423
- body: await parseErrorBody(output.body, context),
1424
- };
1425
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1426
- switch (errorCode) {
1427
- case "ConflictException":
1428
- case "com.amazonaws.opensearchserverless#ConflictException":
1429
- throw await de_ConflictExceptionRes(parsedOutput, context);
1430
- case "InternalServerException":
1431
- case "com.amazonaws.opensearchserverless#InternalServerException":
1432
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1433
- case "ResourceNotFoundException":
1434
- case "com.amazonaws.opensearchserverless#ResourceNotFoundException":
1435
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1436
- case "ValidationException":
1437
- case "com.amazonaws.opensearchserverless#ValidationException":
1438
- throw await de_ValidationExceptionRes(parsedOutput, context);
1439
- default:
1440
- const parsedBody = parsedOutput.body;
1441
- return throwDefaultError({
1442
- output,
1443
- parsedBody,
1444
- errorCode,
1445
- });
1446
- }
1447
- };
1448
- const de_UpdateAccessPolicyCommand = async (output, context) => {
1449
- if (output.statusCode >= 300) {
1450
- return de_UpdateAccessPolicyCommandError(output, context);
1451
- }
1452
- const data = await parseBody(output.body, context);
1453
- let contents = {};
1454
- contents = de_UpdateAccessPolicyResponse(data, context);
1455
- const response = {
1456
- $metadata: deserializeMetadata(output),
1457
- ...contents,
1458
- };
1459
- return response;
1460
- };
1461
- exports.de_UpdateAccessPolicyCommand = de_UpdateAccessPolicyCommand;
1462
- const de_UpdateAccessPolicyCommandError = async (output, context) => {
1463
- const parsedOutput = {
1464
- ...output,
1465
- body: await parseErrorBody(output.body, context),
1466
- };
1467
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1468
- switch (errorCode) {
1469
- case "ConflictException":
1470
- case "com.amazonaws.opensearchserverless#ConflictException":
1471
- throw await de_ConflictExceptionRes(parsedOutput, context);
1472
- case "InternalServerException":
1473
- case "com.amazonaws.opensearchserverless#InternalServerException":
1474
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1475
- case "ResourceNotFoundException":
1476
- case "com.amazonaws.opensearchserverless#ResourceNotFoundException":
1477
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1478
- case "ValidationException":
1479
- case "com.amazonaws.opensearchserverless#ValidationException":
1480
- throw await de_ValidationExceptionRes(parsedOutput, context);
1481
- default:
1482
- const parsedBody = parsedOutput.body;
1483
- return throwDefaultError({
1484
- output,
1485
- parsedBody,
1486
- errorCode,
1487
- });
1488
- }
1489
- };
1490
- const de_UpdateAccountSettingsCommand = async (output, context) => {
1491
- if (output.statusCode >= 300) {
1492
- return de_UpdateAccountSettingsCommandError(output, context);
1493
- }
1494
- const data = await parseBody(output.body, context);
1495
- let contents = {};
1496
- contents = (0, smithy_client_1._json)(data);
1497
- const response = {
1498
- $metadata: deserializeMetadata(output),
1499
- ...contents,
1500
- };
1501
- return response;
1502
- };
1503
- exports.de_UpdateAccountSettingsCommand = de_UpdateAccountSettingsCommand;
1504
- const de_UpdateAccountSettingsCommandError = async (output, context) => {
1505
- const parsedOutput = {
1506
- ...output,
1507
- body: await parseErrorBody(output.body, context),
1508
- };
1509
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1510
- switch (errorCode) {
1511
- case "InternalServerException":
1512
- case "com.amazonaws.opensearchserverless#InternalServerException":
1513
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1514
- case "ValidationException":
1515
- case "com.amazonaws.opensearchserverless#ValidationException":
1516
- throw await de_ValidationExceptionRes(parsedOutput, context);
1517
- default:
1518
- const parsedBody = parsedOutput.body;
1519
- return throwDefaultError({
1520
- output,
1521
- parsedBody,
1522
- errorCode,
1523
- });
1524
- }
1525
- };
1526
- const de_UpdateCollectionCommand = async (output, context) => {
1527
- if (output.statusCode >= 300) {
1528
- return de_UpdateCollectionCommandError(output, context);
1529
- }
1530
- const data = await parseBody(output.body, context);
1531
- let contents = {};
1532
- contents = (0, smithy_client_1._json)(data);
1533
- const response = {
1534
- $metadata: deserializeMetadata(output),
1535
- ...contents,
1536
- };
1537
- return response;
1538
- };
1539
- exports.de_UpdateCollectionCommand = de_UpdateCollectionCommand;
1540
- const de_UpdateCollectionCommandError = async (output, context) => {
1541
- const parsedOutput = {
1542
- ...output,
1543
- body: await parseErrorBody(output.body, context),
1544
- };
1545
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1546
- switch (errorCode) {
1547
- case "ConflictException":
1548
- case "com.amazonaws.opensearchserverless#ConflictException":
1549
- throw await de_ConflictExceptionRes(parsedOutput, context);
1550
- case "InternalServerException":
1551
- case "com.amazonaws.opensearchserverless#InternalServerException":
1552
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1553
- case "ValidationException":
1554
- case "com.amazonaws.opensearchserverless#ValidationException":
1555
- throw await de_ValidationExceptionRes(parsedOutput, context);
1556
- default:
1557
- const parsedBody = parsedOutput.body;
1558
- return throwDefaultError({
1559
- output,
1560
- parsedBody,
1561
- errorCode,
1562
- });
1563
- }
1564
- };
1565
- const de_UpdateLifecyclePolicyCommand = async (output, context) => {
1566
- if (output.statusCode >= 300) {
1567
- return de_UpdateLifecyclePolicyCommandError(output, context);
1568
- }
1569
- const data = await parseBody(output.body, context);
1570
- let contents = {};
1571
- contents = de_UpdateLifecyclePolicyResponse(data, context);
1572
- const response = {
1573
- $metadata: deserializeMetadata(output),
1574
- ...contents,
1575
- };
1576
- return response;
1577
- };
1578
- exports.de_UpdateLifecyclePolicyCommand = de_UpdateLifecyclePolicyCommand;
1579
- const de_UpdateLifecyclePolicyCommandError = async (output, context) => {
1580
- const parsedOutput = {
1581
- ...output,
1582
- body: await parseErrorBody(output.body, context),
1583
- };
1584
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1585
- switch (errorCode) {
1586
- case "ConflictException":
1587
- case "com.amazonaws.opensearchserverless#ConflictException":
1588
- throw await de_ConflictExceptionRes(parsedOutput, context);
1589
- case "InternalServerException":
1590
- case "com.amazonaws.opensearchserverless#InternalServerException":
1591
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1592
- case "ResourceNotFoundException":
1593
- case "com.amazonaws.opensearchserverless#ResourceNotFoundException":
1594
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1595
- case "ServiceQuotaExceededException":
1596
- case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException":
1597
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1598
- case "ValidationException":
1599
- case "com.amazonaws.opensearchserverless#ValidationException":
1600
- throw await de_ValidationExceptionRes(parsedOutput, context);
1601
- default:
1602
- const parsedBody = parsedOutput.body;
1603
- return throwDefaultError({
1604
- output,
1605
- parsedBody,
1606
- errorCode,
1607
- });
1608
- }
1609
- };
1610
- const de_UpdateSecurityConfigCommand = async (output, context) => {
1611
- if (output.statusCode >= 300) {
1612
- return de_UpdateSecurityConfigCommandError(output, context);
1613
- }
1614
- const data = await parseBody(output.body, context);
1615
- let contents = {};
1616
- contents = (0, smithy_client_1._json)(data);
1617
- const response = {
1618
- $metadata: deserializeMetadata(output),
1619
- ...contents,
1620
- };
1621
- return response;
1622
- };
1623
- exports.de_UpdateSecurityConfigCommand = de_UpdateSecurityConfigCommand;
1624
- const de_UpdateSecurityConfigCommandError = async (output, context) => {
1625
- const parsedOutput = {
1626
- ...output,
1627
- body: await parseErrorBody(output.body, context),
1628
- };
1629
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1630
- switch (errorCode) {
1631
- case "ConflictException":
1632
- case "com.amazonaws.opensearchserverless#ConflictException":
1633
- throw await de_ConflictExceptionRes(parsedOutput, context);
1634
- case "InternalServerException":
1635
- case "com.amazonaws.opensearchserverless#InternalServerException":
1636
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1637
- case "ResourceNotFoundException":
1638
- case "com.amazonaws.opensearchserverless#ResourceNotFoundException":
1639
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1640
- case "ValidationException":
1641
- case "com.amazonaws.opensearchserverless#ValidationException":
1642
- throw await de_ValidationExceptionRes(parsedOutput, context);
1643
- default:
1644
- const parsedBody = parsedOutput.body;
1645
- return throwDefaultError({
1646
- output,
1647
- parsedBody,
1648
- errorCode,
1649
- });
1650
- }
1651
- };
1652
- const de_UpdateSecurityPolicyCommand = async (output, context) => {
1653
- if (output.statusCode >= 300) {
1654
- return de_UpdateSecurityPolicyCommandError(output, context);
1655
- }
1656
- const data = await parseBody(output.body, context);
1657
- let contents = {};
1658
- contents = de_UpdateSecurityPolicyResponse(data, context);
1659
- const response = {
1660
- $metadata: deserializeMetadata(output),
1661
- ...contents,
1662
- };
1663
- return response;
1664
- };
1665
- exports.de_UpdateSecurityPolicyCommand = de_UpdateSecurityPolicyCommand;
1666
- const de_UpdateSecurityPolicyCommandError = async (output, context) => {
1667
- const parsedOutput = {
1668
- ...output,
1669
- body: await parseErrorBody(output.body, context),
1670
- };
1671
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1672
- switch (errorCode) {
1673
- case "ConflictException":
1674
- case "com.amazonaws.opensearchserverless#ConflictException":
1675
- throw await de_ConflictExceptionRes(parsedOutput, context);
1676
- case "InternalServerException":
1677
- case "com.amazonaws.opensearchserverless#InternalServerException":
1678
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1679
- case "ResourceNotFoundException":
1680
- case "com.amazonaws.opensearchserverless#ResourceNotFoundException":
1681
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1682
- case "ServiceQuotaExceededException":
1683
- case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException":
1684
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1685
- case "ValidationException":
1686
- case "com.amazonaws.opensearchserverless#ValidationException":
1687
- throw await de_ValidationExceptionRes(parsedOutput, context);
1688
- default:
1689
- const parsedBody = parsedOutput.body;
1690
- return throwDefaultError({
1691
- output,
1692
- parsedBody,
1693
- errorCode,
1694
- });
1695
- }
1696
- };
1697
- const de_UpdateVpcEndpointCommand = async (output, context) => {
1698
- if (output.statusCode >= 300) {
1699
- return de_UpdateVpcEndpointCommandError(output, context);
1700
- }
1701
- const data = await parseBody(output.body, context);
1702
- let contents = {};
1703
- contents = (0, smithy_client_1._json)(data);
1704
- const response = {
1705
- $metadata: deserializeMetadata(output),
1706
- ...contents,
1707
- };
1708
- return response;
1709
- };
1710
- exports.de_UpdateVpcEndpointCommand = de_UpdateVpcEndpointCommand;
1711
- const de_UpdateVpcEndpointCommandError = async (output, context) => {
1712
- const parsedOutput = {
1713
- ...output,
1714
- body: await parseErrorBody(output.body, context),
1715
- };
1716
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1717
- switch (errorCode) {
1718
- case "ConflictException":
1719
- case "com.amazonaws.opensearchserverless#ConflictException":
1720
- throw await de_ConflictExceptionRes(parsedOutput, context);
1721
- case "InternalServerException":
1722
- case "com.amazonaws.opensearchserverless#InternalServerException":
1723
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1724
- case "ValidationException":
1725
- case "com.amazonaws.opensearchserverless#ValidationException":
1726
- throw await de_ValidationExceptionRes(parsedOutput, context);
1727
- default:
1728
- const parsedBody = parsedOutput.body;
1729
- return throwDefaultError({
1730
- output,
1731
- parsedBody,
1732
- errorCode,
1733
- });
1734
- }
1735
- };
1736
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
1737
- const body = parsedOutput.body;
1738
- const deserialized = (0, smithy_client_1._json)(body);
1739
- const exception = new models_0_1.ConflictException({
1740
- $metadata: deserializeMetadata(parsedOutput),
1741
- ...deserialized,
1742
- });
1743
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1744
- };
1745
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
1746
- const body = parsedOutput.body;
1747
- const deserialized = (0, smithy_client_1._json)(body);
1748
- const exception = new models_0_1.InternalServerException({
1749
- $metadata: deserializeMetadata(parsedOutput),
1750
- ...deserialized,
1751
- });
1752
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1753
- };
1754
- const de_OcuLimitExceededExceptionRes = async (parsedOutput, context) => {
1755
- const body = parsedOutput.body;
1756
- const deserialized = (0, smithy_client_1._json)(body);
1757
- const exception = new models_0_1.OcuLimitExceededException({
1758
- $metadata: deserializeMetadata(parsedOutput),
1759
- ...deserialized,
1760
- });
1761
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1762
- };
1763
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1764
- const body = parsedOutput.body;
1765
- const deserialized = (0, smithy_client_1._json)(body);
1766
- const exception = new models_0_1.ResourceNotFoundException({
1767
- $metadata: deserializeMetadata(parsedOutput),
1768
- ...deserialized,
1769
- });
1770
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1771
- };
1772
- const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
1773
- const body = parsedOutput.body;
1774
- const deserialized = (0, smithy_client_1._json)(body);
1775
- const exception = new models_0_1.ServiceQuotaExceededException({
1776
- $metadata: deserializeMetadata(parsedOutput),
1777
- ...deserialized,
1778
- });
1779
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1780
- };
1781
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
1782
- const body = parsedOutput.body;
1783
- const deserialized = (0, smithy_client_1._json)(body);
1784
- const exception = new models_0_1.ValidationException({
1785
- $metadata: deserializeMetadata(parsedOutput),
1786
- ...deserialized,
1787
- });
1788
- return (0, smithy_client_1.decorateServiceException)(exception, body);
1789
- };
1790
- const se_CreateAccessPolicyRequest = (input, context) => {
1791
- return (0, smithy_client_1.take)(input, {
1792
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1793
- description: [],
1794
- name: [],
1795
- policy: [],
1796
- type: [],
1797
- });
1798
- };
1799
- const se_CreateCollectionRequest = (input, context) => {
1800
- return (0, smithy_client_1.take)(input, {
1801
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1802
- description: [],
1803
- name: [],
1804
- standbyReplicas: [],
1805
- tags: smithy_client_1._json,
1806
- type: [],
1807
- });
1808
- };
1809
- const se_CreateLifecyclePolicyRequest = (input, context) => {
1810
- return (0, smithy_client_1.take)(input, {
1811
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1812
- description: [],
1813
- name: [],
1814
- policy: [],
1815
- type: [],
1816
- });
1817
- };
1818
- const se_CreateSecurityConfigRequest = (input, context) => {
1819
- return (0, smithy_client_1.take)(input, {
1820
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1821
- description: [],
1822
- name: [],
1823
- samlOptions: smithy_client_1._json,
1824
- type: [],
1825
- });
1826
- };
1827
- const se_CreateSecurityPolicyRequest = (input, context) => {
1828
- return (0, smithy_client_1.take)(input, {
1829
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1830
- description: [],
1831
- name: [],
1832
- policy: [],
1833
- type: [],
1834
- });
1835
- };
1836
- const se_CreateVpcEndpointRequest = (input, context) => {
1837
- return (0, smithy_client_1.take)(input, {
1838
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1839
- name: [],
1840
- securityGroupIds: smithy_client_1._json,
1841
- subnetIds: smithy_client_1._json,
1842
- vpcId: [],
1843
- });
1844
- };
1845
- const se_DeleteAccessPolicyRequest = (input, context) => {
1846
- return (0, smithy_client_1.take)(input, {
1847
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1848
- name: [],
1849
- type: [],
1850
- });
1851
- };
1852
- const se_DeleteCollectionRequest = (input, context) => {
1853
- return (0, smithy_client_1.take)(input, {
1854
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1855
- id: [],
1856
- });
1857
- };
1858
- const se_DeleteLifecyclePolicyRequest = (input, context) => {
1859
- return (0, smithy_client_1.take)(input, {
1860
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1861
- name: [],
1862
- type: [],
1863
- });
1864
- };
1865
- const se_DeleteSecurityConfigRequest = (input, context) => {
1866
- return (0, smithy_client_1.take)(input, {
1867
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1868
- id: [],
1869
- });
1870
- };
1871
- const se_DeleteSecurityPolicyRequest = (input, context) => {
1872
- return (0, smithy_client_1.take)(input, {
1873
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1874
- name: [],
1875
- type: [],
1876
- });
1877
- };
1878
- const se_DeleteVpcEndpointRequest = (input, context) => {
1879
- return (0, smithy_client_1.take)(input, {
1880
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1881
- id: [],
1882
- });
1883
- };
1884
- const se_UpdateAccessPolicyRequest = (input, context) => {
1885
- return (0, smithy_client_1.take)(input, {
1886
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1887
- description: [],
1888
- name: [],
1889
- policy: [],
1890
- policyVersion: [],
1891
- type: [],
1892
- });
1893
- };
1894
- const se_UpdateCollectionRequest = (input, context) => {
1895
- return (0, smithy_client_1.take)(input, {
1896
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1897
- description: [],
1898
- id: [],
1899
- });
1900
- };
1901
- const se_UpdateLifecyclePolicyRequest = (input, context) => {
1902
- return (0, smithy_client_1.take)(input, {
1903
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1904
- description: [],
1905
- name: [],
1906
- policy: [],
1907
- policyVersion: [],
1908
- type: [],
1909
- });
1910
- };
1911
- const se_UpdateSecurityConfigRequest = (input, context) => {
1912
- return (0, smithy_client_1.take)(input, {
1913
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1914
- configVersion: [],
1915
- description: [],
1916
- id: [],
1917
- samlOptions: smithy_client_1._json,
1918
- });
1919
- };
1920
- const se_UpdateSecurityPolicyRequest = (input, context) => {
1921
- return (0, smithy_client_1.take)(input, {
1922
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1923
- description: [],
1924
- name: [],
1925
- policy: [],
1926
- policyVersion: [],
1927
- type: [],
1928
- });
1929
- };
1930
- const se_UpdateVpcEndpointRequest = (input, context) => {
1931
- return (0, smithy_client_1.take)(input, {
1932
- addSecurityGroupIds: smithy_client_1._json,
1933
- addSubnetIds: smithy_client_1._json,
1934
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
1935
- id: [],
1936
- removeSecurityGroupIds: smithy_client_1._json,
1937
- removeSubnetIds: smithy_client_1._json,
1938
- });
1939
- };
1940
- const de_AccessPolicyDetail = (output, context) => {
1941
- return (0, smithy_client_1.take)(output, {
1942
- createdDate: smithy_client_1.expectLong,
1943
- description: smithy_client_1.expectString,
1944
- lastModifiedDate: smithy_client_1.expectLong,
1945
- name: smithy_client_1.expectString,
1946
- policy: (_) => de_Document(_, context),
1947
- policyVersion: smithy_client_1.expectString,
1948
- type: smithy_client_1.expectString,
1949
- });
1950
- };
1951
- const de_BatchGetLifecyclePolicyResponse = (output, context) => {
1952
- return (0, smithy_client_1.take)(output, {
1953
- lifecyclePolicyDetails: (_) => de_LifecyclePolicyDetails(_, context),
1954
- lifecyclePolicyErrorDetails: smithy_client_1._json,
1955
- });
1956
- };
1957
- const de_CreateAccessPolicyResponse = (output, context) => {
1958
- return (0, smithy_client_1.take)(output, {
1959
- accessPolicyDetail: (_) => de_AccessPolicyDetail(_, context),
1960
- });
1961
- };
1962
- const de_CreateLifecyclePolicyResponse = (output, context) => {
1963
- return (0, smithy_client_1.take)(output, {
1964
- lifecyclePolicyDetail: (_) => de_LifecyclePolicyDetail(_, context),
1965
- });
1966
- };
1967
- const de_CreateSecurityPolicyResponse = (output, context) => {
1968
- return (0, smithy_client_1.take)(output, {
1969
- securityPolicyDetail: (_) => de_SecurityPolicyDetail(_, context),
1970
- });
1971
- };
1972
- const de_GetAccessPolicyResponse = (output, context) => {
1973
- return (0, smithy_client_1.take)(output, {
1974
- accessPolicyDetail: (_) => de_AccessPolicyDetail(_, context),
1975
- });
1976
- };
1977
- const de_GetSecurityPolicyResponse = (output, context) => {
1978
- return (0, smithy_client_1.take)(output, {
1979
- securityPolicyDetail: (_) => de_SecurityPolicyDetail(_, context),
1980
- });
1981
- };
1982
- const de_LifecyclePolicyDetail = (output, context) => {
1983
- return (0, smithy_client_1.take)(output, {
1984
- createdDate: smithy_client_1.expectLong,
1985
- description: smithy_client_1.expectString,
1986
- lastModifiedDate: smithy_client_1.expectLong,
1987
- name: smithy_client_1.expectString,
1988
- policy: (_) => de_Document(_, context),
1989
- policyVersion: smithy_client_1.expectString,
1990
- type: smithy_client_1.expectString,
1991
- });
1992
- };
1993
- const de_LifecyclePolicyDetails = (output, context) => {
1994
- const retVal = (output || [])
1995
- .filter((e) => e != null)
1996
- .map((entry) => {
1997
- return de_LifecyclePolicyDetail(entry, context);
1998
- });
1999
- return retVal;
2000
- };
2001
- const de_SecurityPolicyDetail = (output, context) => {
2002
- return (0, smithy_client_1.take)(output, {
2003
- createdDate: smithy_client_1.expectLong,
2004
- description: smithy_client_1.expectString,
2005
- lastModifiedDate: smithy_client_1.expectLong,
2006
- name: smithy_client_1.expectString,
2007
- policy: (_) => de_Document(_, context),
2008
- policyVersion: smithy_client_1.expectString,
2009
- type: smithy_client_1.expectString,
2010
- });
2011
- };
2012
- const de_UpdateAccessPolicyResponse = (output, context) => {
2013
- return (0, smithy_client_1.take)(output, {
2014
- accessPolicyDetail: (_) => de_AccessPolicyDetail(_, context),
2015
- });
2016
- };
2017
- const de_UpdateLifecyclePolicyResponse = (output, context) => {
2018
- return (0, smithy_client_1.take)(output, {
2019
- lifecyclePolicyDetail: (_) => de_LifecyclePolicyDetail(_, context),
2020
- });
2021
- };
2022
- const de_UpdateSecurityPolicyResponse = (output, context) => {
2023
- return (0, smithy_client_1.take)(output, {
2024
- securityPolicyDetail: (_) => de_SecurityPolicyDetail(_, context),
2025
- });
2026
- };
2027
- const de_Document = (output, context) => {
2028
- return output;
2029
- };
2030
- const deserializeMetadata = (output) => ({
2031
- httpStatusCode: output.statusCode,
2032
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
2033
- extendedRequestId: output.headers["x-amz-id-2"],
2034
- cfId: output.headers["x-amz-cf-id"],
2035
- });
2036
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
2037
- const throwDefaultError = (0, smithy_client_1.withBaseException)(OpenSearchServerlessServiceException_1.OpenSearchServerlessServiceException);
2038
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
2039
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
2040
- const contents = {
2041
- protocol,
2042
- hostname,
2043
- port,
2044
- method: "POST",
2045
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
2046
- headers,
2047
- };
2048
- if (resolvedHostname !== undefined) {
2049
- contents.hostname = resolvedHostname;
2050
- }
2051
- if (body !== undefined) {
2052
- contents.body = body;
2053
- }
2054
- return new protocol_http_1.HttpRequest(contents);
2055
- };
2056
- function sharedHeaders(operation) {
2057
- return {
2058
- "content-type": "application/x-amz-json-1.0",
2059
- "x-amz-target": `OpenSearchServerless.${operation}`,
2060
- };
2061
- }
2062
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
2063
- if (encoded.length) {
2064
- return JSON.parse(encoded);
2065
- }
2066
- return {};
2067
- });
2068
- const parseErrorBody = async (errorBody, context) => {
2069
- const value = await parseBody(errorBody, context);
2070
- value.message = value.message ?? value.Message;
2071
- return value;
2072
- };
2073
- const loadRestJsonErrorCode = (output, data) => {
2074
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
2075
- const sanitizeErrorCode = (rawValue) => {
2076
- let cleanValue = rawValue;
2077
- if (typeof cleanValue === "number") {
2078
- cleanValue = cleanValue.toString();
2079
- }
2080
- if (cleanValue.indexOf(",") >= 0) {
2081
- cleanValue = cleanValue.split(",")[0];
2082
- }
2083
- if (cleanValue.indexOf(":") >= 0) {
2084
- cleanValue = cleanValue.split(":")[0];
2085
- }
2086
- if (cleanValue.indexOf("#") >= 0) {
2087
- cleanValue = cleanValue.split("#")[1];
2088
- }
2089
- return cleanValue;
2090
- };
2091
- const headerKey = findKey(output.headers, "x-amzn-errortype");
2092
- if (headerKey !== undefined) {
2093
- return sanitizeErrorCode(output.headers[headerKey]);
2094
- }
2095
- if (data.code !== undefined) {
2096
- return sanitizeErrorCode(data.code);
2097
- }
2098
- if (data["__type"] !== undefined) {
2099
- return sanitizeErrorCode(data["__type"]);
2100
- }
2101
- };
1
+ module.exports = require("../index.js");