@aws-sdk/client-serverlessapplicationrepository 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 (29) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist-es/ServerlessApplicationRepository.js +58 -65
  3. package/dist-es/ServerlessApplicationRepositoryClient.js +22 -28
  4. package/dist-es/commands/CreateApplicationCommand.js +21 -28
  5. package/dist-es/commands/CreateApplicationVersionCommand.js +21 -28
  6. package/dist-es/commands/CreateCloudFormationChangeSetCommand.js +21 -28
  7. package/dist-es/commands/CreateCloudFormationTemplateCommand.js +21 -28
  8. package/dist-es/commands/DeleteApplicationCommand.js +22 -29
  9. package/dist-es/commands/GetApplicationCommand.js +21 -28
  10. package/dist-es/commands/GetApplicationPolicyCommand.js +21 -28
  11. package/dist-es/commands/GetCloudFormationTemplateCommand.js +21 -28
  12. package/dist-es/commands/ListApplicationDependenciesCommand.js +21 -28
  13. package/dist-es/commands/ListApplicationVersionsCommand.js +21 -28
  14. package/dist-es/commands/ListApplicationsCommand.js +21 -28
  15. package/dist-es/commands/PutApplicationPolicyCommand.js +21 -28
  16. package/dist-es/commands/UnshareApplicationCommand.js +22 -29
  17. package/dist-es/commands/UpdateApplicationCommand.js +21 -28
  18. package/dist-es/endpoints.js +8 -8
  19. package/dist-es/models/ServerlessApplicationRepositoryServiceException.js +5 -10
  20. package/dist-es/models/models_0.js +186 -115
  21. package/dist-es/pagination/ListApplicationDependenciesPaginator.js +25 -68
  22. package/dist-es/pagination/ListApplicationVersionsPaginator.js +25 -68
  23. package/dist-es/pagination/ListApplicationsPaginator.js +25 -68
  24. package/dist-es/protocols/Aws_restJson1.js +1291 -1704
  25. package/dist-es/runtimeConfig.browser.js +26 -12
  26. package/dist-es/runtimeConfig.js +30 -12
  27. package/dist-es/runtimeConfig.native.js +8 -5
  28. package/dist-es/runtimeConfig.shared.js +8 -11
  29. package/package.json +33 -33
@@ -1,1705 +1,1310 @@
1
- import { __assign, __awaiter, __generator } 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, expectObject as __expectObject, expectString as __expectString, map as __map, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { BadRequestException, ConflictException, ForbiddenException, InternalServerErrorException, NotFoundException, TooManyRequestsException, } from "../models/models_0";
5
4
  import { ServerlessApplicationRepositoryServiceException as __BaseException } from "../models/ServerlessApplicationRepositoryServiceException";
6
- export var serializeAws_restJson1CreateApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
8
- return __generator(this, function (_c) {
9
- switch (_c.label) {
10
- case 0: return [4, context.endpoint()];
11
- case 1:
12
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
- headers = {
14
- "content-type": "application/json",
15
- };
16
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications";
17
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.Author != null && { author: input.Author })), (input.Description != null && { description: input.Description })), (input.HomePageUrl != null && { homePageUrl: input.HomePageUrl })), (input.Labels != null && { labels: serializeAws_restJson1__listOf__string(input.Labels, context) })), (input.LicenseBody != null && { licenseBody: input.LicenseBody })), (input.LicenseUrl != null && { licenseUrl: input.LicenseUrl })), (input.Name != null && { name: input.Name })), (input.ReadmeBody != null && { readmeBody: input.ReadmeBody })), (input.ReadmeUrl != null && { readmeUrl: input.ReadmeUrl })), (input.SemanticVersion != null && { semanticVersion: input.SemanticVersion })), (input.SourceCodeArchiveUrl != null && { sourceCodeArchiveUrl: input.SourceCodeArchiveUrl })), (input.SourceCodeUrl != null && { sourceCodeUrl: input.SourceCodeUrl })), (input.SpdxLicenseId != null && { spdxLicenseId: input.SpdxLicenseId })), (input.TemplateBody != null && { templateBody: input.TemplateBody })), (input.TemplateUrl != null && { templateUrl: input.TemplateUrl })));
18
- return [2, new __HttpRequest({
19
- protocol: protocol,
20
- hostname: hostname,
21
- port: port,
22
- method: "POST",
23
- headers: headers,
24
- path: resolvedPath,
25
- body: body,
26
- })];
27
- }
28
- });
29
- }); };
30
- export var serializeAws_restJson1CreateApplicationVersionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
31
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
32
- return __generator(this, function (_c) {
33
- switch (_c.label) {
34
- case 0: return [4, context.endpoint()];
35
- case 1:
36
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
37
- headers = {
38
- "content-type": "application/json",
39
- };
40
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
41
- "/applications/{ApplicationId}/versions/{SemanticVersion}";
42
- resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
43
- resolvedPath = __resolvedPath(resolvedPath, input, "SemanticVersion", function () { return input.SemanticVersion; }, "{SemanticVersion}", false);
44
- body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.SourceCodeArchiveUrl != null && { sourceCodeArchiveUrl: input.SourceCodeArchiveUrl })), (input.SourceCodeUrl != null && { sourceCodeUrl: input.SourceCodeUrl })), (input.TemplateBody != null && { templateBody: input.TemplateBody })), (input.TemplateUrl != null && { templateUrl: input.TemplateUrl })));
45
- return [2, new __HttpRequest({
46
- protocol: protocol,
47
- hostname: hostname,
48
- port: port,
49
- method: "PUT",
50
- headers: headers,
51
- path: resolvedPath,
52
- body: body,
53
- })];
54
- }
55
- });
56
- }); };
57
- export var serializeAws_restJson1CreateCloudFormationChangeSetCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
58
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
59
- return __generator(this, function (_c) {
60
- switch (_c.label) {
61
- case 0: return [4, context.endpoint()];
62
- case 1:
63
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
64
- headers = {
65
- "content-type": "application/json",
66
- };
67
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{ApplicationId}/changesets";
68
- resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
69
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.Capabilities != null && {
70
- capabilities: serializeAws_restJson1__listOf__string(input.Capabilities, context),
71
- })), (input.ChangeSetName != null && { changeSetName: input.ChangeSetName })), (input.ClientToken != null && { clientToken: input.ClientToken })), (input.Description != null && { description: input.Description })), (input.NotificationArns != null && {
72
- notificationArns: serializeAws_restJson1__listOf__string(input.NotificationArns, context),
73
- })), (input.ParameterOverrides != null && {
74
- parameterOverrides: serializeAws_restJson1__listOfParameterValue(input.ParameterOverrides, context),
75
- })), (input.ResourceTypes != null && {
76
- resourceTypes: serializeAws_restJson1__listOf__string(input.ResourceTypes, context),
77
- })), (input.RollbackConfiguration != null && {
78
- rollbackConfiguration: serializeAws_restJson1RollbackConfiguration(input.RollbackConfiguration, context),
79
- })), (input.SemanticVersion != null && { semanticVersion: input.SemanticVersion })), (input.StackName != null && { stackName: input.StackName })), (input.Tags != null && { tags: serializeAws_restJson1__listOfTag(input.Tags, context) })), (input.TemplateId != null && { templateId: input.TemplateId })));
80
- return [2, new __HttpRequest({
81
- protocol: protocol,
82
- hostname: hostname,
83
- port: port,
84
- method: "POST",
85
- headers: headers,
86
- path: resolvedPath,
87
- body: body,
88
- })];
89
- }
90
- });
91
- }); };
92
- export var serializeAws_restJson1CreateCloudFormationTemplateCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
93
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
94
- return __generator(this, function (_c) {
95
- switch (_c.label) {
96
- case 0: return [4, context.endpoint()];
97
- case 1:
98
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
99
- headers = {
100
- "content-type": "application/json",
101
- };
102
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{ApplicationId}/templates";
103
- resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
104
- body = JSON.stringify(__assign({}, (input.SemanticVersion != null && { semanticVersion: input.SemanticVersion })));
105
- return [2, new __HttpRequest({
106
- protocol: protocol,
107
- hostname: hostname,
108
- port: port,
109
- method: "POST",
110
- headers: headers,
111
- path: resolvedPath,
112
- body: body,
113
- })];
114
- }
5
+ export const serializeAws_restJson1CreateApplicationCommand = async (input, context) => {
6
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
+ const headers = {
8
+ "content-type": "application/json",
9
+ };
10
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications";
11
+ let body;
12
+ body = JSON.stringify({
13
+ ...(input.Author != null && { author: input.Author }),
14
+ ...(input.Description != null && { description: input.Description }),
15
+ ...(input.HomePageUrl != null && { homePageUrl: input.HomePageUrl }),
16
+ ...(input.Labels != null && { labels: serializeAws_restJson1__listOf__string(input.Labels, context) }),
17
+ ...(input.LicenseBody != null && { licenseBody: input.LicenseBody }),
18
+ ...(input.LicenseUrl != null && { licenseUrl: input.LicenseUrl }),
19
+ ...(input.Name != null && { name: input.Name }),
20
+ ...(input.ReadmeBody != null && { readmeBody: input.ReadmeBody }),
21
+ ...(input.ReadmeUrl != null && { readmeUrl: input.ReadmeUrl }),
22
+ ...(input.SemanticVersion != null && { semanticVersion: input.SemanticVersion }),
23
+ ...(input.SourceCodeArchiveUrl != null && { sourceCodeArchiveUrl: input.SourceCodeArchiveUrl }),
24
+ ...(input.SourceCodeUrl != null && { sourceCodeUrl: input.SourceCodeUrl }),
25
+ ...(input.SpdxLicenseId != null && { spdxLicenseId: input.SpdxLicenseId }),
26
+ ...(input.TemplateBody != null && { templateBody: input.TemplateBody }),
27
+ ...(input.TemplateUrl != null && { templateUrl: input.TemplateUrl }),
115
28
  });
116
- }); };
117
- export var serializeAws_restJson1DeleteApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
118
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
119
- return __generator(this, function (_c) {
120
- switch (_c.label) {
121
- case 0: return [4, context.endpoint()];
122
- case 1:
123
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
124
- headers = {};
125
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{ApplicationId}";
126
- resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
127
- return [2, new __HttpRequest({
128
- protocol: protocol,
129
- hostname: hostname,
130
- port: port,
131
- method: "DELETE",
132
- headers: headers,
133
- path: resolvedPath,
134
- body: body,
135
- })];
136
- }
29
+ return new __HttpRequest({
30
+ protocol,
31
+ hostname,
32
+ port,
33
+ method: "POST",
34
+ headers,
35
+ path: resolvedPath,
36
+ body,
137
37
  });
138
- }); };
139
- export var serializeAws_restJson1GetApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
140
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
141
- return __generator(this, function (_c) {
142
- switch (_c.label) {
143
- case 0: return [4, context.endpoint()];
144
- case 1:
145
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
146
- headers = {};
147
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{ApplicationId}";
148
- resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
149
- query = map({
150
- semanticVersion: [, input.SemanticVersion],
151
- });
152
- return [2, new __HttpRequest({
153
- protocol: protocol,
154
- hostname: hostname,
155
- port: port,
156
- method: "GET",
157
- headers: headers,
158
- path: resolvedPath,
159
- query: query,
160
- body: body,
161
- })];
162
- }
38
+ };
39
+ export const serializeAws_restJson1CreateApplicationVersionCommand = async (input, context) => {
40
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
41
+ const headers = {
42
+ "content-type": "application/json",
43
+ };
44
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
45
+ "/applications/{ApplicationId}/versions/{SemanticVersion}";
46
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
47
+ resolvedPath = __resolvedPath(resolvedPath, input, "SemanticVersion", () => input.SemanticVersion, "{SemanticVersion}", false);
48
+ let body;
49
+ body = JSON.stringify({
50
+ ...(input.SourceCodeArchiveUrl != null && { sourceCodeArchiveUrl: input.SourceCodeArchiveUrl }),
51
+ ...(input.SourceCodeUrl != null && { sourceCodeUrl: input.SourceCodeUrl }),
52
+ ...(input.TemplateBody != null && { templateBody: input.TemplateBody }),
53
+ ...(input.TemplateUrl != null && { templateUrl: input.TemplateUrl }),
163
54
  });
164
- }); };
165
- export var serializeAws_restJson1GetApplicationPolicyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
166
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
167
- return __generator(this, function (_c) {
168
- switch (_c.label) {
169
- case 0: return [4, context.endpoint()];
170
- case 1:
171
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
172
- headers = {};
173
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{ApplicationId}/policy";
174
- resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
175
- return [2, new __HttpRequest({
176
- protocol: protocol,
177
- hostname: hostname,
178
- port: port,
179
- method: "GET",
180
- headers: headers,
181
- path: resolvedPath,
182
- body: body,
183
- })];
184
- }
55
+ return new __HttpRequest({
56
+ protocol,
57
+ hostname,
58
+ port,
59
+ method: "PUT",
60
+ headers,
61
+ path: resolvedPath,
62
+ body,
185
63
  });
186
- }); };
187
- export var serializeAws_restJson1GetCloudFormationTemplateCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
188
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
189
- return __generator(this, function (_c) {
190
- switch (_c.label) {
191
- case 0: return [4, context.endpoint()];
192
- case 1:
193
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
194
- headers = {};
195
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
196
- "/applications/{ApplicationId}/templates/{TemplateId}";
197
- resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
198
- resolvedPath = __resolvedPath(resolvedPath, input, "TemplateId", function () { return input.TemplateId; }, "{TemplateId}", false);
199
- return [2, new __HttpRequest({
200
- protocol: protocol,
201
- hostname: hostname,
202
- port: port,
203
- method: "GET",
204
- headers: headers,
205
- path: resolvedPath,
206
- body: body,
207
- })];
208
- }
64
+ };
65
+ export const serializeAws_restJson1CreateCloudFormationChangeSetCommand = async (input, context) => {
66
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
67
+ const headers = {
68
+ "content-type": "application/json",
69
+ };
70
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}/changesets";
71
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
72
+ let body;
73
+ body = JSON.stringify({
74
+ ...(input.Capabilities != null && {
75
+ capabilities: serializeAws_restJson1__listOf__string(input.Capabilities, context),
76
+ }),
77
+ ...(input.ChangeSetName != null && { changeSetName: input.ChangeSetName }),
78
+ ...(input.ClientToken != null && { clientToken: input.ClientToken }),
79
+ ...(input.Description != null && { description: input.Description }),
80
+ ...(input.NotificationArns != null && {
81
+ notificationArns: serializeAws_restJson1__listOf__string(input.NotificationArns, context),
82
+ }),
83
+ ...(input.ParameterOverrides != null && {
84
+ parameterOverrides: serializeAws_restJson1__listOfParameterValue(input.ParameterOverrides, context),
85
+ }),
86
+ ...(input.ResourceTypes != null && {
87
+ resourceTypes: serializeAws_restJson1__listOf__string(input.ResourceTypes, context),
88
+ }),
89
+ ...(input.RollbackConfiguration != null && {
90
+ rollbackConfiguration: serializeAws_restJson1RollbackConfiguration(input.RollbackConfiguration, context),
91
+ }),
92
+ ...(input.SemanticVersion != null && { semanticVersion: input.SemanticVersion }),
93
+ ...(input.StackName != null && { stackName: input.StackName }),
94
+ ...(input.Tags != null && { tags: serializeAws_restJson1__listOfTag(input.Tags, context) }),
95
+ ...(input.TemplateId != null && { templateId: input.TemplateId }),
209
96
  });
210
- }); };
211
- export var serializeAws_restJson1ListApplicationDependenciesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
212
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
213
- return __generator(this, function (_c) {
214
- switch (_c.label) {
215
- case 0: return [4, context.endpoint()];
216
- case 1:
217
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
218
- headers = {};
219
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
220
- "/applications/{ApplicationId}/dependencies";
221
- resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
222
- query = map({
223
- maxItems: [function () { return input.MaxItems !== void 0; }, function () { return input.MaxItems.toString(); }],
224
- nextToken: [, input.NextToken],
225
- semanticVersion: [, input.SemanticVersion],
226
- });
227
- return [2, new __HttpRequest({
228
- protocol: protocol,
229
- hostname: hostname,
230
- port: port,
231
- method: "GET",
232
- headers: headers,
233
- path: resolvedPath,
234
- query: query,
235
- body: body,
236
- })];
237
- }
97
+ return new __HttpRequest({
98
+ protocol,
99
+ hostname,
100
+ port,
101
+ method: "POST",
102
+ headers,
103
+ path: resolvedPath,
104
+ body,
238
105
  });
239
- }); };
240
- export var serializeAws_restJson1ListApplicationsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
241
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
242
- return __generator(this, function (_c) {
243
- switch (_c.label) {
244
- case 0: return [4, context.endpoint()];
245
- case 1:
246
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
247
- headers = {};
248
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications";
249
- query = map({
250
- maxItems: [function () { return input.MaxItems !== void 0; }, function () { return input.MaxItems.toString(); }],
251
- nextToken: [, input.NextToken],
252
- });
253
- return [2, new __HttpRequest({
254
- protocol: protocol,
255
- hostname: hostname,
256
- port: port,
257
- method: "GET",
258
- headers: headers,
259
- path: resolvedPath,
260
- query: query,
261
- body: body,
262
- })];
263
- }
106
+ };
107
+ export const serializeAws_restJson1CreateCloudFormationTemplateCommand = async (input, context) => {
108
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
109
+ const headers = {
110
+ "content-type": "application/json",
111
+ };
112
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}/templates";
113
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
114
+ let body;
115
+ body = JSON.stringify({
116
+ ...(input.SemanticVersion != null && { semanticVersion: input.SemanticVersion }),
264
117
  });
265
- }); };
266
- export var serializeAws_restJson1ListApplicationVersionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
267
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
268
- return __generator(this, function (_c) {
269
- switch (_c.label) {
270
- case 0: return [4, context.endpoint()];
271
- case 1:
272
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
273
- headers = {};
274
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{ApplicationId}/versions";
275
- resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
276
- query = map({
277
- maxItems: [function () { return input.MaxItems !== void 0; }, function () { return input.MaxItems.toString(); }],
278
- nextToken: [, input.NextToken],
279
- });
280
- return [2, new __HttpRequest({
281
- protocol: protocol,
282
- hostname: hostname,
283
- port: port,
284
- method: "GET",
285
- headers: headers,
286
- path: resolvedPath,
287
- query: query,
288
- body: body,
289
- })];
290
- }
118
+ return new __HttpRequest({
119
+ protocol,
120
+ hostname,
121
+ port,
122
+ method: "POST",
123
+ headers,
124
+ path: resolvedPath,
125
+ body,
291
126
  });
292
- }); };
293
- export var serializeAws_restJson1PutApplicationPolicyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
294
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
295
- return __generator(this, function (_c) {
296
- switch (_c.label) {
297
- case 0: return [4, context.endpoint()];
298
- case 1:
299
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
300
- headers = {
301
- "content-type": "application/json",
302
- };
303
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{ApplicationId}/policy";
304
- resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
305
- body = JSON.stringify(__assign({}, (input.Statements != null && {
306
- statements: serializeAws_restJson1__listOfApplicationPolicyStatement(input.Statements, context),
307
- })));
308
- return [2, new __HttpRequest({
309
- protocol: protocol,
310
- hostname: hostname,
311
- port: port,
312
- method: "PUT",
313
- headers: headers,
314
- path: resolvedPath,
315
- body: body,
316
- })];
317
- }
127
+ };
128
+ export const serializeAws_restJson1DeleteApplicationCommand = async (input, context) => {
129
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
130
+ const headers = {};
131
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}";
132
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
133
+ let body;
134
+ return new __HttpRequest({
135
+ protocol,
136
+ hostname,
137
+ port,
138
+ method: "DELETE",
139
+ headers,
140
+ path: resolvedPath,
141
+ body,
318
142
  });
319
- }); };
320
- export var serializeAws_restJson1UnshareApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
321
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
322
- return __generator(this, function (_c) {
323
- switch (_c.label) {
324
- case 0: return [4, context.endpoint()];
325
- case 1:
326
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
327
- headers = {
328
- "content-type": "application/json",
329
- };
330
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{ApplicationId}/unshare";
331
- resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
332
- body = JSON.stringify(__assign({}, (input.OrganizationId != null && { organizationId: input.OrganizationId })));
333
- return [2, new __HttpRequest({
334
- protocol: protocol,
335
- hostname: hostname,
336
- port: port,
337
- method: "POST",
338
- headers: headers,
339
- path: resolvedPath,
340
- body: body,
341
- })];
342
- }
143
+ };
144
+ export const serializeAws_restJson1GetApplicationCommand = async (input, context) => {
145
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
146
+ const headers = {};
147
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}";
148
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
149
+ const query = map({
150
+ semanticVersion: [, input.SemanticVersion],
343
151
  });
344
- }); };
345
- export var serializeAws_restJson1UpdateApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
346
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
347
- return __generator(this, function (_c) {
348
- switch (_c.label) {
349
- case 0: return [4, context.endpoint()];
350
- case 1:
351
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
352
- headers = {
353
- "content-type": "application/json",
354
- };
355
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{ApplicationId}";
356
- resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", function () { return input.ApplicationId; }, "{ApplicationId}", false);
357
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.Author != null && { author: input.Author })), (input.Description != null && { description: input.Description })), (input.HomePageUrl != null && { homePageUrl: input.HomePageUrl })), (input.Labels != null && { labels: serializeAws_restJson1__listOf__string(input.Labels, context) })), (input.ReadmeBody != null && { readmeBody: input.ReadmeBody })), (input.ReadmeUrl != null && { readmeUrl: input.ReadmeUrl })));
358
- return [2, new __HttpRequest({
359
- protocol: protocol,
360
- hostname: hostname,
361
- port: port,
362
- method: "PATCH",
363
- headers: headers,
364
- path: resolvedPath,
365
- body: body,
366
- })];
367
- }
152
+ let body;
153
+ return new __HttpRequest({
154
+ protocol,
155
+ hostname,
156
+ port,
157
+ method: "GET",
158
+ headers,
159
+ path: resolvedPath,
160
+ query,
161
+ body,
368
162
  });
