@aws-sdk/client-osis 3.321.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 (131) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +322 -0
  3. package/dist-cjs/OSIS.js +39 -0
  4. package/dist-cjs/OSISClient.js +40 -0
  5. package/dist-cjs/commands/CreatePipelineCommand.js +45 -0
  6. package/dist-cjs/commands/DeletePipelineCommand.js +45 -0
  7. package/dist-cjs/commands/GetPipelineBlueprintCommand.js +45 -0
  8. package/dist-cjs/commands/GetPipelineChangeProgressCommand.js +45 -0
  9. package/dist-cjs/commands/GetPipelineCommand.js +45 -0
  10. package/dist-cjs/commands/ListPipelineBlueprintsCommand.js +45 -0
  11. package/dist-cjs/commands/ListPipelinesCommand.js +45 -0
  12. package/dist-cjs/commands/ListTagsForResourceCommand.js +45 -0
  13. package/dist-cjs/commands/StartPipelineCommand.js +45 -0
  14. package/dist-cjs/commands/StopPipelineCommand.js +45 -0
  15. package/dist-cjs/commands/TagResourceCommand.js +45 -0
  16. package/dist-cjs/commands/UntagResourceCommand.js +45 -0
  17. package/dist-cjs/commands/UpdatePipelineCommand.js +45 -0
  18. package/dist-cjs/commands/ValidatePipelineCommand.js +45 -0
  19. package/dist-cjs/commands/index.js +17 -0
  20. package/dist-cjs/endpoint/EndpointParameters.js +12 -0
  21. package/dist-cjs/endpoint/endpointResolver.js +12 -0
  22. package/dist-cjs/endpoint/ruleset.js +7 -0
  23. package/dist-cjs/index.js +11 -0
  24. package/dist-cjs/models/OSISServiceException.js +11 -0
  25. package/dist-cjs/models/index.js +4 -0
  26. package/dist-cjs/models/models_0.js +132 -0
  27. package/dist-cjs/pagination/Interfaces.js +2 -0
  28. package/dist-cjs/pagination/ListPipelinesPaginator.js +29 -0
  29. package/dist-cjs/pagination/index.js +5 -0
  30. package/dist-cjs/protocols/Aws_restJson1.js +1137 -0
  31. package/dist-cjs/runtimeConfig.browser.js +39 -0
  32. package/dist-cjs/runtimeConfig.js +48 -0
  33. package/dist-cjs/runtimeConfig.native.js +15 -0
  34. package/dist-cjs/runtimeConfig.shared.js +21 -0
  35. package/dist-es/OSIS.js +35 -0
  36. package/dist-es/OSISClient.js +36 -0
  37. package/dist-es/commands/CreatePipelineCommand.js +41 -0
  38. package/dist-es/commands/DeletePipelineCommand.js +41 -0
  39. package/dist-es/commands/GetPipelineBlueprintCommand.js +41 -0
  40. package/dist-es/commands/GetPipelineChangeProgressCommand.js +41 -0
  41. package/dist-es/commands/GetPipelineCommand.js +41 -0
  42. package/dist-es/commands/ListPipelineBlueprintsCommand.js +41 -0
  43. package/dist-es/commands/ListPipelinesCommand.js +41 -0
  44. package/dist-es/commands/ListTagsForResourceCommand.js +41 -0
  45. package/dist-es/commands/StartPipelineCommand.js +41 -0
  46. package/dist-es/commands/StopPipelineCommand.js +41 -0
  47. package/dist-es/commands/TagResourceCommand.js +41 -0
  48. package/dist-es/commands/UntagResourceCommand.js +41 -0
  49. package/dist-es/commands/UpdatePipelineCommand.js +41 -0
  50. package/dist-es/commands/ValidatePipelineCommand.js +41 -0
  51. package/dist-es/commands/index.js +14 -0
  52. package/dist-es/endpoint/EndpointParameters.js +8 -0
  53. package/dist-es/endpoint/endpointResolver.js +8 -0
  54. package/dist-es/endpoint/ruleset.js +4 -0
  55. package/dist-es/index.js +6 -0
  56. package/dist-es/models/OSISServiceException.js +7 -0
  57. package/dist-es/models/index.js +1 -0
  58. package/dist-es/models/models_0.js +121 -0
  59. package/dist-es/pagination/Interfaces.js +1 -0
  60. package/dist-es/pagination/ListPipelinesPaginator.js +25 -0
  61. package/dist-es/pagination/index.js +2 -0
  62. package/dist-es/protocols/Aws_restJson1.js +1106 -0
  63. package/dist-es/runtimeConfig.browser.js +34 -0
  64. package/dist-es/runtimeConfig.js +43 -0
  65. package/dist-es/runtimeConfig.native.js +11 -0
  66. package/dist-es/runtimeConfig.shared.js +17 -0
  67. package/dist-types/OSIS.d.ts +110 -0
  68. package/dist-types/OSISClient.d.ts +177 -0
  69. package/dist-types/commands/CreatePipelineCommand.d.ts +102 -0
  70. package/dist-types/commands/DeletePipelineCommand.d.ts +80 -0
  71. package/dist-types/commands/GetPipelineBlueprintCommand.d.ts +77 -0
  72. package/dist-types/commands/GetPipelineChangeProgressCommand.d.ts +80 -0
  73. package/dist-types/commands/GetPipelineCommand.d.ts +76 -0
  74. package/dist-types/commands/ListPipelineBlueprintsCommand.d.ts +74 -0
  75. package/dist-types/commands/ListPipelinesCommand.d.ts +79 -0
  76. package/dist-types/commands/ListTagsForResourceCommand.d.ts +78 -0
  77. package/dist-types/commands/StartPipelineCommand.d.ts +80 -0
  78. package/dist-types/commands/StopPipelineCommand.d.ts +80 -0
  79. package/dist-types/commands/TagResourceCommand.d.ts +86 -0
  80. package/dist-types/commands/UntagResourceCommand.d.ts +80 -0
  81. package/dist-types/commands/UpdatePipelineCommand.d.ts +89 -0
  82. package/dist-types/commands/ValidatePipelineCommand.d.ts +75 -0
  83. package/dist-types/commands/index.d.ts +14 -0
  84. package/dist-types/endpoint/EndpointParameters.d.ts +19 -0
  85. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  86. package/dist-types/endpoint/ruleset.d.ts +2 -0
  87. package/dist-types/index.d.ts +6 -0
  88. package/dist-types/models/OSISServiceException.d.ts +12 -0
  89. package/dist-types/models/index.d.ts +1 -0
  90. package/dist-types/models/models_0.d.ts +718 -0
  91. package/dist-types/pagination/Interfaces.d.ts +8 -0
  92. package/dist-types/pagination/ListPipelinesPaginator.d.ts +7 -0
  93. package/dist-types/pagination/index.d.ts +2 -0
  94. package/dist-types/protocols/Aws_restJson1.d.ts +128 -0
  95. package/dist-types/runtimeConfig.browser.d.ts +42 -0
  96. package/dist-types/runtimeConfig.d.ts +42 -0
  97. package/dist-types/runtimeConfig.native.d.ts +41 -0
  98. package/dist-types/runtimeConfig.shared.d.ts +18 -0
  99. package/dist-types/ts3.4/OSIS.d.ts +243 -0
  100. package/dist-types/ts3.4/OSISClient.d.ts +196 -0
  101. package/dist-types/ts3.4/commands/CreatePipelineCommand.d.ts +37 -0
  102. package/dist-types/ts3.4/commands/DeletePipelineCommand.d.ts +37 -0
  103. package/dist-types/ts3.4/commands/GetPipelineBlueprintCommand.d.ts +41 -0
  104. package/dist-types/ts3.4/commands/GetPipelineChangeProgressCommand.d.ts +41 -0
  105. package/dist-types/ts3.4/commands/GetPipelineCommand.d.ts +34 -0
  106. package/dist-types/ts3.4/commands/ListPipelineBlueprintsCommand.d.ts +41 -0
  107. package/dist-types/ts3.4/commands/ListPipelinesCommand.d.ts +37 -0
  108. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +38 -0
  109. package/dist-types/ts3.4/commands/StartPipelineCommand.d.ts +37 -0
  110. package/dist-types/ts3.4/commands/StopPipelineCommand.d.ts +34 -0
  111. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +34 -0
  112. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +37 -0
  113. package/dist-types/ts3.4/commands/UpdatePipelineCommand.d.ts +37 -0
  114. package/dist-types/ts3.4/commands/ValidatePipelineCommand.d.ts +37 -0
  115. package/dist-types/ts3.4/commands/index.d.ts +14 -0
  116. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +33 -0
  117. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  118. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  119. package/dist-types/ts3.4/index.d.ts +6 -0
  120. package/dist-types/ts3.4/models/OSISServiceException.d.ts +7 -0
  121. package/dist-types/ts3.4/models/index.d.ts +1 -0
  122. package/dist-types/ts3.4/models/models_0.d.ts +247 -0
  123. package/dist-types/ts3.4/pagination/Interfaces.d.ts +5 -0
  124. package/dist-types/ts3.4/pagination/ListPipelinesPaginator.d.ts +11 -0
  125. package/dist-types/ts3.4/pagination/index.d.ts +2 -0
  126. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +173 -0
  127. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +91 -0
  128. package/dist-types/ts3.4/runtimeConfig.d.ts +91 -0
  129. package/dist-types/ts3.4/runtimeConfig.native.d.ts +80 -0
  130. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +18 -0
  131. package/package.json +98 -0
