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