369
- }); };
370
- export var deserializeAws_restJson1CreateApplicationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
371
- var contents, data, _a, _b;
372
- return __generator(this, function (_c) {
373
- switch (_c.label) {
374
- case 0:
375
- if (output.statusCode !== 201 && output.statusCode >= 300) {
376
- return [2, deserializeAws_restJson1CreateApplicationCommandError(output, context)];
377
- }
378
- contents = map({
379
- $metadata: deserializeMetadata(output),
380
- });
381
- _a = __expectNonNull;
382
- _b = __expectObject;
383
- return [4, parseBody(output.body, context)];
384
- case 1:
385
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
386
- if (data.applicationId != null) {
387
- contents.ApplicationId = __expectString(data.applicationId);
388
- }
389
- if (data.author != null) {
390
- contents.Author = __expectString(data.author);
391
- }
392
- if (data.creationTime != null) {
393
- contents.CreationTime = __expectString(data.creationTime);
394
- }
395
- if (data.description != null) {
396
- contents.Description = __expectString(data.description);
397
- }
398
- if (data.homePageUrl != null) {
399
- contents.HomePageUrl = __expectString(data.homePageUrl);
400
- }
401
- if (data.isVerifiedAuthor != null) {
402
- contents.IsVerifiedAuthor = __expectBoolean(data.isVerifiedAuthor);
403
- }
404
- if (data.labels != null) {
405
- contents.Labels = deserializeAws_restJson1__listOf__string(data.labels, context);
406
- }
407
- if (data.licenseUrl != null) {
408
- contents.LicenseUrl = __expectString(data.licenseUrl);
409
- }
410
- if (data.name != null) {
411
- contents.Name = __expectString(data.name);
412
- }
413
- if (data.readmeUrl != null) {
414
- contents.ReadmeUrl = __expectString(data.readmeUrl);
415
- }
416
- if (data.spdxLicenseId != null) {
417
- contents.SpdxLicenseId = __expectString(data.spdxLicenseId);
418
- }
419
- if (data.verifiedAuthorUrl != null) {
420
- contents.VerifiedAuthorUrl = __expectString(data.verifiedAuthorUrl);
421
- }
422
- if (data.version != null) {
423
- contents.Version = deserializeAws_restJson1Version(data.version, context);
424
- }
425
- return [2, contents];
426
- }
163
+ };
164
+ export const serializeAws_restJson1GetApplicationPolicyCommand = async (input, context) => {
165
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
166
+ const headers = {};
167
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}/policy";
168
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
169
+ let body;
170
+ return new __HttpRequest({
171
+ protocol,
172
+ hostname,
173
+ port,
174
+ method: "GET",
175
+ headers,
176
+ path: resolvedPath,
177
+ body,
427
178
  });
428
- }); };
429
- var deserializeAws_restJson1CreateApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
430
- var parsedOutput, _a, errorCode, _b, parsedBody;
431
- var _c;
432
- return __generator(this, function (_d) {
433
- switch (_d.label) {
434
- case 0:
435
- _a = [__assign({}, output)];
436
- _c = {};
437
- return [4, parseErrorBody(output.body, context)];
438
- case 1:
439
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
440
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
441
- _b = errorCode;
442
- switch (_b) {
443
- case "BadRequestException": return [3, 2];
444
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException": return [3, 2];
445
- case "ConflictException": return [3, 4];
446
- case "com.amazonaws.serverlessapplicationrepository#ConflictException": return [3, 4];
447
- case "ForbiddenException": return [3, 6];
448
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": return [3, 6];
449
- case "InternalServerErrorException": return [3, 8];
450
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": return [3, 8];
451
- case "TooManyRequestsException": return [3, 10];
452
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": return [3, 10];
453
- }
454
- return [3, 12];
455
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
456
- case 3: throw _d.sent();
457
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
458
- case 5: throw _d.sent();
459
- case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
460
- case 7: throw _d.sent();
461
- case 8: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
462
- case 9: throw _d.sent();
463
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
464
- case 11: throw _d.sent();
465
- case 12:
466
- parsedBody = parsedOutput.body;
467
- throwDefaultError({
468
- output: output,
469
- parsedBody: parsedBody,
470
- exceptionCtor: __BaseException,
471
- errorCode: errorCode,
472
- });
473
- _d.label = 13;
474
- case 13: return [2];
475
- }
179
+ };
180
+ export const serializeAws_restJson1GetCloudFormationTemplateCommand = async (input, context) => {
181
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
182
+ const headers = {};
183
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
184
+ "/applications/{ApplicationId}/templates/{TemplateId}";
185
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
186
+ resolvedPath = __resolvedPath(resolvedPath, input, "TemplateId", () => input.TemplateId, "{TemplateId}", false);
187
+ let body;
188
+ return new __HttpRequest({
189
+ protocol,
190
+ hostname,
191
+ port,
192
+ method: "GET",
193
+ headers,
194
+ path: resolvedPath,
195
+ body,
476
196
  });
477
- }); };
478
- export var deserializeAws_restJson1CreateApplicationVersionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
479
- var contents, data, _a, _b;
480
- return __generator(this, function (_c) {
481
- switch (_c.label) {
482
- case 0:
483
- if (output.statusCode !== 201 && output.statusCode >= 300) {
484
- return [2, deserializeAws_restJson1CreateApplicationVersionCommandError(output, context)];
485
- }
486
- contents = map({
487
- $metadata: deserializeMetadata(output),
488
- });
489
- _a = __expectNonNull;
490
- _b = __expectObject;
491
- return [4, parseBody(output.body, context)];
492
- case 1:
493
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
494
- if (data.applicationId != null) {
495
- contents.ApplicationId = __expectString(data.applicationId);
496
- }
497
- if (data.creationTime != null) {
498
- contents.CreationTime = __expectString(data.creationTime);
499
- }
500
- if (data.parameterDefinitions != null) {
501
- contents.ParameterDefinitions = deserializeAws_restJson1__listOfParameterDefinition(data.parameterDefinitions, context);
502
- }
503
- if (data.requiredCapabilities != null) {
504
- contents.RequiredCapabilities = deserializeAws_restJson1__listOfCapability(data.requiredCapabilities, context);
505
- }
506
- if (data.resourcesSupported != null) {
507
- contents.ResourcesSupported = __expectBoolean(data.resourcesSupported);
508
- }
509
- if (data.semanticVersion != null) {
510
- contents.SemanticVersion = __expectString(data.semanticVersion);
511
- }
512
- if (data.sourceCodeArchiveUrl != null) {
513
- contents.SourceCodeArchiveUrl = __expectString(data.sourceCodeArchiveUrl);
514
- }
515
- if (data.sourceCodeUrl != null) {
516
- contents.SourceCodeUrl = __expectString(data.sourceCodeUrl);
517
- }
518
- if (data.templateUrl != null) {
519
- contents.TemplateUrl = __expectString(data.templateUrl);
520
- }
521
- return [2, contents];
522
- }
197
+ };
198
+ export const serializeAws_restJson1ListApplicationDependenciesCommand = async (input, context) => {
199
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
200
+ const headers = {};
201
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
202
+ "/applications/{ApplicationId}/dependencies";
203
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
204
+ const query = map({
205
+ maxItems: [() => input.MaxItems !== void 0, () => input.MaxItems.toString()],
206
+ nextToken: [, input.NextToken],
207
+ semanticVersion: [, input.SemanticVersion],
523
208
  });
524
- }); };
525
- var deserializeAws_restJson1CreateApplicationVersionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
526
- var parsedOutput, _a, errorCode, _b, parsedBody;
527
- var _c;
528
- return __generator(this, function (_d) {
529
- switch (_d.label) {
530
- case 0:
531
- _a = [__assign({}, output)];
532
- _c = {};
533
- return [4, parseErrorBody(output.body, context)];
534
- case 1:
535
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
536
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
537
- _b = errorCode;
538
- switch (_b) {
539
- case "BadRequestException": return [3, 2];
540
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException": return [3, 2];
541
- case "ConflictException": return [3, 4];
542
- case "com.amazonaws.serverlessapplicationrepository#ConflictException": return [3, 4];
543
- case "ForbiddenException": return [3, 6];
544
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": return [3, 6];
545
- case "InternalServerErrorException": return [3, 8];
546
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": return [3, 8];
547
- case "TooManyRequestsException": return [3, 10];
548
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": return [3, 10];
549
- }
550
- return [3, 12];
551
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
552
- case 3: throw _d.sent();
553
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
554
- case 5: throw _d.sent();
555
- case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
556
- case 7: throw _d.sent();
557
- case 8: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
558
- case 9: throw _d.sent();
559
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
560
- case 11: throw _d.sent();
561
- case 12:
562
- parsedBody = parsedOutput.body;
563
- throwDefaultError({
564
- output: output,
565
- parsedBody: parsedBody,
566
- exceptionCtor: __BaseException,
567
- errorCode: errorCode,
568
- });
569
- _d.label = 13;
570
- case 13: return [2];
571
- }
209
+ let body;
210
+ return new __HttpRequest({
211
+ protocol,
212
+ hostname,
213
+ port,
214
+ method: "GET",
215
+ headers,
216
+ path: resolvedPath,
217
+ query,
218
+ body,
572
219
  });
573
- }); };
574
- export var deserializeAws_restJson1CreateCloudFormationChangeSetCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
575
- var contents, data, _a, _b;
576
- return __generator(this, function (_c) {
577
- switch (_c.label) {
578
- case 0:
579
- if (output.statusCode !== 201 && output.statusCode >= 300) {
580
- return [2, deserializeAws_restJson1CreateCloudFormationChangeSetCommandError(output, context)];
581
- }
582
- contents = map({
583
- $metadata: deserializeMetadata(output),
584
- });
585
- _a = __expectNonNull;
586
- _b = __expectObject;
587
- return [4, parseBody(output.body, context)];
588
- case 1:
589
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
590
- if (data.applicationId != null) {
591
- contents.ApplicationId = __expectString(data.applicationId);
592
- }
593
- if (data.changeSetId != null) {
594
- contents.ChangeSetId = __expectString(data.changeSetId);
595
- }
596
- if (data.semanticVersion != null) {
597
- contents.SemanticVersion = __expectString(data.semanticVersion);
598
- }
599
- if (data.stackId != null) {
600
- contents.StackId = __expectString(data.stackId);
601
- }
602
- return [2, contents];
603
- }
220
+ };
221
+ export const serializeAws_restJson1ListApplicationsCommand = async (input, context) => {
222
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
223
+ const headers = {};
224
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications";
225
+ const query = map({
226
+ maxItems: [() => input.MaxItems !== void 0, () => input.MaxItems.toString()],
227
+ nextToken: [, input.NextToken],
604
228
  });
605
- }); };
606
- var deserializeAws_restJson1CreateCloudFormationChangeSetCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
607
- var parsedOutput, _a, errorCode, _b, parsedBody;
608
- var _c;
609
- return __generator(this, function (_d) {
610
- switch (_d.label) {
611
- case 0:
612
- _a = [__assign({}, output)];
613
- _c = {};
614
- return [4, parseErrorBody(output.body, context)];
615
- case 1:
616
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
617
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
618
- _b = errorCode;
619
- switch (_b) {
620
- case "BadRequestException": return [3, 2];
621
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException": return [3, 2];
622
- case "ForbiddenException": return [3, 4];
623
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": return [3, 4];
624
- case "InternalServerErrorException": return [3, 6];
625
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": return [3, 6];
626
- case "TooManyRequestsException": return [3, 8];
627
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": return [3, 8];
628
- }
629
- return [3, 10];
630
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
631
- case 3: throw _d.sent();
632
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
633
- case 5: throw _d.sent();
634
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
635
- case 7: throw _d.sent();
636
- case 8: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
637
- case 9: throw _d.sent();
638
- case 10:
639
- parsedBody = parsedOutput.body;
640
- throwDefaultError({
641
- output: output,
642
- parsedBody: parsedBody,
643
- exceptionCtor: __BaseException,
644
- errorCode: errorCode,
645
- });
646
- _d.label = 11;
647
- case 11: return [2];
648
- }
229
+ let body;
230
+ return new __HttpRequest({
231
+ protocol,
232
+ hostname,
233
+ port,
234
+ method: "GET",
235
+ headers,
236
+ path: resolvedPath,
237
+ query,
238
+ body,
649
239
  });
650
- }); };
651
- export var deserializeAws_restJson1CreateCloudFormationTemplateCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
652
- var contents, data, _a, _b;
653
- return __generator(this, function (_c) {
654
- switch (_c.label) {
655
- case 0:
656
- if (output.statusCode !== 201 && output.statusCode >= 300) {
657
- return [2, deserializeAws_restJson1CreateCloudFormationTemplateCommandError(output, context)];
658
- }
659
- contents = map({
660
- $metadata: deserializeMetadata(output),
661
- });
662
- _a = __expectNonNull;
663
- _b = __expectObject;
664
- return [4, parseBody(output.body, context)];
665
- case 1:
666
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
667
- if (data.applicationId != null) {
668
- contents.ApplicationId = __expectString(data.applicationId);
669
- }
670
- if (data.creationTime != null) {
671
- contents.CreationTime = __expectString(data.creationTime);
672
- }
673
- if (data.expirationTime != null) {
674
- contents.ExpirationTime = __expectString(data.expirationTime);
675
- }
676
- if (data.semanticVersion != null) {
677
- contents.SemanticVersion = __expectString(data.semanticVersion);
678
- }
679
- if (data.status != null) {
680
- contents.Status = __expectString(data.status);
681
- }
682
- if (data.templateId != null) {
683
- contents.TemplateId = __expectString(data.templateId);
684
- }
685
- if (data.templateUrl != null) {
686
- contents.TemplateUrl = __expectString(data.templateUrl);
687
- }
688
- return [2, contents];
689
- }
240
+ };
241
+ export const serializeAws_restJson1ListApplicationVersionsCommand = async (input, context) => {
242
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
243
+ const headers = {};
244
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}/versions";
245
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
246
+ const query = map({
247
+ maxItems: [() => input.MaxItems !== void 0, () => input.MaxItems.toString()],
248
+ nextToken: [, input.NextToken],
690
249
  });
691
- }); };
692
- var deserializeAws_restJson1CreateCloudFormationTemplateCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
693
- var parsedOutput, _a, errorCode, _b, parsedBody;
694
- var _c;
695
- return __generator(this, function (_d) {
696
- switch (_d.label) {
697
- case 0:
698
- _a = [__assign({}, output)];
699
- _c = {};
700
- return [4, parseErrorBody(output.body, context)];
701
- case 1:
702
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
703
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
704
- _b = errorCode;
705
- switch (_b) {
706
- case "BadRequestException": return [3, 2];
707
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException": return [3, 2];
708
- case "ForbiddenException": return [3, 4];
709
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": return [3, 4];
710
- case "InternalServerErrorException": return [3, 6];
711
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": return [3, 6];
712
- case "NotFoundException": return [3, 8];
713
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException": return [3, 8];
714
- case "TooManyRequestsException": return [3, 10];
715
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": return [3, 10];
716
- }
717
- return [3, 12];
718
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
719
- case 3: throw _d.sent();
720
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
721
- case 5: throw _d.sent();
722
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
723
- case 7: throw _d.sent();
724
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
725
- case 9: throw _d.sent();
726
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
727
- case 11: throw _d.sent();
728
- case 12:
729
- parsedBody = parsedOutput.body;
730
- throwDefaultError({
731
- output: output,
732
- parsedBody: parsedBody,
733
- exceptionCtor: __BaseException,
734
- errorCode: errorCode,
735
- });
736
- _d.label = 13;
737
- case 13: return [2];
738
- }
250
+ let body;
251
+ return new __HttpRequest({
252
+ protocol,
253
+ hostname,
254
+ port,
255
+ method: "GET",
256
+ headers,
257
+ path: resolvedPath,
258
+ query,
259
+ body,
739
260
  });
740
- }); };
741
- export var deserializeAws_restJson1DeleteApplicationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
742
- var contents;
743
- return __generator(this, function (_a) {
744
- switch (_a.label) {
745
- case 0:
746
- if (output.statusCode !== 204 && output.statusCode >= 300) {
747
- return [2, deserializeAws_restJson1DeleteApplicationCommandError(output, context)];
748
- }
749
- contents = map({
750
- $metadata: deserializeMetadata(output),
751
- });
752
- return [4, collectBody(output.body, context)];
753
- case 1:
754
- _a.sent();
755
- return [2, contents];
756
- }
261
+ };
262
+ export const serializeAws_restJson1PutApplicationPolicyCommand = async (input, context) => {
263
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
264
+ const headers = {
265
+ "content-type": "application/json",
266
+ };
267
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}/policy";
268
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
269
+ let body;
270
+ body = JSON.stringify({
271
+ ...(input.Statements != null && {
272
+ statements: serializeAws_restJson1__listOfApplicationPolicyStatement(input.Statements, context),
273
+ }),
757
274
  });
758
- }); };
759
- var deserializeAws_restJson1DeleteApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
760
- var parsedOutput, _a, errorCode, _b, parsedBody;
761
- var _c;
762
- return __generator(this, function (_d) {
763
- switch (_d.label) {
764
- case 0:
765
- _a = [__assign({}, output)];
766
- _c = {};
767
- return [4, parseErrorBody(output.body, context)];
768
- case 1:
769
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
770
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
771
- _b = errorCode;
772
- switch (_b) {
773
- case "BadRequestException": return [3, 2];
774
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException": return [3, 2];
775
- case "ConflictException": return [3, 4];
776
- case "com.amazonaws.serverlessapplicationrepository#ConflictException": return [3, 4];
777
- case "ForbiddenException": return [3, 6];
778
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": return [3, 6];
779
- case "InternalServerErrorException": return [3, 8];
780
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": return [3, 8];
781
- case "NotFoundException": return [3, 10];
782
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException": return [3, 10];
783
- case "TooManyRequestsException": return [3, 12];
784
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": return [3, 12];
785
- }
786
- return [3, 14];
787
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
788
- case 3: throw _d.sent();
789
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
790
- case 5: throw _d.sent();
791
- case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
792
- case 7: throw _d.sent();
793
- case 8: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
794
- case 9: throw _d.sent();
795
- case 10: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
796
- case 11: throw _d.sent();
797
- case 12: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
798
- case 13: throw _d.sent();
799
- case 14:
800
- parsedBody = parsedOutput.body;
801
- throwDefaultError({
802
- output: output,
803
- parsedBody: parsedBody,
804
- exceptionCtor: __BaseException,
805
- errorCode: errorCode,
806
- });
807
- _d.label = 15;
808
- case 15: return [2];
809
- }
275
+ return new __HttpRequest({
276
+ protocol,
277
+ hostname,
278
+ port,
279
+ method: "PUT",
280
+ headers,
281
+ path: resolvedPath,
282
+ body,
810
283
  });
811
- }); };
812
- export var deserializeAws_restJson1GetApplicationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
813
- var contents, data, _a, _b;
814
- return __generator(this, function (_c) {
815
- switch (_c.label) {
816
- case 0:
817
- if (output.statusCode !== 200 && output.statusCode >= 300) {
818
- return [2, deserializeAws_restJson1GetApplicationCommandError(output, context)];
819
- }
820
- contents = map({
821
- $metadata: deserializeMetadata(output),
822
- });
823
- _a = __expectNonNull;
824
- _b = __expectObject;
825
- return [4, parseBody(output.body, context)];
826
- case 1:
827
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
828
- if (data.applicationId != null) {
829
- contents.ApplicationId = __expectString(data.applicationId);
830
- }
831
- if (data.author != null) {
832
- contents.Author = __expectString(data.author);
833
- }
834
- if (data.creationTime != null) {
835
- contents.CreationTime = __expectString(data.creationTime);
836
- }
837
- if (data.description != null) {
838
- contents.Description = __expectString(data.description);
839
- }
840
- if (data.homePageUrl != null) {
841
- contents.HomePageUrl = __expectString(data.homePageUrl);
842
- }
843
- if (data.isVerifiedAuthor != null) {
844
- contents.IsVerifiedAuthor = __expectBoolean(data.isVerifiedAuthor);
845
- }
846
- if (data.labels != null) {
847
- contents.Labels = deserializeAws_restJson1__listOf__string(data.labels, context);
848
- }
849
- if (data.licenseUrl != null) {
850
- contents.LicenseUrl = __expectString(data.licenseUrl);
851
- }
852
- if (data.name != null) {
853
- contents.Name = __expectString(data.name);
854
- }
855
- if (data.readmeUrl != null) {
856
- contents.ReadmeUrl = __expectString(data.readmeUrl);
857
- }
858
- if (data.spdxLicenseId != null) {
859
- contents.SpdxLicenseId = __expectString(data.spdxLicenseId);
860
- }
861
- if (data.verifiedAuthorUrl != null) {
862
- contents.VerifiedAuthorUrl = __expectString(data.verifiedAuthorUrl);
863
- }
864
- if (data.version != null) {
865
- contents.Version = deserializeAws_restJson1Version(data.version, context);
866
- }
867
- return [2, contents];
868
- }
284
+ };
285
+ export const serializeAws_restJson1UnshareApplicationCommand = async (input, context) => {
286
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
287
+ const headers = {
288
+ "content-type": "application/json",
289
+ };
290
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}/unshare";
291
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
292
+ let body;
293
+ body = JSON.stringify({
294
+ ...(input.OrganizationId != null && { organizationId: input.OrganizationId }),
869
295
  });
870
- }); };
871
- var deserializeAws_restJson1GetApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
872
- var parsedOutput, _a, errorCode, _b, parsedBody;
873
- var _c;
874
- return __generator(this, function (_d) {
875
- switch (_d.label) {
876
- case 0:
877
- _a = [__assign({}, output)];
878
- _c = {};
879
- return [4, parseErrorBody(output.body, context)];
880
- case 1:
881
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
882
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
883
- _b = errorCode;
884
- switch (_b) {
885
- case "BadRequestException": return [3, 2];
886
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException": return [3, 2];
887
- case "ForbiddenException": return [3, 4];
888
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": return [3, 4];
889
- case "InternalServerErrorException": return [3, 6];
890
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": return [3, 6];
891
- case "NotFoundException": return [3, 8];
892
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException": return [3, 8];
893
- case "TooManyRequestsException": return [3, 10];
894
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": return [3, 10];
895
- }
896
- return [3, 12];
897
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
898
- case 3: throw _d.sent();
899
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
900
- case 5: throw _d.sent();
901
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
902
- case 7: throw _d.sent();
903
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
904
- case 9: throw _d.sent();
905
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
906
- case 11: throw _d.sent();
907
- case 12:
908
- parsedBody = parsedOutput.body;
909
- throwDefaultError({
910
- output: output,
911
- parsedBody: parsedBody,
912
- exceptionCtor: __BaseException,
913
- errorCode: errorCode,
914
- });
915
- _d.label = 13;
916
- case 13: return [2];
917
- }
296
+ return new __HttpRequest({
297
+ protocol,
298
+ hostname,
299
+ port,
300
+ method: "POST",
301
+ headers,
302
+ path: resolvedPath,
303
+ body,
918
304
  });
919
- }); };
920
- export var deserializeAws_restJson1GetApplicationPolicyCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
921
- var contents, data, _a, _b;
922
- return __generator(this, function (_c) {
923
- switch (_c.label) {
924
- case 0:
925
- if (output.statusCode !== 200 && output.statusCode >= 300) {
926
- return [2, deserializeAws_restJson1GetApplicationPolicyCommandError(output, context)];
927
- }
928
- contents = map({
929
- $metadata: deserializeMetadata(output),
930
- });
931
- _a = __expectNonNull;
932
- _b = __expectObject;
933
- return [4, parseBody(output.body, context)];
934
- case 1:
935
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
936
- if (data.statements != null) {
937
- contents.Statements = deserializeAws_restJson1__listOfApplicationPolicyStatement(data.statements, context);
938
- }
939
- return [2, contents];
940
- }
305
+ };
306
+ export const serializeAws_restJson1UpdateApplicationCommand = async (input, context) => {
307
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
308
+ const headers = {
309
+ "content-type": "application/json",
310
+ };
311
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}";
312
+ resolvedPath = __resolvedPath(resolvedPath, input, "ApplicationId", () => input.ApplicationId, "{ApplicationId}", false);
313
+ let body;
314
+ body = JSON.stringify({
315
+ ...(input.Author != null && { author: input.Author }),
316
+ ...(input.Description != null && { description: input.Description }),
317
+ ...(input.HomePageUrl != null && { homePageUrl: input.HomePageUrl }),
318
+ ...(input.Labels != null && { labels: serializeAws_restJson1__listOf__string(input.Labels, context) }),
319
+ ...(input.ReadmeBody != null && { readmeBody: input.ReadmeBody }),
320
+ ...(input.ReadmeUrl != null && { readmeUrl: input.ReadmeUrl }),
941
321
  });
942
- }); };
943
- var deserializeAws_restJson1GetApplicationPolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
944
- var parsedOutput, _a, errorCode, _b, parsedBody;
945
- var _c;
946
- return __generator(this, function (_d) {
947
- switch (_d.label) {
948
- case 0:
949
- _a = [__assign({}, output)];
950
- _c = {};
951
- return [4, parseErrorBody(output.body, context)];
952
- case 1:
953
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
954
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
955
- _b = errorCode;
956
- switch (_b) {
957
- case "BadRequestException": return [3, 2];
958
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException": return [3, 2];
959
- case "ForbiddenException": return [3, 4];
960
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": return [3, 4];
961
- case "InternalServerErrorException": return [3, 6];
962
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": return [3, 6];
963
- case "NotFoundException": return [3, 8];
964
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException": return [3, 8];
965
- case "TooManyRequestsException": return [3, 10];
966
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": return [3, 10];
967
- }
968
- return [3, 12];
969
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
970
- case 3: throw _d.sent();
971
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
972
- case 5: throw _d.sent();
973
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
974
- case 7: throw _d.sent();
975
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
976
- case 9: throw _d.sent();
977
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
978
- case 11: throw _d.sent();
979
- case 12:
980
- parsedBody = parsedOutput.body;
981
- throwDefaultError({
982
- output: output,
983
- parsedBody: parsedBody,
984
- exceptionCtor: __BaseException,
985
- errorCode: errorCode,
986
- });
987
- _d.label = 13;
988
- case 13: return [2];
989
- }
322
+ return new __HttpRequest({
323
+ protocol,
324
+ hostname,
325
+ port,
326
+ method: "PATCH",
327
+ headers,
328
+ path: resolvedPath,
329
+ body,
990
330
  });
991
- }); };
992
- export var deserializeAws_restJson1GetCloudFormationTemplateCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
993
- var contents, data, _a, _b;
994
- return __generator(this, function (_c) {
995
- switch (_c.label) {
996
- case 0:
997
- if (output.statusCode !== 200 && output.statusCode >= 300) {
998
- return [2, deserializeAws_restJson1GetCloudFormationTemplateCommandError(output, context)];
999
- }
1000
- contents = map({
1001
- $metadata: deserializeMetadata(output),
1002
- });
1003
- _a = __expectNonNull;
1004
- _b = __expectObject;
1005
- return [4, parseBody(output.body, context)];
1006
- case 1:
1007
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1008
- if (data.applicationId != null) {
1009
- contents.ApplicationId = __expectString(data.applicationId);
1010
- }
1011
- if (data.creationTime != null) {
1012
- contents.CreationTime = __expectString(data.creationTime);
1013
- }
1014
- if (data.expirationTime != null) {
1015
- contents.ExpirationTime = __expectString(data.expirationTime);
1016
- }
1017
- if (data.semanticVersion != null) {
1018
- contents.SemanticVersion = __expectString(data.semanticVersion);
1019
- }
1020
- if (data.status != null) {
1021
- contents.Status = __expectString(data.status);
1022
- }
1023
- if (data.templateId != null) {
1024
- contents.TemplateId = __expectString(data.templateId);
1025
- }
1026
- if (data.templateUrl != null) {
1027
- contents.TemplateUrl = __expectString(data.templateUrl);
1028
- }
1029
- return [2, contents];
1030
- }
331
+ };
332
+ export const deserializeAws_restJson1CreateApplicationCommand = async (output, context) => {
333
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
334
+ return deserializeAws_restJson1CreateApplicationCommandError(output, context);
335
+ }
336
+ const contents = map({
337
+ $metadata: deserializeMetadata(output),
1031
338
  });
1032
- }); };
1033
- var deserializeAws_restJson1GetCloudFormationTemplateCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1034
- var parsedOutput, _a, errorCode, _b, parsedBody;
1035
- var _c;
1036
- return __generator(this, function (_d) {
1037
- switch (_d.label) {
1038
- case 0:
1039
- _a = [__assign({}, output)];
1040
- _c = {};
1041
- return [4, parseErrorBody(output.body, context)];
1042
- case 1:
1043
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1044
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1045
- _b = errorCode;
1046
- switch (_b) {
1047
- case "BadRequestException": return [3, 2];
1048
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException": return [3, 2];
1049
- case "ForbiddenException": return [3, 4];
1050
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": return [3, 4];
1051
- case "InternalServerErrorException": return [3, 6];
1052
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": return [3, 6];
1053
- case "NotFoundException": return [3, 8];
1054
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException": return [3, 8];
1055
- case "TooManyRequestsException": return [3, 10];
1056
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": return [3, 10];
1057
- }
1058
- return [3, 12];
1059
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1060
- case 3: throw _d.sent();
1061
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1062
- case 5: throw _d.sent();
1063
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1064
- case 7: throw _d.sent();
1065
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1066
- case 9: throw _d.sent();
1067
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1068
- case 11: throw _d.sent();
1069
- case 12:
1070
- parsedBody = parsedOutput.body;
1071
- throwDefaultError({
1072
- output: output,
1073
- parsedBody: parsedBody,
1074
- exceptionCtor: __BaseException,
1075
- errorCode: errorCode,
1076
- });
1077
- _d.label = 13;
1078
- case 13: return [2];
1079
- }
339
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
340
+ if (data.applicationId != null) {
341
+ contents.ApplicationId = __expectString(data.applicationId);
342
+ }
343
+ if (data.author != null) {
344
+ contents.Author = __expectString(data.author);
345
+ }
346
+ if (data.creationTime != null) {
347
+ contents.CreationTime = __expectString(data.creationTime);
348
+ }
349
+ if (data.description != null) {
350
+ contents.Description = __expectString(data.description);
351
+ }
352
+ if (data.homePageUrl != null) {
353
+ contents.HomePageUrl = __expectString(data.homePageUrl);
354
+ }
355
+ if (data.isVerifiedAuthor != null) {
356
+ contents.IsVerifiedAuthor = __expectBoolean(data.isVerifiedAuthor);
357
+ }
358
+ if (data.labels != null) {
359
+ contents.Labels = deserializeAws_restJson1__listOf__string(data.labels, context);
360
+ }
361
+ if (data.licenseUrl != null) {
362
+ contents.LicenseUrl = __expectString(data.licenseUrl);
363
+ }
364
+ if (data.name != null) {
365
+ contents.Name = __expectString(data.name);
366
+ }
367
+ if (data.readmeUrl != null) {
368
+ contents.ReadmeUrl = __expectString(data.readmeUrl);
369
+ }
370
+ if (data.spdxLicenseId != null) {
371
+ contents.SpdxLicenseId = __expectString(data.spdxLicenseId);
372
+ }
373
+ if (data.verifiedAuthorUrl != null) {
374
+ contents.VerifiedAuthorUrl = __expectString(data.verifiedAuthorUrl);
375
+ }
376
+ if (data.version != null) {
377
+ contents.Version = deserializeAws_restJson1Version(data.version, context);
378
+ }
379
+ return contents;
380
+ };
381
+ const deserializeAws_restJson1CreateApplicationCommandError = async (output, context) => {
382
+ const parsedOutput = {
383
+ ...output,
384
+ body: await parseErrorBody(output.body, context),
385
+ };
386
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
387
+ switch (errorCode) {
388
+ case "BadRequestException":
389
+ case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
390
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
391
+ case "ConflictException":
392
+ case "com.amazonaws.serverlessapplicationrepository#ConflictException":
393
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
394
+ case "ForbiddenException":
395
+ case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
396
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
397
+ case "InternalServerErrorException":
398
+ case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
399
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
400
+ case "TooManyRequestsException":
401
+ case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
402
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
403
+ default:
404
+ const parsedBody = parsedOutput.body;
405
+ throwDefaultError({
406
+ output,
407
+ parsedBody,
408
+ exceptionCtor: __BaseException,
409
+ errorCode,
410
+ });
411
+ }
412
+ };
413
+ export const deserializeAws_restJson1CreateApplicationVersionCommand = async (output, context) => {
414
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
415
+ return deserializeAws_restJson1CreateApplicationVersionCommandError(output, context);
416
+ }
417
+ const contents = map({
418
+ $metadata: deserializeMetadata(output),
1080
419
  });
1081
- }); };
1082
- export var deserializeAws_restJson1ListApplicationDependenciesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1083
- var contents, data, _a, _b;
1084
- return __generator(this, function (_c) {
1085
- switch (_c.label) {
1086
- case 0:
1087
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1088
- return [2, deserializeAws_restJson1ListApplicationDependenciesCommandError(output, context)];
1089
- }
1090
- contents = map({
1091
- $metadata: deserializeMetadata(output),
1092
- });
1093
- _a = __expectNonNull;
1094
- _b = __expectObject;
1095
- return [4, parseBody(output.body, context)];
1096
- case 1:
1097
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1098
- if (data.dependencies != null) {
1099
- contents.Dependencies = deserializeAws_restJson1__listOfApplicationDependencySummary(data.dependencies, context);
1100
- }
1101
- if (data.nextToken != null) {
1102
- contents.NextToken = __expectString(data.nextToken);
1103
- }
1104
- return [2, contents];
1105
- }
420
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
421
+ if (data.applicationId != null) {
422
+ contents.ApplicationId = __expectString(data.applicationId);
423
+ }
424
+ if (data.creationTime != null) {
425
+ contents.CreationTime = __expectString(data.creationTime);
426
+ }
427
+ if (data.parameterDefinitions != null) {
428
+ contents.ParameterDefinitions = deserializeAws_restJson1__listOfParameterDefinition(data.parameterDefinitions, context);
429
+ }
430
+ if (data.requiredCapabilities != null) {
431
+ contents.RequiredCapabilities = deserializeAws_restJson1__listOfCapability(data.requiredCapabilities, context);
432
+ }
433
+ if (data.resourcesSupported != null) {
434
+ contents.ResourcesSupported = __expectBoolean(data.resourcesSupported);
435
+ }
436
+ if (data.semanticVersion != null) {
437
+ contents.SemanticVersion = __expectString(data.semanticVersion);
438
+ }
439
+ if (data.sourceCodeArchiveUrl != null) {
440
+ contents.SourceCodeArchiveUrl = __expectString(data.sourceCodeArchiveUrl);
441
+ }
442
+ if (data.sourceCodeUrl != null) {
443
+ contents.SourceCodeUrl = __expectString(data.sourceCodeUrl);
444
+ }
445
+ if (data.templateUrl != null) {
446
+ contents.TemplateUrl = __expectString(data.templateUrl);
447
+ }
448
+ return contents;
449
+ };
450
+ const deserializeAws_restJson1CreateApplicationVersionCommandError = async (output, context) => {
451
+ const parsedOutput = {
452
+ ...output,
453
+ body: await parseErrorBody(output.body, context),
454
+ };
455
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
456
+ switch (errorCode) {
457
+ case "BadRequestException":
458
+ case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
459
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
460
+ case "ConflictException":
461
+ case "com.amazonaws.serverlessapplicationrepository#ConflictException":
462
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
463
+ case "ForbiddenException":
464
+ case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
465
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
466
+ case "InternalServerErrorException":
467
+ case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
468
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
469
+ case "TooManyRequestsException":
470
+ case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
471
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
472
+ default:
473
+ const parsedBody = parsedOutput.body;
474
+ throwDefaultError({
475
+ output,
476
+ parsedBody,
477
+ exceptionCtor: __BaseException,
478
+ errorCode,
479
+ });
480
+ }
481
+ };
482
+ export const deserializeAws_restJson1CreateCloudFormationChangeSetCommand = async (output, context) => {
483
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
484
+ return deserializeAws_restJson1CreateCloudFormationChangeSetCommandError(output, context);
485
+ }
486
+ const contents = map({
487
+ $metadata: deserializeMetadata(output),
1106
488
  });
