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