@@ -0,0 +1,1106 @@
1
+ import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, take, withBaseException, } from "@aws-sdk/smithy-client";
3
+ import { AccessDeniedException, ConflictException, InternalException, InvalidPaginationTokenException, LimitExceededException, ResourceAlreadyExistsException, ResourceNotFoundException, ValidationException, } from "../models/models_0";
4
+ import { OSISServiceException as __BaseException } from "../models/OSISServiceException";
5
+ export const se_CreatePipelineCommand = async (input, context) => {
6
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
+ const headers = {
8
+ "content-type": "application/json",
9
+ };
10
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2022-01-01/osis/createPipeline";
11
+ let body;
12
+ body = JSON.stringify(take(input, {
13
+ LogPublishingOptions: (_) => _json(_),
14
+ MaxUnits: [],
15
+ MinUnits: [],
16
+ PipelineConfigurationBody: [],
17
+ PipelineName: [],
18
+ Tags: (_) => _json(_),
19
+ VpcOptions: (_) => _json(_),
20
+ }));
21
+ return new __HttpRequest({
22
+ protocol,
23
+ hostname,
24
+ port,
25
+ method: "POST",
26
+ headers,
27
+ path: resolvedPath,
28
+ body,
29
+ });
30
+ };
31
+ export const se_DeletePipelineCommand = async (input, context) => {
32
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
33
+ const headers = {};
34
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
35
+ "/2022-01-01/osis/deletePipeline/{PipelineName}";
36
+ resolvedPath = __resolvedPath(resolvedPath, input, "PipelineName", () => input.PipelineName, "{PipelineName}", false);
37
+ let body;
38
+ return new __HttpRequest({
39
+ protocol,
40
+ hostname,
41
+ port,
42
+ method: "DELETE",
43
+ headers,
44
+ path: resolvedPath,
45
+ body,
46
+ });
47
+ };
48
+ export const se_GetPipelineCommand = async (input, context) => {
49
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
50
+ const headers = {};
51
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
52
+ "/2022-01-01/osis/getPipeline/{PipelineName}";
53
+ resolvedPath = __resolvedPath(resolvedPath, input, "PipelineName", () => input.PipelineName, "{PipelineName}", false);
54
+ let body;
55
+ return new __HttpRequest({
56
+ protocol,
57
+ hostname,
58
+ port,
59
+ method: "GET",
60
+ headers,
61
+ path: resolvedPath,
62
+ body,
63
+ });
64
+ };
65
+ export const se_GetPipelineBlueprintCommand = async (input, context) => {
66
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
67
+ const headers = {};
68
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
69
+ "/2022-01-01/osis/getPipelineBlueprint/{BlueprintName}";
70
+ resolvedPath = __resolvedPath(resolvedPath, input, "BlueprintName", () => input.BlueprintName, "{BlueprintName}", false);
71
+ let body;
72
+ return new __HttpRequest({
73
+ protocol,
74
+ hostname,
75
+ port,
76
+ method: "GET",
77
+ headers,
78
+ path: resolvedPath,
79
+ body,
80
+ });
81
+ };
82
+ export const se_GetPipelineChangeProgressCommand = async (input, context) => {
83
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
84
+ const headers = {};
85
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
86
+ "/2022-01-01/osis/getPipelineChangeProgress/{PipelineName}";
87
+ resolvedPath = __resolvedPath(resolvedPath, input, "PipelineName", () => input.PipelineName, "{PipelineName}", false);
88
+ let body;
89
+ return new __HttpRequest({
90
+ protocol,
91
+ hostname,
92
+ port,
93
+ method: "GET",
94
+ headers,
95
+ path: resolvedPath,
96
+ body,
97
+ });
98
+ };
99
+ export const se_ListPipelineBlueprintsCommand = async (input, context) => {
100
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
101
+ const headers = {
102
+ "content-type": "application/json",
103
+ };
104
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2022-01-01/osis/listPipelineBlueprints";
105
+ let body;
106
+ body = "";
107
+ return new __HttpRequest({
108
+ protocol,
109
+ hostname,
110
+ port,
111
+ method: "POST",
112
+ headers,
113
+ path: resolvedPath,
114
+ body,
115
+ });
116
+ };
117
+ export const se_ListPipelinesCommand = async (input, context) => {
118
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
119
+ const headers = {};
120
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2022-01-01/osis/listPipelines";
121
+ const query = map({
122
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
123
+ nextToken: [, input.NextToken],
124
+ });
125
+ let body;
126
+ return new __HttpRequest({
127
+ protocol,
128
+ hostname,
129
+ port,
130
+ method: "GET",
131
+ headers,
132
+ path: resolvedPath,
133
+ query,
134
+ body,
135
+ });
136
+ };
137
+ export const se_ListTagsForResourceCommand = async (input, context) => {
138
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
139
+ const headers = {};
140
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2022-01-01/osis/listTagsForResource";
141
+ const query = map({
142
+ arn: [, __expectNonNull(input.Arn, `Arn`)],
143
+ });
144
+ let body;
145
+ return new __HttpRequest({
146
+ protocol,
147
+ hostname,
148
+ port,
149
+ method: "GET",
150
+ headers,
151
+ path: resolvedPath,
152
+ query,
153
+ body,
154
+ });
155
+ };
156
+ export const se_StartPipelineCommand = async (input, context) => {
157
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
158
+ const headers = {};
159
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
160
+ "/2022-01-01/osis/startPipeline/{PipelineName}";
161
+ resolvedPath = __resolvedPath(resolvedPath, input, "PipelineName", () => input.PipelineName, "{PipelineName}", false);
162
+ let body;
163
+ return new __HttpRequest({
164
+ protocol,
165
+ hostname,
166
+ port,
167
+ method: "PUT",
168
+ headers,
169
+ path: resolvedPath,
170
+ body,
171
+ });
172
+ };
173
+ export const se_StopPipelineCommand = async (input, context) => {
174
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
175
+ const headers = {};
176
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
177
+ "/2022-01-01/osis/stopPipeline/{PipelineName}";
178
+ resolvedPath = __resolvedPath(resolvedPath, input, "PipelineName", () => input.PipelineName, "{PipelineName}", false);
179
+ let body;
180
+ return new __HttpRequest({
181
+ protocol,
182
+ hostname,
183
+ port,
184
+ method: "PUT",
185
+ headers,
186
+ path: resolvedPath,
187
+ body,
188
+ });
189
+ };
190
+ export const se_TagResourceCommand = async (input, context) => {
191
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
192
+ const headers = {
193
+ "content-type": "application/json",
194
+ };
195
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2022-01-01/osis/tagResource";
196
+ const query = map({
197
+ arn: [, __expectNonNull(input.Arn, `Arn`)],
198
+ });
199
+ let body;
200
+ body = JSON.stringify(take(input, {
201
+ Tags: (_) => _json(_),
202
+ }));
203
+ return new __HttpRequest({
204
+ protocol,
205
+ hostname,
206
+ port,
207
+ method: "POST",
208
+ headers,
209
+ path: resolvedPath,
210
+ query,
211
+ body,
212
+ });
213
+ };
214
+ export const se_UntagResourceCommand = async (input, context) => {
215
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
216
+ const headers = {
217
+ "content-type": "application/json",
218
+ };
219
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2022-01-01/osis/untagResource";
220
+ const query = map({
221
+ arn: [, __expectNonNull(input.Arn, `Arn`)],
222
+ });
223
+ let body;
224
+ body = JSON.stringify(take(input, {
225
+ TagKeys: (_) => _json(_),
226
+ }));
227
+ return new __HttpRequest({
228
+ protocol,
229
+ hostname,
230
+ port,
231
+ method: "POST",
232
+ headers,
233
+ path: resolvedPath,
234
+ query,
235
+ body,
236
+ });
237
+ };
238
+ export const se_UpdatePipelineCommand = async (input, context) => {
239
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
240
+ const headers = {
241
+ "content-type": "application/json",
242
+ };
243
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
244
+ "/2022-01-01/osis/updatePipeline/{PipelineName}";
245
+ resolvedPath = __resolvedPath(resolvedPath, input, "PipelineName", () => input.PipelineName, "{PipelineName}", false);
246
+ let body;
247
+ body = JSON.stringify(take(input, {
248
+ LogPublishingOptions: (_) => _json(_),
249
+ MaxUnits: [],
250
+ MinUnits: [],
251
+ PipelineConfigurationBody: [],
252
+ }));
253
+ return new __HttpRequest({
254
+ protocol,
255
+ hostname,
256
+ port,
257
+ method: "PUT",
258
+ headers,
259
+ path: resolvedPath,
260
+ body,
261
+ });
262
+ };
263
+ export const se_ValidatePipelineCommand = async (input, context) => {
264
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
265
+ const headers = {
266
+ "content-type": "application/json",
267
+ };
268
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/2022-01-01/osis/validatePipeline";
269
+ let body;
270
+ body = JSON.stringify(take(input, {
271
+ PipelineConfigurationBody: [],
272
+ }));
273
+ return new __HttpRequest({
274
+ protocol,
275
+ hostname,
276
+ port,
277
+ method: "POST",
278
+ headers,
279
+ path: resolvedPath,
280
+ body,
281
+ });
282
+ };
283
+ export const de_CreatePipelineCommand = async (output, context) => {
284
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
285
+ return de_CreatePipelineCommandError(output, context);
286
+ }
287
+ const contents = map({
288
+ $metadata: deserializeMetadata(output),
289
+ });
290
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
291
+ const doc = take(data, {
292
+ Pipeline: (_) => de_Pipeline(_, context),
293
+ });
294
+ Object.assign(contents, doc);
295
+ return contents;
296
+ };
297
+ const de_CreatePipelineCommandError = async (output, context) => {
298
+ const parsedOutput = {
299
+ ...output,
300
+ body: await parseErrorBody(output.body, context),
301
+ };
302
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
303
+ switch (errorCode) {
304
+ case "AccessDeniedException":
305
+ case "com.amazonaws.osis#AccessDeniedException":
306
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
307
+ case "InternalException":
308
+ case "com.amazonaws.osis#InternalException":
309
+ throw await de_InternalExceptionRes(parsedOutput, context);
310
+ case "LimitExceededException":
311
+ case "com.amazonaws.osis#LimitExceededException":
312
+ throw await de_LimitExceededExceptionRes(parsedOutput, context);
313
+ case "ResourceAlreadyExistsException":
314
+ case "com.amazonaws.osis#ResourceAlreadyExistsException":
315
+ throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context);
316
+ case "ValidationException":
317
+ case "com.amazonaws.osis#ValidationException":
318
+ throw await de_ValidationExceptionRes(parsedOutput, context);
319
+ default:
320
+ const parsedBody = parsedOutput.body;
321
+ return throwDefaultError({
322
+ output,
323
+ parsedBody,
324
+ errorCode,
325
+ });
326
+ }
327
+ };
328
+ export const de_DeletePipelineCommand = async (output, context) => {
329
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
330
+ return de_DeletePipelineCommandError(output, context);
331
+ }
332
+ const contents = map({
333
+ $metadata: deserializeMetadata(output),
334
+ });
335
+ await collectBody(output.body, context);
336
+ return contents;
337
+ };
338
+ const de_DeletePipelineCommandError = async (output, context) => {
339
+ const parsedOutput = {
340
+ ...output,
341
+ body: await parseErrorBody(output.body, context),
342
+ };
343
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
344
+ switch (errorCode) {
345
+ case "AccessDeniedException":
346
+ case "com.amazonaws.osis#AccessDeniedException":
347
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
348
+ case "ConflictException":
349
+ case "com.amazonaws.osis#ConflictException":
350
+ throw await de_ConflictExceptionRes(parsedOutput, context);
351
+ case "InternalException":
352
+ case "com.amazonaws.osis#InternalException":
353
+ throw await de_InternalExceptionRes(parsedOutput, context);
354
+ case "ResourceNotFoundException":
355
+ case "com.amazonaws.osis#ResourceNotFoundException":
356
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
357
+ case "ValidationException":
358
+ case "com.amazonaws.osis#ValidationException":
359
+ throw await de_ValidationExceptionRes(parsedOutput, context);
360
+ default:
361
+ const parsedBody = parsedOutput.body;
362
+ return throwDefaultError({
363
+ output,
364
+ parsedBody,
365
+ errorCode,
366
+ });
367
+ }
368
+ };
369
+ export const de_GetPipelineCommand = async (output, context) => {
370
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
371
+ return de_GetPipelineCommandError(output, context);
372
+ }
373
+ const contents = map({
374
+ $metadata: deserializeMetadata(output),
375
+ });
376
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
377
+ const doc = take(data, {
378
+ Pipeline: (_) => de_Pipeline(_, context),
379
+ });
380
+ Object.assign(contents, doc);
381
+ return contents;
382
+ };
383
+ const de_GetPipelineCommandError = async (output, context) => {
384
+ const parsedOutput = {
385
+ ...output,
386
+ body: await parseErrorBody(output.body, context),
387
+ };
388
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
389
+ switch (errorCode) {
390
+ case "AccessDeniedException":
391
+ case "com.amazonaws.osis#AccessDeniedException":
392
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
393
+ case "InternalException":
394
+ case "com.amazonaws.osis#InternalException":
395
+ throw await de_InternalExceptionRes(parsedOutput, context);
396
+ case "ResourceNotFoundException":
397
+ case "com.amazonaws.osis#ResourceNotFoundException":
398
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
399
+ case "ValidationException":
400
+ case "com.amazonaws.osis#ValidationException":
401
+ throw await de_ValidationExceptionRes(parsedOutput, context);
402
+ default:
403
+ const parsedBody = parsedOutput.body;
404
+ return throwDefaultError({
405
+ output,
406
+ parsedBody,
407
+ errorCode,
408
+ });
409
+ }
410
+ };
411
+ export const de_GetPipelineBlueprintCommand = async (output, context) => {
412
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
413
+ return de_GetPipelineBlueprintCommandError(output, context);
414
+ }
415
+ const contents = map({
416
+ $metadata: deserializeMetadata(output),
417
+ });
418
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
419
+ const doc = take(data, {
420
+ Blueprint: _json,
421
+ });
422
+ Object.assign(contents, doc);
423
+ return contents;
424
+ };
425
+ const de_GetPipelineBlueprintCommandError = async (output, context) => {
426
+ const parsedOutput = {
427
+ ...output,
428
+ body: await parseErrorBody(output.body, context),
429
+ };
430
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
431
+ switch (errorCode) {
432
+ case "AccessDeniedException":
433
+ case "com.amazonaws.osis#AccessDeniedException":
434
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
435
+ case "InternalException":
436
+ case "com.amazonaws.osis#InternalException":
437
+ throw await de_InternalExceptionRes(parsedOutput, context);
438
+ case "ResourceNotFoundException":
439
+ case "com.amazonaws.osis#ResourceNotFoundException":
440
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
441
+ case "ValidationException":
442
+ case "com.amazonaws.osis#ValidationException":
443
+ throw await de_ValidationExceptionRes(parsedOutput, context);
444
+ default:
445
+ const parsedBody = parsedOutput.body;
446
+ return throwDefaultError({
447
+ output,
448
+ parsedBody,
449
+ errorCode,
450
+ });
451
+ }
452
+ };
453
+ export const de_GetPipelineChangeProgressCommand = async (output, context) => {
454
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
455
+ return de_GetPipelineChangeProgressCommandError(output, context);
456
+ }
457
+ const contents = map({
458
+ $metadata: deserializeMetadata(output),
459
+ });
460
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
461
+ const doc = take(data, {
462
+ ChangeProgressStatuses: (_) => de_ChangeProgressStatusList(_, context),
463
+ });
464
+ Object.assign(contents, doc);
465
+ return contents;
466
+ };
467
+ const de_GetPipelineChangeProgressCommandError = async (output, context) => {
468
+ const parsedOutput = {
469
+ ...output,
470
+ body: await parseErrorBody(output.body, context),
471
+ };
472
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
473
+ switch (errorCode) {
474
+ case "AccessDeniedException":
475
+ case "com.amazonaws.osis#AccessDeniedException":
476
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
477
+ case "InternalException":
478
+ case "com.amazonaws.osis#InternalException":
479
+ throw await de_InternalExceptionRes(parsedOutput, context);
480
+ case "ResourceNotFoundException":
481
+ case "com.amazonaws.osis#ResourceNotFoundException":
482
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
483
+ case "ValidationException":
484
+ case "com.amazonaws.osis#ValidationException":
485
+ throw await de_ValidationExceptionRes(parsedOutput, context);
486
+ default:
487
+ const parsedBody = parsedOutput.body;
488
+ return throwDefaultError({
489
+ output,
490
+ parsedBody,
491
+ errorCode,
492
+ });
493
+ }
494
+ };
495
+ export const de_ListPipelineBlueprintsCommand = async (output, context) => {
496
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
497
+ return de_ListPipelineBlueprintsCommandError(output, context);
498
+ }
499
+ const contents = map({
500
+ $metadata: deserializeMetadata(output),
501
+ });
502
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
503
+ const doc = take(data, {
504
+ Blueprints: _json,
505
+ });
506
+ Object.assign(contents, doc);
507
+ return contents;
508
+ };
509
+ const de_ListPipelineBlueprintsCommandError = async (output, context) => {
510
+ const parsedOutput = {
511
+ ...output,
512
+ body: await parseErrorBody(output.body, context),
513
+ };
514
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
515
+ switch (errorCode) {
516
+ case "AccessDeniedException":
517
+ case "com.amazonaws.osis#AccessDeniedException":
518
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
519
+ case "InternalException":
520
+ case "com.amazonaws.osis#InternalException":
521
+ throw await de_InternalExceptionRes(parsedOutput, context);
522
+ case "InvalidPaginationTokenException":
523
+ case "com.amazonaws.osis#InvalidPaginationTokenException":
524
+ throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context);
525
+ case "ValidationException":
526
+ case "com.amazonaws.osis#ValidationException":
527
+ throw await de_ValidationExceptionRes(parsedOutput, context);
528
+ default:
529
+ const parsedBody = parsedOutput.body;
530
+ return throwDefaultError({
531
+ output,
532
+ parsedBody,
533
+ errorCode,
534
+ });
535
+ }
536
+ };
537
+ export const de_ListPipelinesCommand = async (output, context) => {
538
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
539
+ return de_ListPipelinesCommandError(output, context);
540
+ }
541
+ const contents = map({
542
+ $metadata: deserializeMetadata(output),
543
+ });
544
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
545
+ const doc = take(data, {
546
+ NextToken: __expectString,
547
+ Pipelines: (_) => de_PipelineSummaryList(_, context),
548
+ });
549
+ Object.assign(contents, doc);
550
+ return contents;
551
+ };
552
+ const de_ListPipelinesCommandError = async (output, context) => {
553
+ const parsedOutput = {
554
+ ...output,
555
+ body: await parseErrorBody(output.body, context),
556
+ };
557
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
558
+ switch (errorCode) {
559
+ case "AccessDeniedException":
560
+ case "com.amazonaws.osis#AccessDeniedException":
561
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
562
+ case "InternalException":
563
+ case "com.amazonaws.osis#InternalException":
564
+ throw await de_InternalExceptionRes(parsedOutput, context);
565
+ case "InvalidPaginationTokenException":
566
+ case "com.amazonaws.osis#InvalidPaginationTokenException":
567
+ throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context);
568
+ case "ValidationException":
569
+ case "com.amazonaws.osis#ValidationException":
570
+ throw await de_ValidationExceptionRes(parsedOutput, context);
571
+ default:
572
+ const parsedBody = parsedOutput.body;
573
+ return throwDefaultError({
574
+ output,
575
+ parsedBody,
576
+ errorCode,
577
+ });
578
+ }
579
+ };
580
+ export const de_ListTagsForResourceCommand = async (output, context) => {
581
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
582
+ return de_ListTagsForResourceCommandError(output, context);
583
+ }
584
+ const contents = map({
585
+ $metadata: deserializeMetadata(output),
586
+ });
587
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
588
+ const doc = take(data, {
589
+ Tags: _json,
590
+ });
591
+ Object.assign(contents, doc);
592
+ return contents;
593
+ };
594
+ const de_ListTagsForResourceCommandError = async (output, context) => {
595
+ const parsedOutput = {
596
+ ...output,
597
+ body: await parseErrorBody(output.body, context),
598
+ };
599
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
600
+ switch (errorCode) {
601
+ case "AccessDeniedException":
602
+ case "com.amazonaws.osis#AccessDeniedException":
603
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
604
+ case "InternalException":
605
+ case "com.amazonaws.osis#InternalException":
606
+ throw await de_InternalExceptionRes(parsedOutput, context);
607
+ case "ResourceNotFoundException":
608
+ case "com.amazonaws.osis#ResourceNotFoundException":
609
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
610
+ case "ValidationException":
611
+ case "com.amazonaws.osis#ValidationException":
612
+ throw await de_ValidationExceptionRes(parsedOutput, context);
613
+ default:
614
+ const parsedBody = parsedOutput.body;
615
+ return throwDefaultError({
616
+ output,
617
+ parsedBody,
618
+ errorCode,
619
+ });
620
+ }
621
+ };
622
+ export const de_StartPipelineCommand = async (output, context) => {
623
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
624
+ return de_StartPipelineCommandError(output, context);
625
+ }
626
+ const contents = map({
627
+ $metadata: deserializeMetadata(output),
628
+ });
629
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
630
+ const doc = take(data, {
631
+ Pipeline: (_) => de_Pipeline(_, context),
632
+ });
633
+ Object.assign(contents, doc);
634
+ return contents;
635
+ };
636
+ const de_StartPipelineCommandError = async (output, context) => {
637
+ const parsedOutput = {
638
+ ...output,
639
+ body: await parseErrorBody(output.body, context),
640
+ };
641
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
642
+ switch (errorCode) {
643
+ case "AccessDeniedException":
644
+ case "com.amazonaws.osis#AccessDeniedException":
645
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
646
+ case "ConflictException":
647
+ case "com.amazonaws.osis#ConflictException":
648
+ throw await de_ConflictExceptionRes(parsedOutput, context);
649
+ case "InternalException":
650
+ case "com.amazonaws.osis#InternalException":
651
+ throw await de_InternalExceptionRes(parsedOutput, context);
652
+ case "ResourceNotFoundException":
653
+ case "com.amazonaws.osis#ResourceNotFoundException":
654
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
655
+ case "ValidationException":
656
+ case "com.amazonaws.osis#ValidationException":
657
+ throw await de_ValidationExceptionRes(parsedOutput, context);
658
+ default:
659
+ const parsedBody = parsedOutput.body;
660
+ return throwDefaultError({
661
+ output,
662
+ parsedBody,
663
+ errorCode,
664
+ });
665
+ }
666
+ };
667
+ export const de_StopPipelineCommand = async (output, context) => {
668
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
669
+ return de_StopPipelineCommandError(output, context);
670
+ }
671
+ const contents = map({
672
+ $metadata: deserializeMetadata(output),
673
+ });
674
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
675
+ const doc = take(data, {
676
+ Pipeline: (_) => de_Pipeline(_, context),
677
+ });
678
+ Object.assign(contents, doc);
679
+ return contents;
680
+ };
681
+ const de_StopPipelineCommandError = async (output, context) => {
682
+ const parsedOutput = {
683
+ ...output,
684
+ body: await parseErrorBody(output.body, context),
685
+ };
686
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
687
+ switch (errorCode) {
688
+ case "AccessDeniedException":
689
+ case "com.amazonaws.osis#AccessDeniedException":
690
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
691
+ case "ConflictException":
692
+ case "com.amazonaws.osis#ConflictException":
693
+ throw await de_ConflictExceptionRes(parsedOutput, context);
694
+ case "InternalException":
695
+ case "com.amazonaws.osis#InternalException":
696
+ throw await de_InternalExceptionRes(parsedOutput, context);
697
+ case "ResourceNotFoundException":
698
+ case "com.amazonaws.osis#ResourceNotFoundException":
699
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
700
+ case "ValidationException":
701
+ case "com.amazonaws.osis#ValidationException":
702
+ throw await de_ValidationExceptionRes(parsedOutput, context);
703
+ default:
704
+ const parsedBody = parsedOutput.body;
705
+ return throwDefaultError({
706
+ output,
707
+ parsedBody,
708
+ errorCode,
709
+ });
710
+ }
711
+ };
712
+ export const de_TagResourceCommand = async (output, context) => {
713
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
714
+ return de_TagResourceCommandError(output, context);
715
+ }
716
+ const contents = map({
717
+ $metadata: deserializeMetadata(output),
718
+ });
719
+ await collectBody(output.body, context);
720
+ return contents;
721
+ };
722
+ const de_TagResourceCommandError = async (output, context) => {
723
+ const parsedOutput = {
724
+ ...output,
725
+ body: await parseErrorBody(output.body, context),
726
+ };
727
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
728
+ switch (errorCode) {
729
+ case "AccessDeniedException":
730
+ case "com.amazonaws.osis#AccessDeniedException":
731
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
732
+ case "InternalException":
733
+ case "com.amazonaws.osis#InternalException":
734
+ throw await de_InternalExceptionRes(parsedOutput, context);
735
+ case "LimitExceededException":
736
+ case "com.amazonaws.osis#LimitExceededException":
737
+ throw await de_LimitExceededExceptionRes(parsedOutput, context);
738
+ case "ResourceNotFoundException":
739
+ case "com.amazonaws.osis#ResourceNotFoundException":
740
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
741
+ case "ValidationException":
742
+ case "com.amazonaws.osis#ValidationException":
743
+ throw await de_ValidationExceptionRes(parsedOutput, context);
744
+ default:
745
+ const parsedBody = parsedOutput.body;
746
+ return throwDefaultError({
747
+ output,
748
+ parsedBody,
749
+ errorCode,
750
+ });
751
+ }
752
+ };
753
+ export const de_UntagResourceCommand = async (output, context) => {
754
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
755
+ return de_UntagResourceCommandError(output, context);
756
+ }
757
+ const contents = map({
758
+ $metadata: deserializeMetadata(output),
759
+ });
760
+ await collectBody(output.body, context);
761
+ return contents;
762
+ };
763
+ const de_UntagResourceCommandError = async (output, context) => {
764
+ const parsedOutput = {
765
+ ...output,
766
+ body: await parseErrorBody(output.body, context),
767
+ };
768
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
769
+ switch (errorCode) {
770
+ case "AccessDeniedException":
771
+ case "com.amazonaws.osis#AccessDeniedException":
772
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
773
+ case "InternalException":
774
+ case "com.amazonaws.osis#InternalException":
775
+ throw await de_InternalExceptionRes(parsedOutput, context);
776
+ case "ResourceNotFoundException":
777
+ case "com.amazonaws.osis#ResourceNotFoundException":
778
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
779
+ case "ValidationException":
780
+ case "com.amazonaws.osis#ValidationException":
781
+ throw await de_ValidationExceptionRes(parsedOutput, context);
782
+ default:
783
+ const parsedBody = parsedOutput.body;
784
+ return throwDefaultError({
785
+ output,
786
+ parsedBody,
787
+ errorCode,
788
+ });
789
+ }
790
+ };
791
+ export const de_UpdatePipelineCommand = async (output, context) => {
792
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
793
+ return de_UpdatePipelineCommandError(output, context);
794
+ }
795
+ const contents = map({
796
+ $metadata: deserializeMetadata(output),
797
+ });
798
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
799
+ const doc = take(data, {
800
+ Pipeline: (_) => de_Pipeline(_, context),
801
+ });
802
+ Object.assign(contents, doc);
803
+ return contents;
804
+ };
805
+ const de_UpdatePipelineCommandError = async (output, context) => {
806
+ const parsedOutput = {
807
+ ...output,
808
+ body: await parseErrorBody(output.body, context),
809
+ };
810
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
811
+ switch (errorCode) {
812
+ case "AccessDeniedException":
813
+ case "com.amazonaws.osis#AccessDeniedException":
814
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
815
+ case "ConflictException":
816
+ case "com.amazonaws.osis#ConflictException":
817
+ throw await de_ConflictExceptionRes(parsedOutput, context);
818
+ case "InternalException":
819
+ case "com.amazonaws.osis#InternalException":
820
+ throw await de_InternalExceptionRes(parsedOutput, context);
821
+ case "ResourceNotFoundException":
822
+ case "com.amazonaws.osis#ResourceNotFoundException":
823
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
824
+ case "ValidationException":
825
+ case "com.amazonaws.osis#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
+ export const de_ValidatePipelineCommand = async (output, context) => {
837
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
838
+ return de_ValidatePipelineCommandError(output, context);
839
+ }
840
+ const contents = map({
841
+ $metadata: deserializeMetadata(output),
842
+ });
843
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
844
+ const doc = take(data, {
845
+ Errors: _json,
846
+ isValid: __expectBoolean,
847
+ });
848
+ Object.assign(contents, doc);
849
+ return contents;
850
+ };
851
+ const de_ValidatePipelineCommandError = async (output, context) => {
852
+ const parsedOutput = {
853
+ ...output,
854
+ body: await parseErrorBody(output.body, context),
855
+ };
856
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
857
+ switch (errorCode) {
858
+ case "AccessDeniedException":
859
+ case "com.amazonaws.osis#AccessDeniedException":
860
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
861
+ case "InternalException":
862
+ case "com.amazonaws.osis#InternalException":
863
+ throw await de_InternalExceptionRes(parsedOutput, context);
864
+ case "ValidationException":
865
+ case "com.amazonaws.osis#ValidationException":
866
+ throw await de_ValidationExceptionRes(parsedOutput, context);
867
+ default:
868
+ const parsedBody = parsedOutput.body;
869
+ return throwDefaultError({
870
+ output,
871
+ parsedBody,
872
+ errorCode,
873
+ });
874
+ }
875
+ };
876
+ const throwDefaultError = withBaseException(__BaseException);
877
+ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
878
+ const contents = map({});
879
+ const data = parsedOutput.body;
880
+ const doc = take(data, {
881
+ message: __expectString,
882
+ });
883
+ Object.assign(contents, doc);
884
+ const exception = new AccessDeniedException({
885
+ $metadata: deserializeMetadata(parsedOutput),
886
+ ...contents,
887
+ });
888
+ return __decorateServiceException(exception, parsedOutput.body);
889
+ };
890
+ const de_ConflictExceptionRes = async (parsedOutput, context) => {
891
+ const contents = map({});
892
+ const data = parsedOutput.body;
893
+ const doc = take(data, {
894
+ message: __expectString,
895
+ });
896
+ Object.assign(contents, doc);
897
+ const exception = new ConflictException({
898
+ $metadata: deserializeMetadata(parsedOutput),
899
+ ...contents,
900
+ });
901
+ return __decorateServiceException(exception, parsedOutput.body);
902
+ };
903
+ const de_InternalExceptionRes = async (parsedOutput, context) => {
904
+ const contents = map({});
905
+ const data = parsedOutput.body;
906
+ const doc = take(data, {
907
+ message: __expectString,
908
+ });
909
+ Object.assign(contents, doc);
910
+ const exception = new InternalException({
911
+ $metadata: deserializeMetadata(parsedOutput),
912
+ ...contents,
913
+ });
914
+ return __decorateServiceException(exception, parsedOutput.body);
915
+ };
916
+ const de_InvalidPaginationTokenExceptionRes = async (parsedOutput, context) => {
917
+ const contents = map({});
918
+ const data = parsedOutput.body;
919
+ const doc = take(data, {
920
+ message: __expectString,
921
+ });
922
+ Object.assign(contents, doc);
923
+ const exception = new InvalidPaginationTokenException({
924
+ $metadata: deserializeMetadata(parsedOutput),
925
+ ...contents,
926
+ });
927
+ return __decorateServiceException(exception, parsedOutput.body);
928
+ };
929
+ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
930
+ const contents = map({});
931
+ const data = parsedOutput.body;
932
+ const doc = take(data, {
933
+ message: __expectString,
934
+ });
935
+ Object.assign(contents, doc);
936
+ const exception = new LimitExceededException({
937
+ $metadata: deserializeMetadata(parsedOutput),
938
+ ...contents,
939
+ });
940
+ return __decorateServiceException(exception, parsedOutput.body);
941
+ };
942
+ const de_ResourceAlreadyExistsExceptionRes = async (parsedOutput, context) => {
943
+ const contents = map({});
944
+ const data = parsedOutput.body;
945
+ const doc = take(data, {
946
+ message: __expectString,
947
+ });
948
+ Object.assign(contents, doc);
949
+ const exception = new ResourceAlreadyExistsException({
950
+ $metadata: deserializeMetadata(parsedOutput),
951
+ ...contents,
952
+ });
953
+ return __decorateServiceException(exception, parsedOutput.body);
954
+ };
955
+ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
956
+ const contents = map({});
957
+ const data = parsedOutput.body;
958
+ const doc = take(data, {
959
+ message: __expectString,
960
+ });
961
+ Object.assign(contents, doc);
962
+ const exception = new ResourceNotFoundException({
963
+ $metadata: deserializeMetadata(parsedOutput),
964
+ ...contents,
965
+ });
966
+ return __decorateServiceException(exception, parsedOutput.body);
967
+ };
968
+ const de_ValidationExceptionRes = async (parsedOutput, context) => {
969
+ const contents = map({});
970
+ const data = parsedOutput.body;
971
+ const doc = take(data, {
972
+ message: __expectString,
973
+ });
974
+ Object.assign(contents, doc);
975
+ const exception = new ValidationException({
976
+ $metadata: deserializeMetadata(parsedOutput),
977
+ ...contents,
978
+ });
979
+ return __decorateServiceException(exception, parsedOutput.body);
980
+ };
981
+ const de_ChangeProgressStage = (output, context) => {
982
+ return take(output, {
983
+ Description: __expectString,
984
+ LastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
985
+ Name: __expectString,
986
+ Status: __expectString,
987
+ });
988
+ };
989
+ const de_ChangeProgressStageList = (output, context) => {
990
+ const retVal = (output || [])
991
+ .filter((e) => e != null)
992
+ .map((entry) => {
993
+ return de_ChangeProgressStage(entry, context);
994
+ });
995
+ return retVal;
996
+ };
997
+ const de_ChangeProgressStatus = (output, context) => {
998
+ return take(output, {
999
+ ChangeProgressStages: (_) => de_ChangeProgressStageList(_, context),
1000
+ StartTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1001
+ Status: __expectString,
1002
+ TotalNumberOfStages: __expectInt32,
1003
+ });
1004
+ };
1005
+ const de_ChangeProgressStatusList = (output, context) => {
1006
+ const retVal = (output || [])
1007
+ .filter((e) => e != null)
1008
+ .map((entry) => {
1009
+ return de_ChangeProgressStatus(entry, context);
1010
+ });
1011
+ return retVal;
1012
+ };
1013
+ const de_Pipeline = (output, context) => {
1014
+ return take(output, {
1015
+ CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1016
+ IngestEndpointUrls: _json,
1017
+ LastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1018
+ LogPublishingOptions: _json,
1019
+ MaxUnits: __expectInt32,
1020
+ MinUnits: __expectInt32,
1021
+ PipelineArn: __expectString,
1022
+ PipelineConfigurationBody: __expectString,
1023
+ PipelineName: __expectString,
1024
+ Status: __expectString,
1025
+ StatusReason: _json,
1026
+ VpcEndpoints: _json,
1027
+ });
1028
+ };
1029
+ const de_PipelineSummary = (output, context) => {
1030
+ return take(output, {
1031
+ CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1032
+ LastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1033
+ MaxUnits: __expectInt32,
1034
+ MinUnits: __expectInt32,
1035
+ PipelineArn: __expectString,
1036
+ PipelineName: __expectString,
1037
+ Status: __expectString,
1038
+ StatusReason: _json,
1039
+ });
1040
+ };
1041
+ const de_PipelineSummaryList = (output, context) => {
1042
+ const retVal = (output || [])
1043
+ .filter((e) => e != null)
1044
+ .map((entry) => {
1045
+ return de_PipelineSummary(entry, context);
1046
+ });
1047
+ return retVal;
1048
+ };
1049
+ const deserializeMetadata = (output) => ({
1050
+ httpStatusCode: output.statusCode,
1051
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1052
+ extendedRequestId: output.headers["x-amz-id-2"],
1053
+ cfId: output.headers["x-amz-cf-id"],
1054
+ });
1055
+ const collectBody = (streamBody = new Uint8Array(), context) => {
1056
+ if (streamBody instanceof Uint8Array) {
1057
+ return Promise.resolve(streamBody);
1058
+ }
1059
+ return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1060
+ };
1061
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1062
+ const isSerializableHeaderValue = (value) => value !== undefined &&
1063
+ value !== null &&
1064
+ value !== "" &&
1065
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1066
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1067
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1068
+ if (encoded.length) {
1069
+ return JSON.parse(encoded);
1070
+ }
1071
+ return {};
1072
+ });
1073
+ const parseErrorBody = async (errorBody, context) => {
1074
+ const value = await parseBody(errorBody, context);
1075
+ value.message = value.message ?? value.Message;
1076
+ return value;
1077
+ };
1078
+ const loadRestJsonErrorCode = (output, data) => {
1079
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1080
+ const sanitizeErrorCode = (rawValue) => {
1081
+ let cleanValue = rawValue;
1082
+ if (typeof cleanValue === "number") {
1083
+ cleanValue = cleanValue.toString();
1084
+ }
1085
+ if (cleanValue.indexOf(",") >= 0) {
1086
+ cleanValue = cleanValue.split(",")[0];
1087
+ }
1088
+ if (cleanValue.indexOf(":") >= 0) {
1089
+ cleanValue = cleanValue.split(":")[0];
1090
+ }
1091
+ if (cleanValue.indexOf("#") >= 0) {
1092
+ cleanValue = cleanValue.split("#")[1];
1093
+ }
1094
+ return cleanValue;
1095
+ };
1096
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1097
+ if (headerKey !== undefined) {
1098
+ return sanitizeErrorCode(output.headers[headerKey]);
1099
+ }
1100
+ if (data.code !== undefined) {
1101
+ return sanitizeErrorCode(data.code);
1102
+ }
1103
+ if (data["__type"] !== undefined) {
1104
+ return sanitizeErrorCode(data["__type"]);
1105
+ }
1106
+ };