1107
- }); };
1108
- var deserializeAws_restJson1ListApplicationDependenciesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1109
- var parsedOutput, _a, errorCode, _b, parsedBody;
1110
- var _c;
1111
- return __generator(this, function (_d) {
1112
- switch (_d.label) {
1113
- case 0:
1114
- _a = [__assign({}, output)];
1115
- _c = {};
1116
- return [4, parseErrorBody(output.body, context)];
1117
- case 1:
1118
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1119
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1120
- _b = errorCode;
1121
- switch (_b) {
1122
- case "BadRequestException": return [3, 2];
1123
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException": return [3, 2];
1124
- case "ForbiddenException": return [3, 4];
1125
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": return [3, 4];
1126
- case "InternalServerErrorException": return [3, 6];
1127
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": return [3, 6];
1128
- case "NotFoundException": return [3, 8];
1129
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException": return [3, 8];
1130
- case "TooManyRequestsException": return [3, 10];
1131
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": return [3, 10];
1132
- }
1133
- return [3, 12];
1134
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1135
- case 3: throw _d.sent();
1136
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1137
- case 5: throw _d.sent();
1138
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1139
- case 7: throw _d.sent();
1140
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1141
- case 9: throw _d.sent();
1142
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1143
- case 11: throw _d.sent();
1144
- case 12:
1145
- parsedBody = parsedOutput.body;
1146
- throwDefaultError({
1147
- output: output,
1148
- parsedBody: parsedBody,
1149
- exceptionCtor: __BaseException,
1150
- errorCode: errorCode,
1151
- });
1152
- _d.label = 13;
1153
- case 13: return [2];
1154
- }
489
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
490
+ if (data.applicationId != null) {
491
+ contents.ApplicationId = __expectString(data.applicationId);
492
+ }
493
+ if (data.changeSetId != null) {
494
+ contents.ChangeSetId = __expectString(data.changeSetId);
495
+ }
496
+ if (data.semanticVersion != null) {
497
+ contents.SemanticVersion = __expectString(data.semanticVersion);
498
+ }
499
+ if (data.stackId != null) {
500
+ contents.StackId = __expectString(data.stackId);
501
+ }
502
+ return contents;
503
+ };
504
+ const deserializeAws_restJson1CreateCloudFormationChangeSetCommandError = async (output, context) => {
505
+ const parsedOutput = {
506
+ ...output,
507
+ body: await parseErrorBody(output.body, context),
508
+ };
509
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
510
+ switch (errorCode) {
511
+ case "BadRequestException":
512
+ case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
513
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
514
+ case "ForbiddenException":
515
+ case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
516
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
517
+ case "InternalServerErrorException":
518
+ case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
519
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
520
+ case "TooManyRequestsException":
521
+ case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
522
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
523
+ default:
524
+ const parsedBody = parsedOutput.body;
525
+ throwDefaultError({
526
+ output,
527
+ parsedBody,
528
+ exceptionCtor: __BaseException,
529
+ errorCode,
530
+ });
531
+ }
532
+ };
533
+ export const deserializeAws_restJson1CreateCloudFormationTemplateCommand = async (output, context) => {
534
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
535
+ return deserializeAws_restJson1CreateCloudFormationTemplateCommandError(output, context);
536
+ }
537
+ const contents = map({
538
+ $metadata: deserializeMetadata(output),
1155
539
  });
1156
- }); };
1157
- export var deserializeAws_restJson1ListApplicationsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1158
- var contents, data, _a, _b;
1159
- return __generator(this, function (_c) {
1160
- switch (_c.label) {
1161
- case 0:
1162
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1163
- return [2, deserializeAws_restJson1ListApplicationsCommandError(output, context)];
1164
- }
1165
- contents = map({
1166
- $metadata: deserializeMetadata(output),
1167
- });
1168
- _a = __expectNonNull;
1169
- _b = __expectObject;
1170
- return [4, parseBody(output.body, context)];
1171
- case 1:
1172
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1173
- if (data.applications != null) {
1174
- contents.Applications = deserializeAws_restJson1__listOfApplicationSummary(data.applications, context);
1175
- }
1176
- if (data.nextToken != null) {
1177
- contents.NextToken = __expectString(data.nextToken);
1178
- }
1179
- return [2, contents];
1180
- }
540
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
541
+ if (data.applicationId != null) {
542
+ contents.ApplicationId = __expectString(data.applicationId);
543
+ }
544
+ if (data.creationTime != null) {
545
+ contents.CreationTime = __expectString(data.creationTime);
546
+ }
547
+ if (data.expirationTime != null) {
548
+ contents.ExpirationTime = __expectString(data.expirationTime);
549
+ }
550
+ if (data.semanticVersion != null) {
551
+ contents.SemanticVersion = __expectString(data.semanticVersion);
552
+ }
553
+ if (data.status != null) {
554
+ contents.Status = __expectString(data.status);
555
+ }
556
+ if (data.templateId != null) {
557
+ contents.TemplateId = __expectString(data.templateId);
558
+ }
559
+ if (data.templateUrl != null) {
560
+ contents.TemplateUrl = __expectString(data.templateUrl);
561
+ }
562
+ return contents;
563
+ };
564
+ const deserializeAws_restJson1CreateCloudFormationTemplateCommandError = async (output, context) => {
565
+ const parsedOutput = {
566
+ ...output,
567
+ body: await parseErrorBody(output.body, context),
568
+ };
569
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
570
+ switch (errorCode) {
571
+ case "BadRequestException":
572
+ case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
573
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
574
+ case "ForbiddenException":
575
+ case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
576
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
577
+ case "InternalServerErrorException":
578
+ case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
579
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
580
+ case "NotFoundException":
581
+ case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
582
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
583
+ case "TooManyRequestsException":
584
+ case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
585
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
586
+ default:
587
+ const parsedBody = parsedOutput.body;
588
+ throwDefaultError({
589
+ output,
590
+ parsedBody,
591
+ exceptionCtor: __BaseException,
592
+ errorCode,
593
+ });
594
+ }
595
+ };
596
+ export const deserializeAws_restJson1DeleteApplicationCommand = async (output, context) => {
597
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
598
+ return deserializeAws_restJson1DeleteApplicationCommandError(output, context);
599
+ }
600
+ const contents = map({
601
+ $metadata: deserializeMetadata(output),
1181
602
  });
