@aws-sdk/client-signer 3.186.0 → 3.188.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 (33) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist-es/Signer.js +70 -77
  3. package/dist-es/SignerClient.js +22 -28
  4. package/dist-es/commands/AddProfilePermissionCommand.js +21 -28
  5. package/dist-es/commands/CancelSigningProfileCommand.js +22 -29
  6. package/dist-es/commands/DescribeSigningJobCommand.js +21 -28
  7. package/dist-es/commands/GetSigningPlatformCommand.js +21 -28
  8. package/dist-es/commands/GetSigningProfileCommand.js +21 -28
  9. package/dist-es/commands/ListProfilePermissionsCommand.js +21 -28
  10. package/dist-es/commands/ListSigningJobsCommand.js +21 -28
  11. package/dist-es/commands/ListSigningPlatformsCommand.js +21 -28
  12. package/dist-es/commands/ListSigningProfilesCommand.js +21 -28
  13. package/dist-es/commands/ListTagsForResourceCommand.js +21 -28
  14. package/dist-es/commands/PutSigningProfileCommand.js +21 -28
  15. package/dist-es/commands/RemoveProfilePermissionCommand.js +21 -28
  16. package/dist-es/commands/RevokeSignatureCommand.js +22 -29
  17. package/dist-es/commands/RevokeSigningProfileCommand.js +22 -29
  18. package/dist-es/commands/StartSigningJobCommand.js +21 -28
  19. package/dist-es/commands/TagResourceCommand.js +21 -28
  20. package/dist-es/commands/UntagResourceCommand.js +21 -28
  21. package/dist-es/endpoints.js +8 -8
  22. package/dist-es/models/SignerServiceException.js +5 -10
  23. package/dist-es/models/models_0.js +273 -172
  24. package/dist-es/pagination/ListSigningJobsPaginator.js +25 -68
  25. package/dist-es/pagination/ListSigningPlatformsPaginator.js +25 -68
  26. package/dist-es/pagination/ListSigningProfilesPaginator.js +25 -68
  27. package/dist-es/protocols/Aws_restJson1.js +1494 -2004
  28. package/dist-es/runtimeConfig.browser.js +26 -12
  29. package/dist-es/runtimeConfig.js +30 -12
  30. package/dist-es/runtimeConfig.native.js +8 -5
  31. package/dist-es/runtimeConfig.shared.js +8 -11
  32. package/dist-es/waiters/waitForSuccessfulSigningJob.js +39 -59
  33. package/package.json +34 -34
@@ -1,1973 +1,1479 @@
1
- import { __assign, __awaiter, __generator, __read } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { v4 as generateIdempotencyToken } from "uuid";
5
4
  import { AccessDeniedException, BadRequestException, ConflictException, InternalServiceErrorException, NotFoundException, ResourceNotFoundException, ServiceLimitExceededException, ThrottlingException, TooManyRequestsException, ValidationException, } from "../models/models_0";
6
5
  import { SignerServiceException as __BaseException } from "../models/SignerServiceException";