1182
- }); };
1183
- var deserializeAws_restJson1ListApplicationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1184
- var parsedOutput, _a, errorCode, _b, parsedBody;
1185
- var _c;
1186
- return __generator(this, function (_d) {
1187
- switch (_d.label) {
1188
- case 0:
1189
- _a = [__assign({}, output)];
1190
- _c = {};
1191
- return [4, parseErrorBody(output.body, context)];
1192
- case 1:
1193
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1194
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1195
- _b = errorCode;
1196
- switch (_b) {
1197
- case "BadRequestException": return [3, 2];
1198
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException": return [3, 2];
1199
- case "ForbiddenException": return [3, 4];
1200
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": return [3, 4];
1201
- case "InternalServerErrorException": return [3, 6];
1202
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": return [3, 6];
1203
- case "NotFoundException": return [3, 8];
1204
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException": return [3, 8];
1205
- }
1206
- return [3, 10];
1207
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1208
- case 3: throw _d.sent();
1209
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1210
- case 5: throw _d.sent();
1211
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1212
- case 7: throw _d.sent();
1213
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1214
- case 9: throw _d.sent();
1215
- case 10:
1216
- parsedBody = parsedOutput.body;
1217
- throwDefaultError({
1218
- output: output,
1219
- parsedBody: parsedBody,
1220
- exceptionCtor: __BaseException,
1221
- errorCode: errorCode,
1222
- });
1223
- _d.label = 11;
1224
- case 11: return [2];
1225
- }
603
+ await collectBody(output.body, context);
604
+ return contents;
605
+ };
606
+ const deserializeAws_restJson1DeleteApplicationCommandError = async (output, context) => {
607
+ const parsedOutput = {
608
+ ...output,
609
+ body: await parseErrorBody(output.body, context),
610
+ };
611
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
612
+ switch (errorCode) {
613
+ case "BadRequestException":
614
+ case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
615
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
616
+ case "ConflictException":
617
+ case "com.amazonaws.serverlessapplicationrepository#ConflictException":
618
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
619
+ case "ForbiddenException":
620
+ case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
621
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
622
+ case "InternalServerErrorException":
623
+ case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
624
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
625
+ case "NotFoundException":
626
+ case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
627
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
628
+ case "TooManyRequestsException":
629
+ case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
630
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
631
+ default:
632
+ const parsedBody = parsedOutput.body;
633
+ throwDefaultError({
634
+ output,
635
+ parsedBody,
636
+ exceptionCtor: __BaseException,
637
+ errorCode,
638
+ });
639
+ }
640
+ };
641
+ export const deserializeAws_restJson1GetApplicationCommand = async (output, context) => {
642
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
643
+ return deserializeAws_restJson1GetApplicationCommandError(output, context);
644
+ }
645
+ const contents = map({
646
+ $metadata: deserializeMetadata(output),
1226
647
  });
1227
- }); };
1228
- export var deserializeAws_restJson1ListApplicationVersionsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1229
- var contents, data, _a, _b;
1230
- return __generator(this, function (_c) {
1231
- switch (_c.label) {
1232
- case 0:
1233
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1234
- return [2, deserializeAws_restJson1ListApplicationVersionsCommandError(output, context)];
1235
- }
1236
- contents = map({
1237
- $metadata: deserializeMetadata(output),
1238
- });
1239
- _a = __expectNonNull;
1240
- _b = __expectObject;
1241
- return [4, parseBody(output.body, context)];
1242
- case 1:
1243
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1244
- if (data.nextToken != null) {
1245
- contents.NextToken = __expectString(data.nextToken);
1246
- }
1247
- if (data.versions != null) {
1248
- contents.Versions = deserializeAws_restJson1__listOfVersionSummary(data.versions, context);
1249
- }
1250
- return [2, contents];
1251
- }
648
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
649
+ if (data.applicationId != null) {
650
+ contents.ApplicationId = __expectString(data.applicationId);
651
+ }
652
+ if (data.author != null) {
653
+ contents.Author = __expectString(data.author);
654
+ }
655
+ if (data.creationTime != null) {
656
+ contents.CreationTime = __expectString(data.creationTime);
657
+ }
658
+ if (data.description != null) {
659
+ contents.Description = __expectString(data.description);
660
+ }
661
+ if (data.homePageUrl != null) {
662
+ contents.HomePageUrl = __expectString(data.homePageUrl);
663
+ }
664
+ if (data.isVerifiedAuthor != null) {
665
+ contents.IsVerifiedAuthor = __expectBoolean(data.isVerifiedAuthor);
666
+ }
667
+ if (data.labels != null) {
668
+ contents.Labels = deserializeAws_restJson1__listOf__string(data.labels, context);
669
+ }
670
+ if (data.licenseUrl != null) {
671
+ contents.LicenseUrl = __expectString(data.licenseUrl);
672
+ }
673
+ if (data.name != null) {
674
+ contents.Name = __expectString(data.name);
675
+ }
676
+ if (data.readmeUrl != null) {
677
+ contents.ReadmeUrl = __expectString(data.readmeUrl);
678
+ }
679
+ if (data.spdxLicenseId != null) {
680
+ contents.SpdxLicenseId = __expectString(data.spdxLicenseId);
681
+ }
682
+ if (data.verifiedAuthorUrl != null) {
683
+ contents.VerifiedAuthorUrl = __expectString(data.verifiedAuthorUrl);
684
+ }
685
+ if (data.version != null) {
686
+ contents.Version = deserializeAws_restJson1Version(data.version, context);
687
+ }
688
+ return contents;
689
+ };
690
+ const deserializeAws_restJson1GetApplicationCommandError = async (output, context) => {
691
+ const parsedOutput = {
692
+ ...output,
693
+ body: await parseErrorBody(output.body, context),
694
+ };
695
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
696
+ switch (errorCode) {
697
+ case "BadRequestException":
698
+ case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
699
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
700
+ case "ForbiddenException":
701
+ case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
702
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
703
+ case "InternalServerErrorException":
704
+ case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
705
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
706
+ case "NotFoundException":
707
+ case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
708
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
709
+ case "TooManyRequestsException":
710
+ case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
711
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
712
+ default:
713
+ const parsedBody = parsedOutput.body;
714
+ throwDefaultError({
715
+ output,
716
+ parsedBody,
717
+ exceptionCtor: __BaseException,
718
+ errorCode,
719
+ });
720
+ }
721
+ };
722
+ export const deserializeAws_restJson1GetApplicationPolicyCommand = async (output, context) => {
723
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
724
+ return deserializeAws_restJson1GetApplicationPolicyCommandError(output, context);
725
+ }
726
+ const contents = map({
727
+ $metadata: deserializeMetadata(output),
1252
728
  });
1253
- }); };
1254
- var deserializeAws_restJson1ListApplicationVersionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1255
- var parsedOutput, _a, errorCode, _b, parsedBody;
1256
- var _c;
1257
- return __generator(this, function (_d) {
1258
- switch (_d.label) {
1259
- case 0:
1260
- _a = [__assign({}, output)];
1261
- _c = {};
1262
- return [4, parseErrorBody(output.body, context)];
1263
- case 1:
1264
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1265
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1266
- _b = errorCode;
1267
- switch (_b) {
1268
- case "BadRequestException": return [3, 2];
1269
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException": return [3, 2];
1270
- case "ForbiddenException": return [3, 4];
1271
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": return [3, 4];
1272
- case "InternalServerErrorException": return [3, 6];
1273
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": return [3, 6];
1274
- case "NotFoundException": return [3, 8];
1275
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException": return [3, 8];
1276
- case "TooManyRequestsException": return [3, 10];
1277
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": return [3, 10];
1278
- }
1279
- return [3, 12];
1280
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1281
- case 3: throw _d.sent();
1282
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1283
- case 5: throw _d.sent();
1284
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1285
- case 7: throw _d.sent();
1286
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1287
- case 9: throw _d.sent();
1288
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1289
- case 11: throw _d.sent();
1290
- case 12:
1291
- parsedBody = parsedOutput.body;
1292
- throwDefaultError({
1293
- output: output,
1294
- parsedBody: parsedBody,
1295
- exceptionCtor: __BaseException,
1296
- errorCode: errorCode,
1297
- });
1298
- _d.label = 13;
1299
- case 13: return [2];
1300
- }
729
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
730
+ if (data.statements != null) {
731
+ contents.Statements = deserializeAws_restJson1__listOfApplicationPolicyStatement(data.statements, context);
732
+ }
733
+ return contents;
734
+ };
735
+ const deserializeAws_restJson1GetApplicationPolicyCommandError = async (output, context) => {
736
+ const parsedOutput = {
737
+ ...output,
738
+ body: await parseErrorBody(output.body, context),
739
+ };
740
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
741
+ switch (errorCode) {
742
+ case "BadRequestException":
743
+ case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
744
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
745
+ case "ForbiddenException":
746
+ case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
747
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
748
+ case "InternalServerErrorException":
749
+ case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
750
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
751
+ case "NotFoundException":
752
+ case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
753
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
754
+ case "TooManyRequestsException":
755
+ case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
756
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
757
+ default:
758
+ const parsedBody = parsedOutput.body;
759
+ throwDefaultError({
760
+ output,
761
+ parsedBody,
762
+ exceptionCtor: __BaseException,
763
+ errorCode,
764
+ });
765
+ }
766
+ };
767
+ export const deserializeAws_restJson1GetCloudFormationTemplateCommand = async (output, context) => {
768
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
769
+ return deserializeAws_restJson1GetCloudFormationTemplateCommandError(output, context);
770
+ }
771
+ const contents = map({
772
+ $metadata: deserializeMetadata(output),
1301
773
  });
1302
- }); };
1303
- export var deserializeAws_restJson1PutApplicationPolicyCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1304
- var contents, data, _a, _b;
1305
- return __generator(this, function (_c) {
1306
- switch (_c.label) {
1307
- case 0:
1308
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1309
- return [2, deserializeAws_restJson1PutApplicationPolicyCommandError(output, context)];
1310
- }
1311
- contents = map({
1312
- $metadata: deserializeMetadata(output),
1313
- });
1314
- _a = __expectNonNull;
1315
- _b = __expectObject;
1316
- return [4, parseBody(output.body, context)];
1317
- case 1:
1318
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1319
- if (data.statements != null) {
1320
- contents.Statements = deserializeAws_restJson1__listOfApplicationPolicyStatement(data.statements, context);
1321
- }
1322
- return [2, contents];
1323
- }
774
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
775
+ if (data.applicationId != null) {
776
+ contents.ApplicationId = __expectString(data.applicationId);
777
+ }
778
+ if (data.creationTime != null) {
779
+ contents.CreationTime = __expectString(data.creationTime);
780
+ }
781
+ if (data.expirationTime != null) {
782
+ contents.ExpirationTime = __expectString(data.expirationTime);
783
+ }
784
+ if (data.semanticVersion != null) {
785
+ contents.SemanticVersion = __expectString(data.semanticVersion);
786
+ }
787
+ if (data.status != null) {
788
+ contents.Status = __expectString(data.status);
789
+ }
790
+ if (data.templateId != null) {
791
+ contents.TemplateId = __expectString(data.templateId);
792
+ }
793
+ if (data.templateUrl != null) {
794
+ contents.TemplateUrl = __expectString(data.templateUrl);
795
+ }
796
+ return contents;
797
+ };
798
+ const deserializeAws_restJson1GetCloudFormationTemplateCommandError = async (output, context) => {
799
+ const parsedOutput = {
800
+ ...output,
801
+ body: await parseErrorBody(output.body, context),
802
+ };
803
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
804
+ switch (errorCode) {
805
+ case "BadRequestException":
806
+ case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
807
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
808
+ case "ForbiddenException":
809
+ case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
810
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
811
+ case "InternalServerErrorException":
812
+ case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
813
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
814
+ case "NotFoundException":
815
+ case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
816
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
817
+ case "TooManyRequestsException":
818
+ case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
819
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
820
+ default:
821
+ const parsedBody = parsedOutput.body;
822
+ throwDefaultError({
823
+ output,
824
+ parsedBody,
825
+ exceptionCtor: __BaseException,
826
+ errorCode,
827
+ });
828
+ }
829
+ };
830
+ export const deserializeAws_restJson1ListApplicationDependenciesCommand = async (output, context) => {
831
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
832
+ return deserializeAws_restJson1ListApplicationDependenciesCommandError(output, context);
833
+ }
834
+ const contents = map({
835
+ $metadata: deserializeMetadata(output),
1324
836
  });