7
- export var serializeAws_restJson1AddProfilePermissionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
8
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
9
- return __generator(this, function (_c) {
10
- switch (_c.label) {
11
- case 0: return [4, context.endpoint()];
12
- case 1:
13
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
14
- headers = {
15
- "content-type": "application/json",
16
- };
17
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
18
- "/signing-profiles/{profileName}/permissions";
19
- resolvedPath = __resolvedPath(resolvedPath, input, "profileName", function () { return input.profileName; }, "{profileName}", false);
20
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.action != null && { action: input.action })), (input.principal != null && { principal: input.principal })), (input.profileVersion != null && { profileVersion: input.profileVersion })), (input.revisionId != null && { revisionId: input.revisionId })), (input.statementId != null && { statementId: input.statementId })));
21
- return [2, new __HttpRequest({
22
- protocol: protocol,
23
- hostname: hostname,
24
- port: port,
25
- method: "POST",
26
- headers: headers,
27
- path: resolvedPath,
28
- body: body,
29
- })];
30
- }
31
- });
32
- }); };
33
- export var serializeAws_restJson1CancelSigningProfileCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
34
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
35
- return __generator(this, function (_c) {
36
- switch (_c.label) {
37
- case 0: return [4, context.endpoint()];
38
- case 1:
39
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
40
- headers = {};
41
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/signing-profiles/{profileName}";
42
- resolvedPath = __resolvedPath(resolvedPath, input, "profileName", function () { return input.profileName; }, "{profileName}", false);
43
- return [2, new __HttpRequest({
44
- protocol: protocol,
45
- hostname: hostname,
46
- port: port,
47
- method: "DELETE",
48
- headers: headers,
49
- path: resolvedPath,
50
- body: body,
51
- })];
52
- }
53
- });
54
- }); };
55
- export var serializeAws_restJson1DescribeSigningJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
56
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
57
- return __generator(this, function (_c) {
58
- switch (_c.label) {
59
- case 0: return [4, context.endpoint()];
60
- case 1:
61
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
62
- headers = {};
63
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/signing-jobs/{jobId}";
64
- resolvedPath = __resolvedPath(resolvedPath, input, "jobId", function () { return input.jobId; }, "{jobId}", false);
65
- return [2, new __HttpRequest({
66
- protocol: protocol,
67
- hostname: hostname,
68
- port: port,
69
- method: "GET",
70
- headers: headers,
71
- path: resolvedPath,
72
- body: body,
73
- })];
74
- }
75
- });
76
- }); };
77
- export var serializeAws_restJson1GetSigningPlatformCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
78
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
79
- return __generator(this, function (_c) {
80
- switch (_c.label) {
81
- case 0: return [4, context.endpoint()];
82
- case 1:
83
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
84
- headers = {};
85
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/signing-platforms/{platformId}";
86
- resolvedPath = __resolvedPath(resolvedPath, input, "platformId", function () { return input.platformId; }, "{platformId}", false);
87
- return [2, new __HttpRequest({
88
- protocol: protocol,
89
- hostname: hostname,
90
- port: port,
91
- method: "GET",
92
- headers: headers,
93
- path: resolvedPath,
94
- body: body,
95
- })];
96
- }
97
- });
98
- }); };
99
- export var serializeAws_restJson1GetSigningProfileCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
100
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
101
- return __generator(this, function (_c) {
102
- switch (_c.label) {
103
- case 0: return [4, context.endpoint()];
104
- case 1:
105
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
106
- headers = {};
107
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/signing-profiles/{profileName}";
108
- resolvedPath = __resolvedPath(resolvedPath, input, "profileName", function () { return input.profileName; }, "{profileName}", false);
109
- query = map({
110
- profileOwner: [, input.profileOwner],
111
- });
112
- return [2, new __HttpRequest({
113
- protocol: protocol,
114
- hostname: hostname,
115
- port: port,
116
- method: "GET",
117
- headers: headers,
118
- path: resolvedPath,
119
- query: query,
120
- body: body,
121
- })];
122
- }
123
- });
124
- }); };
125
- export var serializeAws_restJson1ListProfilePermissionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
126
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
127
- return __generator(this, function (_c) {
128
- switch (_c.label) {
129
- case 0: return [4, context.endpoint()];
130
- case 1:
131
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
132
- headers = {};
133
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
134
- "/signing-profiles/{profileName}/permissions";
135
- resolvedPath = __resolvedPath(resolvedPath, input, "profileName", function () { return input.profileName; }, "{profileName}", false);
136
- query = map({
137
- nextToken: [, input.nextToken],
138
- });
139
- return [2, new __HttpRequest({
140
- protocol: protocol,
141
- hostname: hostname,
142
- port: port,
143
- method: "GET",
144
- headers: headers,
145
- path: resolvedPath,
146
- query: query,
147
- body: body,
148
- })];
149
- }
150
- });
151
- }); };
152
- export var serializeAws_restJson1ListSigningJobsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
153
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
154
- return __generator(this, function (_c) {
155
- switch (_c.label) {
156
- case 0: return [4, context.endpoint()];
157
- case 1:
158
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
159
- headers = {};
160
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/signing-jobs";
161
- query = map({
162
- status: [, input.status],
163
- platformId: [, input.platformId],
164
- requestedBy: [, input.requestedBy],
165
- maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
166
- nextToken: [, input.nextToken],
167
- isRevoked: [function () { return input.isRevoked !== void 0; }, function () { return input.isRevoked.toString(); }],
168
- signatureExpiresBefore: [
169
- function () { return input.signatureExpiresBefore !== void 0; },
170
- function () { return (input.signatureExpiresBefore.toISOString().split(".")[0] + "Z").toString(); },
171
- ],
172
- signatureExpiresAfter: [
173
- function () { return input.signatureExpiresAfter !== void 0; },
174
- function () { return (input.signatureExpiresAfter.toISOString().split(".")[0] + "Z").toString(); },
175
- ],
176
- jobInvoker: [, input.jobInvoker],
177
- });
178
- return [2, new __HttpRequest({
179
- protocol: protocol,
180
- hostname: hostname,
181
- port: port,
182
- method: "GET",
183
- headers: headers,
184
- path: resolvedPath,
185
- query: query,
186
- body: body,
187
- })];
188
- }
189
- });
190
- }); };
191
- export var serializeAws_restJson1ListSigningPlatformsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
192
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
193
- return __generator(this, function (_c) {
194
- switch (_c.label) {
195
- case 0: return [4, context.endpoint()];
196
- case 1:
197
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
198
- headers = {};
199
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/signing-platforms";
200
- query = map({
201
- category: [, input.category],
202
- partner: [, input.partner],
203
- target: [, input.target],
204
- maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
205
- nextToken: [, input.nextToken],
206
- });
207
- return [2, new __HttpRequest({
208
- protocol: protocol,
209
- hostname: hostname,
210
- port: port,
211
- method: "GET",
212
- headers: headers,
213
- path: resolvedPath,
214
- query: query,
215
- body: body,
216
- })];
217
- }
218
- });
219
- }); };
220
- export var serializeAws_restJson1ListSigningProfilesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
221
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
222
- return __generator(this, function (_c) {
223
- switch (_c.label) {
224
- case 0: return [4, context.endpoint()];
225
- case 1:
226
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
227
- headers = {};
228
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/signing-profiles";
229
- query = map({
230
- includeCanceled: [function () { return input.includeCanceled !== void 0; }, function () { return input.includeCanceled.toString(); }],
231
- maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
232
- nextToken: [, input.nextToken],
233
- platformId: [, input.platformId],
234
- statuses: [function () { return input.statuses !== void 0; }, function () { return (input.statuses || []).map(function (_entry) { return _entry; }); }],
235
- });
236
- return [2, new __HttpRequest({
237
- protocol: protocol,
238
- hostname: hostname,
239
- port: port,
240
- method: "GET",
241
- headers: headers,
242
- path: resolvedPath,
243
- query: query,
244
- body: body,
245
- })];
246
- }
6
+ export const serializeAws_restJson1AddProfilePermissionCommand = async (input, context) => {
7
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
+ const headers = {
9
+ "content-type": "application/json",
10
+ };
11
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
12
+ "/signing-profiles/{profileName}/permissions";
13
+ resolvedPath = __resolvedPath(resolvedPath, input, "profileName", () => input.profileName, "{profileName}", false);
14
+ let body;
15
+ body = JSON.stringify({
16
+ ...(input.action != null && { action: input.action }),
17
+ ...(input.principal != null && { principal: input.principal }),
18
+ ...(input.profileVersion != null && { profileVersion: input.profileVersion }),
19
+ ...(input.revisionId != null && { revisionId: input.revisionId }),
20
+ ...(input.statementId != null && { statementId: input.statementId }),
21
+ });
22
+ return new __HttpRequest({
23
+ protocol,
24
+ hostname,
25
+ port,
26
+ method: "POST",
27
+ headers,
28
+ path: resolvedPath,
29
+ body,
247
30
  });
248
- }); };
249
- export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
250
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
251
- return __generator(this, function (_c) {
252
- switch (_c.label) {
253
- case 0: return [4, context.endpoint()];
254
- case 1:
255
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
256
- headers = {};
257
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
258
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
259
- return [2, new __HttpRequest({
260
- protocol: protocol,
261
- hostname: hostname,
262
- port: port,
263
- method: "GET",
264
- headers: headers,
265
- path: resolvedPath,
266
- body: body,
267
- })];
268
- }
31
+ };
32
+ export const serializeAws_restJson1CancelSigningProfileCommand = async (input, context) => {
33
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
34
+ const headers = {};
35
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-profiles/{profileName}";
36
+ resolvedPath = __resolvedPath(resolvedPath, input, "profileName", () => input.profileName, "{profileName}", false);
37
+ let body;
38
+ return new __HttpRequest({
39
+ protocol,
40
+ hostname,
41
+ port,
42
+ method: "DELETE",
43
+ headers,
44
+ path: resolvedPath,
45
+ body,
269
46
  });
270
- }); };
271
- export var serializeAws_restJson1PutSigningProfileCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
272
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
273
- return __generator(this, function (_c) {
274
- switch (_c.label) {
275
- case 0: return [4, context.endpoint()];
276
- case 1:
277
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
278
- headers = {
279
- "content-type": "application/json",
280
- };
281
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/signing-profiles/{profileName}";
282
- resolvedPath = __resolvedPath(resolvedPath, input, "profileName", function () { return input.profileName; }, "{profileName}", false);
283
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.overrides != null && {
284
- overrides: serializeAws_restJson1SigningPlatformOverrides(input.overrides, context),
285
- })), (input.platformId != null && { platformId: input.platformId })), (input.signatureValidityPeriod != null && {
286
- signatureValidityPeriod: serializeAws_restJson1SignatureValidityPeriod(input.signatureValidityPeriod, context),
287
- })), (input.signingMaterial != null && {
288
- signingMaterial: serializeAws_restJson1SigningMaterial(input.signingMaterial, context),
289
- })), (input.signingParameters != null && {
290
- signingParameters: serializeAws_restJson1SigningParameters(input.signingParameters, context),
291
- })), (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
292
- return [2, new __HttpRequest({
293
- protocol: protocol,
294
- hostname: hostname,
295
- port: port,
296
- method: "PUT",
297
- headers: headers,
298
- path: resolvedPath,
299
- body: body,
300
- })];
301
- }
47
+ };
48
+ export const serializeAws_restJson1DescribeSigningJobCommand = 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 || ""}` + "/signing-jobs/{jobId}";
52
+ resolvedPath = __resolvedPath(resolvedPath, input, "jobId", () => input.jobId, "{jobId}", false);
53
+ let body;
54
+ return new __HttpRequest({
55
+ protocol,
56
+ hostname,
57
+ port,
58
+ method: "GET",
59
+ headers,
60
+ path: resolvedPath,
61
+ body,
302
62
  });
303
- }); };
304
- export var serializeAws_restJson1RemoveProfilePermissionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
305
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
306
- return __generator(this, function (_c) {
307
- switch (_c.label) {
308
- case 0: return [4, context.endpoint()];
309
- case 1:
310
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
311
- headers = {};
312
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
313
- "/signing-profiles/{profileName}/permissions/{statementId}";
314
- resolvedPath = __resolvedPath(resolvedPath, input, "profileName", function () { return input.profileName; }, "{profileName}", false);
315
- resolvedPath = __resolvedPath(resolvedPath, input, "statementId", function () { return input.statementId; }, "{statementId}", false);
316
- query = map({
317
- revisionId: [, input.revisionId],
318
- });
319
- return [2, new __HttpRequest({
320
- protocol: protocol,
321
- hostname: hostname,
322
- port: port,
323
- method: "DELETE",
324
- headers: headers,
325
- path: resolvedPath,
326
- query: query,
327
- body: body,
328
- })];
329
- }
63
+ };
64
+ export const serializeAws_restJson1GetSigningPlatformCommand = async (input, context) => {
65
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
66
+ const headers = {};
67
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-platforms/{platformId}";
68
+ resolvedPath = __resolvedPath(resolvedPath, input, "platformId", () => input.platformId, "{platformId}", false);
69
+ let body;
70
+ return new __HttpRequest({
71
+ protocol,
72
+ hostname,
73
+ port,
74
+ method: "GET",
75
+ headers,
76
+ path: resolvedPath,
77
+ body,
330
78
  });
331
- }); };
332
- export var serializeAws_restJson1RevokeSignatureCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
333
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
334
- return __generator(this, function (_c) {
335
- switch (_c.label) {
336
- case 0: return [4, context.endpoint()];
337
- case 1:
338
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
339
- headers = {
340
- "content-type": "application/json",
341
- };
342
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/signing-jobs/{jobId}/revoke";
343
- resolvedPath = __resolvedPath(resolvedPath, input, "jobId", function () { return input.jobId; }, "{jobId}", false);
344
- body = JSON.stringify(__assign(__assign({}, (input.jobOwner != null && { jobOwner: input.jobOwner })), (input.reason != null && { reason: input.reason })));
345
- return [2, new __HttpRequest({
346
- protocol: protocol,
347
- hostname: hostname,
348
- port: port,
349
- method: "PUT",
350
- headers: headers,
351
- path: resolvedPath,
352
- body: body,
353
- })];
354
- }
79
+ };
80
+ export const serializeAws_restJson1GetSigningProfileCommand = async (input, context) => {
81
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
82
+ const headers = {};
83
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-profiles/{profileName}";
84
+ resolvedPath = __resolvedPath(resolvedPath, input, "profileName", () => input.profileName, "{profileName}", false);
85
+ const query = map({
86
+ profileOwner: [, input.profileOwner],
87
+ });
88
+ let body;
89
+ return new __HttpRequest({
90
+ protocol,
91
+ hostname,
92
+ port,
93
+ method: "GET",
94
+ headers,
95
+ path: resolvedPath,
96
+ query,
97
+ body,
355
98
  });
356
- }); };
357
- export var serializeAws_restJson1RevokeSigningProfileCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
358
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
359
- return __generator(this, function (_c) {
360
- switch (_c.label) {
361
- case 0: return [4, context.endpoint()];
362
- case 1:
363
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
364
- headers = {
365
- "content-type": "application/json",
366
- };
367
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/signing-profiles/{profileName}/revoke";
368
- resolvedPath = __resolvedPath(resolvedPath, input, "profileName", function () { return input.profileName; }, "{profileName}", false);
369
- body = JSON.stringify(__assign(__assign(__assign({}, (input.effectiveTime != null && { effectiveTime: Math.round(input.effectiveTime.getTime() / 1000) })), (input.profileVersion != null && { profileVersion: input.profileVersion })), (input.reason != null && { reason: input.reason })));
370
- return [2, new __HttpRequest({
371
- protocol: protocol,
372
- hostname: hostname,
373
- port: port,
374
- method: "PUT",
375
- headers: headers,
376
- path: resolvedPath,
377
- body: body,
378
- })];
379
- }
99
+ };
100
+ export const serializeAws_restJson1ListProfilePermissionsCommand = async (input, context) => {
101
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
102
+ const headers = {};
103
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
104
+ "/signing-profiles/{profileName}/permissions";
105
+ resolvedPath = __resolvedPath(resolvedPath, input, "profileName", () => input.profileName, "{profileName}", false);
106
+ const query = map({
107
+ nextToken: [, input.nextToken],
108
+ });
109
+ let body;
110
+ return new __HttpRequest({
111
+ protocol,
112
+ hostname,
113
+ port,
114
+ method: "GET",
115
+ headers,
116
+ path: resolvedPath,
117
+ query,
118
+ body,
380
119
  });
381
- }); };
382
- export var serializeAws_restJson1StartSigningJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
383
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
384
- var _c;
385
- return __generator(this, function (_d) {
386
- switch (_d.label) {
387
- case 0: return [4, context.endpoint()];
388
- case 1:
389
- _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
390
- headers = {
391
- "content-type": "application/json",
392
- };
393
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/signing-jobs";
394
- body = JSON.stringify(__assign(__assign(__assign(__assign({ clientRequestToken: (_c = input.clientRequestToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.destination != null && { destination: serializeAws_restJson1Destination(input.destination, context) })), (input.profileName != null && { profileName: input.profileName })), (input.profileOwner != null && { profileOwner: input.profileOwner })), (input.source != null && { source: serializeAws_restJson1Source(input.source, context) })));
395
- return [2, new __HttpRequest({
396
- protocol: protocol,
397
- hostname: hostname,
398
- port: port,
399
- method: "POST",
400
- headers: headers,
401
- path: resolvedPath,
402
- body: body,
403
- })];
404
- }
120
+ };
121
+ export const serializeAws_restJson1ListSigningJobsCommand = async (input, context) => {
122
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
123
+ const headers = {};
124
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-jobs";
125
+ const query = map({
126
+ status: [, input.status],
127
+ platformId: [, input.platformId],
128
+ requestedBy: [, input.requestedBy],
129
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
130
+ nextToken: [, input.nextToken],
131
+ isRevoked: [() => input.isRevoked !== void 0, () => input.isRevoked.toString()],
132
+ signatureExpiresBefore: [
133
+ () => input.signatureExpiresBefore !== void 0,
134
+ () => (input.signatureExpiresBefore.toISOString().split(".")[0] + "Z").toString(),
135
+ ],
136
+ signatureExpiresAfter: [
137
+ () => input.signatureExpiresAfter !== void 0,
138
+ () => (input.signatureExpiresAfter.toISOString().split(".")[0] + "Z").toString(),
139
+ ],
140
+ jobInvoker: [, input.jobInvoker],
141
+ });
142
+ let body;
143
+ return new __HttpRequest({
144
+ protocol,
145
+ hostname,
146
+ port,
147
+ method: "GET",
148
+ headers,
149
+ path: resolvedPath,
150
+ query,
151
+ body,
405
152
  });
406
- }); };
407
- export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
408
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
409
- return __generator(this, function (_c) {
410
- switch (_c.label) {
411
- case 0: return [4, context.endpoint()];
412
- case 1:
413
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
414
- headers = {
415
- "content-type": "application/json",
416
- };
417
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
418
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
419
- body = JSON.stringify(__assign({}, (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
420
- return [2, new __HttpRequest({
421
- protocol: protocol,
422
- hostname: hostname,
423
- port: port,
424
- method: "POST",
425
- headers: headers,
426
- path: resolvedPath,
427
- body: body,
428
- })];
429
- }
153
+ };
154
+ export const serializeAws_restJson1ListSigningPlatformsCommand = async (input, context) => {
155
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
156
+ const headers = {};
157
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-platforms";
158
+ const query = map({
159
+ category: [, input.category],
160
+ partner: [, input.partner],
161
+ target: [, input.target],
162
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
163
+ nextToken: [, input.nextToken],
164
+ });
165
+ let body;
166
+ return new __HttpRequest({
167
+ protocol,
168
+ hostname,
169
+ port,
170
+ method: "GET",
171
+ headers,
172
+ path: resolvedPath,
173
+ query,
174
+ body,
430
175
  });
431
- }); };
432
- export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
433
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
434
- return __generator(this, function (_c) {
435
- switch (_c.label) {
436
- case 0: return [4, context.endpoint()];
437
- case 1:
438
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
439
- headers = {};
440
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
441
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
442
- query = map({
443
- tagKeys: [function () { return input.tagKeys !== void 0; }, function () { return (input.tagKeys || []).map(function (_entry) { return _entry; }); }],
444
- });
445
- return [2, new __HttpRequest({
446
- protocol: protocol,
447
- hostname: hostname,
448
- port: port,
449
- method: "DELETE",
450
- headers: headers,
451
- path: resolvedPath,
452
- query: query,
453
- body: body,
454
- })];
455
- }
176
+ };
177
+ export const serializeAws_restJson1ListSigningProfilesCommand = async (input, context) => {
178
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
179
+ const headers = {};
180
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-profiles";
181
+ const query = map({
182
+ includeCanceled: [() => input.includeCanceled !== void 0, () => input.includeCanceled.toString()],
183
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
184
+ nextToken: [, input.nextToken],
185
+ platformId: [, input.platformId],
186
+ statuses: [() => input.statuses !== void 0, () => (input.statuses || []).map((_entry) => _entry)],
187
+ });
188
+ let body;
189
+ return new __HttpRequest({
190
+ protocol,
191
+ hostname,
192
+ port,
193
+ method: "GET",
194
+ headers,
195
+ path: resolvedPath,
196
+ query,
197
+ body,
456
198
  });
457
- }); };
458
- export var deserializeAws_restJson1AddProfilePermissionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
459
- var contents, data, _a, _b;
460
- return __generator(this, function (_c) {
461
- switch (_c.label) {
462
- case 0:
463
- if (output.statusCode !== 200 && output.statusCode >= 300) {
464
- return [2, deserializeAws_restJson1AddProfilePermissionCommandError(output, context)];
465
- }
466
- contents = map({
467
- $metadata: deserializeMetadata(output),
468
- });
469
- _a = __expectNonNull;
470
- _b = __expectObject;
471
- return [4, parseBody(output.body, context)];
472
- case 1:
473
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
474
- if (data.revisionId != null) {
475
- contents.revisionId = __expectString(data.revisionId);
476
- }
477
- return [2, contents];
478
- }
199
+ };
200
+ export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
201
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
202
+ const headers = {};
203
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
204
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
205
+ let body;
206
+ return new __HttpRequest({
207
+ protocol,
208
+ hostname,
209
+ port,
210
+ method: "GET",
211
+ headers,
212
+ path: resolvedPath,
213
+ body,
479
214
  });
480
- }); };
481
- var deserializeAws_restJson1AddProfilePermissionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
482
- var parsedOutput, _a, errorCode, _b, parsedBody;
483
- var _c;
484
- return __generator(this, function (_d) {
485
- switch (_d.label) {
486
- case 0:
487
- _a = [__assign({}, output)];
488
- _c = {};
489
- return [4, parseErrorBody(output.body, context)];
490
- case 1:
491
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
492
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
493
- _b = errorCode;
494
- switch (_b) {
495
- case "AccessDeniedException": return [3, 2];
496
- case "com.amazonaws.signer#AccessDeniedException": return [3, 2];
497
- case "ConflictException": return [3, 4];
498
- case "com.amazonaws.signer#ConflictException": return [3, 4];
499
- case "InternalServiceErrorException": return [3, 6];
500
- case "com.amazonaws.signer#InternalServiceErrorException": return [3, 6];
501
- case "ResourceNotFoundException": return [3, 8];
502
- case "com.amazonaws.signer#ResourceNotFoundException": return [3, 8];
503
- case "ServiceLimitExceededException": return [3, 10];
504
- case "com.amazonaws.signer#ServiceLimitExceededException": return [3, 10];
505
- case "TooManyRequestsException": return [3, 12];
506
- case "com.amazonaws.signer#TooManyRequestsException": return [3, 12];
507
- case "ValidationException": return [3, 14];
508
- case "com.amazonaws.signer#ValidationException": return [3, 14];
509
- }
510
- return [3, 16];
511
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
512
- case 3: throw _d.sent();
513
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
514
- case 5: throw _d.sent();
515
- case 6: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
516
- case 7: throw _d.sent();
517
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
518
- case 9: throw _d.sent();
519
- case 10: return [4, deserializeAws_restJson1ServiceLimitExceededExceptionResponse(parsedOutput, context)];
520
- case 11: throw _d.sent();
521
- case 12: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
522
- case 13: throw _d.sent();
523
- case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
524
- case 15: throw _d.sent();
525
- case 16:
526
- parsedBody = parsedOutput.body;
527
- throwDefaultError({
528
- output: output,
529
- parsedBody: parsedBody,
530
- exceptionCtor: __BaseException,
531
- errorCode: errorCode,
532
- });
533
- _d.label = 17;
534
- case 17: return [2];
535
- }
215
+ };
216
+ export const serializeAws_restJson1PutSigningProfileCommand = async (input, context) => {
217
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
218
+ const headers = {
219
+ "content-type": "application/json",
220
+ };
221
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-profiles/{profileName}";
222
+ resolvedPath = __resolvedPath(resolvedPath, input, "profileName", () => input.profileName, "{profileName}", false);
223
+ let body;
224
+ body = JSON.stringify({
225
+ ...(input.overrides != null && {
226
+ overrides: serializeAws_restJson1SigningPlatformOverrides(input.overrides, context),
227
+ }),
228
+ ...(input.platformId != null && { platformId: input.platformId }),
229
+ ...(input.signatureValidityPeriod != null && {
230
+ signatureValidityPeriod: serializeAws_restJson1SignatureValidityPeriod(input.signatureValidityPeriod, context),
231
+ }),
232
+ ...(input.signingMaterial != null && {
233
+ signingMaterial: serializeAws_restJson1SigningMaterial(input.signingMaterial, context),
234
+ }),
235
+ ...(input.signingParameters != null && {
236
+ signingParameters: serializeAws_restJson1SigningParameters(input.signingParameters, context),
237
+ }),
238
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
239
+ });
240
+ return new __HttpRequest({
241
+ protocol,
242
+ hostname,
243
+ port,
244
+ method: "PUT",
245
+ headers,
246
+ path: resolvedPath,
247
+ body,
536
248
  });
537
- }); };
538
- export var deserializeAws_restJson1CancelSigningProfileCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
539
- var contents;
540
- return __generator(this, function (_a) {
541
- switch (_a.label) {
542
- case 0:
543
- if (output.statusCode !== 200 && output.statusCode >= 300) {
544
- return [2, deserializeAws_restJson1CancelSigningProfileCommandError(output, context)];
545
- }
546
- contents = map({
547
- $metadata: deserializeMetadata(output),
548
- });
549
- return [4, collectBody(output.body, context)];
550
- case 1:
551
- _a.sent();
552
- return [2, contents];
553
- }
249
+ };
250
+ export const serializeAws_restJson1RemoveProfilePermissionCommand = async (input, context) => {
251
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
252
+ const headers = {};
253
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
254
+ "/signing-profiles/{profileName}/permissions/{statementId}";
255
+ resolvedPath = __resolvedPath(resolvedPath, input, "profileName", () => input.profileName, "{profileName}", false);
256
+ resolvedPath = __resolvedPath(resolvedPath, input, "statementId", () => input.statementId, "{statementId}", false);
257
+ const query = map({
258
+ revisionId: [, input.revisionId],
259
+ });
260
+ let body;
261
+ return new __HttpRequest({
262
+ protocol,
263
+ hostname,
264
+ port,
265
+ method: "DELETE",
266
+ headers,
267
+ path: resolvedPath,
268
+ query,
269
+ body,
554
270
  });
555
- }); };
556
- var deserializeAws_restJson1CancelSigningProfileCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
557
- var parsedOutput, _a, errorCode, _b, parsedBody;
558
- var _c;
559
- return __generator(this, function (_d) {
560
- switch (_d.label) {
561
- case 0:
562
- _a = [__assign({}, output)];
563
- _c = {};
564
- return [4, parseErrorBody(output.body, context)];
565
- case 1:
566
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
567
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
568
- _b = errorCode;
569
- switch (_b) {
570
- case "AccessDeniedException": return [3, 2];
571
- case "com.amazonaws.signer#AccessDeniedException": return [3, 2];
572
- case "InternalServiceErrorException": return [3, 4];
573
- case "com.amazonaws.signer#InternalServiceErrorException": return [3, 4];
574
- case "ResourceNotFoundException": return [3, 6];
575
- case "com.amazonaws.signer#ResourceNotFoundException": return [3, 6];
576
- case "TooManyRequestsException": return [3, 8];
577
- case "com.amazonaws.signer#TooManyRequestsException": return [3, 8];
578
- }
579
- return [3, 10];
580
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
581
- case 3: throw _d.sent();
582
- case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
583
- case 5: throw _d.sent();
584
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
585
- case 7: throw _d.sent();
586
- case 8: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
587
- case 9: throw _d.sent();
588
- case 10:
589
- parsedBody = parsedOutput.body;
590
- throwDefaultError({
591
- output: output,
592
- parsedBody: parsedBody,
593
- exceptionCtor: __BaseException,
594
- errorCode: errorCode,
595
- });
596
- _d.label = 11;
597
- case 11: return [2];
598
- }
271
+ };
272
+ export const serializeAws_restJson1RevokeSignatureCommand = async (input, context) => {
273
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
274
+ const headers = {
275
+ "content-type": "application/json",
276
+ };
277
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-jobs/{jobId}/revoke";
278
+ resolvedPath = __resolvedPath(resolvedPath, input, "jobId", () => input.jobId, "{jobId}", false);
279
+ let body;
280
+ body = JSON.stringify({
281
+ ...(input.jobOwner != null && { jobOwner: input.jobOwner }),
282
+ ...(input.reason != null && { reason: input.reason }),
283
+ });
284
+ return new __HttpRequest({
285
+ protocol,
286
+ hostname,
287
+ port,
288
+ method: "PUT",
289
+ headers,
290
+ path: resolvedPath,
291
+ body,
599
292
  });
600
- }); };
601
- export var deserializeAws_restJson1DescribeSigningJobCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
602
- var contents, data, _a, _b;
603
- return __generator(this, function (_c) {
604
- switch (_c.label) {
605
- case 0:
606
- if (output.statusCode !== 200 && output.statusCode >= 300) {
607
- return [2, deserializeAws_restJson1DescribeSigningJobCommandError(output, context)];
608
- }
609
- contents = map({
610
- $metadata: deserializeMetadata(output),
611
- });
612
- _a = __expectNonNull;
613
- _b = __expectObject;
614
- return [4, parseBody(output.body, context)];
615
- case 1:
616
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
617
- if (data.completedAt != null) {
618
- contents.completedAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.completedAt)));
619
- }
620
- if (data.createdAt != null) {
621
- contents.createdAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.createdAt)));
622
- }
623
- if (data.jobId != null) {
624
- contents.jobId = __expectString(data.jobId);
625
- }
626
- if (data.jobInvoker != null) {
627
- contents.jobInvoker = __expectString(data.jobInvoker);
628
- }
629
- if (data.jobOwner != null) {
630
- contents.jobOwner = __expectString(data.jobOwner);
631
- }
632
- if (data.overrides != null) {
633
- contents.overrides = deserializeAws_restJson1SigningPlatformOverrides(data.overrides, context);
634
- }
635
- if (data.platformDisplayName != null) {
636
- contents.platformDisplayName = __expectString(data.platformDisplayName);
637
- }
638
- if (data.platformId != null) {
639
- contents.platformId = __expectString(data.platformId);
640
- }
641
- if (data.profileName != null) {
642
- contents.profileName = __expectString(data.profileName);
643
- }
644
- if (data.profileVersion != null) {
645
- contents.profileVersion = __expectString(data.profileVersion);
646
- }
647
- if (data.requestedBy != null) {
648
- contents.requestedBy = __expectString(data.requestedBy);
649
- }
650
- if (data.revocationRecord != null) {
651
- contents.revocationRecord = deserializeAws_restJson1SigningJobRevocationRecord(data.revocationRecord, context);
652
- }
653
- if (data.signatureExpiresAt != null) {
654
- contents.signatureExpiresAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.signatureExpiresAt)));
655
- }
656
- if (data.signedObject != null) {
657
- contents.signedObject = deserializeAws_restJson1SignedObject(data.signedObject, context);
658
- }
659
- if (data.signingMaterial != null) {
660
- contents.signingMaterial = deserializeAws_restJson1SigningMaterial(data.signingMaterial, context);
661
- }
662
- if (data.signingParameters != null) {
663
- contents.signingParameters = deserializeAws_restJson1SigningParameters(data.signingParameters, context);
664
- }
665
- if (data.source != null) {
666
- contents.source = deserializeAws_restJson1Source(data.source, context);
667
- }
668
- if (data.status != null) {
669
- contents.status = __expectString(data.status);
670
- }
671
- if (data.statusReason != null) {
672
- contents.statusReason = __expectString(data.statusReason);
673
- }
674
- return [2, contents];
675
- }
293
+ };
294
+ export const serializeAws_restJson1RevokeSigningProfileCommand = async (input, context) => {
295
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
296
+ const headers = {
297
+ "content-type": "application/json",
298
+ };
299
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-profiles/{profileName}/revoke";
300
+ resolvedPath = __resolvedPath(resolvedPath, input, "profileName", () => input.profileName, "{profileName}", false);
301
+ let body;
302
+ body = JSON.stringify({
303
+ ...(input.effectiveTime != null && { effectiveTime: Math.round(input.effectiveTime.getTime() / 1000) }),
304
+ ...(input.profileVersion != null && { profileVersion: input.profileVersion }),
305
+ ...(input.reason != null && { reason: input.reason }),
306
+ });
307
+ return new __HttpRequest({
308
+ protocol,
309
+ hostname,
310
+ port,
311
+ method: "PUT",
312
+ headers,
313
+ path: resolvedPath,
314
+ body,
676
315
  });
677
- }); };
678
- var deserializeAws_restJson1DescribeSigningJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
679
- var parsedOutput, _a, errorCode, _b, parsedBody;
680
- var _c;
681
- return __generator(this, function (_d) {
682
- switch (_d.label) {
683
- case 0:
684
- _a = [__assign({}, output)];
685
- _c = {};
686
- return [4, parseErrorBody(output.body, context)];
687
- case 1:
688
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
689
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
690
- _b = errorCode;
691
- switch (_b) {
692
- case "AccessDeniedException": return [3, 2];
693
- case "com.amazonaws.signer#AccessDeniedException": return [3, 2];
694
- case "InternalServiceErrorException": return [3, 4];
695
- case "com.amazonaws.signer#InternalServiceErrorException": return [3, 4];
696
- case "ResourceNotFoundException": return [3, 6];
697
- case "com.amazonaws.signer#ResourceNotFoundException": return [3, 6];
698
- case "TooManyRequestsException": return [3, 8];
699
- case "com.amazonaws.signer#TooManyRequestsException": return [3, 8];
700
- }
701
- return [3, 10];
702
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
703
- case 3: throw _d.sent();
704
- case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
705
- case 5: throw _d.sent();
706
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
707
- case 7: throw _d.sent();
708
- case 8: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
709
- case 9: throw _d.sent();
710
- case 10:
711
- parsedBody = parsedOutput.body;
712
- throwDefaultError({
713
- output: output,
714
- parsedBody: parsedBody,
715
- exceptionCtor: __BaseException,
716
- errorCode: errorCode,
717
- });
718
- _d.label = 11;
719
- case 11: return [2];
720
- }
316
+ };
317
+ export const serializeAws_restJson1StartSigningJobCommand = async (input, context) => {
318
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
319
+ const headers = {
320
+ "content-type": "application/json",
321
+ };
322
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-jobs";
323
+ let body;
324
+ body = JSON.stringify({
325
+ clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(),
326
+ ...(input.destination != null && { destination: serializeAws_restJson1Destination(input.destination, context) }),
327
+ ...(input.profileName != null && { profileName: input.profileName }),
328
+ ...(input.profileOwner != null && { profileOwner: input.profileOwner }),
329
+ ...(input.source != null && { source: serializeAws_restJson1Source(input.source, context) }),
330
+ });
331
+ return new __HttpRequest({
332
+ protocol,
333
+ hostname,
334
+ port,
335
+ method: "POST",
336
+ headers,
337
+ path: resolvedPath,
338
+ body,
721
339
  });
722
- }); };
723
- export var deserializeAws_restJson1GetSigningPlatformCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
724
- var contents, data, _a, _b;
725
- return __generator(this, function (_c) {
726
- switch (_c.label) {
727
- case 0:
728
- if (output.statusCode !== 200 && output.statusCode >= 300) {
729
- return [2, deserializeAws_restJson1GetSigningPlatformCommandError(output, context)];
730
- }
731
- contents = map({
732
- $metadata: deserializeMetadata(output),
733
- });
734
- _a = __expectNonNull;
735
- _b = __expectObject;
736
- return [4, parseBody(output.body, context)];
737
- case 1:
738
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
739
- if (data.category != null) {
740
- contents.category = __expectString(data.category);
741
- }
742
- if (data.displayName != null) {
743
- contents.displayName = __expectString(data.displayName);
744
- }
745
- if (data.maxSizeInMB != null) {
746
- contents.maxSizeInMB = __expectInt32(data.maxSizeInMB);
747
- }
748
- if (data.partner != null) {
749
- contents.partner = __expectString(data.partner);
750
- }
751
- if (data.platformId != null) {
752
- contents.platformId = __expectString(data.platformId);
753
- }
754
- if (data.revocationSupported != null) {
755
- contents.revocationSupported = __expectBoolean(data.revocationSupported);
756
- }
757
- if (data.signingConfiguration != null) {
758
- contents.signingConfiguration = deserializeAws_restJson1SigningConfiguration(data.signingConfiguration, context);
759
- }
760
- if (data.signingImageFormat != null) {
761
- contents.signingImageFormat = deserializeAws_restJson1SigningImageFormat(data.signingImageFormat, context);
762
- }
763
- if (data.target != null) {
764
- contents.target = __expectString(data.target);
765
- }
766
- return [2, contents];
767
- }
340
+ };
341
+ export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
342
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
343
+ const headers = {
344
+ "content-type": "application/json",
345
+ };
346
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
347
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
348
+ let body;
349
+ body = JSON.stringify({
350
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
351
+ });
352
+ return new __HttpRequest({
353
+ protocol,
354
+ hostname,
355
+ port,
356
+ method: "POST",
357
+ headers,
358
+ path: resolvedPath,
359
+ body,
768
360
  });
769
- }); };
770
- var deserializeAws_restJson1GetSigningPlatformCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
771
- var parsedOutput, _a, errorCode, _b, parsedBody;
772
- var _c;
773
- return __generator(this, function (_d) {
774
- switch (_d.label) {
775
- case 0:
776
- _a = [__assign({}, output)];
777
- _c = {};
778
- return [4, parseErrorBody(output.body, context)];
779
- case 1:
780
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
781
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
782
- _b = errorCode;
783
- switch (_b) {
784
- case "AccessDeniedException": return [3, 2];
785
- case "com.amazonaws.signer#AccessDeniedException": return [3, 2];
786
- case "InternalServiceErrorException": return [3, 4];
787
- case "com.amazonaws.signer#InternalServiceErrorException": return [3, 4];
788
- case "ResourceNotFoundException": return [3, 6];
789
- case "com.amazonaws.signer#ResourceNotFoundException": return [3, 6];
790
- case "TooManyRequestsException": return [3, 8];
791
- case "com.amazonaws.signer#TooManyRequestsException": return [3, 8];
792
- }
793
- return [3, 10];
794
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
795
- case 3: throw _d.sent();
796
- case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
797
- case 5: throw _d.sent();
798
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
799
- case 7: throw _d.sent();
800
- case 8: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
801
- case 9: throw _d.sent();
802
- case 10:
803
- parsedBody = parsedOutput.body;
804
- throwDefaultError({
805
- output: output,
806
- parsedBody: parsedBody,
807
- exceptionCtor: __BaseException,
808
- errorCode: errorCode,
809
- });
810
- _d.label = 11;
811
- case 11: return [2];
812
- }
361
+ };
362
+ export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
363
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
364
+ const headers = {};
365
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
366
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
367
+ const query = map({
368
+ tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys || []).map((_entry) => _entry)],
369
+ });
370
+ let body;
371
+ return new __HttpRequest({
372
+ protocol,
373
+ hostname,
374
+ port,
375
+ method: "DELETE",
376
+ headers,
377
+ path: resolvedPath,
378
+ query,
379
+ body,
813
380
  });
814
- }); };
815
- export var deserializeAws_restJson1GetSigningProfileCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
816
- var contents, data, _a, _b;
817
- return __generator(this, function (_c) {
818
- switch (_c.label) {
819
- case 0:
820
- if (output.statusCode !== 200 && output.statusCode >= 300) {
821
- return [2, deserializeAws_restJson1GetSigningProfileCommandError(output, context)];
822
- }
823
- contents = map({
824
- $metadata: deserializeMetadata(output),
825
- });
826
- _a = __expectNonNull;
827
- _b = __expectObject;
828
- return [4, parseBody(output.body, context)];
829
- case 1:
830
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
831
- if (data.arn != null) {
832
- contents.arn = __expectString(data.arn);
833
- }
834
- if (data.overrides != null) {
835
- contents.overrides = deserializeAws_restJson1SigningPlatformOverrides(data.overrides, context);
836
- }
837
- if (data.platformDisplayName != null) {
838
- contents.platformDisplayName = __expectString(data.platformDisplayName);
839
- }
840
- if (data.platformId != null) {
841
- contents.platformId = __expectString(data.platformId);
842
- }
843
- if (data.profileName != null) {
844
- contents.profileName = __expectString(data.profileName);
845
- }
846
- if (data.profileVersion != null) {
847
- contents.profileVersion = __expectString(data.profileVersion);
848
- }
849
- if (data.profileVersionArn != null) {
850
- contents.profileVersionArn = __expectString(data.profileVersionArn);
851
- }
852
- if (data.revocationRecord != null) {
853
- contents.revocationRecord = deserializeAws_restJson1SigningProfileRevocationRecord(data.revocationRecord, context);
854
- }
855
- if (data.signatureValidityPeriod != null) {
856
- contents.signatureValidityPeriod = deserializeAws_restJson1SignatureValidityPeriod(data.signatureValidityPeriod, context);
857
- }
858
- if (data.signingMaterial != null) {
859
- contents.signingMaterial = deserializeAws_restJson1SigningMaterial(data.signingMaterial, context);
860
- }
861
- if (data.signingParameters != null) {
862
- contents.signingParameters = deserializeAws_restJson1SigningParameters(data.signingParameters, context);
863
- }
864
- if (data.status != null) {
865
- contents.status = __expectString(data.status);
866
- }
867
- if (data.statusReason != null) {
868
- contents.statusReason = __expectString(data.statusReason);
869
- }
870
- if (data.tags != null) {
871
- contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
872
- }
873
- return [2, contents];
874
- }
381
+ };
382
+ export const deserializeAws_restJson1AddProfilePermissionCommand = async (output, context) => {
383
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
384
+ return deserializeAws_restJson1AddProfilePermissionCommandError(output, context);
385
+ }
386
+ const contents = map({
387
+ $metadata: deserializeMetadata(output),
875
388
  });
876
- }); };
877
- var deserializeAws_restJson1GetSigningProfileCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
878
- var parsedOutput, _a, errorCode, _b, parsedBody;
879
- var _c;
880
- return __generator(this, function (_d) {
881
- switch (_d.label) {
882
- case 0:
883
- _a = [__assign({}, output)];
884
- _c = {};
885
- return [4, parseErrorBody(output.body, context)];
886
- case 1:
887
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
888
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
889
- _b = errorCode;
890
- switch (_b) {
891
- case "AccessDeniedException": return [3, 2];
892
- case "com.amazonaws.signer#AccessDeniedException": return [3, 2];
893
- case "InternalServiceErrorException": return [3, 4];
894
- case "com.amazonaws.signer#InternalServiceErrorException": return [3, 4];
895
- case "ResourceNotFoundException": return [3, 6];
896
- case "com.amazonaws.signer#ResourceNotFoundException": return [3, 6];
897
- case "TooManyRequestsException": return [3, 8];
898
- case "com.amazonaws.signer#TooManyRequestsException": return [3, 8];
899
- }
900
- return [3, 10];
901
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
902
- case 3: throw _d.sent();
903
- case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
904
- case 5: throw _d.sent();
905
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
906
- case 7: throw _d.sent();
907
- case 8: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
908
- case 9: throw _d.sent();
909
- case 10:
910
- parsedBody = parsedOutput.body;
911
- throwDefaultError({
912
- output: output,
913
- parsedBody: parsedBody,
914
- exceptionCtor: __BaseException,
915
- errorCode: errorCode,
916
- });
917
- _d.label = 11;
918
- case 11: return [2];
919
- }
389
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
390
+ if (data.revisionId != null) {
391
+ contents.revisionId = __expectString(data.revisionId);
392
+ }
393
+ return contents;
394
+ };
395
+ const deserializeAws_restJson1AddProfilePermissionCommandError = async (output, context) => {
396
+ const parsedOutput = {
397
+ ...output,
398
+ body: await parseErrorBody(output.body, context),
399
+ };
400
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
401
+ switch (errorCode) {
402
+ case "AccessDeniedException":
403
+ case "com.amazonaws.signer#AccessDeniedException":
404
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
405
+ case "ConflictException":
406
+ case "com.amazonaws.signer#ConflictException":
407
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
408
+ case "InternalServiceErrorException":
409
+ case "com.amazonaws.signer#InternalServiceErrorException":
410
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
411
+ case "ResourceNotFoundException":
412
+ case "com.amazonaws.signer#ResourceNotFoundException":
413
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
414
+ case "ServiceLimitExceededException":
415
+ case "com.amazonaws.signer#ServiceLimitExceededException":
416
+ throw await deserializeAws_restJson1ServiceLimitExceededExceptionResponse(parsedOutput, context);
417
+ case "TooManyRequestsException":
418
+ case "com.amazonaws.signer#TooManyRequestsException":
419
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
420
+ case "ValidationException":
421
+ case "com.amazonaws.signer#ValidationException":
422
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
423
+ default:
424
+ const parsedBody = parsedOutput.body;
425
+ throwDefaultError({
426
+ output,
427
+ parsedBody,
428
+ exceptionCtor: __BaseException,
429
+ errorCode,
430
+ });
431
+ }
432
+ };
433
+ export const deserializeAws_restJson1CancelSigningProfileCommand = async (output, context) => {
434
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
435
+ return deserializeAws_restJson1CancelSigningProfileCommandError(output, context);
436
+ }
437
+ const contents = map({
438
+ $metadata: deserializeMetadata(output),
920
439
  });
921
- }); };
922
- export var deserializeAws_restJson1ListProfilePermissionsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
923
- var contents, data, _a, _b;
924
- return __generator(this, function (_c) {
925
- switch (_c.label) {
926
- case 0:
927
- if (output.statusCode !== 200 && output.statusCode >= 300) {
928
- return [2, deserializeAws_restJson1ListProfilePermissionsCommandError(output, context)];
929
- }
930
- contents = map({
931
- $metadata: deserializeMetadata(output),
932
- });
933
- _a = __expectNonNull;
934
- _b = __expectObject;
935
- return [4, parseBody(output.body, context)];
936
- case 1:
937
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
938
- if (data.nextToken != null) {
939
- contents.nextToken = __expectString(data.nextToken);
940
- }
941
- if (data.permissions != null) {
942
- contents.permissions = deserializeAws_restJson1Permissions(data.permissions, context);
943
- }
944
- if (data.policySizeBytes != null) {
945
- contents.policySizeBytes = __expectInt32(data.policySizeBytes);
946
- }
947
- if (data.revisionId != null) {
948
- contents.revisionId = __expectString(data.revisionId);
949
- }
950
- return [2, contents];
951
- }
440
+ await collectBody(output.body, context);
441
+ return contents;
442
+ };
443
+ const deserializeAws_restJson1CancelSigningProfileCommandError = async (output, context) => {
444
+ const parsedOutput = {
445
+ ...output,
446
+ body: await parseErrorBody(output.body, context),
447
+ };
448
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
449
+ switch (errorCode) {
450
+ case "AccessDeniedException":
451
+ case "com.amazonaws.signer#AccessDeniedException":
452
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
453
+ case "InternalServiceErrorException":
454
+ case "com.amazonaws.signer#InternalServiceErrorException":
455
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
456
+ case "ResourceNotFoundException":
457
+ case "com.amazonaws.signer#ResourceNotFoundException":
458
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
459
+ case "TooManyRequestsException":
460
+ case "com.amazonaws.signer#TooManyRequestsException":
461
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
462
+ default:
463
+ const parsedBody = parsedOutput.body;
464
+ throwDefaultError({
465
+ output,
466
+ parsedBody,
467
+ exceptionCtor: __BaseException,
468
+ errorCode,
469
+ });
470
+ }
471
+ };
472
+ export const deserializeAws_restJson1DescribeSigningJobCommand = async (output, context) => {
473
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
474
+ return deserializeAws_restJson1DescribeSigningJobCommandError(output, context);
475
+ }
476
+ const contents = map({
477
+ $metadata: deserializeMetadata(output),
952
478
  });
953
- }); };
954
- var deserializeAws_restJson1ListProfilePermissionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
955
- var parsedOutput, _a, errorCode, _b, parsedBody;
956
- var _c;
957
- return __generator(this, function (_d) {
958
- switch (_d.label) {
959
- case 0:
960
- _a = [__assign({}, output)];
961
- _c = {};
962
- return [4, parseErrorBody(output.body, context)];
963
- case 1:
964
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
965
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
966
- _b = errorCode;
967
- switch (_b) {
968
- case "AccessDeniedException": return [3, 2];
969
- case "com.amazonaws.signer#AccessDeniedException": return [3, 2];
970
- case "InternalServiceErrorException": return [3, 4];
971
- case "com.amazonaws.signer#InternalServiceErrorException": return [3, 4];
972
- case "ResourceNotFoundException": return [3, 6];
973
- case "com.amazonaws.signer#ResourceNotFoundException": return [3, 6];
974
- case "TooManyRequestsException": return [3, 8];
975
- case "com.amazonaws.signer#TooManyRequestsException": return [3, 8];
976
- case "ValidationException": return [3, 10];
977
- case "com.amazonaws.signer#ValidationException": return [3, 10];
978
- }
979
- return [3, 12];
980
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
981
- case 3: throw _d.sent();
982
- case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
983
- case 5: throw _d.sent();
984
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
985
- case 7: throw _d.sent();
986
- case 8: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
987
- case 9: throw _d.sent();
988
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
989
- case 11: throw _d.sent();
990
- case 12:
991
- parsedBody = parsedOutput.body;
992
- throwDefaultError({
993
- output: output,
994
- parsedBody: parsedBody,
995
- exceptionCtor: __BaseException,
996
- errorCode: errorCode,
997
- });
998
- _d.label = 13;
999
- case 13: return [2];
1000
- }
479
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
480
+ if (data.completedAt != null) {
481
+ contents.completedAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.completedAt)));
482
+ }
483
+ if (data.createdAt != null) {
484
+ contents.createdAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.createdAt)));
485
+ }
486
+ if (data.jobId != null) {
487
+ contents.jobId = __expectString(data.jobId);
488
+ }
489
+ if (data.jobInvoker != null) {
490
+ contents.jobInvoker = __expectString(data.jobInvoker);
491
+ }
492
+ if (data.jobOwner != null) {
493
+ contents.jobOwner = __expectString(data.jobOwner);
494
+ }
495
+ if (data.overrides != null) {
496
+ contents.overrides = deserializeAws_restJson1SigningPlatformOverrides(data.overrides, context);
497
+ }
498
+ if (data.platformDisplayName != null) {
499
+ contents.platformDisplayName = __expectString(data.platformDisplayName);
500
+ }
501
+ if (data.platformId != null) {
502
+ contents.platformId = __expectString(data.platformId);
503
+ }
504
+ if (data.profileName != null) {
505
+ contents.profileName = __expectString(data.profileName);
506
+ }
507
+ if (data.profileVersion != null) {
508
+ contents.profileVersion = __expectString(data.profileVersion);
509
+ }
510
+ if (data.requestedBy != null) {
511
+ contents.requestedBy = __expectString(data.requestedBy);
512
+ }
513
+ if (data.revocationRecord != null) {
514
+ contents.revocationRecord = deserializeAws_restJson1SigningJobRevocationRecord(data.revocationRecord, context);
515
+ }
516
+ if (data.signatureExpiresAt != null) {
517
+ contents.signatureExpiresAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.signatureExpiresAt)));
518
+ }
519
+ if (data.signedObject != null) {
520
+ contents.signedObject = deserializeAws_restJson1SignedObject(data.signedObject, context);
521
+ }
522
+ if (data.signingMaterial != null) {
523
+ contents.signingMaterial = deserializeAws_restJson1SigningMaterial(data.signingMaterial, context);
524
+ }
525
+ if (data.signingParameters != null) {
526
+ contents.signingParameters = deserializeAws_restJson1SigningParameters(data.signingParameters, context);
527
+ }
528
+ if (data.source != null) {
529
+ contents.source = deserializeAws_restJson1Source(data.source, context);
530
+ }
531
+ if (data.status != null) {
532
+ contents.status = __expectString(data.status);
533
+ }
534
+ if (data.statusReason != null) {
535
+ contents.statusReason = __expectString(data.statusReason);
536
+ }
537
+ return contents;
538
+ };
539
+ const deserializeAws_restJson1DescribeSigningJobCommandError = async (output, context) => {
540
+ const parsedOutput = {
541
+ ...output,
542
+ body: await parseErrorBody(output.body, context),
543
+ };
544
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
545
+ switch (errorCode) {
546
+ case "AccessDeniedException":
547
+ case "com.amazonaws.signer#AccessDeniedException":
548
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
549
+ case "InternalServiceErrorException":
550
+ case "com.amazonaws.signer#InternalServiceErrorException":
551
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
552
+ case "ResourceNotFoundException":
553
+ case "com.amazonaws.signer#ResourceNotFoundException":
554
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
555
+ case "TooManyRequestsException":
556
+ case "com.amazonaws.signer#TooManyRequestsException":
557
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
558
+ default:
559
+ const parsedBody = parsedOutput.body;
560
+ throwDefaultError({
561
+ output,
562
+ parsedBody,
563
+ exceptionCtor: __BaseException,
564
+ errorCode,
565
+ });
566
+ }
567
+ };
568
+ export const deserializeAws_restJson1GetSigningPlatformCommand = async (output, context) => {
569
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
570
+ return deserializeAws_restJson1GetSigningPlatformCommandError(output, context);
571
+ }
572
+ const contents = map({
573
+ $metadata: deserializeMetadata(output),
1001
574
  });
1002
- }); };
1003
- export var deserializeAws_restJson1ListSigningJobsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1004
- var contents, data, _a, _b;
1005
- return __generator(this, function (_c) {
1006
- switch (_c.label) {
1007
- case 0:
1008
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1009
- return [2, deserializeAws_restJson1ListSigningJobsCommandError(output, context)];
1010
- }
1011
- contents = map({
1012
- $metadata: deserializeMetadata(output),
1013
- });
1014
- _a = __expectNonNull;
1015
- _b = __expectObject;
1016
- return [4, parseBody(output.body, context)];
1017
- case 1:
1018
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1019
- if (data.jobs != null) {
1020
- contents.jobs = deserializeAws_restJson1SigningJobs(data.jobs, context);
1021
- }
1022
- if (data.nextToken != null) {
1023
- contents.nextToken = __expectString(data.nextToken);
1024
- }
1025
- return [2, contents];
1026
- }
575
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
576
+ if (data.category != null) {
577
+ contents.category = __expectString(data.category);
578
+ }
579
+ if (data.displayName != null) {
580
+ contents.displayName = __expectString(data.displayName);
581
+ }
582
+ if (data.maxSizeInMB != null) {
583
+ contents.maxSizeInMB = __expectInt32(data.maxSizeInMB);
584
+ }
585
+ if (data.partner != null) {
586
+ contents.partner = __expectString(data.partner);
587
+ }
588
+ if (data.platformId != null) {
589
+ contents.platformId = __expectString(data.platformId);
590
+ }
591
+ if (data.revocationSupported != null) {
592
+ contents.revocationSupported = __expectBoolean(data.revocationSupported);
593
+ }
594
+ if (data.signingConfiguration != null) {
595
+ contents.signingConfiguration = deserializeAws_restJson1SigningConfiguration(data.signingConfiguration, context);
596
+ }
597
+ if (data.signingImageFormat != null) {
598
+ contents.signingImageFormat = deserializeAws_restJson1SigningImageFormat(data.signingImageFormat, context);
599
+ }
600
+ if (data.target != null) {
601
+ contents.target = __expectString(data.target);
602
+ }
603
+ return contents;
604
+ };
605
+ const deserializeAws_restJson1GetSigningPlatformCommandError = async (output, context) => {
606
+ const parsedOutput = {
607
+ ...output,
608
+ body: await parseErrorBody(output.body, context),
609
+ };
610
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
611
+ switch (errorCode) {
612
+ case "AccessDeniedException":
613
+ case "com.amazonaws.signer#AccessDeniedException":
614
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
615
+ case "InternalServiceErrorException":
616
+ case "com.amazonaws.signer#InternalServiceErrorException":
617
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
618
+ case "ResourceNotFoundException":
619
+ case "com.amazonaws.signer#ResourceNotFoundException":
620
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
621
+ case "TooManyRequestsException":
622
+ case "com.amazonaws.signer#TooManyRequestsException":
623
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
624
+ default:
625
+ const parsedBody = parsedOutput.body;
626
+ throwDefaultError({
627
+ output,
628
+ parsedBody,
629
+ exceptionCtor: __BaseException,
630
+ errorCode,
631
+ });
632
+ }
633
+ };
634
+ export const deserializeAws_restJson1GetSigningProfileCommand = async (output, context) => {
635
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
636
+ return deserializeAws_restJson1GetSigningProfileCommandError(output, context);
637
+ }
638
+ const contents = map({
639
+ $metadata: deserializeMetadata(output),
1027
640
  });
1028
- }); };
1029
- var deserializeAws_restJson1ListSigningJobsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1030
- var parsedOutput, _a, errorCode, _b, parsedBody;
1031
- var _c;
1032
- return __generator(this, function (_d) {
1033
- switch (_d.label) {
1034
- case 0:
1035
- _a = [__assign({}, output)];
1036
- _c = {};
1037
- return [4, parseErrorBody(output.body, context)];
1038
- case 1:
1039
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1040
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1041
- _b = errorCode;
1042
- switch (_b) {
1043
- case "AccessDeniedException": return [3, 2];
1044
- case "com.amazonaws.signer#AccessDeniedException": return [3, 2];
1045
- case "InternalServiceErrorException": return [3, 4];
1046
- case "com.amazonaws.signer#InternalServiceErrorException": return [3, 4];
1047
- case "TooManyRequestsException": return [3, 6];
1048
- case "com.amazonaws.signer#TooManyRequestsException": return [3, 6];
1049
- case "ValidationException": return [3, 8];
1050
- case "com.amazonaws.signer#ValidationException": return [3, 8];
1051
- }
1052
- return [3, 10];
1053
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1054
- case 3: throw _d.sent();
1055
- case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1056
- case 5: throw _d.sent();
1057
- case 6: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1058
- case 7: throw _d.sent();
1059
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1060
- case 9: throw _d.sent();
1061
- case 10:
1062
- parsedBody = parsedOutput.body;
1063
- throwDefaultError({
1064
- output: output,
1065
- parsedBody: parsedBody,
1066
- exceptionCtor: __BaseException,
1067
- errorCode: errorCode,
1068
- });
1069
- _d.label = 11;
1070
- case 11: return [2];
1071
- }
641
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
642
+ if (data.arn != null) {
643
+ contents.arn = __expectString(data.arn);
644
+ }
645
+ if (data.overrides != null) {
646
+ contents.overrides = deserializeAws_restJson1SigningPlatformOverrides(data.overrides, context);
647
+ }
648
+ if (data.platformDisplayName != null) {
649
+ contents.platformDisplayName = __expectString(data.platformDisplayName);
650
+ }
651
+ if (data.platformId != null) {
652
+ contents.platformId = __expectString(data.platformId);
653
+ }
654
+ if (data.profileName != null) {
655
+ contents.profileName = __expectString(data.profileName);
656
+ }
657
+ if (data.profileVersion != null) {
658
+ contents.profileVersion = __expectString(data.profileVersion);
659
+ }
660
+ if (data.profileVersionArn != null) {
661
+ contents.profileVersionArn = __expectString(data.profileVersionArn);
662
+ }
663
+ if (data.revocationRecord != null) {
664
+ contents.revocationRecord = deserializeAws_restJson1SigningProfileRevocationRecord(data.revocationRecord, context);
665
+ }
666
+ if (data.signatureValidityPeriod != null) {
667
+ contents.signatureValidityPeriod = deserializeAws_restJson1SignatureValidityPeriod(data.signatureValidityPeriod, context);
668
+ }
669
+ if (data.signingMaterial != null) {
670
+ contents.signingMaterial = deserializeAws_restJson1SigningMaterial(data.signingMaterial, context);
671
+ }
672
+ if (data.signingParameters != null) {
673
+ contents.signingParameters = deserializeAws_restJson1SigningParameters(data.signingParameters, context);
674
+ }
675
+ if (data.status != null) {
676
+ contents.status = __expectString(data.status);
677
+ }
678
+ if (data.statusReason != null) {
679
+ contents.statusReason = __expectString(data.statusReason);
680
+ }
681
+ if (data.tags != null) {
682
+ contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
683
+ }
684
+ return contents;
685
+ };
686
+ const deserializeAws_restJson1GetSigningProfileCommandError = async (output, context) => {
687
+ const parsedOutput = {
688
+ ...output,
689
+ body: await parseErrorBody(output.body, context),
690
+ };
691
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
692
+ switch (errorCode) {
693
+ case "AccessDeniedException":
694
+ case "com.amazonaws.signer#AccessDeniedException":
695
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
696
+ case "InternalServiceErrorException":
697
+ case "com.amazonaws.signer#InternalServiceErrorException":
698
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
699
+ case "ResourceNotFoundException":
700
+ case "com.amazonaws.signer#ResourceNotFoundException":
701
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
702
+ case "TooManyRequestsException":
703
+ case "com.amazonaws.signer#TooManyRequestsException":
704
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
705
+ default:
706
+ const parsedBody = parsedOutput.body;
707
+ throwDefaultError({
708
+ output,
709
+ parsedBody,
710
+ exceptionCtor: __BaseException,
711
+ errorCode,
712
+ });
713
+ }
714
+ };
715
+ export const deserializeAws_restJson1ListProfilePermissionsCommand = async (output, context) => {
716
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
717
+ return deserializeAws_restJson1ListProfilePermissionsCommandError(output, context);
718
+ }
719
+ const contents = map({
720
+ $metadata: deserializeMetadata(output),
1072
721
  });
1073
- }); };
1074
- export var deserializeAws_restJson1ListSigningPlatformsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1075
- var contents, data, _a, _b;
1076
- return __generator(this, function (_c) {
1077
- switch (_c.label) {
1078
- case 0:
1079
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1080
- return [2, deserializeAws_restJson1ListSigningPlatformsCommandError(output, context)];
1081
- }
1082
- contents = map({
1083
- $metadata: deserializeMetadata(output),
1084
- });
1085
- _a = __expectNonNull;
1086
- _b = __expectObject;
1087
- return [4, parseBody(output.body, context)];
1088
- case 1:
1089
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1090
- if (data.nextToken != null) {
1091
- contents.nextToken = __expectString(data.nextToken);
1092
- }
1093
- if (data.platforms != null) {
1094
- contents.platforms = deserializeAws_restJson1SigningPlatforms(data.platforms, context);
1095
- }
1096
- return [2, contents];
1097
- }
722
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
723
+ if (data.nextToken != null) {
724
+ contents.nextToken = __expectString(data.nextToken);
725
+ }
726
+ if (data.permissions != null) {
727
+ contents.permissions = deserializeAws_restJson1Permissions(data.permissions, context);
728
+ }
729
+ if (data.policySizeBytes != null) {
730
+ contents.policySizeBytes = __expectInt32(data.policySizeBytes);
731
+ }
732
+ if (data.revisionId != null) {
733
+ contents.revisionId = __expectString(data.revisionId);
734
+ }
735
+ return contents;
736
+ };
737
+ const deserializeAws_restJson1ListProfilePermissionsCommandError = async (output, context) => {
738
+ const parsedOutput = {
739
+ ...output,
740
+ body: await parseErrorBody(output.body, context),
741
+ };
742
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
743
+ switch (errorCode) {
744
+ case "AccessDeniedException":
745
+ case "com.amazonaws.signer#AccessDeniedException":
746
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
747
+ case "InternalServiceErrorException":
748
+ case "com.amazonaws.signer#InternalServiceErrorException":
749
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
750
+ case "ResourceNotFoundException":
751
+ case "com.amazonaws.signer#ResourceNotFoundException":
752
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
753
+ case "TooManyRequestsException":
754
+ case "com.amazonaws.signer#TooManyRequestsException":
755
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
756
+ case "ValidationException":
757
+ case "com.amazonaws.signer#ValidationException":
758
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
759
+ default:
760
+ const parsedBody = parsedOutput.body;
761
+ throwDefaultError({
762
+ output,
763
+ parsedBody,
764
+ exceptionCtor: __BaseException,
765
+ errorCode,
766
+ });
767
+ }
768
+ };
769
+ export const deserializeAws_restJson1ListSigningJobsCommand = async (output, context) => {
770
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
771
+ return deserializeAws_restJson1ListSigningJobsCommandError(output, context);
772
+ }
773
+ const contents = map({
774
+ $metadata: deserializeMetadata(output),
1098
775
  });
1099
- }); };
1100
- var deserializeAws_restJson1ListSigningPlatformsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1101
- var parsedOutput, _a, errorCode, _b, parsedBody;
1102
- var _c;
1103
- return __generator(this, function (_d) {
1104
- switch (_d.label) {
1105
- case 0:
1106
- _a = [__assign({}, output)];
1107
- _c = {};
1108
- return [4, parseErrorBody(output.body, context)];
1109
- case 1:
1110
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1111
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1112
- _b = errorCode;
1113
- switch (_b) {
1114
- case "AccessDeniedException": return [3, 2];
1115
- case "com.amazonaws.signer#AccessDeniedException": return [3, 2];
1116
- case "InternalServiceErrorException": return [3, 4];
1117
- case "com.amazonaws.signer#InternalServiceErrorException": return [3, 4];
1118
- case "TooManyRequestsException": return [3, 6];
1119
- case "com.amazonaws.signer#TooManyRequestsException": return [3, 6];
1120
- case "ValidationException": return [3, 8];
1121
- case "com.amazonaws.signer#ValidationException": return [3, 8];
1122
- }
1123
- return [3, 10];
1124
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1125
- case 3: throw _d.sent();
1126
- case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1127
- case 5: throw _d.sent();
1128
- case 6: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1129
- case 7: throw _d.sent();
1130
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1131
- case 9: throw _d.sent();
1132
- case 10:
1133
- parsedBody = parsedOutput.body;
1134
- throwDefaultError({
1135
- output: output,
1136
- parsedBody: parsedBody,
1137
- exceptionCtor: __BaseException,
1138
- errorCode: errorCode,
1139
- });
1140
- _d.label = 11;
1141
- case 11: return [2];
1142
- }
776
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
777
+ if (data.jobs != null) {
778
+ contents.jobs = deserializeAws_restJson1SigningJobs(data.jobs, context);
779
+ }
780
+ if (data.nextToken != null) {
781
+ contents.nextToken = __expectString(data.nextToken);
782
+ }
783
+ return contents;
784
+ };
785
+ const deserializeAws_restJson1ListSigningJobsCommandError = async (output, context) => {
786
+ const parsedOutput = {
787
+ ...output,
788
+ body: await parseErrorBody(output.body, context),
789
+ };
790
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
791
+ switch (errorCode) {
792
+ case "AccessDeniedException":
793
+ case "com.amazonaws.signer#AccessDeniedException":
794
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
795
+ case "InternalServiceErrorException":
796
+ case "com.amazonaws.signer#InternalServiceErrorException":
797
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
798
+ case "TooManyRequestsException":
799
+ case "com.amazonaws.signer#TooManyRequestsException":
800
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
801
+ case "ValidationException":
802
+ case "com.amazonaws.signer#ValidationException":
803
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
804
+ default:
805
+ const parsedBody = parsedOutput.body;
806
+ throwDefaultError({
807
+ output,
808
+ parsedBody,
809
+ exceptionCtor: __BaseException,
810
+ errorCode,
811
+ });
812
+ }
813
+ };
814
+ export const deserializeAws_restJson1ListSigningPlatformsCommand = async (output, context) => {
815
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
816
+ return deserializeAws_restJson1ListSigningPlatformsCommandError(output, context);
817
+ }
818
+ const contents = map({
819
+ $metadata: deserializeMetadata(output),
1143
820
  });
1144
- }); };
1145
- export var deserializeAws_restJson1ListSigningProfilesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1146
- var contents, data, _a, _b;
1147
- return __generator(this, function (_c) {
1148
- switch (_c.label) {
1149
- case 0:
1150
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1151
- return [2, deserializeAws_restJson1ListSigningProfilesCommandError(output, context)];
1152
- }
1153
- contents = map({
1154
- $metadata: deserializeMetadata(output),
1155
- });
1156
- _a = __expectNonNull;
1157
- _b = __expectObject;
1158
- return [4, parseBody(output.body, context)];
1159
- case 1:
1160
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1161
- if (data.nextToken != null) {
1162
- contents.nextToken = __expectString(data.nextToken);
1163
- }
1164
- if (data.profiles != null) {
1165
- contents.profiles = deserializeAws_restJson1SigningProfiles(data.profiles, context);
1166
- }
1167
- return [2, contents];
1168
- }
821
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
822
+ if (data.nextToken != null) {
823
+ contents.nextToken = __expectString(data.nextToken);
824
+ }
825
+ if (data.platforms != null) {
826
+ contents.platforms = deserializeAws_restJson1SigningPlatforms(data.platforms, context);
827
+ }
828
+ return contents;
829
+ };
830
+ const deserializeAws_restJson1ListSigningPlatformsCommandError = async (output, context) => {
831
+ const parsedOutput = {
832
+ ...output,
833
+ body: await parseErrorBody(output.body, context),
834
+ };
835
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
836
+ switch (errorCode) {
837
+ case "AccessDeniedException":
838
+ case "com.amazonaws.signer#AccessDeniedException":
839
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
840
+ case "InternalServiceErrorException":
841
+ case "com.amazonaws.signer#InternalServiceErrorException":
842
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
843
+ case "TooManyRequestsException":
844
+ case "com.amazonaws.signer#TooManyRequestsException":
845
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
846
+ case "ValidationException":
847
+ case "com.amazonaws.signer#ValidationException":
848
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
849
+ default:
850
+ const parsedBody = parsedOutput.body;
851
+ throwDefaultError({
852
+ output,
853
+ parsedBody,
854
+ exceptionCtor: __BaseException,
855
+ errorCode,
856
+ });
857
+ }
858
+ };
859
+ export const deserializeAws_restJson1ListSigningProfilesCommand = async (output, context) => {
860
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
861
+ return deserializeAws_restJson1ListSigningProfilesCommandError(output, context);
862
+ }
863
+ const contents = map({
864
+ $metadata: deserializeMetadata(output),
1169
865
  });
1170
- }); };
1171
- var deserializeAws_restJson1ListSigningProfilesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1172
- var parsedOutput, _a, errorCode, _b, parsedBody;
1173
- var _c;
1174
- return __generator(this, function (_d) {
1175
- switch (_d.label) {
1176
- case 0:
1177
- _a = [__assign({}, output)];
1178
- _c = {};
1179
- return [4, parseErrorBody(output.body, context)];
1180
- case 1:
1181
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1182
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1183
- _b = errorCode;
1184
- switch (_b) {
1185
- case "AccessDeniedException": return [3, 2];
1186
- case "com.amazonaws.signer#AccessDeniedException": return [3, 2];
1187
- case "InternalServiceErrorException": return [3, 4];
1188
- case "com.amazonaws.signer#InternalServiceErrorException": return [3, 4];
1189
- case "TooManyRequestsException": return [3, 6];
1190
- case "com.amazonaws.signer#TooManyRequestsException": return [3, 6];
1191
- }
1192
- return [3, 8];
1193
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1194
- case 3: throw _d.sent();
1195
- case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1196
- case 5: throw _d.sent();
1197
- case 6: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1198
- case 7: throw _d.sent();
1199
- case 8:
1200
- parsedBody = parsedOutput.body;
1201
- throwDefaultError({
1202
- output: output,
1203
- parsedBody: parsedBody,
1204
- exceptionCtor: __BaseException,
1205
- errorCode: errorCode,
1206
- });
1207
- _d.label = 9;
1208
- case 9: return [2];
1209
- }
866
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
867
+ if (data.nextToken != null) {
868
+ contents.nextToken = __expectString(data.nextToken);
869
+ }
870
+ if (data.profiles != null) {
871
+ contents.profiles = deserializeAws_restJson1SigningProfiles(data.profiles, context);
872
+ }
873
+ return contents;
874
+ };
875
+ const deserializeAws_restJson1ListSigningProfilesCommandError = async (output, context) => {
876
+ const parsedOutput = {
877
+ ...output,
878
+ body: await parseErrorBody(output.body, context),
879
+ };
880
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
881
+ switch (errorCode) {
882
+ case "AccessDeniedException":
883
+ case "com.amazonaws.signer#AccessDeniedException":
884
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
885
+ case "InternalServiceErrorException":
886
+ case "com.amazonaws.signer#InternalServiceErrorException":
887
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
888
+ case "TooManyRequestsException":
889
+ case "com.amazonaws.signer#TooManyRequestsException":
890
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
891
+ default:
892
+ const parsedBody = parsedOutput.body;
893
+ throwDefaultError({
894
+ output,
895
+ parsedBody,
896
+ exceptionCtor: __BaseException,
897
+ errorCode,
898
+ });
899
+ }
900
+ };
901
+ export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
902
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
903
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
904
+ }
905
+ const contents = map({
906
+ $metadata: deserializeMetadata(output),
1210
907
  });
1211
- }); };
1212
- export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1213
- var contents, data, _a, _b;
1214
- return __generator(this, function (_c) {
1215
- switch (_c.label) {
1216
- case 0:
1217
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1218
- return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
1219
- }
1220
- contents = map({
1221
- $metadata: deserializeMetadata(output),
1222
- });
1223
- _a = __expectNonNull;
1224
- _b = __expectObject;
1225
- return [4, parseBody(output.body, context)];
1226
- case 1:
1227
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1228
- if (data.tags != null) {
1229
- contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
1230
- }
1231
- return [2, contents];
1232
- }
908
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
909
+ if (data.tags != null) {
910
+ contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
911
+ }
912
+ return contents;
913
+ };
914
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
915
+ const parsedOutput = {
916
+ ...output,
917
+ body: await parseErrorBody(output.body, context),
918
+ };
919
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
920
+ switch (errorCode) {
921
+ case "BadRequestException":
922
+ case "com.amazonaws.signer#BadRequestException":
923
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
924
+ case "InternalServiceErrorException":
925
+ case "com.amazonaws.signer#InternalServiceErrorException":
926
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
927
+ case "NotFoundException":
928
+ case "com.amazonaws.signer#NotFoundException":
929
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
930
+ case "TooManyRequestsException":
931
+ case "com.amazonaws.signer#TooManyRequestsException":
932
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
933
+ default:
934
+ const parsedBody = parsedOutput.body;
935
+ throwDefaultError({
936
+ output,
937
+ parsedBody,
938
+ exceptionCtor: __BaseException,
939
+ errorCode,
940
+ });
941
+ }
942
+ };
943
+ export const deserializeAws_restJson1PutSigningProfileCommand = async (output, context) => {
944
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
945
+ return deserializeAws_restJson1PutSigningProfileCommandError(output, context);
946
+ }
947
+ const contents = map({
948
+ $metadata: deserializeMetadata(output),
1233
949
  });
1234
- }); };
1235
- var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1236
- var parsedOutput, _a, errorCode, _b, parsedBody;
1237
- var _c;
1238
- return __generator(this, function (_d) {
1239
- switch (_d.label) {
1240
- case 0:
1241
- _a = [__assign({}, output)];
1242
- _c = {};
1243
- return [4, parseErrorBody(output.body, context)];
1244
- case 1:
1245
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1246
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1247
- _b = errorCode;
1248
- switch (_b) {
1249
- case "BadRequestException": return [3, 2];
1250
- case "com.amazonaws.signer#BadRequestException": return [3, 2];
1251
- case "InternalServiceErrorException": return [3, 4];
1252
- case "com.amazonaws.signer#InternalServiceErrorException": return [3, 4];
1253
- case "NotFoundException": return [3, 6];
1254
- case "com.amazonaws.signer#NotFoundException": return [3, 6];
1255
- case "TooManyRequestsException": return [3, 8];
1256
- case "com.amazonaws.signer#TooManyRequestsException": return [3, 8];
1257
- }
1258
- return [3, 10];
1259
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1260
- case 3: throw _d.sent();
1261
- case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1262
- case 5: throw _d.sent();
1263
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1264
- case 7: throw _d.sent();
1265
- case 8: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1266
- case 9: throw _d.sent();
1267
- case 10:
1268
- parsedBody = parsedOutput.body;
1269
- throwDefaultError({
1270
- output: output,
1271
- parsedBody: parsedBody,
1272
- exceptionCtor: __BaseException,
1273
- errorCode: errorCode,
1274
- });
1275
- _d.label = 11;
1276
- case 11: return [2];
1277
- }
950
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
951
+ if (data.arn != null) {
952
+ contents.arn = __expectString(data.arn);
953
+ }
954
+ if (data.profileVersion != null) {
955
+ contents.profileVersion = __expectString(data.profileVersion);
956
+ }
957
+ if (data.profileVersionArn != null) {
958
+ contents.profileVersionArn = __expectString(data.profileVersionArn);
959
+ }
960
+ return contents;
961
+ };
962
+ const deserializeAws_restJson1PutSigningProfileCommandError = async (output, context) => {
963
+ const parsedOutput = {
964
+ ...output,
965
+ body: await parseErrorBody(output.body, context),
966
+ };
967
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
968
+ switch (errorCode) {
969
+ case "AccessDeniedException":
970
+ case "com.amazonaws.signer#AccessDeniedException":
971
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
972
+ case "InternalServiceErrorException":
973
+ case "com.amazonaws.signer#InternalServiceErrorException":
974
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
975
+ case "ResourceNotFoundException":
976
+ case "com.amazonaws.signer#ResourceNotFoundException":
977
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
978
+ case "TooManyRequestsException":
979
+ case "com.amazonaws.signer#TooManyRequestsException":
980
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
981
+ case "ValidationException":
982
+ case "com.amazonaws.signer#ValidationException":
983
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
984
+ default:
985
+ const parsedBody = parsedOutput.body;
986
+ throwDefaultError({
987
+ output,
988
+ parsedBody,
989
+ exceptionCtor: __BaseException,
990
+ errorCode,
991
+ });
992
+ }
993
+ };
994
+ export const deserializeAws_restJson1RemoveProfilePermissionCommand = async (output, context) => {
995
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
996
+ return deserializeAws_restJson1RemoveProfilePermissionCommandError(output, context);
997
+ }
998
+ const contents = map({
999
+ $metadata: deserializeMetadata(output),
1278
1000
  });
1279
- }); };
1280
- export var deserializeAws_restJson1PutSigningProfileCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1281
- var contents, data, _a, _b;
1282
- return __generator(this, function (_c) {
1283
- switch (_c.label) {
1284
- case 0:
1285
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1286
- return [2, deserializeAws_restJson1PutSigningProfileCommandError(output, context)];
1287
- }
1288
- contents = map({
1289
- $metadata: deserializeMetadata(output),
1290
- });
1291
- _a = __expectNonNull;
1292
- _b = __expectObject;
1293
- return [4, parseBody(output.body, context)];
1294
- case 1:
1295
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1296
- if (data.arn != null) {
1297
- contents.arn = __expectString(data.arn);
1298
- }
1299
- if (data.profileVersion != null) {
1300
- contents.profileVersion = __expectString(data.profileVersion);
1301
- }
1302
- if (data.profileVersionArn != null) {
1303
- contents.profileVersionArn = __expectString(data.profileVersionArn);
1304
- }
1305
- return [2, contents];
1306
- }
1001
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1002
+ if (data.revisionId != null) {
1003
+ contents.revisionId = __expectString(data.revisionId);
1004
+ }
1005
+ return contents;
1006
+ };
1007
+ const deserializeAws_restJson1RemoveProfilePermissionCommandError = async (output, context) => {
1008
+ const parsedOutput = {
1009
+ ...output,
1010
+ body: await parseErrorBody(output.body, context),
1011
+ };
1012
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1013
+ switch (errorCode) {
1014
+ case "AccessDeniedException":
1015
+ case "com.amazonaws.signer#AccessDeniedException":
1016
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1017
+ case "ConflictException":
1018
+ case "com.amazonaws.signer#ConflictException":
1019
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1020
+ case "InternalServiceErrorException":
1021
+ case "com.amazonaws.signer#InternalServiceErrorException":
1022
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1023
+ case "ResourceNotFoundException":
1024
+ case "com.amazonaws.signer#ResourceNotFoundException":
1025
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1026
+ case "TooManyRequestsException":
1027
+ case "com.amazonaws.signer#TooManyRequestsException":
1028
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1029
+ case "ValidationException":
1030
+ case "com.amazonaws.signer#ValidationException":
1031
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1032
+ default:
1033
+ const parsedBody = parsedOutput.body;
1034
+ throwDefaultError({
1035
+ output,
1036
+ parsedBody,
1037
+ exceptionCtor: __BaseException,
1038
+ errorCode,
1039
+ });
1040
+ }
1041
+ };
1042
+ export const deserializeAws_restJson1RevokeSignatureCommand = async (output, context) => {
1043
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1044
+ return deserializeAws_restJson1RevokeSignatureCommandError(output, context);
1045
+ }
1046
+ const contents = map({
1047
+ $metadata: deserializeMetadata(output),
1307
1048
  });
1308
- }); };
1309
- var deserializeAws_restJson1PutSigningProfileCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1310
- var parsedOutput, _a, errorCode, _b, parsedBody;
1311
- var _c;
1312
- return __generator(this, function (_d) {
1313
- switch (_d.label) {
1314
- case 0:
1315
- _a = [__assign({}, output)];
1316
- _c = {};
1317
- return [4, parseErrorBody(output.body, context)];
1318
- case 1:
1319
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1320
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1321
- _b = errorCode;
1322
- switch (_b) {
1323
- case "AccessDeniedException": return [3, 2];
1324
- case "com.amazonaws.signer#AccessDeniedException": return [3, 2];
1325
- case "InternalServiceErrorException": return [3, 4];
1326
- case "com.amazonaws.signer#InternalServiceErrorException": return [3, 4];
1327
- case "ResourceNotFoundException": return [3, 6];
1328
- case "com.amazonaws.signer#ResourceNotFoundException": return [3, 6];
1329
- case "TooManyRequestsException": return [3, 8];
1330
- case "com.amazonaws.signer#TooManyRequestsException": return [3, 8];
1331
- case "ValidationException": return [3, 10];
1332
- case "com.amazonaws.signer#ValidationException": return [3, 10];
1333
- }
1334
- return [3, 12];
1335
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1336
- case 3: throw _d.sent();
1337
- case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1338
- case 5: throw _d.sent();
1339
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1340
- case 7: throw _d.sent();
1341
- case 8: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1342
- case 9: throw _d.sent();
1343
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1344
- case 11: throw _d.sent();
1345
- case 12:
1346
- parsedBody = parsedOutput.body;
1347
- throwDefaultError({
1348
- output: output,
1349
- parsedBody: parsedBody,
1350
- exceptionCtor: __BaseException,
1351
- errorCode: errorCode,
1352
- });
1353
- _d.label = 13;
1354
- case 13: return [2];
1355
- }
1049
+ await collectBody(output.body, context);
1050
+ return contents;
1051
+ };
1052
+ const deserializeAws_restJson1RevokeSignatureCommandError = async (output, context) => {
1053
+ const parsedOutput = {
1054
+ ...output,
1055
+ body: await parseErrorBody(output.body, context),
1056
+ };
1057
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1058
+ switch (errorCode) {
1059
+ case "AccessDeniedException":
1060
+ case "com.amazonaws.signer#AccessDeniedException":
1061
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1062
+ case "InternalServiceErrorException":
1063
+ case "com.amazonaws.signer#InternalServiceErrorException":
1064
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1065
+ case "ResourceNotFoundException":
1066
+ case "com.amazonaws.signer#ResourceNotFoundException":
1067
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1068
+ case "TooManyRequestsException":
1069
+ case "com.amazonaws.signer#TooManyRequestsException":
1070
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1071
+ case "ValidationException":
1072
+ case "com.amazonaws.signer#ValidationException":
1073
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1074
+ default:
1075
+ const parsedBody = parsedOutput.body;
1076
+ throwDefaultError({
1077
+ output,
1078
+ parsedBody,
1079
+ exceptionCtor: __BaseException,
1080
+ errorCode,
1081
+ });
1082
+ }
1083
+ };
1084
+ export const deserializeAws_restJson1RevokeSigningProfileCommand = async (output, context) => {
1085
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1086
+ return deserializeAws_restJson1RevokeSigningProfileCommandError(output, context);
1087
+ }
1088
+ const contents = map({
1089
+ $metadata: deserializeMetadata(output),
1356
1090
  });
1357
- }); };
1358
- export var deserializeAws_restJson1RemoveProfilePermissionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1359
- var contents, data, _a, _b;
1360
- return __generator(this, function (_c) {
1361
- switch (_c.label) {
1362
- case 0:
1363
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1364
- return [2, deserializeAws_restJson1RemoveProfilePermissionCommandError(output, context)];
1365
- }
1366
- contents = map({
1367
- $metadata: deserializeMetadata(output),
1368
- });
1369
- _a = __expectNonNull;
1370
- _b = __expectObject;
1371
- return [4, parseBody(output.body, context)];
1372
- case 1:
1373
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1374
- if (data.revisionId != null) {
1375
- contents.revisionId = __expectString(data.revisionId);
1376
- }
1377
- return [2, contents];
1378
- }
1091
+ await collectBody(output.body, context);
1092
+ return contents;
1093
+ };
1094
+ const deserializeAws_restJson1RevokeSigningProfileCommandError = async (output, context) => {
1095
+ const parsedOutput = {
1096
+ ...output,
1097
+ body: await parseErrorBody(output.body, context),
1098
+ };
1099
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1100
+ switch (errorCode) {
1101
+ case "AccessDeniedException":
1102
+ case "com.amazonaws.signer#AccessDeniedException":
1103
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1104
+ case "InternalServiceErrorException":
1105
+ case "com.amazonaws.signer#InternalServiceErrorException":
1106
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1107
+ case "ResourceNotFoundException":
1108
+ case "com.amazonaws.signer#ResourceNotFoundException":
1109
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1110
+ case "TooManyRequestsException":
1111
+ case "com.amazonaws.signer#TooManyRequestsException":
1112
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1113
+ case "ValidationException":
1114
+ case "com.amazonaws.signer#ValidationException":
1115
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1116
+ default:
1117
+ const parsedBody = parsedOutput.body;
1118
+ throwDefaultError({
1119
+ output,
1120
+ parsedBody,
1121
+ exceptionCtor: __BaseException,
1122
+ errorCode,
1123
+ });
1124
+ }
1125
+ };
1126
+ export const deserializeAws_restJson1StartSigningJobCommand = async (output, context) => {
1127
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1128
+ return deserializeAws_restJson1StartSigningJobCommandError(output, context);
1129
+ }
1130
+ const contents = map({
1131
+ $metadata: deserializeMetadata(output),
1379
1132
  });
1380
- }); };
1381
- var deserializeAws_restJson1RemoveProfilePermissionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1382
- var parsedOutput, _a, errorCode, _b, parsedBody;
1383
- var _c;
1384
- return __generator(this, function (_d) {
1385
- switch (_d.label) {
1386
- case 0:
1387
- _a = [__assign({}, output)];
1388
- _c = {};
1389
- return [4, parseErrorBody(output.body, context)];
1390
- case 1:
1391
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1392
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1393
- _b = errorCode;
1394
- switch (_b) {
1395
- case "AccessDeniedException": return [3, 2];
1396
- case "com.amazonaws.signer#AccessDeniedException": return [3, 2];
1397
- case "ConflictException": return [3, 4];
1398
- case "com.amazonaws.signer#ConflictException": return [3, 4];
1399
- case "InternalServiceErrorException": return [3, 6];
1400
- case "com.amazonaws.signer#InternalServiceErrorException": return [3, 6];
1401
- case "ResourceNotFoundException": return [3, 8];
1402
- case "com.amazonaws.signer#ResourceNotFoundException": return [3, 8];
1403
- case "TooManyRequestsException": return [3, 10];
1404
- case "com.amazonaws.signer#TooManyRequestsException": return [3, 10];
1405
- case "ValidationException": return [3, 12];
1406
- case "com.amazonaws.signer#ValidationException": return [3, 12];
1407
- }
1408
- return [3, 14];
1409
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1410
- case 3: throw _d.sent();
1411
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1412
- case 5: throw _d.sent();
1413
- case 6: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1414
- case 7: throw _d.sent();
1415
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1416
- case 9: throw _d.sent();
1417
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1418
- case 11: throw _d.sent();
1419
- case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1420
- case 13: throw _d.sent();
1421
- case 14:
1422
- parsedBody = parsedOutput.body;
1423
- throwDefaultError({
1424
- output: output,
1425
- parsedBody: parsedBody,
1426
- exceptionCtor: __BaseException,
1427
- errorCode: errorCode,
1428
- });
1429
- _d.label = 15;
1430
- case 15: return [2];
1431
- }
1133
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1134
+ if (data.jobId != null) {
1135
+ contents.jobId = __expectString(data.jobId);
1136
+ }
1137
+ if (data.jobOwner != null) {
1138
+ contents.jobOwner = __expectString(data.jobOwner);
1139
+ }
1140
+ return contents;
1141
+ };
1142
+ const deserializeAws_restJson1StartSigningJobCommandError = async (output, context) => {
1143
+ const parsedOutput = {
1144
+ ...output,
1145
+ body: await parseErrorBody(output.body, context),
1146
+ };
1147
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1148
+ switch (errorCode) {
1149
+ case "AccessDeniedException":
1150
+ case "com.amazonaws.signer#AccessDeniedException":
1151
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1152
+ case "InternalServiceErrorException":
1153
+ case "com.amazonaws.signer#InternalServiceErrorException":
1154
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1155
+ case "ResourceNotFoundException":
1156
+ case "com.amazonaws.signer#ResourceNotFoundException":
1157
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1158
+ case "ThrottlingException":
1159
+ case "com.amazonaws.signer#ThrottlingException":
1160
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1161
+ case "TooManyRequestsException":
1162
+ case "com.amazonaws.signer#TooManyRequestsException":
1163
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1164
+ case "ValidationException":
1165
+ case "com.amazonaws.signer#ValidationException":
1166
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1167
+ default:
1168
+ const parsedBody = parsedOutput.body;
1169
+ throwDefaultError({
1170
+ output,
1171
+ parsedBody,
1172
+ exceptionCtor: __BaseException,
1173
+ errorCode,
1174
+ });
1175
+ }
1176
+ };
1177
+ export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
1178
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1179
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
1180
+ }
1181
+ const contents = map({
1182
+ $metadata: deserializeMetadata(output),
1432
1183
  });
1433
- }); };
1434
- export var deserializeAws_restJson1RevokeSignatureCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1435
- var contents;
1436
- return __generator(this, function (_a) {
1437
- switch (_a.label) {
1438
- case 0:
1439
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1440
- return [2, deserializeAws_restJson1RevokeSignatureCommandError(output, context)];
1441
- }
1442
- contents = map({
1443
- $metadata: deserializeMetadata(output),
1444
- });
1445
- return [4, collectBody(output.body, context)];
1446
- case 1:
1447
- _a.sent();
1448
- return [2, contents];
1449
- }
1184
+ await collectBody(output.body, context);
1185
+ return contents;
1186
+ };
1187
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
1188
+ const parsedOutput = {
1189
+ ...output,
1190
+ body: await parseErrorBody(output.body, context),
1191
+ };
1192
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1193
+ switch (errorCode) {
1194
+ case "BadRequestException":
1195
+ case "com.amazonaws.signer#BadRequestException":
1196
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1197
+ case "InternalServiceErrorException":
1198
+ case "com.amazonaws.signer#InternalServiceErrorException":
1199
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1200
+ case "NotFoundException":
1201
+ case "com.amazonaws.signer#NotFoundException":
1202
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1203
+ case "TooManyRequestsException":
1204
+ case "com.amazonaws.signer#TooManyRequestsException":
1205
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1206
+ default:
1207
+ const parsedBody = parsedOutput.body;
1208
+ throwDefaultError({
1209
+ output,
1210
+ parsedBody,
1211
+ exceptionCtor: __BaseException,
1212
+ errorCode,
1213
+ });
1214
+ }
1215
+ };
1216
+ export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1217
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1218
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
1219
+ }
1220
+ const contents = map({
1221
+ $metadata: deserializeMetadata(output),
1450
1222
  });
1451
- }); };
1452
- var deserializeAws_restJson1RevokeSignatureCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1453
- var parsedOutput, _a, errorCode, _b, parsedBody;
1454
- var _c;
1455
- return __generator(this, function (_d) {
1456
- switch (_d.label) {
1457
- case 0:
1458
- _a = [__assign({}, output)];
1459
- _c = {};
1460
- return [4, parseErrorBody(output.body, context)];
1461
- case 1:
1462
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1463
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1464
- _b = errorCode;
1465
- switch (_b) {
1466
- case "AccessDeniedException": return [3, 2];
1467
- case "com.amazonaws.signer#AccessDeniedException": return [3, 2];
1468
- case "InternalServiceErrorException": return [3, 4];
1469
- case "com.amazonaws.signer#InternalServiceErrorException": return [3, 4];
1470
- case "ResourceNotFoundException": return [3, 6];
1471
- case "com.amazonaws.signer#ResourceNotFoundException": return [3, 6];
1472
- case "TooManyRequestsException": return [3, 8];
1473
- case "com.amazonaws.signer#TooManyRequestsException": return [3, 8];
1474
- case "ValidationException": return [3, 10];
1475
- case "com.amazonaws.signer#ValidationException": return [3, 10];
1476
- }
1477
- return [3, 12];
1478
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1479
- case 3: throw _d.sent();
1480
- case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1481
- case 5: throw _d.sent();
1482
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1483
- case 7: throw _d.sent();
1484
- case 8: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1485
- case 9: throw _d.sent();
1486
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1487
- case 11: throw _d.sent();
1488
- case 12:
1489
- parsedBody = parsedOutput.body;
1490
- throwDefaultError({
1491
- output: output,
1492
- parsedBody: parsedBody,
1493
- exceptionCtor: __BaseException,
1494
- errorCode: errorCode,
1495
- });
1496
- _d.label = 13;
1497
- case 13: return [2];
1498
- }
1223
+ await collectBody(output.body, context);
1224
+ return contents;
1225
+ };
1226
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
1227
+ const parsedOutput = {
1228
+ ...output,
1229
+ body: await parseErrorBody(output.body, context),
1230
+ };
1231
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1232
+ switch (errorCode) {
1233
+ case "BadRequestException":
1234
+ case "com.amazonaws.signer#BadRequestException":
1235
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1236
+ case "InternalServiceErrorException":
1237
+ case "com.amazonaws.signer#InternalServiceErrorException":
1238
+ throw await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context);
1239
+ case "NotFoundException":
1240
+ case "com.amazonaws.signer#NotFoundException":
1241
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1242
+ case "TooManyRequestsException":
1243
+ case "com.amazonaws.signer#TooManyRequestsException":
1244
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1245
+ default:
1246
+ const parsedBody = parsedOutput.body;
1247
+ throwDefaultError({
1248
+ output,
1249
+ parsedBody,
1250
+ exceptionCtor: __BaseException,
1251
+ errorCode,
1252
+ });
1253
+ }
1254
+ };
1255
+ const map = __map;
1256
+ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
1257
+ const contents = map({});
1258
+ const data = parsedOutput.body;
1259
+ if (data.code != null) {
1260
+ contents.code = __expectString(data.code);
1261
+ }
1262
+ if (data.message != null) {
1263
+ contents.message = __expectString(data.message);
1264
+ }
1265
+ const exception = new AccessDeniedException({
1266
+ $metadata: deserializeMetadata(parsedOutput),
1267
+ ...contents,
1499
1268
  });
1500
- }); };
1501
- export var deserializeAws_restJson1RevokeSigningProfileCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1502
- var contents;
1503
- return __generator(this, function (_a) {
1504
- switch (_a.label) {
1505
- case 0:
1506
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1507
- return [2, deserializeAws_restJson1RevokeSigningProfileCommandError(output, context)];
1508
- }
1509
- contents = map({
1510
- $metadata: deserializeMetadata(output),
1511
- });
1512
- return [4, collectBody(output.body, context)];
1513
- case 1:
1514
- _a.sent();
1515
- return [2, contents];
1516
- }
1269
+ return __decorateServiceException(exception, parsedOutput.body);
1270
+ };
1271
+ const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
1272
+ const contents = map({});
1273
+ const data = parsedOutput.body;
1274
+ if (data.code != null) {
1275
+ contents.code = __expectString(data.code);
1276
+ }
1277
+ if (data.message != null) {
1278
+ contents.message = __expectString(data.message);
1279
+ }
1280
+ const exception = new BadRequestException({
1281
+ $metadata: deserializeMetadata(parsedOutput),
1282
+ ...contents,
1517
1283
  });
1518
- }); };
1519
- var deserializeAws_restJson1RevokeSigningProfileCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1520
- var parsedOutput, _a, errorCode, _b, parsedBody;
1521
- var _c;
1522
- return __generator(this, function (_d) {
1523
- switch (_d.label) {
1524
- case 0:
1525
- _a = [__assign({}, output)];
1526
- _c = {};
1527
- return [4, parseErrorBody(output.body, context)];
1528
- case 1:
1529
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1530
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1531
- _b = errorCode;
1532
- switch (_b) {
1533
- case "AccessDeniedException": return [3, 2];
1534
- case "com.amazonaws.signer#AccessDeniedException": return [3, 2];
1535
- case "InternalServiceErrorException": return [3, 4];
1536
- case "com.amazonaws.signer#InternalServiceErrorException": return [3, 4];
1537
- case "ResourceNotFoundException": return [3, 6];
1538
- case "com.amazonaws.signer#ResourceNotFoundException": return [3, 6];
1539
- case "TooManyRequestsException": return [3, 8];
1540
- case "com.amazonaws.signer#TooManyRequestsException": return [3, 8];
1541
- case "ValidationException": return [3, 10];
1542
- case "com.amazonaws.signer#ValidationException": return [3, 10];
1543
- }
1544
- return [3, 12];
1545
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1546
- case 3: throw _d.sent();
1547
- case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1548
- case 5: throw _d.sent();
1549
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1550
- case 7: throw _d.sent();
1551
- case 8: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1552
- case 9: throw _d.sent();
1553
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1554
- case 11: throw _d.sent();
1555
- case 12:
1556
- parsedBody = parsedOutput.body;
1557
- throwDefaultError({
1558
- output: output,
1559
- parsedBody: parsedBody,
1560
- exceptionCtor: __BaseException,
1561
- errorCode: errorCode,
1562
- });
1563
- _d.label = 13;
1564
- case 13: return [2];
1565
- }
1284
+ return __decorateServiceException(exception, parsedOutput.body);
1285
+ };
1286
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1287
+ const contents = map({});
1288
+ const data = parsedOutput.body;
1289
+ if (data.code != null) {
1290
+ contents.code = __expectString(data.code);
1291
+ }
1292
+ if (data.message != null) {
1293
+ contents.message = __expectString(data.message);
1294
+ }
1295
+ const exception = new ConflictException({
1296
+ $metadata: deserializeMetadata(parsedOutput),
1297
+ ...contents,
1566
1298
  });
1567
- }); };
1568
- export var deserializeAws_restJson1StartSigningJobCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1569
- var contents, data, _a, _b;
1570
- return __generator(this, function (_c) {
1571
- switch (_c.label) {
1572
- case 0:
1573
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1574
- return [2, deserializeAws_restJson1StartSigningJobCommandError(output, context)];
1575
- }
1576
- contents = map({
1577
- $metadata: deserializeMetadata(output),
1578
- });
1579
- _a = __expectNonNull;
1580
- _b = __expectObject;
1581
- return [4, parseBody(output.body, context)];
1582
- case 1:
1583
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1584
- if (data.jobId != null) {
1585
- contents.jobId = __expectString(data.jobId);
1586
- }
1587
- if (data.jobOwner != null) {
1588
- contents.jobOwner = __expectString(data.jobOwner);
1589
- }
1590
- return [2, contents];
1591
- }
1299
+ return __decorateServiceException(exception, parsedOutput.body);
1300
+ };
1301
+ const deserializeAws_restJson1InternalServiceErrorExceptionResponse = async (parsedOutput, context) => {
1302
+ const contents = map({});
1303
+ const data = parsedOutput.body;
1304
+ if (data.code != null) {
1305
+ contents.code = __expectString(data.code);
1306
+ }
1307
+ if (data.message != null) {
1308
+ contents.message = __expectString(data.message);
1309
+ }
1310
+ const exception = new InternalServiceErrorException({
1311
+ $metadata: deserializeMetadata(parsedOutput),
1312
+ ...contents,
1592
1313
  });
1593
- }); };
1594
- var deserializeAws_restJson1StartSigningJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1595
- var parsedOutput, _a, errorCode, _b, parsedBody;
1596
- var _c;
1597
- return __generator(this, function (_d) {
1598
- switch (_d.label) {
1599
- case 0:
1600
- _a = [__assign({}, output)];
1601
- _c = {};
1602
- return [4, parseErrorBody(output.body, context)];
1603
- case 1:
1604
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1605
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1606
- _b = errorCode;
1607
- switch (_b) {
1608
- case "AccessDeniedException": return [3, 2];
1609
- case "com.amazonaws.signer#AccessDeniedException": return [3, 2];
1610
- case "InternalServiceErrorException": return [3, 4];
1611
- case "com.amazonaws.signer#InternalServiceErrorException": return [3, 4];
1612
- case "ResourceNotFoundException": return [3, 6];
1613
- case "com.amazonaws.signer#ResourceNotFoundException": return [3, 6];
1614
- case "ThrottlingException": return [3, 8];
1615
- case "com.amazonaws.signer#ThrottlingException": return [3, 8];
1616
- case "TooManyRequestsException": return [3, 10];
1617
- case "com.amazonaws.signer#TooManyRequestsException": return [3, 10];
1618
- case "ValidationException": return [3, 12];
1619
- case "com.amazonaws.signer#ValidationException": return [3, 12];
1620
- }
1621
- return [3, 14];
1622
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1623
- case 3: throw _d.sent();
1624
- case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1625
- case 5: throw _d.sent();
1626
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1627
- case 7: throw _d.sent();
1628
- case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1629
- case 9: throw _d.sent();
1630
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1631
- case 11: throw _d.sent();
1632
- case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1633
- case 13: throw _d.sent();
1634
- case 14:
1635
- parsedBody = parsedOutput.body;
1636
- throwDefaultError({
1637
- output: output,
1638
- parsedBody: parsedBody,
1639
- exceptionCtor: __BaseException,
1640
- errorCode: errorCode,
1641
- });
1642
- _d.label = 15;
1643
- case 15: return [2];
1644
- }
1314
+ return __decorateServiceException(exception, parsedOutput.body);
1315
+ };
1316
+ const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, context) => {
1317
+ const contents = map({});
1318
+ const data = parsedOutput.body;
1319
+ if (data.code != null) {
1320
+ contents.code = __expectString(data.code);
1321
+ }
1322
+ if (data.message != null) {
1323
+ contents.message = __expectString(data.message);
1324
+ }
1325
+ const exception = new NotFoundException({
1326
+ $metadata: deserializeMetadata(parsedOutput),
1327
+ ...contents,
1645
1328
  });
1646
- }); };
1647
- export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1648
- var contents;
1649
- return __generator(this, function (_a) {
1650
- switch (_a.label) {
1651
- case 0:
1652
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1653
- return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
1654
- }
1655
- contents = map({
1656
- $metadata: deserializeMetadata(output),
1657
- });
1658
- return [4, collectBody(output.body, context)];
1659
- case 1:
1660
- _a.sent();
1661
- return [2, contents];
1662
- }
1329
+ return __decorateServiceException(exception, parsedOutput.body);
1330
+ };
1331
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1332
+ const contents = map({});
1333
+ const data = parsedOutput.body;
1334
+ if (data.code != null) {
1335
+ contents.code = __expectString(data.code);
1336
+ }
1337
+ if (data.message != null) {
1338
+ contents.message = __expectString(data.message);
1339
+ }
1340
+ const exception = new ResourceNotFoundException({
1341
+ $metadata: deserializeMetadata(parsedOutput),
1342
+ ...contents,
1663
1343
  });
1664
- }); };
1665
- var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1666
- var parsedOutput, _a, errorCode, _b, parsedBody;
1667
- var _c;
1668
- return __generator(this, function (_d) {
1669
- switch (_d.label) {
1670
- case 0:
1671
- _a = [__assign({}, output)];
1672
- _c = {};
1673
- return [4, parseErrorBody(output.body, context)];
1674
- case 1:
1675
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1676
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1677
- _b = errorCode;
1678
- switch (_b) {
1679
- case "BadRequestException": return [3, 2];
1680
- case "com.amazonaws.signer#BadRequestException": return [3, 2];
1681
- case "InternalServiceErrorException": return [3, 4];
1682
- case "com.amazonaws.signer#InternalServiceErrorException": return [3, 4];
1683
- case "NotFoundException": return [3, 6];
1684
- case "com.amazonaws.signer#NotFoundException": return [3, 6];
1685
- case "TooManyRequestsException": return [3, 8];
1686
- case "com.amazonaws.signer#TooManyRequestsException": return [3, 8];
1687
- }
1688
- return [3, 10];
1689
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1690
- case 3: throw _d.sent();
1691
- case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1692
- case 5: throw _d.sent();
1693
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1694
- case 7: throw _d.sent();
1695
- case 8: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1696
- case 9: throw _d.sent();
1697
- case 10:
1698
- parsedBody = parsedOutput.body;
1699
- throwDefaultError({
1700
- output: output,
1701
- parsedBody: parsedBody,
1702
- exceptionCtor: __BaseException,
1703
- errorCode: errorCode,
1704
- });
1705
- _d.label = 11;
1706
- case 11: return [2];
1707
- }
1344
+ return __decorateServiceException(exception, parsedOutput.body);
1345
+ };
1346
+ const deserializeAws_restJson1ServiceLimitExceededExceptionResponse = async (parsedOutput, context) => {
1347
+ const contents = map({});
1348
+ const data = parsedOutput.body;
1349
+ if (data.code != null) {
1350
+ contents.code = __expectString(data.code);
1351
+ }
1352
+ if (data.message != null) {
1353
+ contents.message = __expectString(data.message);
1354
+ }
1355
+ const exception = new ServiceLimitExceededException({
1356
+ $metadata: deserializeMetadata(parsedOutput),
1357
+ ...contents,
1708
1358
  });
1709
- }); };
1710
- export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1711
- var contents;
1712
- return __generator(this, function (_a) {
1713
- switch (_a.label) {
1714
- case 0:
1715
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1716
- return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
1717
- }
1718
- contents = map({
1719
- $metadata: deserializeMetadata(output),
1720
- });
1721
- return [4, collectBody(output.body, context)];
1722
- case 1:
1723
- _a.sent();
1724
- return [2, contents];
1725
- }
1359
+ return __decorateServiceException(exception, parsedOutput.body);
1360
+ };
1361
+ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
1362
+ const contents = map({});
1363
+ const data = parsedOutput.body;
1364
+ if (data.code != null) {
1365
+ contents.code = __expectString(data.code);
1366
+ }
1367
+ if (data.message != null) {
1368
+ contents.message = __expectString(data.message);
1369
+ }
1370
+ const exception = new ThrottlingException({
1371
+ $metadata: deserializeMetadata(parsedOutput),
1372
+ ...contents,
1726
1373
  });
1727
- }); };
1728
- var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1729
- var parsedOutput, _a, errorCode, _b, parsedBody;
1730
- var _c;
1731
- return __generator(this, function (_d) {
1732
- switch (_d.label) {
1733
- case 0:
1734
- _a = [__assign({}, output)];
1735
- _c = {};
1736
- return [4, parseErrorBody(output.body, context)];
1737
- case 1:
1738
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1739
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1740
- _b = errorCode;
1741
- switch (_b) {
1742
- case "BadRequestException": return [3, 2];
1743
- case "com.amazonaws.signer#BadRequestException": return [3, 2];
1744
- case "InternalServiceErrorException": return [3, 4];
1745
- case "com.amazonaws.signer#InternalServiceErrorException": return [3, 4];
1746
- case "NotFoundException": return [3, 6];
1747
- case "com.amazonaws.signer#NotFoundException": return [3, 6];
1748
- case "TooManyRequestsException": return [3, 8];
1749
- case "com.amazonaws.signer#TooManyRequestsException": return [3, 8];
1750
- }
1751
- return [3, 10];
1752
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1753
- case 3: throw _d.sent();
1754
- case 4: return [4, deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)];
1755
- case 5: throw _d.sent();
1756
- case 6: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1757
- case 7: throw _d.sent();
1758
- case 8: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1759
- case 9: throw _d.sent();
1760
- case 10:
1761
- parsedBody = parsedOutput.body;
1762
- throwDefaultError({
1763
- output: output,
1764
- parsedBody: parsedBody,
1765
- exceptionCtor: __BaseException,
1766
- errorCode: errorCode,
1767
- });
1768
- _d.label = 11;
1769
- case 11: return [2];
1770
- }
1374
+ return __decorateServiceException(exception, parsedOutput.body);
1375
+ };
1376
+ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOutput, context) => {
1377
+ const contents = map({});
1378
+ const data = parsedOutput.body;
1379
+ if (data.code != null) {
1380
+ contents.code = __expectString(data.code);
1381
+ }
1382
+ if (data.message != null) {
1383
+ contents.message = __expectString(data.message);
1384
+ }
1385
+ const exception = new TooManyRequestsException({
1386
+ $metadata: deserializeMetadata(parsedOutput),
1387
+ ...contents,
1771
1388
  });
1772
- }); };
1773
- var map = __map;
1774
- var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1775
- var contents, data, exception;
1776
- return __generator(this, function (_a) {
1777
- contents = map({});
1778
- data = parsedOutput.body;
1779
- if (data.code != null) {
1780
- contents.code = __expectString(data.code);
1781
- }
1782
- if (data.message != null) {
1783
- contents.message = __expectString(data.message);
1784
- }
1785
- exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1786
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1787
- });
1788
- }); };
1789
- var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1790
- var contents, data, exception;
1791
- return __generator(this, function (_a) {
1792
- contents = map({});
1793
- data = parsedOutput.body;
1794
- if (data.code != null) {
1795
- contents.code = __expectString(data.code);
1796
- }
1797
- if (data.message != null) {
1798
- contents.message = __expectString(data.message);
1799
- }
1800
- exception = new BadRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1801
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1802
- });
1803
- }); };
1804
- var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1805
- var contents, data, exception;
1806
- return __generator(this, function (_a) {
1807
- contents = map({});
1808
- data = parsedOutput.body;
1809
- if (data.code != null) {
1810
- contents.code = __expectString(data.code);
1811
- }
1812
- if (data.message != null) {
1813
- contents.message = __expectString(data.message);
1814
- }
1815
- exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1816
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1817
- });
1818
- }); };
1819
- var deserializeAws_restJson1InternalServiceErrorExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1820
- var contents, data, exception;
1821
- return __generator(this, function (_a) {
1822
- contents = map({});
1823
- data = parsedOutput.body;
1824
- if (data.code != null) {
1825
- contents.code = __expectString(data.code);
1826
- }
1827
- if (data.message != null) {
1828
- contents.message = __expectString(data.message);
1829
- }
1830
- exception = new InternalServiceErrorException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1831
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1832
- });
1833
- }); };
1834
- var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1835
- var contents, data, exception;
1836
- return __generator(this, function (_a) {
1837
- contents = map({});
1838
- data = parsedOutput.body;
1839
- if (data.code != null) {
1840
- contents.code = __expectString(data.code);
1841
- }
1842
- if (data.message != null) {
1843
- contents.message = __expectString(data.message);
1844
- }
1845
- exception = new NotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1846
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1847
- });
1848
- }); };
1849
- var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1850
- var contents, data, exception;
1851
- return __generator(this, function (_a) {
1852
- contents = map({});
1853
- data = parsedOutput.body;
1854
- if (data.code != null) {
1855
- contents.code = __expectString(data.code);
1856
- }
1857
- if (data.message != null) {
1858
- contents.message = __expectString(data.message);
1859
- }
1860
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1861
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1862
- });
1863
- }); };
1864
- var deserializeAws_restJson1ServiceLimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1865
- var contents, data, exception;
1866
- return __generator(this, function (_a) {
1867
- contents = map({});
1868
- data = parsedOutput.body;
1869
- if (data.code != null) {
1870
- contents.code = __expectString(data.code);
1871
- }
1872
- if (data.message != null) {
1873
- contents.message = __expectString(data.message);
1874
- }
1875
- exception = new ServiceLimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1876
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1877
- });
1878
- }); };
1879
- var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1880
- var contents, data, exception;
1881
- return __generator(this, function (_a) {
1882
- contents = map({});
1883
- data = parsedOutput.body;
1884
- if (data.code != null) {
1885
- contents.code = __expectString(data.code);
1886
- }
1887
- if (data.message != null) {
1888
- contents.message = __expectString(data.message);
1889
- }
1890
- exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1891
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1892
- });
1893
- }); };
1894
- var deserializeAws_restJson1TooManyRequestsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1895
- var contents, data, exception;
1896
- return __generator(this, function (_a) {
1897
- contents = map({});
1898
- data = parsedOutput.body;
1899
- if (data.code != null) {
1900
- contents.code = __expectString(data.code);
1901
- }
1902
- if (data.message != null) {
1903
- contents.message = __expectString(data.message);
1904
- }
1905
- exception = new TooManyRequestsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1906
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1907
- });
1908
- }); };
1909
- var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1910
- var contents, data, exception;
1911
- return __generator(this, function (_a) {
1912
- contents = map({});
1913
- data = parsedOutput.body;
1914
- if (data.code != null) {
1915
- contents.code = __expectString(data.code);
1916
- }
1917
- if (data.message != null) {
1918
- contents.message = __expectString(data.message);
1919
- }
1920
- exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1921
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1389
+ return __decorateServiceException(exception, parsedOutput.body);
1390
+ };
1391
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1392
+ const contents = map({});
1393
+ const data = parsedOutput.body;
1394
+ if (data.code != null) {
1395
+ contents.code = __expectString(data.code);
1396
+ }
1397
+ if (data.message != null) {
1398
+ contents.message = __expectString(data.message);
1399
+ }
1400
+ const exception = new ValidationException({
1401
+ $metadata: deserializeMetadata(parsedOutput),
1402
+ ...contents,
1922
1403
  });
1923
- }); };
1924
- var serializeAws_restJson1Destination = function (input, context) {
1925
- return __assign({}, (input.s3 != null && { s3: serializeAws_restJson1S3Destination(input.s3, context) }));
1404
+ return __decorateServiceException(exception, parsedOutput.body);
1926
1405
  };
1927
- var serializeAws_restJson1S3Destination = function (input, context) {
1928
- return __assign(__assign({}, (input.bucketName != null && { bucketName: input.bucketName })), (input.prefix != null && { prefix: input.prefix }));
1406
+ const serializeAws_restJson1Destination = (input, context) => {
1407
+ return {
1408
+ ...(input.s3 != null && { s3: serializeAws_restJson1S3Destination(input.s3, context) }),
1409
+ };
1929
1410
  };
1930
- var serializeAws_restJson1S3Source = function (input, context) {
1931
- return __assign(__assign(__assign({}, (input.bucketName != null && { bucketName: input.bucketName })), (input.key != null && { key: input.key })), (input.version != null && { version: input.version }));
1411
+ const serializeAws_restJson1S3Destination = (input, context) => {
1412
+ return {
1413
+ ...(input.bucketName != null && { bucketName: input.bucketName }),
1414
+ ...(input.prefix != null && { prefix: input.prefix }),
1415
+ };
1932
1416
  };
1933
- var serializeAws_restJson1SignatureValidityPeriod = function (input, context) {
1934
- return __assign(__assign({}, (input.type != null && { type: input.type })), (input.value != null && { value: input.value }));
1417
+ const serializeAws_restJson1S3Source = (input, context) => {
1418
+ return {
1419
+ ...(input.bucketName != null && { bucketName: input.bucketName }),
1420
+ ...(input.key != null && { key: input.key }),
1421
+ ...(input.version != null && { version: input.version }),
1422
+ };
1935
1423
  };
1936
- var serializeAws_restJson1SigningConfigurationOverrides = function (input, context) {
1937
- return __assign(__assign({}, (input.encryptionAlgorithm != null && { encryptionAlgorithm: input.encryptionAlgorithm })), (input.hashAlgorithm != null && { hashAlgorithm: input.hashAlgorithm }));
1424
+ const serializeAws_restJson1SignatureValidityPeriod = (input, context) => {
1425
+ return {
1426
+ ...(input.type != null && { type: input.type }),
1427
+ ...(input.value != null && { value: input.value }),
1428
+ };
1938
1429
  };
1939
- var serializeAws_restJson1SigningMaterial = function (input, context) {
1940
- return __assign({}, (input.certificateArn != null && { certificateArn: input.certificateArn }));
1430
+ const serializeAws_restJson1SigningConfigurationOverrides = (input, context) => {
1431
+ return {
1432
+ ...(input.encryptionAlgorithm != null && { encryptionAlgorithm: input.encryptionAlgorithm }),
1433
+ ...(input.hashAlgorithm != null && { hashAlgorithm: input.hashAlgorithm }),
1434
+ };
1941
1435
  };
1942
- var serializeAws_restJson1SigningParameters = function (input, context) {
1943
- return Object.entries(input).reduce(function (acc, _a) {
1944
- var _b;
1945
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1436
+ const serializeAws_restJson1SigningMaterial = (input, context) => {
1437
+ return {
1438
+ ...(input.certificateArn != null && { certificateArn: input.certificateArn }),
1439
+ };
1440
+ };
1441
+ const serializeAws_restJson1SigningParameters = (input, context) => {
1442
+ return Object.entries(input).reduce((acc, [key, value]) => {
1946
1443
  if (value === null) {
1947
1444
  return acc;
1948
1445
  }
1949
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1446
+ return {
1447
+ ...acc,
1448
+ [key]: value,
1449
+ };
1950
1450
  }, {});
1951
1451
  };
1952
- var serializeAws_restJson1SigningPlatformOverrides = function (input, context) {
1953
- return __assign(__assign({}, (input.signingConfiguration != null && {
1954
- signingConfiguration: serializeAws_restJson1SigningConfigurationOverrides(input.signingConfiguration, context),
1955
- })), (input.signingImageFormat != null && { signingImageFormat: input.signingImageFormat }));
1452
+ const serializeAws_restJson1SigningPlatformOverrides = (input, context) => {
1453
+ return {
1454
+ ...(input.signingConfiguration != null && {
1455
+ signingConfiguration: serializeAws_restJson1SigningConfigurationOverrides(input.signingConfiguration, context),
1456
+ }),
1457
+ ...(input.signingImageFormat != null && { signingImageFormat: input.signingImageFormat }),
1458
+ };
1956
1459
  };
1957
- var serializeAws_restJson1Source = function (input, context) {
1958
- return __assign({}, (input.s3 != null && { s3: serializeAws_restJson1S3Source(input.s3, context) }));
1460
+ const serializeAws_restJson1Source = (input, context) => {
1461
+ return {
1462
+ ...(input.s3 != null && { s3: serializeAws_restJson1S3Source(input.s3, context) }),
1463
+ };
1959
1464
  };
1960
- var serializeAws_restJson1TagMap = function (input, context) {
1961
- return Object.entries(input).reduce(function (acc, _a) {
1962
- var _b;
1963
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1465
+ const serializeAws_restJson1TagMap = (input, context) => {
1466
+ return Object.entries(input).reduce((acc, [key, value]) => {
1964
1467
  if (value === null) {
1965
1468
  return acc;
1966
1469
  }
1967
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1470
+ return {
1471
+ ...acc,
1472
+ [key]: value,
1473
+ };
1968
1474
  }, {});
1969
1475
  };
1970
- var deserializeAws_restJson1EncryptionAlgorithmOptions = function (output, context) {
1476
+ const deserializeAws_restJson1EncryptionAlgorithmOptions = (output, context) => {
1971
1477
  return {
1972
1478
  allowedValues: output.allowedValues != null
1973
1479
  ? deserializeAws_restJson1EncryptionAlgorithms(output.allowedValues, context)
@@ -1975,10 +1481,10 @@ var deserializeAws_restJson1EncryptionAlgorithmOptions = function (output, conte
1975
1481
  defaultValue: __expectString(output.defaultValue),
1976
1482
  };
1977
1483
  };
1978
- var deserializeAws_restJson1EncryptionAlgorithms = function (output, context) {
1979
- var retVal = (output || [])
1980
- .filter(function (e) { return e != null; })
1981
- .map(function (entry) {
1484
+ const deserializeAws_restJson1EncryptionAlgorithms = (output, context) => {
1485
+ const retVal = (output || [])
1486
+ .filter((e) => e != null)
1487
+ .map((entry) => {
1982
1488
  if (entry === null) {
1983
1489
  return null;
1984
1490
  }
@@ -1986,16 +1492,16 @@ var deserializeAws_restJson1EncryptionAlgorithms = function (output, context) {
1986
1492
  });
1987
1493
  return retVal;
1988
1494
  };
1989
- var deserializeAws_restJson1HashAlgorithmOptions = function (output, context) {
1495
+ const deserializeAws_restJson1HashAlgorithmOptions = (output, context) => {
1990
1496
  return {
1991
1497
  allowedValues: output.allowedValues != null ? deserializeAws_restJson1HashAlgorithms(output.allowedValues, context) : undefined,
1992
1498
  defaultValue: __expectString(output.defaultValue),
1993
1499
  };
1994
1500
  };
1995
- var deserializeAws_restJson1HashAlgorithms = function (output, context) {
1996
- var retVal = (output || [])
1997
- .filter(function (e) { return e != null; })
1998
- .map(function (entry) {
1501
+ const deserializeAws_restJson1HashAlgorithms = (output, context) => {
1502
+ const retVal = (output || [])
1503
+ .filter((e) => e != null)
1504
+ .map((entry) => {
1999
1505
  if (entry === null) {
2000
1506
  return null;
2001
1507
  }
@@ -2003,10 +1509,10 @@ var deserializeAws_restJson1HashAlgorithms = function (output, context) {
2003
1509
  });
2004
1510
  return retVal;
2005
1511
  };
2006
- var deserializeAws_restJson1ImageFormats = function (output, context) {
2007
- var retVal = (output || [])
2008
- .filter(function (e) { return e != null; })
2009
- .map(function (entry) {
1512
+ const deserializeAws_restJson1ImageFormats = (output, context) => {
1513
+ const retVal = (output || [])
1514
+ .filter((e) => e != null)
1515
+ .map((entry) => {
2010
1516
  if (entry === null) {
2011
1517
  return null;
2012
1518
  }
@@ -2014,7 +1520,7 @@ var deserializeAws_restJson1ImageFormats = function (output, context) {
2014
1520
  });
2015
1521
  return retVal;
2016
1522
  };
2017
- var deserializeAws_restJson1Permission = function (output, context) {
1523
+ const deserializeAws_restJson1Permission = (output, context) => {
2018
1524
  return {
2019
1525
  action: __expectString(output.action),
2020
1526
  principal: __expectString(output.principal),
@@ -2022,10 +1528,10 @@ var deserializeAws_restJson1Permission = function (output, context) {
2022
1528
  statementId: __expectString(output.statementId),
2023
1529
  };
2024
1530
  };
2025
- var deserializeAws_restJson1Permissions = function (output, context) {
2026
- var retVal = (output || [])
2027
- .filter(function (e) { return e != null; })
2028
- .map(function (entry) {
1531
+ const deserializeAws_restJson1Permissions = (output, context) => {
1532
+ const retVal = (output || [])
1533
+ .filter((e) => e != null)
1534
+ .map((entry) => {
2029
1535
  if (entry === null) {
2030
1536
  return null;
2031
1537
  }
@@ -2033,31 +1539,31 @@ var deserializeAws_restJson1Permissions = function (output, context) {
2033
1539
  });
2034
1540
  return retVal;
2035
1541
  };
2036
- var deserializeAws_restJson1S3SignedObject = function (output, context) {
1542
+ const deserializeAws_restJson1S3SignedObject = (output, context) => {
2037
1543
  return {
2038
1544
  bucketName: __expectString(output.bucketName),
2039
1545
  key: __expectString(output.key),
2040
1546
  };
2041
1547
  };
2042
- var deserializeAws_restJson1S3Source = function (output, context) {
1548
+ const deserializeAws_restJson1S3Source = (output, context) => {
2043
1549
  return {
2044
1550
  bucketName: __expectString(output.bucketName),
2045
1551
  key: __expectString(output.key),
2046
1552
  version: __expectString(output.version),
2047
1553
  };
2048
1554
  };
2049
- var deserializeAws_restJson1SignatureValidityPeriod = function (output, context) {
1555
+ const deserializeAws_restJson1SignatureValidityPeriod = (output, context) => {
2050
1556
  return {
2051
1557
  type: __expectString(output.type),
2052
1558
  value: __expectInt32(output.value),
2053
1559
  };
2054
1560
  };
2055
- var deserializeAws_restJson1SignedObject = function (output, context) {
1561
+ const deserializeAws_restJson1SignedObject = (output, context) => {
2056
1562
  return {
2057
1563
  s3: output.s3 != null ? deserializeAws_restJson1S3SignedObject(output.s3, context) : undefined,
2058
1564
  };
2059
1565
  };
2060
- var deserializeAws_restJson1SigningConfiguration = function (output, context) {
1566
+ const deserializeAws_restJson1SigningConfiguration = (output, context) => {
2061
1567
  return {
2062
1568
  encryptionAlgorithmOptions: output.encryptionAlgorithmOptions != null
2063
1569
  ? deserializeAws_restJson1EncryptionAlgorithmOptions(output.encryptionAlgorithmOptions, context)
@@ -2067,13 +1573,13 @@ var deserializeAws_restJson1SigningConfiguration = function (output, context) {
2067
1573
  : undefined,
2068
1574
  };
2069
1575
  };
2070
- var deserializeAws_restJson1SigningConfigurationOverrides = function (output, context) {
1576
+ const deserializeAws_restJson1SigningConfigurationOverrides = (output, context) => {
2071
1577
  return {
2072
1578
  encryptionAlgorithm: __expectString(output.encryptionAlgorithm),
2073
1579
  hashAlgorithm: __expectString(output.hashAlgorithm),
2074
1580
  };
2075
1581
  };
2076
- var deserializeAws_restJson1SigningImageFormat = function (output, context) {
1582
+ const deserializeAws_restJson1SigningImageFormat = (output, context) => {
2077
1583
  return {
2078
1584
  defaultFormat: __expectString(output.defaultFormat),
2079
1585
  supportedFormats: output.supportedFormats != null
@@ -2081,7 +1587,7 @@ var deserializeAws_restJson1SigningImageFormat = function (output, context) {
2081
1587
  : undefined,
2082
1588
  };
2083
1589
  };
2084
- var deserializeAws_restJson1SigningJob = function (output, context) {
1590
+ const deserializeAws_restJson1SigningJob = (output, context) => {
2085
1591
  return {
2086
1592
  createdAt: output.createdAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt))) : undefined,
2087
1593
  isRevoked: __expectBoolean(output.isRevoked),
@@ -2103,17 +1609,17 @@ var deserializeAws_restJson1SigningJob = function (output, context) {
2103
1609
  status: __expectString(output.status),
2104
1610
  };
2105
1611
  };
2106
- var deserializeAws_restJson1SigningJobRevocationRecord = function (output, context) {
1612
+ const deserializeAws_restJson1SigningJobRevocationRecord = (output, context) => {
2107
1613
  return {
2108
1614
  reason: __expectString(output.reason),
2109
1615
  revokedAt: output.revokedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.revokedAt))) : undefined,
2110
1616
  revokedBy: __expectString(output.revokedBy),
2111
1617
  };
2112
1618
  };
2113
- var deserializeAws_restJson1SigningJobs = function (output, context) {
2114
- var retVal = (output || [])
2115
- .filter(function (e) { return e != null; })
2116
- .map(function (entry) {
1619
+ const deserializeAws_restJson1SigningJobs = (output, context) => {
1620
+ const retVal = (output || [])
1621
+ .filter((e) => e != null)
1622
+ .map((entry) => {
2117
1623
  if (entry === null) {
2118
1624
  return null;
2119
1625
  }
@@ -2121,22 +1627,23 @@ var deserializeAws_restJson1SigningJobs = function (output, context) {
2121
1627
  });
2122
1628
  return retVal;
2123
1629
  };
2124
- var deserializeAws_restJson1SigningMaterial = function (output, context) {
1630
+ const deserializeAws_restJson1SigningMaterial = (output, context) => {
2125
1631
  return {
2126
1632
  certificateArn: __expectString(output.certificateArn),
2127
1633
  };
2128
1634
  };
2129
- var deserializeAws_restJson1SigningParameters = function (output, context) {
2130
- return Object.entries(output).reduce(function (acc, _a) {
2131
- var _b;
2132
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1635
+ const deserializeAws_restJson1SigningParameters = (output, context) => {
1636
+ return Object.entries(output).reduce((acc, [key, value]) => {
2133
1637
  if (value === null) {
2134
1638
  return acc;
2135
1639
  }
2136
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1640
+ return {
1641
+ ...acc,
1642
+ [key]: __expectString(value),
1643
+ };
2137
1644
  }, {});
2138
1645
  };
2139
- var deserializeAws_restJson1SigningPlatform = function (output, context) {
1646
+ const deserializeAws_restJson1SigningPlatform = (output, context) => {
2140
1647
  return {
2141
1648
  category: __expectString(output.category),
2142
1649
  displayName: __expectString(output.displayName),
@@ -2153,7 +1660,7 @@ var deserializeAws_restJson1SigningPlatform = function (output, context) {
2153
1660
  target: __expectString(output.target),
2154
1661
  };
2155
1662
  };
2156
- var deserializeAws_restJson1SigningPlatformOverrides = function (output, context) {
1663
+ const deserializeAws_restJson1SigningPlatformOverrides = (output, context) => {
2157
1664
  return {
2158
1665
  signingConfiguration: output.signingConfiguration != null
2159
1666
  ? deserializeAws_restJson1SigningConfigurationOverrides(output.signingConfiguration, context)
@@ -2161,10 +1668,10 @@ var deserializeAws_restJson1SigningPlatformOverrides = function (output, context
2161
1668
  signingImageFormat: __expectString(output.signingImageFormat),
2162
1669
  };
2163
1670
  };
2164
- var deserializeAws_restJson1SigningPlatforms = function (output, context) {
2165
- var retVal = (output || [])
2166
- .filter(function (e) { return e != null; })
2167
- .map(function (entry) {
1671
+ const deserializeAws_restJson1SigningPlatforms = (output, context) => {
1672
+ const retVal = (output || [])
1673
+ .filter((e) => e != null)
1674
+ .map((entry) => {
2168
1675
  if (entry === null) {
2169
1676
  return null;
2170
1677
  }
@@ -2172,7 +1679,7 @@ var deserializeAws_restJson1SigningPlatforms = function (output, context) {
2172
1679
  });
2173
1680
  return retVal;
2174
1681
  };
2175
- var deserializeAws_restJson1SigningProfile = function (output, context) {
1682
+ const deserializeAws_restJson1SigningProfile = (output, context) => {
2176
1683
  return {
2177
1684
  arn: __expectString(output.arn),
2178
1685
  platformDisplayName: __expectString(output.platformDisplayName),
@@ -2193,7 +1700,7 @@ var deserializeAws_restJson1SigningProfile = function (output, context) {
2193
1700
  tags: output.tags != null ? deserializeAws_restJson1TagMap(output.tags, context) : undefined,
2194
1701
  };
2195
1702
  };
2196
- var deserializeAws_restJson1SigningProfileRevocationRecord = function (output, context) {
1703
+ const deserializeAws_restJson1SigningProfileRevocationRecord = (output, context) => {
2197
1704
  return {
2198
1705
  revocationEffectiveFrom: output.revocationEffectiveFrom != null
2199
1706
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.revocationEffectiveFrom)))
@@ -2202,10 +1709,10 @@ var deserializeAws_restJson1SigningProfileRevocationRecord = function (output, c
2202
1709
  revokedBy: __expectString(output.revokedBy),
2203
1710
  };
2204
1711
  };
2205
- var deserializeAws_restJson1SigningProfiles = function (output, context) {
2206
- var retVal = (output || [])
2207
- .filter(function (e) { return e != null; })
2208
- .map(function (entry) {
1712
+ const deserializeAws_restJson1SigningProfiles = (output, context) => {
1713
+ const retVal = (output || [])
1714
+ .filter((e) => e != null)
1715
+ .map((entry) => {
2209
1716
  if (entry === null) {
2210
1717
  return null;
2211
1718
  }
@@ -2213,72 +1720,55 @@ var deserializeAws_restJson1SigningProfiles = function (output, context) {
2213
1720
  });
2214
1721
  return retVal;
2215
1722
  };
2216
- var deserializeAws_restJson1Source = function (output, context) {
1723
+ const deserializeAws_restJson1Source = (output, context) => {
2217
1724
  return {
2218
1725
  s3: output.s3 != null ? deserializeAws_restJson1S3Source(output.s3, context) : undefined,
2219
1726
  };
2220
1727
  };
2221
- var deserializeAws_restJson1TagMap = function (output, context) {
2222
- return Object.entries(output).reduce(function (acc, _a) {
2223
- var _b;
2224
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1728
+ const deserializeAws_restJson1TagMap = (output, context) => {
1729
+ return Object.entries(output).reduce((acc, [key, value]) => {
2225
1730
  if (value === null) {
2226
1731
  return acc;
2227
1732
  }
2228
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1733
+ return {
1734
+ ...acc,
1735
+ [key]: __expectString(value),
1736
+ };
2229
1737
  }, {});
2230
1738
  };
2231
- var deserializeMetadata = function (output) {
2232
- var _a, _b;
2233
- return ({
2234
- httpStatusCode: output.statusCode,
2235
- requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
2236
- extendedRequestId: output.headers["x-amz-id-2"],
2237
- cfId: output.headers["x-amz-cf-id"],
2238
- });
2239
- };
2240
- var collectBody = function (streamBody, context) {
2241
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
1739
+ const deserializeMetadata = (output) => ({
1740
+ httpStatusCode: output.statusCode,
1741
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1742
+ extendedRequestId: output.headers["x-amz-id-2"],
1743
+ cfId: output.headers["x-amz-cf-id"],
1744
+ });
1745
+ const collectBody = (streamBody = new Uint8Array(), context) => {
2242
1746
  if (streamBody instanceof Uint8Array) {
2243
1747
  return Promise.resolve(streamBody);
2244
1748
  }
2245
1749
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2246
1750
  };
2247
- var collectBodyString = function (streamBody, context) {
2248
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
2249
- };
2250
- var isSerializableHeaderValue = function (value) {
2251
- return value !== undefined &&
2252
- value !== null &&
2253
- value !== "" &&
2254
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2255
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1751
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1752
+ const isSerializableHeaderValue = (value) => value !== undefined &&
1753
+ value !== null &&
1754
+ value !== "" &&
1755
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1756
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1757
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1758
+ if (encoded.length) {
1759
+ return JSON.parse(encoded);
1760
+ }
1761
+ return {};
1762
+ });
1763
+ const parseErrorBody = async (errorBody, context) => {
1764
+ const value = await parseBody(errorBody, context);
1765
+ value.message = value.message ?? value.Message;
1766
+ return value;
2256
1767
  };
2257
- var parseBody = function (streamBody, context) {
2258
- return collectBodyString(streamBody, context).then(function (encoded) {
2259
- if (encoded.length) {
2260
- return JSON.parse(encoded);
2261
- }
2262
- return {};
2263
- });
2264
- };
2265
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
2266
- var value;
2267
- var _a;
2268
- return __generator(this, function (_b) {
2269
- switch (_b.label) {
2270
- case 0: return [4, parseBody(errorBody, context)];
2271
- case 1:
2272
- value = _b.sent();
2273
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
2274
- return [2, value];
2275
- }
2276
- });
2277
- }); };
2278
- var loadRestJsonErrorCode = function (output, data) {
2279
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
2280
- var sanitizeErrorCode = function (rawValue) {
2281
- var cleanValue = rawValue;
1768
+ const loadRestJsonErrorCode = (output, data) => {
1769
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1770
+ const sanitizeErrorCode = (rawValue) => {
1771
+ let cleanValue = rawValue;
2282
1772
  if (typeof cleanValue === "number") {
2283
1773
  cleanValue = cleanValue.toString();
2284
1774
  }
@@ -2293,7 +1783,7 @@ var loadRestJsonErrorCode = function (output, data) {
2293
1783
  }
2294
1784
  return cleanValue;
2295
1785
  };
2296
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1786
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
2297
1787
  if (headerKey !== undefined) {
2298
1788
  return sanitizeErrorCode(output.headers[headerKey]);
2299
1789
  }