1325
- }); };
1326
- var deserializeAws_restJson1PutApplicationPolicyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1327
- var parsedOutput, _a, errorCode, _b, parsedBody;
1328
- var _c;
1329
- return __generator(this, function (_d) {
1330
- switch (_d.label) {
1331
- case 0:
1332
- _a = [__assign({}, output)];
1333
- _c = {};
1334
- return [4, parseErrorBody(output.body, context)];
1335
- case 1:
1336
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1337
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1338
- _b = errorCode;
1339
- switch (_b) {
1340
- case "BadRequestException": return [3, 2];
1341
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException": return [3, 2];
1342
- case "ForbiddenException": return [3, 4];
1343
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": return [3, 4];
1344
- case "InternalServerErrorException": return [3, 6];
1345
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": return [3, 6];
1346
- case "NotFoundException": return [3, 8];
1347
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException": return [3, 8];
1348
- case "TooManyRequestsException": return [3, 10];
1349
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": return [3, 10];
1350
- }
1351
- return [3, 12];
1352
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1353
- case 3: throw _d.sent();
1354
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1355
- case 5: throw _d.sent();
1356
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1357
- case 7: throw _d.sent();
1358
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1359
- case 9: throw _d.sent();
1360
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1361
- case 11: throw _d.sent();
1362
- case 12:
1363
- parsedBody = parsedOutput.body;
1364
- throwDefaultError({
1365
- output: output,
1366
- parsedBody: parsedBody,
1367
- exceptionCtor: __BaseException,
1368
- errorCode: errorCode,
1369
- });
1370
- _d.label = 13;
1371
- case 13: return [2];
1372
- }
837
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
838
+ if (data.dependencies != null) {
839
+ contents.Dependencies = deserializeAws_restJson1__listOfApplicationDependencySummary(data.dependencies, context);
840
+ }
841
+ if (data.nextToken != null) {
842
+ contents.NextToken = __expectString(data.nextToken);
843
+ }
844
+ return contents;
845
+ };
846
+ const deserializeAws_restJson1ListApplicationDependenciesCommandError = async (output, context) => {
847
+ const parsedOutput = {
848
+ ...output,
849
+ body: await parseErrorBody(output.body, context),
850
+ };
851
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
852
+ switch (errorCode) {
853
+ case "BadRequestException":
854
+ case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
855
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
856
+ case "ForbiddenException":
857
+ case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
858
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
859
+ case "InternalServerErrorException":
860
+ case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
861
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
862
+ case "NotFoundException":
863
+ case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
864
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
865
+ case "TooManyRequestsException":
866
+ case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
867
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
868
+ default:
869
+ const parsedBody = parsedOutput.body;
870
+ throwDefaultError({
871
+ output,
872
+ parsedBody,
873
+ exceptionCtor: __BaseException,
874
+ errorCode,
875
+ });
876
+ }
877
+ };
878
+ export const deserializeAws_restJson1ListApplicationsCommand = async (output, context) => {
879
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
880
+ return deserializeAws_restJson1ListApplicationsCommandError(output, context);
881
+ }
882
+ const contents = map({
883
+ $metadata: deserializeMetadata(output),
1373
884
  });
1374
- }); };
1375
- export var deserializeAws_restJson1UnshareApplicationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1376
- var contents;
1377
- return __generator(this, function (_a) {
1378
- switch (_a.label) {
1379
- case 0:
1380
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1381
- return [2, deserializeAws_restJson1UnshareApplicationCommandError(output, context)];
1382
- }
1383
- contents = map({
1384
- $metadata: deserializeMetadata(output),
1385
- });
1386
- return [4, collectBody(output.body, context)];
1387
- case 1:
1388
- _a.sent();
1389
- return [2, contents];
1390
- }
885
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
886
+ if (data.applications != null) {
887
+ contents.Applications = deserializeAws_restJson1__listOfApplicationSummary(data.applications, context);
888
+ }
889
+ if (data.nextToken != null) {
890
+ contents.NextToken = __expectString(data.nextToken);
891
+ }
892
+ return contents;
893
+ };
894
+ const deserializeAws_restJson1ListApplicationsCommandError = async (output, context) => {
895
+ const parsedOutput = {
896
+ ...output,
897
+ body: await parseErrorBody(output.body, context),
898
+ };
899
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
900
+ switch (errorCode) {
901
+ case "BadRequestException":
902
+ case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
903
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
904
+ case "ForbiddenException":
905
+ case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
906
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
907
+ case "InternalServerErrorException":
908
+ case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
909
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
910
+ case "NotFoundException":
911
+ case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
912
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
913
+ default:
914
+ const parsedBody = parsedOutput.body;
915
+ throwDefaultError({
916
+ output,
917
+ parsedBody,
918
+ exceptionCtor: __BaseException,
919
+ errorCode,
920
+ });
921
+ }
922
+ };
923
+ export const deserializeAws_restJson1ListApplicationVersionsCommand = async (output, context) => {
924
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
925
+ return deserializeAws_restJson1ListApplicationVersionsCommandError(output, context);
926
+ }
927
+ const contents = map({
928
+ $metadata: deserializeMetadata(output),
1391
929
  });
1392
- }); };
1393
- var deserializeAws_restJson1UnshareApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1394
- var parsedOutput, _a, errorCode, _b, parsedBody;
1395
- var _c;
1396
- return __generator(this, function (_d) {
1397
- switch (_d.label) {
1398
- case 0:
1399
- _a = [__assign({}, output)];
1400
- _c = {};
1401
- return [4, parseErrorBody(output.body, context)];
1402
- case 1:
1403
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1404
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1405
- _b = errorCode;
1406
- switch (_b) {
1407
- case "BadRequestException": return [3, 2];
1408
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException": return [3, 2];
1409
- case "ForbiddenException": return [3, 4];
1410
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": return [3, 4];
1411
- case "InternalServerErrorException": return [3, 6];
1412
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": return [3, 6];
1413
- case "NotFoundException": return [3, 8];
1414
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException": return [3, 8];
1415
- case "TooManyRequestsException": return [3, 10];
1416
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": return [3, 10];
1417
- }
1418
- return [3, 12];
1419
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1420
- case 3: throw _d.sent();
1421
- case 4: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1422
- case 5: throw _d.sent();
1423
- case 6: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1424
- case 7: throw _d.sent();
1425
- case 8: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1426
- case 9: throw _d.sent();
1427
- case 10: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1428
- case 11: throw _d.sent();
1429
- case 12:
1430
- parsedBody = parsedOutput.body;
1431
- throwDefaultError({
1432
- output: output,
1433
- parsedBody: parsedBody,
1434
- exceptionCtor: __BaseException,
1435
- errorCode: errorCode,
1436
- });
1437
- _d.label = 13;
1438
- case 13: return [2];
1439
- }
930
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
931
+ if (data.nextToken != null) {
932
+ contents.NextToken = __expectString(data.nextToken);
933
+ }
934
+ if (data.versions != null) {
935
+ contents.Versions = deserializeAws_restJson1__listOfVersionSummary(data.versions, context);
936
+ }
937
+ return contents;
938
+ };
939
+ const deserializeAws_restJson1ListApplicationVersionsCommandError = async (output, context) => {
940
+ const parsedOutput = {
941
+ ...output,
942
+ body: await parseErrorBody(output.body, context),
943
+ };
944
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
945
+ switch (errorCode) {
946
+ case "BadRequestException":
947
+ case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
948
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
949
+ case "ForbiddenException":
950
+ case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
951
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
952
+ case "InternalServerErrorException":
953
+ case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
954
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
955
+ case "NotFoundException":
956
+ case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
957
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
958
+ case "TooManyRequestsException":
959
+ case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
960
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
961
+ default:
962
+ const parsedBody = parsedOutput.body;
963
+ throwDefaultError({
964
+ output,
965
+ parsedBody,
966
+ exceptionCtor: __BaseException,
967
+ errorCode,
968
+ });
969
+ }
970
+ };
971
+ export const deserializeAws_restJson1PutApplicationPolicyCommand = async (output, context) => {
972
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
973
+ return deserializeAws_restJson1PutApplicationPolicyCommandError(output, context);
974
+ }
975
+ const contents = map({
976
+ $metadata: deserializeMetadata(output),
1440
977
  });
1441
- }); };
1442
- export var deserializeAws_restJson1UpdateApplicationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1443
- var contents, data, _a, _b;
1444
- return __generator(this, function (_c) {
1445
- switch (_c.label) {
1446
- case 0:
1447
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1448
- return [2, deserializeAws_restJson1UpdateApplicationCommandError(output, context)];
1449
- }
1450
- contents = map({
1451
- $metadata: deserializeMetadata(output),
1452
- });
1453
- _a = __expectNonNull;
1454
- _b = __expectObject;
1455
- return [4, parseBody(output.body, context)];
1456
- case 1:
1457
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1458
- if (data.applicationId != null) {
1459
- contents.ApplicationId = __expectString(data.applicationId);
1460
- }
1461
- if (data.author != null) {
1462
- contents.Author = __expectString(data.author);
1463
- }
1464
- if (data.creationTime != null) {
1465
- contents.CreationTime = __expectString(data.creationTime);
1466
- }
1467
- if (data.description != null) {
1468
- contents.Description = __expectString(data.description);
1469
- }
1470
- if (data.homePageUrl != null) {
1471
- contents.HomePageUrl = __expectString(data.homePageUrl);
1472
- }
1473
- if (data.isVerifiedAuthor != null) {
1474
- contents.IsVerifiedAuthor = __expectBoolean(data.isVerifiedAuthor);
1475
- }
1476
- if (data.labels != null) {
1477
- contents.Labels = deserializeAws_restJson1__listOf__string(data.labels, context);
1478
- }
1479
- if (data.licenseUrl != null) {
1480
- contents.LicenseUrl = __expectString(data.licenseUrl);
1481
- }
1482
- if (data.name != null) {
1483
- contents.Name = __expectString(data.name);
1484
- }
1485
- if (data.readmeUrl != null) {
1486
- contents.ReadmeUrl = __expectString(data.readmeUrl);
1487
- }
1488
- if (data.spdxLicenseId != null) {
1489
- contents.SpdxLicenseId = __expectString(data.spdxLicenseId);
1490
- }
1491
- if (data.verifiedAuthorUrl != null) {
1492
- contents.VerifiedAuthorUrl = __expectString(data.verifiedAuthorUrl);
1493
- }
1494
- if (data.version != null) {
1495
- contents.Version = deserializeAws_restJson1Version(data.version, context);
1496
- }
1497
- return [2, contents];
1498
- }
978
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
979
+ if (data.statements != null) {
980
+ contents.Statements = deserializeAws_restJson1__listOfApplicationPolicyStatement(data.statements, context);
981
+ }
982
+ return contents;
983
+ };
984
+ const deserializeAws_restJson1PutApplicationPolicyCommandError = async (output, context) => {
985
+ const parsedOutput = {
986
+ ...output,
987
+ body: await parseErrorBody(output.body, context),
988
+ };
989
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
990
+ switch (errorCode) {
991
+ case "BadRequestException":
992
+ case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
993
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
994
+ case "ForbiddenException":
995
+ case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
996
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
997
+ case "InternalServerErrorException":
998
+ case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
999
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1000
+ case "NotFoundException":
1001
+ case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
1002
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1003
+ case "TooManyRequestsException":
1004
+ case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
1005
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1006
+ default:
1007
+ const parsedBody = parsedOutput.body;
1008
+ throwDefaultError({
1009
+ output,
1010
+ parsedBody,
1011
+ exceptionCtor: __BaseException,
1012
+ errorCode,
1013
+ });
1014
+ }
1015
+ };
1016
+ export const deserializeAws_restJson1UnshareApplicationCommand = async (output, context) => {
1017
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
1018
+ return deserializeAws_restJson1UnshareApplicationCommandError(output, context);
1019
+ }
1020
+ const contents = map({
1021
+ $metadata: deserializeMetadata(output),
1499
1022
  });
1500
- }); };
1501
- var deserializeAws_restJson1UpdateApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1502
- var parsedOutput, _a, errorCode, _b, parsedBody;
1503
- var _c;
1504
- return __generator(this, function (_d) {
1505
- switch (_d.label) {
1506
- case 0:
1507
- _a = [__assign({}, output)];
1508
- _c = {};
1509
- return [4, parseErrorBody(output.body, context)];
1510
- case 1:
1511
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1512
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1513
- _b = errorCode;
1514
- switch (_b) {
1515
- case "BadRequestException": return [3, 2];
1516
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException": return [3, 2];
1517
- case "ConflictException": return [3, 4];
1518
- case "com.amazonaws.serverlessapplicationrepository#ConflictException": return [3, 4];
1519
- case "ForbiddenException": return [3, 6];
1520
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": return [3, 6];
1521
- case "InternalServerErrorException": return [3, 8];
1522
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": return [3, 8];
1523
- case "NotFoundException": return [3, 10];
1524
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException": return [3, 10];
1525
- case "TooManyRequestsException": return [3, 12];
1526
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": return [3, 12];
1527
- }
1528
- return [3, 14];
1529
- case 2: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
1530
- case 3: throw _d.sent();
1531
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1532
- case 5: throw _d.sent();
1533
- case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
1534
- case 7: throw _d.sent();
1535
- case 8: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
1536
- case 9: throw _d.sent();
1537
- case 10: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
1538
- case 11: throw _d.sent();
1539
- case 12: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
1540
- case 13: throw _d.sent();
1541
- case 14:
1542
- parsedBody = parsedOutput.body;
1543
- throwDefaultError({
1544
- output: output,
1545
- parsedBody: parsedBody,
1546
- exceptionCtor: __BaseException,
1547
- errorCode: errorCode,
1548
- });
1549
- _d.label = 15;
1550
- case 15: return [2];
1551
- }
1023
+ await collectBody(output.body, context);
1024
+ return contents;
1025
+ };
1026
+ const deserializeAws_restJson1UnshareApplicationCommandError = async (output, context) => {
1027
+ const parsedOutput = {
1028
+ ...output,
1029
+ body: await parseErrorBody(output.body, context),
1030
+ };
1031
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1032
+ switch (errorCode) {
1033
+ case "BadRequestException":
1034
+ case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
1035
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1036
+ case "ForbiddenException":
1037
+ case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
1038
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1039
+ case "InternalServerErrorException":
1040
+ case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
1041
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1042
+ case "NotFoundException":
1043
+ case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
1044
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1045
+ case "TooManyRequestsException":
1046
+ case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
1047
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1048
+ default:
1049
+ const parsedBody = parsedOutput.body;
1050
+ throwDefaultError({
1051
+ output,
1052
+ parsedBody,
1053
+ exceptionCtor: __BaseException,
1054
+ errorCode,
1055
+ });
1056
+ }
1057
+ };
1058
+ export const deserializeAws_restJson1UpdateApplicationCommand = async (output, context) => {
1059
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1060
+ return deserializeAws_restJson1UpdateApplicationCommandError(output, context);
1061
+ }
1062
+ const contents = map({
1063
+ $metadata: deserializeMetadata(output),
1552
1064
  });
1553
- }); };
1554
- var map = __map;
1555
- var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1556
- var contents, data, exception;
1557
- return __generator(this, function (_a) {
1558
- contents = map({});
1559
- data = parsedOutput.body;
1560
- if (data.errorCode != null) {
1561
- contents.ErrorCode = __expectString(data.errorCode);
1562
- }
1563
- if (data.message != null) {
1564
- contents.Message = __expectString(data.message);
1565
- }
1566
- exception = new BadRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1567
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1065
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1066
+ if (data.applicationId != null) {
1067
+ contents.ApplicationId = __expectString(data.applicationId);
1068
+ }
1069
+ if (data.author != null) {
1070
+ contents.Author = __expectString(data.author);
1071
+ }
1072
+ if (data.creationTime != null) {
1073
+ contents.CreationTime = __expectString(data.creationTime);
1074
+ }
1075
+ if (data.description != null) {
1076
+ contents.Description = __expectString(data.description);
1077
+ }
1078
+ if (data.homePageUrl != null) {
1079
+ contents.HomePageUrl = __expectString(data.homePageUrl);
1080
+ }
1081
+ if (data.isVerifiedAuthor != null) {
1082
+ contents.IsVerifiedAuthor = __expectBoolean(data.isVerifiedAuthor);
1083
+ }
1084
+ if (data.labels != null) {
1085
+ contents.Labels = deserializeAws_restJson1__listOf__string(data.labels, context);
1086
+ }
1087
+ if (data.licenseUrl != null) {
1088
+ contents.LicenseUrl = __expectString(data.licenseUrl);
1089
+ }
1090
+ if (data.name != null) {
1091
+ contents.Name = __expectString(data.name);
1092
+ }
1093
+ if (data.readmeUrl != null) {
1094
+ contents.ReadmeUrl = __expectString(data.readmeUrl);
1095
+ }
1096
+ if (data.spdxLicenseId != null) {
1097
+ contents.SpdxLicenseId = __expectString(data.spdxLicenseId);
1098
+ }
1099
+ if (data.verifiedAuthorUrl != null) {
1100
+ contents.VerifiedAuthorUrl = __expectString(data.verifiedAuthorUrl);
1101
+ }
1102
+ if (data.version != null) {
1103
+ contents.Version = deserializeAws_restJson1Version(data.version, context);
1104
+ }
1105
+ return contents;
1106
+ };
1107
+ const deserializeAws_restJson1UpdateApplicationCommandError = async (output, context) => {
1108
+ const parsedOutput = {
1109
+ ...output,
1110
+ body: await parseErrorBody(output.body, context),
1111
+ };
1112
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1113
+ switch (errorCode) {
1114
+ case "BadRequestException":
1115
+ case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
1116
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1117
+ case "ConflictException":
1118
+ case "com.amazonaws.serverlessapplicationrepository#ConflictException":
1119
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1120
+ case "ForbiddenException":
1121
+ case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
1122
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
1123
+ case "InternalServerErrorException":
1124
+ case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
1125
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
1126
+ case "NotFoundException":
1127
+ case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
1128
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1129
+ case "TooManyRequestsException":
1130
+ case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
1131
+ throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
1132
+ default:
1133
+ const parsedBody = parsedOutput.body;
1134
+ throwDefaultError({
1135
+ output,
1136
+ parsedBody,
1137
+ exceptionCtor: __BaseException,
1138
+ errorCode,
1139
+ });
1140
+ }
1141
+ };
1142
+ const map = __map;
1143
+ const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
1144
+ const contents = map({});
1145
+ const data = parsedOutput.body;
1146
+ if (data.errorCode != null) {
1147
+ contents.ErrorCode = __expectString(data.errorCode);
1148
+ }
1149
+ if (data.message != null) {
1150
+ contents.Message = __expectString(data.message);
1151
+ }
1152
+ const exception = new BadRequestException({
1153
+ $metadata: deserializeMetadata(parsedOutput),
1154
+ ...contents,
1568
1155
  });
1569
- }); };
1570
- var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1571
- var contents, data, exception;
1572
- return __generator(this, function (_a) {
1573
- contents = map({});
1574
- data = parsedOutput.body;
1575
- if (data.errorCode != null) {
1576
- contents.ErrorCode = __expectString(data.errorCode);
1577
- }
1578
- if (data.message != null) {
1579
- contents.Message = __expectString(data.message);
1580
- }
1581
- exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1582
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1156
+ return __decorateServiceException(exception, parsedOutput.body);
1157
+ };
1158
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1159
+ const contents = map({});
1160
+ const data = parsedOutput.body;
1161
+ if (data.errorCode != null) {
1162
+ contents.ErrorCode = __expectString(data.errorCode);
1163
+ }
1164
+ if (data.message != null) {
1165
+ contents.Message = __expectString(data.message);
1166
+ }
1167
+ const exception = new ConflictException({
1168
+ $metadata: deserializeMetadata(parsedOutput),
1169
+ ...contents,
1583
1170
  });
1584
- }); };
1585
- var deserializeAws_restJson1ForbiddenExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1586
- var contents, data, exception;
1587
- return __generator(this, function (_a) {
1588
- contents = map({});
1589
- data = parsedOutput.body;
1590
- if (data.errorCode != null) {
1591
- contents.ErrorCode = __expectString(data.errorCode);
1592
- }
1593
- if (data.message != null) {
1594
- contents.Message = __expectString(data.message);
1595
- }
1596
- exception = new ForbiddenException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1597
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1171
+ return __decorateServiceException(exception, parsedOutput.body);
1172
+ };
1173
+ const deserializeAws_restJson1ForbiddenExceptionResponse = async (parsedOutput, context) => {
1174
+ const contents = map({});
1175
+ const data = parsedOutput.body;
1176
+ if (data.errorCode != null) {
1177
+ contents.ErrorCode = __expectString(data.errorCode);
1178
+ }
1179
+ if (data.message != null) {
1180
+ contents.Message = __expectString(data.message);
1181
+ }
1182
+ const exception = new ForbiddenException({
1183
+ $metadata: deserializeMetadata(parsedOutput),
1184
+ ...contents,
1598
1185
  });
1599
- }); };
1600
- var deserializeAws_restJson1InternalServerErrorExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1601
- var contents, data, exception;
1602
- return __generator(this, function (_a) {
1603
- contents = map({});
1604
- data = parsedOutput.body;
1605
- if (data.errorCode != null) {
1606
- contents.ErrorCode = __expectString(data.errorCode);
1607
- }
1608
- if (data.message != null) {
1609
- contents.Message = __expectString(data.message);
1610
- }
1611
- exception = new InternalServerErrorException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1612
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1186
+ return __decorateServiceException(exception, parsedOutput.body);
1187
+ };
1188
+ const deserializeAws_restJson1InternalServerErrorExceptionResponse = async (parsedOutput, context) => {
1189
+ const contents = map({});
1190
+ const data = parsedOutput.body;
1191
+ if (data.errorCode != null) {
1192
+ contents.ErrorCode = __expectString(data.errorCode);
1193
+ }
1194
+ if (data.message != null) {
1195
+ contents.Message = __expectString(data.message);
1196
+ }
1197
+ const exception = new InternalServerErrorException({
1198
+ $metadata: deserializeMetadata(parsedOutput),
1199
+ ...contents,
1613
1200
  });
1614
- }); };
1615
- var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1616
- var contents, data, exception;
1617
- return __generator(this, function (_a) {
1618
- contents = map({});
1619
- data = parsedOutput.body;
1620
- if (data.errorCode != null) {
1621
- contents.ErrorCode = __expectString(data.errorCode);
1622
- }
1623
- if (data.message != null) {
1624
- contents.Message = __expectString(data.message);
1625
- }
1626
- exception = new NotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1627
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1201
+ return __decorateServiceException(exception, parsedOutput.body);
1202
+ };
1203
+ const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, context) => {
1204
+ const contents = map({});
1205
+ const data = parsedOutput.body;
1206
+ if (data.errorCode != null) {
1207
+ contents.ErrorCode = __expectString(data.errorCode);
1208
+ }
1209
+ if (data.message != null) {
1210
+ contents.Message = __expectString(data.message);
1211
+ }
1212
+ const exception = new NotFoundException({
1213
+ $metadata: deserializeMetadata(parsedOutput),
1214
+ ...contents,
1628
1215
  });
1629
- }); };
1630
- var deserializeAws_restJson1TooManyRequestsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1631
- var contents, data, exception;
1632
- return __generator(this, function (_a) {
1633
- contents = map({});
1634
- data = parsedOutput.body;
1635
- if (data.errorCode != null) {
1636
- contents.ErrorCode = __expectString(data.errorCode);
1637
- }
1638
- if (data.message != null) {
1639
- contents.Message = __expectString(data.message);
1640
- }
1641
- exception = new TooManyRequestsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1642
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1216
+ return __decorateServiceException(exception, parsedOutput.body);
1217
+ };
1218
+ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOutput, context) => {
1219
+ const contents = map({});
1220
+ const data = parsedOutput.body;
1221
+ if (data.errorCode != null) {
1222
+ contents.ErrorCode = __expectString(data.errorCode);
1223
+ }
1224
+ if (data.message != null) {
1225
+ contents.Message = __expectString(data.message);
1226
+ }
1227
+ const exception = new TooManyRequestsException({
1228
+ $metadata: deserializeMetadata(parsedOutput),
1229
+ ...contents,
1643
1230
  });
1644
- }); };
1645
- var serializeAws_restJson1__listOf__string = function (input, context) {
1231
+ return __decorateServiceException(exception, parsedOutput.body);
1232
+ };
1233
+ const serializeAws_restJson1__listOf__string = (input, context) => {
1646
1234
  return input
1647
- .filter(function (e) { return e != null; })
1648
- .map(function (entry) {
1235
+ .filter((e) => e != null)
1236
+ .map((entry) => {
1649
1237
  return entry;
1650
1238
  });
1651
1239
  };
1652
- var serializeAws_restJson1__listOfApplicationPolicyStatement = function (input, context) {
1240
+ const serializeAws_restJson1__listOfApplicationPolicyStatement = (input, context) => {
1653
1241
  return input
1654
- .filter(function (e) { return e != null; })
1655
- .map(function (entry) {
1242
+ .filter((e) => e != null)
1243
+ .map((entry) => {
1656
1244
  return serializeAws_restJson1ApplicationPolicyStatement(entry, context);
1657
1245
  });
1658
1246
  };
1659
- var serializeAws_restJson1__listOfParameterValue = function (input, context) {
1247
+ const serializeAws_restJson1__listOfParameterValue = (input, context) => {
1660
1248
  return input
1661
- .filter(function (e) { return e != null; })
1662
- .map(function (entry) {
1249
+ .filter((e) => e != null)
1250
+ .map((entry) => {
1663
1251
  return serializeAws_restJson1ParameterValue(entry, context);
1664
1252
  });
1665
1253
  };
1666
- var serializeAws_restJson1__listOfRollbackTrigger = function (input, context) {
1254
+ const serializeAws_restJson1__listOfRollbackTrigger = (input, context) => {
1667
1255
  return input
1668
- .filter(function (e) { return e != null; })
1669
- .map(function (entry) {
1256
+ .filter((e) => e != null)
1257
+ .map((entry) => {
1670
1258
  return serializeAws_restJson1RollbackTrigger(entry, context);
1671
1259
  });
1672
1260
  };
1673
- var serializeAws_restJson1__listOfTag = function (input, context) {
1261
+ const serializeAws_restJson1__listOfTag = (input, context) => {
1674
1262
  return input
1675
- .filter(function (e) { return e != null; })
1676
- .map(function (entry) {
1263
+ .filter((e) => e != null)
1264
+ .map((entry) => {
1677
1265
  return serializeAws_restJson1Tag(entry, context);
1678
1266
  });
1679
1267
  };
1680
- var serializeAws_restJson1ApplicationPolicyStatement = function (input, context) {
1681
- return __assign(__assign(__assign(__assign({}, (input.Actions != null && { actions: serializeAws_restJson1__listOf__string(input.Actions, context) })), (input.PrincipalOrgIDs != null && {
1682
- principalOrgIDs: serializeAws_restJson1__listOf__string(input.PrincipalOrgIDs, context),
1683
- })), (input.Principals != null && { principals: serializeAws_restJson1__listOf__string(input.Principals, context) })), (input.StatementId != null && { statementId: input.StatementId }));
1268
+ const serializeAws_restJson1ApplicationPolicyStatement = (input, context) => {
1269
+ return {
1270
+ ...(input.Actions != null && { actions: serializeAws_restJson1__listOf__string(input.Actions, context) }),
1271
+ ...(input.PrincipalOrgIDs != null && {
1272
+ principalOrgIDs: serializeAws_restJson1__listOf__string(input.PrincipalOrgIDs, context),
1273
+ }),
1274
+ ...(input.Principals != null && { principals: serializeAws_restJson1__listOf__string(input.Principals, context) }),
1275
+ ...(input.StatementId != null && { statementId: input.StatementId }),
1276
+ };
1684
1277
  };
1685
- var serializeAws_restJson1ParameterValue = function (input, context) {
1686
- return __assign(__assign({}, (input.Name != null && { name: input.Name })), (input.Value != null && { value: input.Value }));
1278
+ const serializeAws_restJson1ParameterValue = (input, context) => {
1279
+ return {
1280
+ ...(input.Name != null && { name: input.Name }),
1281
+ ...(input.Value != null && { value: input.Value }),
1282
+ };
1687
1283
  };
1688
- var serializeAws_restJson1RollbackConfiguration = function (input, context) {
1689
- return __assign(__assign({}, (input.MonitoringTimeInMinutes != null && { monitoringTimeInMinutes: input.MonitoringTimeInMinutes })), (input.RollbackTriggers != null && {
1690
- rollbackTriggers: serializeAws_restJson1__listOfRollbackTrigger(input.RollbackTriggers, context),
1691
- }));
1284
+ const serializeAws_restJson1RollbackConfiguration = (input, context) => {
1285
+ return {
1286
+ ...(input.MonitoringTimeInMinutes != null && { monitoringTimeInMinutes: input.MonitoringTimeInMinutes }),
1287
+ ...(input.RollbackTriggers != null && {
1288
+ rollbackTriggers: serializeAws_restJson1__listOfRollbackTrigger(input.RollbackTriggers, context),
1289
+ }),
1290
+ };
1692
1291
  };
1693
- var serializeAws_restJson1RollbackTrigger = function (input, context) {
1694
- return __assign(__assign({}, (input.Arn != null && { arn: input.Arn })), (input.Type != null && { type: input.Type }));
1292
+ const serializeAws_restJson1RollbackTrigger = (input, context) => {
1293
+ return {
1294
+ ...(input.Arn != null && { arn: input.Arn }),
1295
+ ...(input.Type != null && { type: input.Type }),
1296
+ };
1695
1297
  };
1696
- var serializeAws_restJson1Tag = function (input, context) {
1697
- return __assign(__assign({}, (input.Key != null && { key: input.Key })), (input.Value != null && { value: input.Value }));
1298
+ const serializeAws_restJson1Tag = (input, context) => {
1299
+ return {
1300
+ ...(input.Key != null && { key: input.Key }),
1301
+ ...(input.Value != null && { value: input.Value }),
1302
+ };
1698
1303
  };
1699
- var deserializeAws_restJson1__listOf__string = function (output, context) {
1700
- var retVal = (output || [])
1701
- .filter(function (e) { return e != null; })
1702
- .map(function (entry) {
1304
+ const deserializeAws_restJson1__listOf__string = (output, context) => {
1305
+ const retVal = (output || [])
1306
+ .filter((e) => e != null)
1307
+ .map((entry) => {
1703
1308
  if (entry === null) {
1704
1309
  return null;
1705
1310
  }
@@ -1707,10 +1312,10 @@ var deserializeAws_restJson1__listOf__string = function (output, context) {
1707
1312
  });
1708
1313
  return retVal;
1709
1314
  };
1710
- var deserializeAws_restJson1__listOfApplicationDependencySummary = function (output, context) {
1711
- var retVal = (output || [])
1712
- .filter(function (e) { return e != null; })
1713
- .map(function (entry) {
1315
+ const deserializeAws_restJson1__listOfApplicationDependencySummary = (output, context) => {
1316
+ const retVal = (output || [])
1317
+ .filter((e) => e != null)
1318
+ .map((entry) => {
1714
1319
  if (entry === null) {
1715
1320
  return null;
1716
1321
  }
@@ -1718,10 +1323,10 @@ var deserializeAws_restJson1__listOfApplicationDependencySummary = function (out
1718
1323
  });
1719
1324
  return retVal;
1720
1325
  };
1721
- var deserializeAws_restJson1__listOfApplicationPolicyStatement = function (output, context) {
1722
- var retVal = (output || [])
1723
- .filter(function (e) { return e != null; })
1724
- .map(function (entry) {
1326
+ const deserializeAws_restJson1__listOfApplicationPolicyStatement = (output, context) => {
1327
+ const retVal = (output || [])
1328
+ .filter((e) => e != null)
1329
+ .map((entry) => {
1725
1330
  if (entry === null) {
1726
1331
  return null;
1727
1332
  }
@@ -1729,10 +1334,10 @@ var deserializeAws_restJson1__listOfApplicationPolicyStatement = function (outpu
1729
1334
  });
1730
1335
  return retVal;
1731
1336
  };
1732
- var deserializeAws_restJson1__listOfApplicationSummary = function (output, context) {
1733
- var retVal = (output || [])
1734
- .filter(function (e) { return e != null; })
1735
- .map(function (entry) {
1337
+ const deserializeAws_restJson1__listOfApplicationSummary = (output, context) => {
1338
+ const retVal = (output || [])
1339
+ .filter((e) => e != null)
1340
+ .map((entry) => {
1736
1341
  if (entry === null) {
1737
1342
  return null;
1738
1343
  }
@@ -1740,10 +1345,10 @@ var deserializeAws_restJson1__listOfApplicationSummary = function (output, conte
1740
1345
  });
1741
1346
  return retVal;
1742
1347
  };
1743
- var deserializeAws_restJson1__listOfCapability = function (output, context) {
1744
- var retVal = (output || [])
1745
- .filter(function (e) { return e != null; })
1746
- .map(function (entry) {
1348
+ const deserializeAws_restJson1__listOfCapability = (output, context) => {
1349
+ const retVal = (output || [])
1350
+ .filter((e) => e != null)
1351
+ .map((entry) => {
1747
1352
  if (entry === null) {
1748
1353
  return null;
1749
1354
  }
@@ -1751,10 +1356,10 @@ var deserializeAws_restJson1__listOfCapability = function (output, context) {
1751
1356
  });
1752
1357
  return retVal;
1753
1358
  };
1754
- var deserializeAws_restJson1__listOfParameterDefinition = function (output, context) {
1755
- var retVal = (output || [])
1756
- .filter(function (e) { return e != null; })
1757
- .map(function (entry) {
1359
+ const deserializeAws_restJson1__listOfParameterDefinition = (output, context) => {
1360
+ const retVal = (output || [])
1361
+ .filter((e) => e != null)
1362
+ .map((entry) => {
1758
1363
  if (entry === null) {
1759
1364
  return null;
1760
1365
  }
@@ -1762,10 +1367,10 @@ var deserializeAws_restJson1__listOfParameterDefinition = function (output, cont
1762
1367
  });
1763
1368
  return retVal;
1764
1369
  };
1765
- var deserializeAws_restJson1__listOfVersionSummary = function (output, context) {
1766
- var retVal = (output || [])
1767
- .filter(function (e) { return e != null; })
1768
- .map(function (entry) {
1370
+ const deserializeAws_restJson1__listOfVersionSummary = (output, context) => {
1371
+ const retVal = (output || [])
1372
+ .filter((e) => e != null)
1373
+ .map((entry) => {
1769
1374
  if (entry === null) {
1770
1375
  return null;
1771
1376
  }
@@ -1773,13 +1378,13 @@ var deserializeAws_restJson1__listOfVersionSummary = function (output, context)
1773
1378
  });
1774
1379
  return retVal;
1775
1380
  };
1776
- var deserializeAws_restJson1ApplicationDependencySummary = function (output, context) {
1381
+ const deserializeAws_restJson1ApplicationDependencySummary = (output, context) => {
1777
1382
  return {
1778
1383
  ApplicationId: __expectString(output.applicationId),
1779
1384
  SemanticVersion: __expectString(output.semanticVersion),
1780
1385
  };
1781
1386
  };
1782
- var deserializeAws_restJson1ApplicationPolicyStatement = function (output, context) {
1387
+ const deserializeAws_restJson1ApplicationPolicyStatement = (output, context) => {
1783
1388
  return {
1784
1389
  Actions: output.actions != null ? deserializeAws_restJson1__listOf__string(output.actions, context) : undefined,
1785
1390
  PrincipalOrgIDs: output.principalOrgIDs != null
@@ -1789,7 +1394,7 @@ var deserializeAws_restJson1ApplicationPolicyStatement = function (output, conte
1789
1394
  StatementId: __expectString(output.statementId),
1790
1395
  };
1791
1396
  };
1792
- var deserializeAws_restJson1ApplicationSummary = function (output, context) {
1397
+ const deserializeAws_restJson1ApplicationSummary = (output, context) => {
1793
1398
  return {
1794
1399
  ApplicationId: __expectString(output.applicationId),
1795
1400
  Author: __expectString(output.author),
@@ -1801,7 +1406,7 @@ var deserializeAws_restJson1ApplicationSummary = function (output, context) {
1801
1406
  SpdxLicenseId: __expectString(output.spdxLicenseId),
1802
1407
  };
1803
1408
  };
1804
- var deserializeAws_restJson1ParameterDefinition = function (output, context) {
1409
+ const deserializeAws_restJson1ParameterDefinition = (output, context) => {
1805
1410
  return {
1806
1411
  AllowedPattern: __expectString(output.allowedPattern),
1807
1412
  AllowedValues: output.allowedValues != null
@@ -1822,7 +1427,7 @@ var deserializeAws_restJson1ParameterDefinition = function (output, context) {
1822
1427
  Type: __expectString(output.type),
1823
1428
  };
1824
1429
  };
1825
- var deserializeAws_restJson1Version = function (output, context) {
1430
+ const deserializeAws_restJson1Version = (output, context) => {
1826
1431
  return {
1827
1432
  ApplicationId: __expectString(output.applicationId),
1828
1433
  CreationTime: __expectString(output.creationTime),
@@ -1839,7 +1444,7 @@ var deserializeAws_restJson1Version = function (output, context) {
1839
1444
  TemplateUrl: __expectString(output.templateUrl),
1840
1445
  };
1841
1446
  };
1842
- var deserializeAws_restJson1VersionSummary = function (output, context) {
1447
+ const deserializeAws_restJson1VersionSummary = (output, context) => {
1843
1448
  return {
1844
1449
  ApplicationId: __expectString(output.applicationId),
1845
1450
  CreationTime: __expectString(output.creationTime),
@@ -1847,57 +1452,39 @@ var deserializeAws_restJson1VersionSummary = function (output, context) {
1847
1452
  SourceCodeUrl: __expectString(output.sourceCodeUrl),
1848
1453
  };
1849
1454
  };
1850
- var deserializeMetadata = function (output) {
1851
- var _a, _b;
1852
- return ({
1853
- httpStatusCode: output.statusCode,
1854
- 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"],
1855
- extendedRequestId: output.headers["x-amz-id-2"],
1856
- cfId: output.headers["x-amz-cf-id"],
1857
- });
1858
- };
1859
- var collectBody = function (streamBody, context) {
1860
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
1455
+ const deserializeMetadata = (output) => ({
1456
+ httpStatusCode: output.statusCode,
1457
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1458
+ extendedRequestId: output.headers["x-amz-id-2"],
1459
+ cfId: output.headers["x-amz-cf-id"],
1460
+ });
1461
+ const collectBody = (streamBody = new Uint8Array(), context) => {
1861
1462
  if (streamBody instanceof Uint8Array) {
1862
1463
  return Promise.resolve(streamBody);
1863
1464
  }
1864
1465
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1865
1466
  };
1866
- var collectBodyString = function (streamBody, context) {
1867
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1868
- };
1869
- var isSerializableHeaderValue = function (value) {
1870
- return value !== undefined &&
1871
- value !== null &&
1872
- value !== "" &&
1873
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1874
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1875
- };
1876
- var parseBody = function (streamBody, context) {
1877
- return collectBodyString(streamBody, context).then(function (encoded) {
1878
- if (encoded.length) {
1879
- return JSON.parse(encoded);
1880
- }
1881
- return {};
1882
- });
1467
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1468
+ const isSerializableHeaderValue = (value) => value !== undefined &&
1469
+ value !== null &&
1470
+ value !== "" &&
1471
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1472
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1473
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1474
+ if (encoded.length) {
1475
+ return JSON.parse(encoded);
1476
+ }
1477
+ return {};
1478
+ });
1479
+ const parseErrorBody = async (errorBody, context) => {
1480
+ const value = await parseBody(errorBody, context);
1481
+ value.message = value.message ?? value.Message;
1482
+ return value;
1883
1483
  };
1884
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
1885
- var value;
1886
- var _a;
1887
- return __generator(this, function (_b) {
1888
- switch (_b.label) {
1889
- case 0: return [4, parseBody(errorBody, context)];
1890
- case 1:
1891
- value = _b.sent();
1892
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1893
- return [2, value];
1894
- }
1895
- });
1896
- }); };
1897
- var loadRestJsonErrorCode = function (output, data) {
1898
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1899
- var sanitizeErrorCode = function (rawValue) {
1900
- var cleanValue = rawValue;
1484
+ const loadRestJsonErrorCode = (output, data) => {
1485
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1486
+ const sanitizeErrorCode = (rawValue) => {
1487
+ let cleanValue = rawValue;
1901
1488
  if (typeof cleanValue === "number") {
1902
1489
  cleanValue = cleanValue.toString();
1903
1490
  }
@@ -1912,7 +1499,7 @@ var loadRestJsonErrorCode = function (output, data) {
1912
1499
  }
1913
1500
  return cleanValue;
1914
1501
  };
1915
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1502
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1916
1503
  if (headerKey !== undefined) {
1917
1504
  return sanitizeErrorCode(output.headers[headerKey]);
1918
1505
  }