@aws-sdk/client-amp 3.141.0 → 3.149.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 (36) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist-cjs/Amp.js +60 -0
  3. package/dist-cjs/commands/CreateLoggingConfigurationCommand.js +36 -0
  4. package/dist-cjs/commands/DeleteLoggingConfigurationCommand.js +36 -0
  5. package/dist-cjs/commands/DescribeLoggingConfigurationCommand.js +36 -0
  6. package/dist-cjs/commands/UpdateLoggingConfigurationCommand.js +36 -0
  7. package/dist-cjs/commands/index.js +4 -0
  8. package/dist-cjs/models/models_0.js +47 -1
  9. package/dist-cjs/protocols/Aws_restJson1.js +512 -466
  10. package/dist-es/Amp.js +60 -0
  11. package/dist-es/commands/CreateLoggingConfigurationCommand.js +39 -0
  12. package/dist-es/commands/DeleteLoggingConfigurationCommand.js +39 -0
  13. package/dist-es/commands/DescribeLoggingConfigurationCommand.js +39 -0
  14. package/dist-es/commands/UpdateLoggingConfigurationCommand.js +39 -0
  15. package/dist-es/commands/index.js +4 -0
  16. package/dist-es/models/models_0.js +18 -0
  17. package/dist-es/protocols/Aws_restJson1.js +692 -465
  18. package/dist-types/Amp.d.ts +28 -0
  19. package/dist-types/AmpClient.d.ts +6 -2
  20. package/dist-types/commands/CreateLoggingConfigurationCommand.d.ts +35 -0
  21. package/dist-types/commands/DeleteLoggingConfigurationCommand.d.ts +35 -0
  22. package/dist-types/commands/DescribeLoggingConfigurationCommand.d.ts +35 -0
  23. package/dist-types/commands/UpdateLoggingConfigurationCommand.d.ts +35 -0
  24. package/dist-types/commands/index.d.ts +4 -0
  25. package/dist-types/models/models_0.d.ts +183 -0
  26. package/dist-types/protocols/Aws_restJson1.d.ts +12 -0
  27. package/dist-types/ts3.4/Amp.d.ts +20 -0
  28. package/dist-types/ts3.4/AmpClient.d.ts +6 -2
  29. package/dist-types/ts3.4/commands/CreateLoggingConfigurationCommand.d.ts +17 -0
  30. package/dist-types/ts3.4/commands/DeleteLoggingConfigurationCommand.d.ts +17 -0
  31. package/dist-types/ts3.4/commands/DescribeLoggingConfigurationCommand.d.ts +17 -0
  32. package/dist-types/ts3.4/commands/UpdateLoggingConfigurationCommand.d.ts +17 -0
  33. package/dist-types/ts3.4/commands/index.d.ts +4 -0
  34. package/dist-types/ts3.4/models/models_0.d.ts +97 -0
  35. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +12 -0
  36. package/package.json +11 -6
@@ -1,11 +1,11 @@
1
1
  import { __assign, __awaiter, __generator, __read } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, parseEpochTimestamp as __parseEpochTimestamp, strictParseInt32 as __strictParseInt32, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, strictParseInt32 as __strictParseInt32, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { v4 as generateIdempotencyToken } from "uuid";
5
5
  import { AmpServiceException as __BaseException } from "../models/AmpServiceException";
6
6
  import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
7
7
  export var serializeAws_restJson1CreateAlertManagerDefinitionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
8
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
8
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
9
9
  var _c;
10
10
  return __generator(this, function (_d) {
11
11
  switch (_d.label) {
@@ -17,16 +17,7 @@ export var serializeAws_restJson1CreateAlertManagerDefinitionCommand = function
17
17
  };
18
18
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
19
19
  "/workspaces/{workspaceId}/alertmanager/definition";
20
- if (input.workspaceId !== undefined) {
21
- labelValue = input.workspaceId;
22
- if (labelValue.length <= 0) {
23
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
24
- }
25
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
26
- }
27
- else {
28
- throw new Error("No value provided for input HTTP label: workspaceId.");
29
- }
20
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
30
21
  body = JSON.stringify(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.data != null && { data: context.base64Encoder(input.data) })));
31
22
  return [2, new __HttpRequest({
32
23
  protocol: protocol,
@@ -40,8 +31,34 @@ export var serializeAws_restJson1CreateAlertManagerDefinitionCommand = function
40
31
  }
41
32
  });
42
33
  }); };
34
+ export var serializeAws_restJson1CreateLoggingConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
35
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
36
+ var _c;
37
+ return __generator(this, function (_d) {
38
+ switch (_d.label) {
39
+ case 0: return [4, context.endpoint()];
40
+ case 1:
41
+ _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
42
+ headers = {
43
+ "content-type": "application/json",
44
+ };
45
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}/logging";
46
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
47
+ body = JSON.stringify(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.logGroupArn != null && { logGroupArn: input.logGroupArn })));
48
+ return [2, new __HttpRequest({
49
+ protocol: protocol,
50
+ hostname: hostname,
51
+ port: port,
52
+ method: "POST",
53
+ headers: headers,
54
+ path: resolvedPath,
55
+ body: body,
56
+ })];
57
+ }
58
+ });
59
+ }); };
43
60
  export var serializeAws_restJson1CreateRuleGroupsNamespaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
44
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
61
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
45
62
  var _c;
46
63
  return __generator(this, function (_d) {
47
64
  switch (_d.label) {
@@ -53,16 +70,7 @@ export var serializeAws_restJson1CreateRuleGroupsNamespaceCommand = function (in
53
70
  };
54
71
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
55
72
  "/workspaces/{workspaceId}/rulegroupsnamespaces";
56
- if (input.workspaceId !== undefined) {
57
- labelValue = input.workspaceId;
58
- if (labelValue.length <= 0) {
59
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
60
- }
61
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
62
- }
63
- else {
64
- throw new Error("No value provided for input HTTP label: workspaceId.");
65
- }
73
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
66
74
  body = JSON.stringify(__assign(__assign(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.data != null && { data: context.base64Encoder(input.data) })), (input.name != null && { name: input.name })), (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
67
75
  return [2, new __HttpRequest({
68
76
  protocol: protocol,
@@ -102,7 +110,7 @@ export var serializeAws_restJson1CreateWorkspaceCommand = function (input, conte
102
110
  });
103
111
  }); };
104
112
  export var serializeAws_restJson1DeleteAlertManagerDefinitionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
105
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
113
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
106
114
  return __generator(this, function (_c) {
107
115
  switch (_c.label) {
108
116
  case 0: return [4, context.endpoint()];
@@ -111,17 +119,36 @@ export var serializeAws_restJson1DeleteAlertManagerDefinitionCommand = function
111
119
  headers = {};
112
120
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
113
121
  "/workspaces/{workspaceId}/alertmanager/definition";
114
- if (input.workspaceId !== undefined) {
115
- labelValue = input.workspaceId;
116
- if (labelValue.length <= 0) {
117
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
118
- }
119
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
120
- }
121
- else {
122
- throw new Error("No value provided for input HTTP label: workspaceId.");
123
- }
124
- query = __assign({}, (input.clientToken !== undefined && { clientToken: input.clientToken }));
122
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
123
+ query = map({
124
+ clientToken: [, input.clientToken],
125
+ });
126
+ return [2, new __HttpRequest({
127
+ protocol: protocol,
128
+ hostname: hostname,
129
+ port: port,
130
+ method: "DELETE",
131
+ headers: headers,
132
+ path: resolvedPath,
133
+ query: query,
134
+ body: body,
135
+ })];
136
+ }
137
+ });
138
+ }); };
139
+ export var serializeAws_restJson1DeleteLoggingConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
140
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
141
+ return __generator(this, function (_c) {
142
+ switch (_c.label) {
143
+ case 0: return [4, context.endpoint()];
144
+ case 1:
145
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
146
+ headers = {};
147
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}/logging";
148
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
149
+ query = map({
150
+ clientToken: [, input.clientToken],
151
+ });
125
152
  return [2, new __HttpRequest({
126
153
  protocol: protocol,
127
154
  hostname: hostname,
@@ -136,7 +163,7 @@ export var serializeAws_restJson1DeleteAlertManagerDefinitionCommand = function
136
163
  });
137
164
  }); };
138
165
  export var serializeAws_restJson1DeleteRuleGroupsNamespaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
139
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
166
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
140
167
  return __generator(this, function (_c) {
141
168
  switch (_c.label) {
142
169
  case 0: return [4, context.endpoint()];
@@ -145,27 +172,11 @@ export var serializeAws_restJson1DeleteRuleGroupsNamespaceCommand = function (in
145
172
  headers = {};
146
173
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
147
174
  "/workspaces/{workspaceId}/rulegroupsnamespaces/{name}";
148
- if (input.workspaceId !== undefined) {
149
- labelValue = input.workspaceId;
150
- if (labelValue.length <= 0) {
151
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
152
- }
153
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
154
- }
155
- else {
156
- throw new Error("No value provided for input HTTP label: workspaceId.");
157
- }
158
- if (input.name !== undefined) {
159
- labelValue = input.name;
160
- if (labelValue.length <= 0) {
161
- throw new Error("Empty value provided for input HTTP label: name.");
162
- }
163
- resolvedPath = resolvedPath.replace("{name}", __extendedEncodeURIComponent(labelValue));
164
- }
165
- else {
166
- throw new Error("No value provided for input HTTP label: name.");
167
- }
168
- query = __assign({}, (input.clientToken !== undefined && { clientToken: input.clientToken }));
175
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
176
+ resolvedPath = __resolvedPath(resolvedPath, input, "name", function () { return input.name; }, "{name}", false);
177
+ query = map({
178
+ clientToken: [, input.clientToken],
179
+ });
169
180
  return [2, new __HttpRequest({
170
181
  protocol: protocol,
171
182
  hostname: hostname,
@@ -180,7 +191,7 @@ export var serializeAws_restJson1DeleteRuleGroupsNamespaceCommand = function (in
180
191
  });
181
192
  }); };
182
193
  export var serializeAws_restJson1DeleteWorkspaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
183
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
194
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
184
195
  return __generator(this, function (_c) {
185
196
  switch (_c.label) {
186
197
  case 0: return [4, context.endpoint()];
@@ -188,17 +199,10 @@ export var serializeAws_restJson1DeleteWorkspaceCommand = function (input, conte
188
199
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
189
200
  headers = {};
190
201
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}";
191
- if (input.workspaceId !== undefined) {
192
- labelValue = input.workspaceId;
193
- if (labelValue.length <= 0) {
194
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
195
- }
196
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
197
- }
198
- else {
199
- throw new Error("No value provided for input HTTP label: workspaceId.");
200
- }
201
- query = __assign({}, (input.clientToken !== undefined && { clientToken: input.clientToken }));
202
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
203
+ query = map({
204
+ clientToken: [, input.clientToken],
205
+ });
202
206
  return [2, new __HttpRequest({
203
207
  protocol: protocol,
204
208
  hostname: hostname,
@@ -213,7 +217,7 @@ export var serializeAws_restJson1DeleteWorkspaceCommand = function (input, conte
213
217
  });
214
218
  }); };
215
219
  export var serializeAws_restJson1DescribeAlertManagerDefinitionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
216
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
220
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
217
221
  return __generator(this, function (_c) {
218
222
  switch (_c.label) {
219
223
  case 0: return [4, context.endpoint()];
@@ -222,16 +226,29 @@ export var serializeAws_restJson1DescribeAlertManagerDefinitionCommand = functio
222
226
  headers = {};
223
227
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
224
228
  "/workspaces/{workspaceId}/alertmanager/definition";
225
- if (input.workspaceId !== undefined) {
226
- labelValue = input.workspaceId;
227
- if (labelValue.length <= 0) {
228
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
229
- }
230
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
231
- }
232
- else {
233
- throw new Error("No value provided for input HTTP label: workspaceId.");
234
- }
229
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
230
+ return [2, new __HttpRequest({
231
+ protocol: protocol,
232
+ hostname: hostname,
233
+ port: port,
234
+ method: "GET",
235
+ headers: headers,
236
+ path: resolvedPath,
237
+ body: body,
238
+ })];
239
+ }
240
+ });
241
+ }); };
242
+ export var serializeAws_restJson1DescribeLoggingConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
243
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
244
+ return __generator(this, function (_c) {
245
+ switch (_c.label) {
246
+ case 0: return [4, context.endpoint()];
247
+ case 1:
248
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
249
+ headers = {};
250
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}/logging";
251
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
235
252
  return [2, new __HttpRequest({
236
253
  protocol: protocol,
237
254
  hostname: hostname,
@@ -245,7 +262,7 @@ export var serializeAws_restJson1DescribeAlertManagerDefinitionCommand = functio
245
262
  });
246
263
  }); };
247
264
  export var serializeAws_restJson1DescribeRuleGroupsNamespaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
248
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
265
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
249
266
  return __generator(this, function (_c) {
250
267
  switch (_c.label) {
251
268
  case 0: return [4, context.endpoint()];
@@ -254,26 +271,8 @@ export var serializeAws_restJson1DescribeRuleGroupsNamespaceCommand = function (
254
271
  headers = {};
255
272
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
256
273
  "/workspaces/{workspaceId}/rulegroupsnamespaces/{name}";
257
- if (input.workspaceId !== undefined) {
258
- labelValue = input.workspaceId;
259
- if (labelValue.length <= 0) {
260
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
261
- }
262
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
263
- }
264
- else {
265
- throw new Error("No value provided for input HTTP label: workspaceId.");
266
- }
267
- if (input.name !== undefined) {
268
- labelValue = input.name;
269
- if (labelValue.length <= 0) {
270
- throw new Error("Empty value provided for input HTTP label: name.");
271
- }
272
- resolvedPath = resolvedPath.replace("{name}", __extendedEncodeURIComponent(labelValue));
273
- }
274
- else {
275
- throw new Error("No value provided for input HTTP label: name.");
276
- }
274
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
275
+ resolvedPath = __resolvedPath(resolvedPath, input, "name", function () { return input.name; }, "{name}", false);
277
276
  return [2, new __HttpRequest({
278
277
  protocol: protocol,
279
278
  hostname: hostname,
@@ -287,7 +286,7 @@ export var serializeAws_restJson1DescribeRuleGroupsNamespaceCommand = function (
287
286
  });
288
287
  }); };
289
288
  export var serializeAws_restJson1DescribeWorkspaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
290
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
289
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
291
290
  return __generator(this, function (_c) {
292
291
  switch (_c.label) {
293
292
  case 0: return [4, context.endpoint()];
@@ -295,16 +294,7 @@ export var serializeAws_restJson1DescribeWorkspaceCommand = function (input, con
295
294
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
296
295
  headers = {};
297
296
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}";
298
- if (input.workspaceId !== undefined) {
299
- labelValue = input.workspaceId;
300
- if (labelValue.length <= 0) {
301
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
302
- }
303
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
304
- }
305
- else {
306
- throw new Error("No value provided for input HTTP label: workspaceId.");
307
- }
297
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
308
298
  return [2, new __HttpRequest({
309
299
  protocol: protocol,
310
300
  hostname: hostname,
@@ -318,7 +308,7 @@ export var serializeAws_restJson1DescribeWorkspaceCommand = function (input, con
318
308
  });
319
309
  }); };
320
310
  export var serializeAws_restJson1ListRuleGroupsNamespacesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
321
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
311
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
322
312
  return __generator(this, function (_c) {
323
313
  switch (_c.label) {
324
314
  case 0: return [4, context.endpoint()];
@@ -327,17 +317,12 @@ export var serializeAws_restJson1ListRuleGroupsNamespacesCommand = function (inp
327
317
  headers = {};
328
318
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
329
319
  "/workspaces/{workspaceId}/rulegroupsnamespaces";
330
- if (input.workspaceId !== undefined) {
331
- labelValue = input.workspaceId;
332
- if (labelValue.length <= 0) {
333
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
334
- }
335
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
336
- }
337
- else {
338
- throw new Error("No value provided for input HTTP label: workspaceId.");
339
- }
340
- query = __assign(__assign(__assign({}, (input.name !== undefined && { name: input.name })), (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
320
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
321
+ query = map({
322
+ name: [, input.name],
323
+ nextToken: [, input.nextToken],
324
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
325
+ });
341
326
  return [2, new __HttpRequest({
342
327
  protocol: protocol,
343
328
  hostname: hostname,
@@ -352,7 +337,7 @@ export var serializeAws_restJson1ListRuleGroupsNamespacesCommand = function (inp
352
337
  });
353
338
  }); };
354
339
  export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
355
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
340
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
356
341
  return __generator(this, function (_c) {
357
342
  switch (_c.label) {
358
343
  case 0: return [4, context.endpoint()];
@@ -360,16 +345,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
360
345
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
361
346
  headers = {};
362
347
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
363
- if (input.resourceArn !== undefined) {
364
- labelValue = input.resourceArn;
365
- if (labelValue.length <= 0) {
366
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
367
- }
368
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
369
- }
370
- else {
371
- throw new Error("No value provided for input HTTP label: resourceArn.");
372
- }
348
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
373
349
  return [2, new __HttpRequest({
374
350
  protocol: protocol,
375
351
  hostname: hostname,
@@ -391,7 +367,11 @@ export var serializeAws_restJson1ListWorkspacesCommand = function (input, contex
391
367
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
392
368
  headers = {};
393
369
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces";
394
- query = __assign(__assign(__assign({}, (input.nextToken !== undefined && { nextToken: input.nextToken })), (input.alias !== undefined && { alias: input.alias })), (input.maxResults !== undefined && { maxResults: input.maxResults.toString() }));
370
+ query = map({
371
+ nextToken: [, input.nextToken],
372
+ alias: [, input.alias],
373
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
374
+ });
395
375
  return [2, new __HttpRequest({
396
376
  protocol: protocol,
397
377
  hostname: hostname,
@@ -406,7 +386,7 @@ export var serializeAws_restJson1ListWorkspacesCommand = function (input, contex
406
386
  });
407
387
  }); };
408
388
  export var serializeAws_restJson1PutAlertManagerDefinitionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
409
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
389
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
410
390
  var _c;
411
391
  return __generator(this, function (_d) {
412
392
  switch (_d.label) {
@@ -418,16 +398,7 @@ export var serializeAws_restJson1PutAlertManagerDefinitionCommand = function (in
418
398
  };
419
399
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
420
400
  "/workspaces/{workspaceId}/alertmanager/definition";
421
- if (input.workspaceId !== undefined) {
422
- labelValue = input.workspaceId;
423
- if (labelValue.length <= 0) {
424
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
425
- }
426
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
427
- }
428
- else {
429
- throw new Error("No value provided for input HTTP label: workspaceId.");
430
- }
401
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
431
402
  body = JSON.stringify(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.data != null && { data: context.base64Encoder(input.data) })));
432
403
  return [2, new __HttpRequest({
433
404
  protocol: protocol,
@@ -442,7 +413,7 @@ export var serializeAws_restJson1PutAlertManagerDefinitionCommand = function (in
442
413
  });
443
414
  }); };
444
415
  export var serializeAws_restJson1PutRuleGroupsNamespaceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
445
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, body;
416
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
446
417
  var _c;
447
418
  return __generator(this, function (_d) {
448
419
  switch (_d.label) {
@@ -454,26 +425,8 @@ export var serializeAws_restJson1PutRuleGroupsNamespaceCommand = function (input
454
425
  };
455
426
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
456
427
  "/workspaces/{workspaceId}/rulegroupsnamespaces/{name}";
457
- if (input.workspaceId !== undefined) {
458
- labelValue = input.workspaceId;
459
- if (labelValue.length <= 0) {
460
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
461
- }
462
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
463
- }
464
- else {
465
- throw new Error("No value provided for input HTTP label: workspaceId.");
466
- }
467
- if (input.name !== undefined) {
468
- labelValue = input.name;
469
- if (labelValue.length <= 0) {
470
- throw new Error("Empty value provided for input HTTP label: name.");
471
- }
472
- resolvedPath = resolvedPath.replace("{name}", __extendedEncodeURIComponent(labelValue));
473
- }
474
- else {
475
- throw new Error("No value provided for input HTTP label: name.");
476
- }
428
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
429
+ resolvedPath = __resolvedPath(resolvedPath, input, "name", function () { return input.name; }, "{name}", false);
477
430
  body = JSON.stringify(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.data != null && { data: context.base64Encoder(input.data) })));
478
431
  return [2, new __HttpRequest({
479
432
  protocol: protocol,
@@ -488,7 +441,7 @@ export var serializeAws_restJson1PutRuleGroupsNamespaceCommand = function (input
488
441
  });
489
442
  }); };
490
443
  export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
491
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
444
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
492
445
  return __generator(this, function (_c) {
493
446
  switch (_c.label) {
494
447
  case 0: return [4, context.endpoint()];
@@ -498,16 +451,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
498
451
  "content-type": "application/json",
499
452
  };
500
453
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
501
- if (input.resourceArn !== undefined) {
502
- labelValue = input.resourceArn;
503
- if (labelValue.length <= 0) {
504
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
505
- }
506
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
507
- }
508
- else {
509
- throw new Error("No value provided for input HTTP label: resourceArn.");
510
- }
454
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
511
455
  body = JSON.stringify(__assign({}, (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
512
456
  return [2, new __HttpRequest({
513
457
  protocol: protocol,
@@ -522,7 +466,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
522
466
  });
523
467
  }); };
524
468
  export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
525
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
469
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
526
470
  return __generator(this, function (_c) {
527
471
  switch (_c.label) {
528
472
  case 0: return [4, context.endpoint()];
@@ -530,17 +474,10 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
530
474
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
531
475
  headers = {};
532
476
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
533
- if (input.resourceArn !== undefined) {
534
- labelValue = input.resourceArn;
535
- if (labelValue.length <= 0) {
536
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
537
- }
538
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
539
- }
540
- else {
541
- throw new Error("No value provided for input HTTP label: resourceArn.");
542
- }
543
- query = __assign({}, (input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map(function (_entry) { return _entry; }) }));
477
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
478
+ query = map({
479
+ tagKeys: [function () { return input.tagKeys !== void 0; }, function () { return (input.tagKeys || []).map(function (_entry) { return _entry; }); }],
480
+ });
544
481
  return [2, new __HttpRequest({
545
482
  protocol: protocol,
546
483
  hostname: hostname,
@@ -554,8 +491,34 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
554
491
  }
555
492
  });
556
493
  }); };
494
+ export var serializeAws_restJson1UpdateLoggingConfigurationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
495
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
496
+ var _c;
497
+ return __generator(this, function (_d) {
498
+ switch (_d.label) {
499
+ case 0: return [4, context.endpoint()];
500
+ case 1:
501
+ _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
502
+ headers = {
503
+ "content-type": "application/json",
504
+ };
505
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}/logging";
506
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
507
+ body = JSON.stringify(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.logGroupArn != null && { logGroupArn: input.logGroupArn })));
508
+ return [2, new __HttpRequest({
509
+ protocol: protocol,
510
+ hostname: hostname,
511
+ port: port,
512
+ method: "PUT",
513
+ headers: headers,
514
+ path: resolvedPath,
515
+ body: body,
516
+ })];
517
+ }
518
+ });
519
+ }); };
557
520
  export var serializeAws_restJson1UpdateWorkspaceAliasCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
558
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
521
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
559
522
  var _c;
560
523
  return __generator(this, function (_d) {
561
524
  switch (_d.label) {
@@ -566,16 +529,7 @@ export var serializeAws_restJson1UpdateWorkspaceAliasCommand = function (input,
566
529
  "content-type": "application/json",
567
530
  };
568
531
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/workspaces/{workspaceId}/alias";
569
- if (input.workspaceId !== undefined) {
570
- labelValue = input.workspaceId;
571
- if (labelValue.length <= 0) {
572
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
573
- }
574
- resolvedPath = resolvedPath.replace("{workspaceId}", __extendedEncodeURIComponent(labelValue));
575
- }
576
- else {
577
- throw new Error("No value provided for input HTTP label: workspaceId.");
578
- }
532
+ resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", function () { return input.workspaceId; }, "{workspaceId}", false);
579
533
  body = JSON.stringify(__assign(__assign({}, (input.alias != null && { alias: input.alias })), { clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }));
580
534
  return [2, new __HttpRequest({
581
535
  protocol: protocol,
@@ -597,24 +551,23 @@ export var deserializeAws_restJson1CreateAlertManagerDefinitionCommand = functio
597
551
  if (output.statusCode !== 202 && output.statusCode >= 300) {
598
552
  return [2, deserializeAws_restJson1CreateAlertManagerDefinitionCommandError(output, context)];
599
553
  }
600
- contents = {
554
+ contents = map({
601
555
  $metadata: deserializeMetadata(output),
602
- status: undefined,
603
- };
556
+ });
604
557
  _a = __expectNonNull;
605
558
  _b = __expectObject;
606
559
  return [4, parseBody(output.body, context)];
607
560
  case 1:
608
561
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
609
- if (data.status !== undefined && data.status !== null) {
562
+ if (data.status != null) {
610
563
  contents.status = deserializeAws_restJson1AlertManagerDefinitionStatus(data.status, context);
611
564
  }
612
- return [2, Promise.resolve(contents)];
565
+ return [2, contents];
613
566
  }
614
567
  });
615
568
  }); };
616
569
  var deserializeAws_restJson1CreateAlertManagerDefinitionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
617
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
570
+ var parsedOutput, _a, errorCode, _b, parsedBody;
618
571
  var _c;
619
572
  return __generator(this, function (_d) {
620
573
  switch (_d.label) {
@@ -659,14 +612,82 @@ var deserializeAws_restJson1CreateAlertManagerDefinitionCommandError = function
659
612
  case 15: throw _d.sent();
660
613
  case 16:
661
614
  parsedBody = parsedOutput.body;
662
- $metadata = deserializeMetadata(output);
663
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
664
- response = new __BaseException({
665
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
666
- $fault: "client",
667
- $metadata: $metadata,
615
+ throwDefaultError({
616
+ output: output,
617
+ parsedBody: parsedBody,
618
+ exceptionCtor: __BaseException,
619
+ errorCode: errorCode,
620
+ });
621
+ _d.label = 17;
622
+ case 17: return [2];
623
+ }
624
+ });
625
+ }); };
626
+ export var deserializeAws_restJson1CreateLoggingConfigurationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
627
+ var contents, data, _a, _b;
628
+ return __generator(this, function (_c) {
629
+ switch (_c.label) {
630
+ case 0:
631
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
632
+ return [2, deserializeAws_restJson1CreateLoggingConfigurationCommandError(output, context)];
633
+ }
634
+ contents = map({
635
+ $metadata: deserializeMetadata(output),
636
+ });
637
+ _a = __expectNonNull;
638
+ _b = __expectObject;
639
+ return [4, parseBody(output.body, context)];
640
+ case 1:
641
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
642
+ if (data.status != null) {
643
+ contents.status = deserializeAws_restJson1LoggingConfigurationStatus(data.status, context);
644
+ }
645
+ return [2, contents];
646
+ }
647
+ });
648
+ }); };
649
+ var deserializeAws_restJson1CreateLoggingConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
650
+ var parsedOutput, _a, errorCode, _b, parsedBody;
651
+ var _c;
652
+ return __generator(this, function (_d) {
653
+ switch (_d.label) {
654
+ case 0:
655
+ _a = [__assign({}, output)];
656
+ _c = {};
657
+ return [4, parseBody(output.body, context)];
658
+ case 1:
659
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
660
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
661
+ _b = errorCode;
662
+ switch (_b) {
663
+ case "AccessDeniedException": return [3, 2];
664
+ case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
665
+ case "InternalServerException": return [3, 4];
666
+ case "com.amazonaws.amp#InternalServerException": return [3, 4];
667
+ case "ResourceNotFoundException": return [3, 6];
668
+ case "com.amazonaws.amp#ResourceNotFoundException": return [3, 6];
669
+ case "ValidationException": return [3, 8];
670
+ case "com.amazonaws.amp#ValidationException": return [3, 8];
671
+ }
672
+ return [3, 10];
673
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
674
+ case 3: throw _d.sent();
675
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
676
+ case 5: throw _d.sent();
677
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
678
+ case 7: throw _d.sent();
679
+ case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
680
+ case 9: throw _d.sent();
681
+ case 10:
682
+ parsedBody = parsedOutput.body;
683
+ throwDefaultError({
684
+ output: output,
685
+ parsedBody: parsedBody,
686
+ exceptionCtor: __BaseException,
687
+ errorCode: errorCode,
668
688
  });
669
- throw __decorateServiceException(response, parsedBody);
689
+ _d.label = 11;
690
+ case 11: return [2];
670
691
  }
671
692
  });
672
693
  }); };
@@ -678,36 +699,32 @@ export var deserializeAws_restJson1CreateRuleGroupsNamespaceCommand = function (
678
699
  if (output.statusCode !== 202 && output.statusCode >= 300) {
679
700
  return [2, deserializeAws_restJson1CreateRuleGroupsNamespaceCommandError(output, context)];
680
701
  }
681
- contents = {
702
+ contents = map({
682
703
  $metadata: deserializeMetadata(output),
683
- arn: undefined,
684
- name: undefined,
685
- status: undefined,
686
- tags: undefined,
687
- };
704
+ });
688
705
  _a = __expectNonNull;
689
706
  _b = __expectObject;
690
707
  return [4, parseBody(output.body, context)];
691
708
  case 1:
692
709
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
693
- if (data.arn !== undefined && data.arn !== null) {
710
+ if (data.arn != null) {
694
711
  contents.arn = __expectString(data.arn);
695
712
  }
696
- if (data.name !== undefined && data.name !== null) {
713
+ if (data.name != null) {
697
714
  contents.name = __expectString(data.name);
698
715
  }
699
- if (data.status !== undefined && data.status !== null) {
716
+ if (data.status != null) {
700
717
  contents.status = deserializeAws_restJson1RuleGroupsNamespaceStatus(data.status, context);
701
718
  }
702
- if (data.tags !== undefined && data.tags !== null) {
719
+ if (data.tags != null) {
703
720
  contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
704
721
  }
705
- return [2, Promise.resolve(contents)];
722
+ return [2, contents];
706
723
  }
707
724
  });
708
725
  }); };
709
726
  var deserializeAws_restJson1CreateRuleGroupsNamespaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
710
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
727
+ var parsedOutput, _a, errorCode, _b, parsedBody;
711
728
  var _c;
712
729
  return __generator(this, function (_d) {
713
730
  switch (_d.label) {
@@ -752,14 +769,14 @@ var deserializeAws_restJson1CreateRuleGroupsNamespaceCommandError = function (ou
752
769
  case 15: throw _d.sent();
753
770
  case 16:
754
771
  parsedBody = parsedOutput.body;
755
- $metadata = deserializeMetadata(output);
756
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
757
- response = new __BaseException({
758
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
759
- $fault: "client",
760
- $metadata: $metadata,
772
+ throwDefaultError({
773
+ output: output,
774
+ parsedBody: parsedBody,
775
+ exceptionCtor: __BaseException,
776
+ errorCode: errorCode,
761
777
  });
762
- throw __decorateServiceException(response, parsedBody);
778
+ _d.label = 17;
779
+ case 17: return [2];
763
780
  }
764
781
  });
765
782
  }); };
@@ -771,36 +788,32 @@ export var deserializeAws_restJson1CreateWorkspaceCommand = function (output, co
771
788
  if (output.statusCode !== 202 && output.statusCode >= 300) {
772
789
  return [2, deserializeAws_restJson1CreateWorkspaceCommandError(output, context)];
773
790
  }
774
- contents = {
791
+ contents = map({
775
792
  $metadata: deserializeMetadata(output),
776
- arn: undefined,
777
- status: undefined,
778
- tags: undefined,
779
- workspaceId: undefined,
780
- };
793
+ });
781
794
  _a = __expectNonNull;
782
795
  _b = __expectObject;
783
796
  return [4, parseBody(output.body, context)];
784
797
  case 1:
785
798
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
786
- if (data.arn !== undefined && data.arn !== null) {
799
+ if (data.arn != null) {
787
800
  contents.arn = __expectString(data.arn);
788
801
  }
789
- if (data.status !== undefined && data.status !== null) {
802
+ if (data.status != null) {
790
803
  contents.status = deserializeAws_restJson1WorkspaceStatus(data.status, context);
791
804
  }
792
- if (data.tags !== undefined && data.tags !== null) {
805
+ if (data.tags != null) {
793
806
  contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
794
807
  }
795
- if (data.workspaceId !== undefined && data.workspaceId !== null) {
808
+ if (data.workspaceId != null) {
796
809
  contents.workspaceId = __expectString(data.workspaceId);
797
810
  }
798
- return [2, Promise.resolve(contents)];
811
+ return [2, contents];
799
812
  }
800
813
  });
801
814
  }); };
802
815
  var deserializeAws_restJson1CreateWorkspaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
803
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
816
+ var parsedOutput, _a, errorCode, _b, parsedBody;
804
817
  var _c;
805
818
  return __generator(this, function (_d) {
806
819
  switch (_d.label) {
@@ -841,14 +854,14 @@ var deserializeAws_restJson1CreateWorkspaceCommandError = function (output, cont
841
854
  case 13: throw _d.sent();
842
855
  case 14:
843
856
  parsedBody = parsedOutput.body;
844
- $metadata = deserializeMetadata(output);
845
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
846
- response = new __BaseException({
847
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
848
- $fault: "client",
849
- $metadata: $metadata,
857
+ throwDefaultError({
858
+ output: output,
859
+ parsedBody: parsedBody,
860
+ exceptionCtor: __BaseException,
861
+ errorCode: errorCode,
850
862
  });
851
- throw __decorateServiceException(response, parsedBody);
863
+ _d.label = 15;
864
+ case 15: return [2];
852
865
  }
853
866
  });
854
867
  }); };
@@ -860,18 +873,18 @@ export var deserializeAws_restJson1DeleteAlertManagerDefinitionCommand = functio
860
873
  if (output.statusCode !== 202 && output.statusCode >= 300) {
861
874
  return [2, deserializeAws_restJson1DeleteAlertManagerDefinitionCommandError(output, context)];
862
875
  }
863
- contents = {
876
+ contents = map({
864
877
  $metadata: deserializeMetadata(output),
865
- };
878
+ });
866
879
  return [4, collectBody(output.body, context)];
867
880
  case 1:
868
881
  _a.sent();
869
- return [2, Promise.resolve(contents)];
882
+ return [2, contents];
870
883
  }
871
884
  });
872
885
  }); };
873
886
  var deserializeAws_restJson1DeleteAlertManagerDefinitionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
874
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
887
+ var parsedOutput, _a, errorCode, _b, parsedBody;
875
888
  var _c;
876
889
  return __generator(this, function (_d) {
877
890
  switch (_d.label) {
@@ -912,14 +925,81 @@ var deserializeAws_restJson1DeleteAlertManagerDefinitionCommandError = function
912
925
  case 13: throw _d.sent();
913
926
  case 14:
914
927
  parsedBody = parsedOutput.body;
915
- $metadata = deserializeMetadata(output);
916
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
917
- response = new __BaseException({
918
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
919
- $fault: "client",
920
- $metadata: $metadata,
928
+ throwDefaultError({
929
+ output: output,
930
+ parsedBody: parsedBody,
931
+ exceptionCtor: __BaseException,
932
+ errorCode: errorCode,
933
+ });
934
+ _d.label = 15;
935
+ case 15: return [2];
936
+ }
937
+ });
938
+ }); };
939
+ export var deserializeAws_restJson1DeleteLoggingConfigurationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
940
+ var contents;
941
+ return __generator(this, function (_a) {
942
+ switch (_a.label) {
943
+ case 0:
944
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
945
+ return [2, deserializeAws_restJson1DeleteLoggingConfigurationCommandError(output, context)];
946
+ }
947
+ contents = map({
948
+ $metadata: deserializeMetadata(output),
949
+ });
950
+ return [4, collectBody(output.body, context)];
951
+ case 1:
952
+ _a.sent();
953
+ return [2, contents];
954
+ }
955
+ });
956
+ }); };
957
+ var deserializeAws_restJson1DeleteLoggingConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
958
+ var parsedOutput, _a, errorCode, _b, parsedBody;
959
+ var _c;
960
+ return __generator(this, function (_d) {
961
+ switch (_d.label) {
962
+ case 0:
963
+ _a = [__assign({}, output)];
964
+ _c = {};
965
+ return [4, parseBody(output.body, context)];
966
+ case 1:
967
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
968
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
969
+ _b = errorCode;
970
+ switch (_b) {
971
+ case "AccessDeniedException": return [3, 2];
972
+ case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
973
+ case "ConflictException": return [3, 4];
974
+ case "com.amazonaws.amp#ConflictException": return [3, 4];
975
+ case "InternalServerException": return [3, 6];
976
+ case "com.amazonaws.amp#InternalServerException": return [3, 6];
977
+ case "ResourceNotFoundException": return [3, 8];
978
+ case "com.amazonaws.amp#ResourceNotFoundException": return [3, 8];
979
+ case "ValidationException": return [3, 10];
980
+ case "com.amazonaws.amp#ValidationException": return [3, 10];
981
+ }
982
+ return [3, 12];
983
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
984
+ case 3: throw _d.sent();
985
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
986
+ case 5: throw _d.sent();
987
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
988
+ case 7: throw _d.sent();
989
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
990
+ case 9: throw _d.sent();
991
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
992
+ case 11: throw _d.sent();
993
+ case 12:
994
+ parsedBody = parsedOutput.body;
995
+ throwDefaultError({
996
+ output: output,
997
+ parsedBody: parsedBody,
998
+ exceptionCtor: __BaseException,
999
+ errorCode: errorCode,
921
1000
  });
922
- throw __decorateServiceException(response, parsedBody);
1001
+ _d.label = 13;
1002
+ case 13: return [2];
923
1003
  }
924
1004
  });
925
1005
  }); };
@@ -931,18 +1011,18 @@ export var deserializeAws_restJson1DeleteRuleGroupsNamespaceCommand = function (
931
1011
  if (output.statusCode !== 202 && output.statusCode >= 300) {
932
1012
  return [2, deserializeAws_restJson1DeleteRuleGroupsNamespaceCommandError(output, context)];
933
1013
  }
934
- contents = {
1014
+ contents = map({
935
1015
  $metadata: deserializeMetadata(output),
936
- };
1016
+ });
937
1017
  return [4, collectBody(output.body, context)];
938
1018
  case 1:
939
1019
  _a.sent();
940
- return [2, Promise.resolve(contents)];
1020
+ return [2, contents];
941
1021
  }
942
1022
  });
943
1023
  }); };
944
1024
  var deserializeAws_restJson1DeleteRuleGroupsNamespaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
945
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1025
+ var parsedOutput, _a, errorCode, _b, parsedBody;
946
1026
  var _c;
947
1027
  return __generator(this, function (_d) {
948
1028
  switch (_d.label) {
@@ -983,14 +1063,14 @@ var deserializeAws_restJson1DeleteRuleGroupsNamespaceCommandError = function (ou
983
1063
  case 13: throw _d.sent();
984
1064
  case 14:
985
1065
  parsedBody = parsedOutput.body;
986
- $metadata = deserializeMetadata(output);
987
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
988
- response = new __BaseException({
989
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
990
- $fault: "client",
991
- $metadata: $metadata,
1066
+ throwDefaultError({
1067
+ output: output,
1068
+ parsedBody: parsedBody,
1069
+ exceptionCtor: __BaseException,
1070
+ errorCode: errorCode,
992
1071
  });
993
- throw __decorateServiceException(response, parsedBody);
1072
+ _d.label = 15;
1073
+ case 15: return [2];
994
1074
  }
995
1075
  });
996
1076
  }); };
@@ -1002,18 +1082,18 @@ export var deserializeAws_restJson1DeleteWorkspaceCommand = function (output, co
1002
1082
  if (output.statusCode !== 202 && output.statusCode >= 300) {
1003
1083
  return [2, deserializeAws_restJson1DeleteWorkspaceCommandError(output, context)];
1004
1084
  }
1005
- contents = {
1085
+ contents = map({
1006
1086
  $metadata: deserializeMetadata(output),
1007
- };
1087
+ });
1008
1088
  return [4, collectBody(output.body, context)];
1009
1089
  case 1:
1010
1090
  _a.sent();
1011
- return [2, Promise.resolve(contents)];
1091
+ return [2, contents];
1012
1092
  }
1013
1093
  });
1014
1094
  }); };
1015
1095
  var deserializeAws_restJson1DeleteWorkspaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1016
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1096
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1017
1097
  var _c;
1018
1098
  return __generator(this, function (_d) {
1019
1099
  switch (_d.label) {
@@ -1054,14 +1134,14 @@ var deserializeAws_restJson1DeleteWorkspaceCommandError = function (output, cont
1054
1134
  case 13: throw _d.sent();
1055
1135
  case 14:
1056
1136
  parsedBody = parsedOutput.body;
1057
- $metadata = deserializeMetadata(output);
1058
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1059
- response = new __BaseException({
1060
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1061
- $fault: "client",
1062
- $metadata: $metadata,
1137
+ throwDefaultError({
1138
+ output: output,
1139
+ parsedBody: parsedBody,
1140
+ exceptionCtor: __BaseException,
1141
+ errorCode: errorCode,
1063
1142
  });
1064
- throw __decorateServiceException(response, parsedBody);
1143
+ _d.label = 15;
1144
+ case 15: return [2];
1065
1145
  }
1066
1146
  });
1067
1147
  }); };
@@ -1073,24 +1153,23 @@ export var deserializeAws_restJson1DescribeAlertManagerDefinitionCommand = funct
1073
1153
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1074
1154
  return [2, deserializeAws_restJson1DescribeAlertManagerDefinitionCommandError(output, context)];
1075
1155
  }
1076
- contents = {
1156
+ contents = map({
1077
1157
  $metadata: deserializeMetadata(output),
1078
- alertManagerDefinition: undefined,
1079
- };
1158
+ });
1080
1159
  _a = __expectNonNull;
1081
1160
  _b = __expectObject;
1082
1161
  return [4, parseBody(output.body, context)];
1083
1162
  case 1:
1084
1163
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1085
- if (data.alertManagerDefinition !== undefined && data.alertManagerDefinition !== null) {
1164
+ if (data.alertManagerDefinition != null) {
1086
1165
  contents.alertManagerDefinition = deserializeAws_restJson1AlertManagerDefinitionDescription(data.alertManagerDefinition, context);
1087
1166
  }
1088
- return [2, Promise.resolve(contents)];
1167
+ return [2, contents];
1089
1168
  }
1090
1169
  });
1091
1170
  }); };
1092
1171
  var deserializeAws_restJson1DescribeAlertManagerDefinitionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1093
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1172
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1094
1173
  var _c;
1095
1174
  return __generator(this, function (_d) {
1096
1175
  switch (_d.label) {
@@ -1127,14 +1206,82 @@ var deserializeAws_restJson1DescribeAlertManagerDefinitionCommandError = functio
1127
1206
  case 11: throw _d.sent();
1128
1207
  case 12:
1129
1208
  parsedBody = parsedOutput.body;
1130
- $metadata = deserializeMetadata(output);
1131
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1132
- response = new __BaseException({
1133
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1134
- $fault: "client",
1135
- $metadata: $metadata,
1209
+ throwDefaultError({
1210
+ output: output,
1211
+ parsedBody: parsedBody,
1212
+ exceptionCtor: __BaseException,
1213
+ errorCode: errorCode,
1136
1214
  });
1137
- throw __decorateServiceException(response, parsedBody);
1215
+ _d.label = 13;
1216
+ case 13: return [2];
1217
+ }
1218
+ });
1219
+ }); };
1220
+ export var deserializeAws_restJson1DescribeLoggingConfigurationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1221
+ var contents, data, _a, _b;
1222
+ return __generator(this, function (_c) {
1223
+ switch (_c.label) {
1224
+ case 0:
1225
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1226
+ return [2, deserializeAws_restJson1DescribeLoggingConfigurationCommandError(output, context)];
1227
+ }
1228
+ contents = map({
1229
+ $metadata: deserializeMetadata(output),
1230
+ });
1231
+ _a = __expectNonNull;
1232
+ _b = __expectObject;
1233
+ return [4, parseBody(output.body, context)];
1234
+ case 1:
1235
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1236
+ if (data.loggingConfiguration != null) {
1237
+ contents.loggingConfiguration = deserializeAws_restJson1LoggingConfigurationMetadata(data.loggingConfiguration, context);
1238
+ }
1239
+ return [2, contents];
1240
+ }
1241
+ });
1242
+ }); };
1243
+ var deserializeAws_restJson1DescribeLoggingConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1244
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1245
+ var _c;
1246
+ return __generator(this, function (_d) {
1247
+ switch (_d.label) {
1248
+ case 0:
1249
+ _a = [__assign({}, output)];
1250
+ _c = {};
1251
+ return [4, parseBody(output.body, context)];
1252
+ case 1:
1253
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1254
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1255
+ _b = errorCode;
1256
+ switch (_b) {
1257
+ case "AccessDeniedException": return [3, 2];
1258
+ case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
1259
+ case "InternalServerException": return [3, 4];
1260
+ case "com.amazonaws.amp#InternalServerException": return [3, 4];
1261
+ case "ResourceNotFoundException": return [3, 6];
1262
+ case "com.amazonaws.amp#ResourceNotFoundException": return [3, 6];
1263
+ case "ValidationException": return [3, 8];
1264
+ case "com.amazonaws.amp#ValidationException": return [3, 8];
1265
+ }
1266
+ return [3, 10];
1267
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1268
+ case 3: throw _d.sent();
1269
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1270
+ case 5: throw _d.sent();
1271
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1272
+ case 7: throw _d.sent();
1273
+ case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1274
+ case 9: throw _d.sent();
1275
+ case 10:
1276
+ parsedBody = parsedOutput.body;
1277
+ throwDefaultError({
1278
+ output: output,
1279
+ parsedBody: parsedBody,
1280
+ exceptionCtor: __BaseException,
1281
+ errorCode: errorCode,
1282
+ });
1283
+ _d.label = 11;
1284
+ case 11: return [2];
1138
1285
  }
1139
1286
  });
1140
1287
  }); };
@@ -1146,24 +1293,23 @@ export var deserializeAws_restJson1DescribeRuleGroupsNamespaceCommand = function
1146
1293
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1147
1294
  return [2, deserializeAws_restJson1DescribeRuleGroupsNamespaceCommandError(output, context)];
1148
1295
  }
1149
- contents = {
1296
+ contents = map({
1150
1297
  $metadata: deserializeMetadata(output),
1151
- ruleGroupsNamespace: undefined,
1152
- };
1298
+ });
1153
1299
  _a = __expectNonNull;
1154
1300
  _b = __expectObject;
1155
1301
  return [4, parseBody(output.body, context)];
1156
1302
  case 1:
1157
1303
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1158
- if (data.ruleGroupsNamespace !== undefined && data.ruleGroupsNamespace !== null) {
1304
+ if (data.ruleGroupsNamespace != null) {
1159
1305
  contents.ruleGroupsNamespace = deserializeAws_restJson1RuleGroupsNamespaceDescription(data.ruleGroupsNamespace, context);
1160
1306
  }
1161
- return [2, Promise.resolve(contents)];
1307
+ return [2, contents];
1162
1308
  }
1163
1309
  });
1164
1310
  }); };
1165
1311
  var deserializeAws_restJson1DescribeRuleGroupsNamespaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1166
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1312
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1167
1313
  var _c;
1168
1314
  return __generator(this, function (_d) {
1169
1315
  switch (_d.label) {
@@ -1200,14 +1346,14 @@ var deserializeAws_restJson1DescribeRuleGroupsNamespaceCommandError = function (
1200
1346
  case 11: throw _d.sent();
1201
1347
  case 12:
1202
1348
  parsedBody = parsedOutput.body;
1203
- $metadata = deserializeMetadata(output);
1204
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1205
- response = new __BaseException({
1206
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1207
- $fault: "client",
1208
- $metadata: $metadata,
1349
+ throwDefaultError({
1350
+ output: output,
1351
+ parsedBody: parsedBody,
1352
+ exceptionCtor: __BaseException,
1353
+ errorCode: errorCode,
1209
1354
  });
1210
- throw __decorateServiceException(response, parsedBody);
1355
+ _d.label = 13;
1356
+ case 13: return [2];
1211
1357
  }
1212
1358
  });
1213
1359
  }); };
@@ -1219,24 +1365,23 @@ export var deserializeAws_restJson1DescribeWorkspaceCommand = function (output,
1219
1365
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1220
1366
  return [2, deserializeAws_restJson1DescribeWorkspaceCommandError(output, context)];
1221
1367
  }
1222
- contents = {
1368
+ contents = map({
1223
1369
  $metadata: deserializeMetadata(output),
1224
- workspace: undefined,
1225
- };
1370
+ });
1226
1371
  _a = __expectNonNull;
1227
1372
  _b = __expectObject;
1228
1373
  return [4, parseBody(output.body, context)];
1229
1374
  case 1:
1230
1375
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1231
- if (data.workspace !== undefined && data.workspace !== null) {
1376
+ if (data.workspace != null) {
1232
1377
  contents.workspace = deserializeAws_restJson1WorkspaceDescription(data.workspace, context);
1233
1378
  }
1234
- return [2, Promise.resolve(contents)];
1379
+ return [2, contents];
1235
1380
  }
1236
1381
  });
1237
1382
  }); };
1238
1383
  var deserializeAws_restJson1DescribeWorkspaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1239
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1384
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1240
1385
  var _c;
1241
1386
  return __generator(this, function (_d) {
1242
1387
  switch (_d.label) {
@@ -1273,14 +1418,14 @@ var deserializeAws_restJson1DescribeWorkspaceCommandError = function (output, co
1273
1418
  case 11: throw _d.sent();
1274
1419
  case 12:
1275
1420
  parsedBody = parsedOutput.body;
1276
- $metadata = deserializeMetadata(output);
1277
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1278
- response = new __BaseException({
1279
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1280
- $fault: "client",
1281
- $metadata: $metadata,
1421
+ throwDefaultError({
1422
+ output: output,
1423
+ parsedBody: parsedBody,
1424
+ exceptionCtor: __BaseException,
1425
+ errorCode: errorCode,
1282
1426
  });
1283
- throw __decorateServiceException(response, parsedBody);
1427
+ _d.label = 13;
1428
+ case 13: return [2];
1284
1429
  }
1285
1430
  });
1286
1431
  }); };
@@ -1292,28 +1437,26 @@ export var deserializeAws_restJson1ListRuleGroupsNamespacesCommand = function (o
1292
1437
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1293
1438
  return [2, deserializeAws_restJson1ListRuleGroupsNamespacesCommandError(output, context)];
1294
1439
  }
1295
- contents = {
1440
+ contents = map({
1296
1441
  $metadata: deserializeMetadata(output),
1297
- nextToken: undefined,
1298
- ruleGroupsNamespaces: undefined,
1299
- };
1442
+ });
1300
1443
  _a = __expectNonNull;
1301
1444
  _b = __expectObject;
1302
1445
  return [4, parseBody(output.body, context)];
1303
1446
  case 1:
1304
1447
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1305
- if (data.nextToken !== undefined && data.nextToken !== null) {
1448
+ if (data.nextToken != null) {
1306
1449
  contents.nextToken = __expectString(data.nextToken);
1307
1450
  }
1308
- if (data.ruleGroupsNamespaces !== undefined && data.ruleGroupsNamespaces !== null) {
1451
+ if (data.ruleGroupsNamespaces != null) {
1309
1452
  contents.ruleGroupsNamespaces = deserializeAws_restJson1RuleGroupsNamespaceSummaryList(data.ruleGroupsNamespaces, context);
1310
1453
  }
1311
- return [2, Promise.resolve(contents)];
1454
+ return [2, contents];
1312
1455
  }
1313
1456
  });
1314
1457
  }); };
1315
1458
  var deserializeAws_restJson1ListRuleGroupsNamespacesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1316
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1459
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1317
1460
  var _c;
1318
1461
  return __generator(this, function (_d) {
1319
1462
  switch (_d.label) {
@@ -1350,14 +1493,14 @@ var deserializeAws_restJson1ListRuleGroupsNamespacesCommandError = function (out
1350
1493
  case 11: throw _d.sent();
1351
1494
  case 12:
1352
1495
  parsedBody = parsedOutput.body;
1353
- $metadata = deserializeMetadata(output);
1354
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1355
- response = new __BaseException({
1356
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1357
- $fault: "client",
1358
- $metadata: $metadata,
1496
+ throwDefaultError({
1497
+ output: output,
1498
+ parsedBody: parsedBody,
1499
+ exceptionCtor: __BaseException,
1500
+ errorCode: errorCode,
1359
1501
  });
1360
- throw __decorateServiceException(response, parsedBody);
1502
+ _d.label = 13;
1503
+ case 13: return [2];
1361
1504
  }
1362
1505
  });
1363
1506
  }); };
@@ -1369,24 +1512,23 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
1369
1512
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1370
1513
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
1371
1514
  }
1372
- contents = {
1515
+ contents = map({
1373
1516
  $metadata: deserializeMetadata(output),
1374
- tags: undefined,
1375
- };
1517
+ });
1376
1518
  _a = __expectNonNull;
1377
1519
  _b = __expectObject;
1378
1520
  return [4, parseBody(output.body, context)];
1379
1521
  case 1:
1380
1522
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1381
- if (data.tags !== undefined && data.tags !== null) {
1523
+ if (data.tags != null) {
1382
1524
  contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
1383
1525
  }
1384
- return [2, Promise.resolve(contents)];
1526
+ return [2, contents];
1385
1527
  }
1386
1528
  });
1387
1529
  }); };
1388
1530
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1389
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1531
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1390
1532
  var _c;
1391
1533
  return __generator(this, function (_d) {
1392
1534
  switch (_d.label) {
@@ -1423,14 +1565,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
1423
1565
  case 11: throw _d.sent();
1424
1566
  case 12:
1425
1567
  parsedBody = parsedOutput.body;
1426
- $metadata = deserializeMetadata(output);
1427
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1428
- response = new __BaseException({
1429
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1430
- $fault: "client",
1431
- $metadata: $metadata,
1568
+ throwDefaultError({
1569
+ output: output,
1570
+ parsedBody: parsedBody,
1571
+ exceptionCtor: __BaseException,
1572
+ errorCode: errorCode,
1432
1573
  });
1433
- throw __decorateServiceException(response, parsedBody);
1574
+ _d.label = 13;
1575
+ case 13: return [2];
1434
1576
  }
1435
1577
  });
1436
1578
  }); };
@@ -1442,28 +1584,26 @@ export var deserializeAws_restJson1ListWorkspacesCommand = function (output, con
1442
1584
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1443
1585
  return [2, deserializeAws_restJson1ListWorkspacesCommandError(output, context)];
1444
1586
  }
1445
- contents = {
1587
+ contents = map({
1446
1588
  $metadata: deserializeMetadata(output),
1447
- nextToken: undefined,
1448
- workspaces: undefined,
1449
- };
1589
+ });
1450
1590
  _a = __expectNonNull;
1451
1591
  _b = __expectObject;
1452
1592
  return [4, parseBody(output.body, context)];
1453
1593
  case 1:
1454
1594
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1455
- if (data.nextToken !== undefined && data.nextToken !== null) {
1595
+ if (data.nextToken != null) {
1456
1596
  contents.nextToken = __expectString(data.nextToken);
1457
1597
  }
1458
- if (data.workspaces !== undefined && data.workspaces !== null) {
1598
+ if (data.workspaces != null) {
1459
1599
  contents.workspaces = deserializeAws_restJson1WorkspaceSummaryList(data.workspaces, context);
1460
1600
  }
1461
- return [2, Promise.resolve(contents)];
1601
+ return [2, contents];
1462
1602
  }
1463
1603
  });
1464
1604
  }); };
1465
1605
  var deserializeAws_restJson1ListWorkspacesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1466
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1606
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1467
1607
  var _c;
1468
1608
  return __generator(this, function (_d) {
1469
1609
  switch (_d.label) {
@@ -1496,14 +1636,14 @@ var deserializeAws_restJson1ListWorkspacesCommandError = function (output, conte
1496
1636
  case 9: throw _d.sent();
1497
1637
  case 10:
1498
1638
  parsedBody = parsedOutput.body;
1499
- $metadata = deserializeMetadata(output);
1500
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1501
- response = new __BaseException({
1502
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1503
- $fault: "client",
1504
- $metadata: $metadata,
1639
+ throwDefaultError({
1640
+ output: output,
1641
+ parsedBody: parsedBody,
1642
+ exceptionCtor: __BaseException,
1643
+ errorCode: errorCode,
1505
1644
  });
1506
- throw __decorateServiceException(response, parsedBody);
1645
+ _d.label = 11;
1646
+ case 11: return [2];
1507
1647
  }
1508
1648
  });
1509
1649
  }); };
@@ -1515,24 +1655,23 @@ export var deserializeAws_restJson1PutAlertManagerDefinitionCommand = function (
1515
1655
  if (output.statusCode !== 202 && output.statusCode >= 300) {
1516
1656
  return [2, deserializeAws_restJson1PutAlertManagerDefinitionCommandError(output, context)];
1517
1657
  }
1518
- contents = {
1658
+ contents = map({
1519
1659
  $metadata: deserializeMetadata(output),
1520
- status: undefined,
1521
- };
1660
+ });
1522
1661
  _a = __expectNonNull;
1523
1662
  _b = __expectObject;
1524
1663
  return [4, parseBody(output.body, context)];
1525
1664
  case 1:
1526
1665
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1527
- if (data.status !== undefined && data.status !== null) {
1666
+ if (data.status != null) {
1528
1667
  contents.status = deserializeAws_restJson1AlertManagerDefinitionStatus(data.status, context);
1529
1668
  }
1530
- return [2, Promise.resolve(contents)];
1669
+ return [2, contents];
1531
1670
  }
1532
1671
  });
1533
1672
  }); };
1534
1673
  var deserializeAws_restJson1PutAlertManagerDefinitionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1535
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1674
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1536
1675
  var _c;
1537
1676
  return __generator(this, function (_d) {
1538
1677
  switch (_d.label) {
@@ -1577,14 +1716,14 @@ var deserializeAws_restJson1PutAlertManagerDefinitionCommandError = function (ou
1577
1716
  case 15: throw _d.sent();
1578
1717
  case 16:
1579
1718
  parsedBody = parsedOutput.body;
1580
- $metadata = deserializeMetadata(output);
1581
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1582
- response = new __BaseException({
1583
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1584
- $fault: "client",
1585
- $metadata: $metadata,
1719
+ throwDefaultError({
1720
+ output: output,
1721
+ parsedBody: parsedBody,
1722
+ exceptionCtor: __BaseException,
1723
+ errorCode: errorCode,
1586
1724
  });
1587
- throw __decorateServiceException(response, parsedBody);
1725
+ _d.label = 17;
1726
+ case 17: return [2];
1588
1727
  }
1589
1728
  });
1590
1729
  }); };
@@ -1596,36 +1735,32 @@ export var deserializeAws_restJson1PutRuleGroupsNamespaceCommand = function (out
1596
1735
  if (output.statusCode !== 202 && output.statusCode >= 300) {
1597
1736
  return [2, deserializeAws_restJson1PutRuleGroupsNamespaceCommandError(output, context)];
1598
1737
  }
1599
- contents = {
1738
+ contents = map({
1600
1739
  $metadata: deserializeMetadata(output),
1601
- arn: undefined,
1602
- name: undefined,
1603
- status: undefined,
1604
- tags: undefined,
1605
- };
1740
+ });
1606
1741
  _a = __expectNonNull;
1607
1742
  _b = __expectObject;
1608
1743
  return [4, parseBody(output.body, context)];
1609
1744
  case 1:
1610
1745
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1611
- if (data.arn !== undefined && data.arn !== null) {
1746
+ if (data.arn != null) {
1612
1747
  contents.arn = __expectString(data.arn);
1613
1748
  }
1614
- if (data.name !== undefined && data.name !== null) {
1749
+ if (data.name != null) {
1615
1750
  contents.name = __expectString(data.name);
1616
1751
  }
1617
- if (data.status !== undefined && data.status !== null) {
1752
+ if (data.status != null) {
1618
1753
  contents.status = deserializeAws_restJson1RuleGroupsNamespaceStatus(data.status, context);
1619
1754
  }
1620
- if (data.tags !== undefined && data.tags !== null) {
1755
+ if (data.tags != null) {
1621
1756
  contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
1622
1757
  }
1623
- return [2, Promise.resolve(contents)];
1758
+ return [2, contents];
1624
1759
  }
1625
1760
  });
1626
1761
  }); };
1627
1762
  var deserializeAws_restJson1PutRuleGroupsNamespaceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1628
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1763
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1629
1764
  var _c;
1630
1765
  return __generator(this, function (_d) {
1631
1766
  switch (_d.label) {
@@ -1670,14 +1805,14 @@ var deserializeAws_restJson1PutRuleGroupsNamespaceCommandError = function (outpu
1670
1805
  case 15: throw _d.sent();
1671
1806
  case 16:
1672
1807
  parsedBody = parsedOutput.body;
1673
- $metadata = deserializeMetadata(output);
1674
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1675
- response = new __BaseException({
1676
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1677
- $fault: "client",
1678
- $metadata: $metadata,
1808
+ throwDefaultError({
1809
+ output: output,
1810
+ parsedBody: parsedBody,
1811
+ exceptionCtor: __BaseException,
1812
+ errorCode: errorCode,
1679
1813
  });
1680
- throw __decorateServiceException(response, parsedBody);
1814
+ _d.label = 17;
1815
+ case 17: return [2];
1681
1816
  }
1682
1817
  });
1683
1818
  }); };
@@ -1689,18 +1824,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
1689
1824
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1690
1825
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
1691
1826
  }
1692
- contents = {
1827
+ contents = map({
1693
1828
  $metadata: deserializeMetadata(output),
1694
- };
1829
+ });
1695
1830
  return [4, collectBody(output.body, context)];
1696
1831
  case 1:
1697
1832
  _a.sent();
1698
- return [2, Promise.resolve(contents)];
1833
+ return [2, contents];
1699
1834
  }
1700
1835
  });
1701
1836
  }); };
1702
1837
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1703
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1838
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1704
1839
  var _c;
1705
1840
  return __generator(this, function (_d) {
1706
1841
  switch (_d.label) {
@@ -1737,14 +1872,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
1737
1872
  case 11: throw _d.sent();
1738
1873
  case 12:
1739
1874
  parsedBody = parsedOutput.body;
1740
- $metadata = deserializeMetadata(output);
1741
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1742
- response = new __BaseException({
1743
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1744
- $fault: "client",
1745
- $metadata: $metadata,
1875
+ throwDefaultError({
1876
+ output: output,
1877
+ parsedBody: parsedBody,
1878
+ exceptionCtor: __BaseException,
1879
+ errorCode: errorCode,
1746
1880
  });
1747
- throw __decorateServiceException(response, parsedBody);
1881
+ _d.label = 13;
1882
+ case 13: return [2];
1748
1883
  }
1749
1884
  });
1750
1885
  }); };
@@ -1756,18 +1891,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
1756
1891
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1757
1892
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
1758
1893
  }
1759
- contents = {
1894
+ contents = map({
1760
1895
  $metadata: deserializeMetadata(output),
1761
- };
1896
+ });
1762
1897
  return [4, collectBody(output.body, context)];
1763
1898
  case 1:
1764
1899
  _a.sent();
1765
- return [2, Promise.resolve(contents)];
1900
+ return [2, contents];
1766
1901
  }
1767
1902
  });
1768
1903
  }); };
1769
1904
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1770
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1905
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1771
1906
  var _c;
1772
1907
  return __generator(this, function (_d) {
1773
1908
  switch (_d.label) {
@@ -1804,14 +1939,86 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
1804
1939
  case 11: throw _d.sent();
1805
1940
  case 12:
1806
1941
  parsedBody = parsedOutput.body;
1807
- $metadata = deserializeMetadata(output);
1808
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1809
- response = new __BaseException({
1810
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1811
- $fault: "client",
1812
- $metadata: $metadata,
1942
+ throwDefaultError({
1943
+ output: output,
1944
+ parsedBody: parsedBody,
1945
+ exceptionCtor: __BaseException,
1946
+ errorCode: errorCode,
1947
+ });
1948
+ _d.label = 13;
1949
+ case 13: return [2];
1950
+ }
1951
+ });
1952
+ }); };
1953
+ export var deserializeAws_restJson1UpdateLoggingConfigurationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1954
+ var contents, data, _a, _b;
1955
+ return __generator(this, function (_c) {
1956
+ switch (_c.label) {
1957
+ case 0:
1958
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
1959
+ return [2, deserializeAws_restJson1UpdateLoggingConfigurationCommandError(output, context)];
1960
+ }
1961
+ contents = map({
1962
+ $metadata: deserializeMetadata(output),
1963
+ });
1964
+ _a = __expectNonNull;
1965
+ _b = __expectObject;
1966
+ return [4, parseBody(output.body, context)];
1967
+ case 1:
1968
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1969
+ if (data.status != null) {
1970
+ contents.status = deserializeAws_restJson1LoggingConfigurationStatus(data.status, context);
1971
+ }
1972
+ return [2, contents];
1973
+ }
1974
+ });
1975
+ }); };
1976
+ var deserializeAws_restJson1UpdateLoggingConfigurationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1977
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1978
+ var _c;
1979
+ return __generator(this, function (_d) {
1980
+ switch (_d.label) {
1981
+ case 0:
1982
+ _a = [__assign({}, output)];
1983
+ _c = {};
1984
+ return [4, parseBody(output.body, context)];
1985
+ case 1:
1986
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1987
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1988
+ _b = errorCode;
1989
+ switch (_b) {
1990
+ case "AccessDeniedException": return [3, 2];
1991
+ case "com.amazonaws.amp#AccessDeniedException": return [3, 2];
1992
+ case "ConflictException": return [3, 4];
1993
+ case "com.amazonaws.amp#ConflictException": return [3, 4];
1994
+ case "InternalServerException": return [3, 6];
1995
+ case "com.amazonaws.amp#InternalServerException": return [3, 6];
1996
+ case "ResourceNotFoundException": return [3, 8];
1997
+ case "com.amazonaws.amp#ResourceNotFoundException": return [3, 8];
1998
+ case "ValidationException": return [3, 10];
1999
+ case "com.amazonaws.amp#ValidationException": return [3, 10];
2000
+ }
2001
+ return [3, 12];
2002
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
2003
+ case 3: throw _d.sent();
2004
+ case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
2005
+ case 5: throw _d.sent();
2006
+ case 6: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
2007
+ case 7: throw _d.sent();
2008
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
2009
+ case 9: throw _d.sent();
2010
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
2011
+ case 11: throw _d.sent();
2012
+ case 12:
2013
+ parsedBody = parsedOutput.body;
2014
+ throwDefaultError({
2015
+ output: output,
2016
+ parsedBody: parsedBody,
2017
+ exceptionCtor: __BaseException,
2018
+ errorCode: errorCode,
1813
2019
  });
1814
- throw __decorateServiceException(response, parsedBody);
2020
+ _d.label = 13;
2021
+ case 13: return [2];
1815
2022
  }
1816
2023
  });
1817
2024
  }); };
@@ -1823,18 +2030,18 @@ export var deserializeAws_restJson1UpdateWorkspaceAliasCommand = function (outpu
1823
2030
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1824
2031
  return [2, deserializeAws_restJson1UpdateWorkspaceAliasCommandError(output, context)];
1825
2032
  }
1826
- contents = {
2033
+ contents = map({
1827
2034
  $metadata: deserializeMetadata(output),
1828
- };
2035
+ });
1829
2036
  return [4, collectBody(output.body, context)];
1830
2037
  case 1:
1831
2038
  _a.sent();
1832
- return [2, Promise.resolve(contents)];
2039
+ return [2, contents];
1833
2040
  }
1834
2041
  });
1835
2042
  }); };
1836
2043
  var deserializeAws_restJson1UpdateWorkspaceAliasCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1837
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
2044
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1838
2045
  var _c;
1839
2046
  return __generator(this, function (_d) {
1840
2047
  switch (_d.label) {
@@ -1879,23 +2086,24 @@ var deserializeAws_restJson1UpdateWorkspaceAliasCommandError = function (output,
1879
2086
  case 15: throw _d.sent();
1880
2087
  case 16:
1881
2088
  parsedBody = parsedOutput.body;
1882
- $metadata = deserializeMetadata(output);
1883
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1884
- response = new __BaseException({
1885
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1886
- $fault: "client",
1887
- $metadata: $metadata,
2089
+ throwDefaultError({
2090
+ output: output,
2091
+ parsedBody: parsedBody,
2092
+ exceptionCtor: __BaseException,
2093
+ errorCode: errorCode,
1888
2094
  });
1889
- throw __decorateServiceException(response, parsedBody);
2095
+ _d.label = 17;
2096
+ case 17: return [2];
1890
2097
  }
1891
2098
  });
1892
2099
  }); };
2100
+ var map = __map;
1893
2101
  var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1894
2102
  var contents, data, exception;
1895
2103
  return __generator(this, function (_a) {
1896
- contents = {};
2104
+ contents = map({});
1897
2105
  data = parsedOutput.body;
1898
- if (data.message !== undefined && data.message !== null) {
2106
+ if (data.message != null) {
1899
2107
  contents.message = __expectString(data.message);
1900
2108
  }
1901
2109
  exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1905,15 +2113,15 @@ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutp
1905
2113
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1906
2114
  var contents, data, exception;
1907
2115
  return __generator(this, function (_a) {
1908
- contents = {};
2116
+ contents = map({});
1909
2117
  data = parsedOutput.body;
1910
- if (data.message !== undefined && data.message !== null) {
2118
+ if (data.message != null) {
1911
2119
  contents.message = __expectString(data.message);
1912
2120
  }
1913
- if (data.resourceId !== undefined && data.resourceId !== null) {
2121
+ if (data.resourceId != null) {
1914
2122
  contents.resourceId = __expectString(data.resourceId);
1915
2123
  }
1916
- if (data.resourceType !== undefined && data.resourceType !== null) {
2124
+ if (data.resourceType != null) {
1917
2125
  contents.resourceType = __expectString(data.resourceType);
1918
2126
  }
1919
2127
  exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1923,12 +2131,14 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
1923
2131
  var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1924
2132
  var contents, data, exception;
1925
2133
  return __generator(this, function (_a) {
1926
- contents = {};
1927
- if (parsedOutput.headers["retry-after"] !== undefined) {
1928
- contents.retryAfterSeconds = __strictParseInt32(parsedOutput.headers["retry-after"]);
1929
- }
2134
+ contents = map({
2135
+ retryAfterSeconds: [
2136
+ function () { return void 0 !== parsedOutput.headers["retry-after"]; },
2137
+ function () { return __strictParseInt32(parsedOutput.headers["retry-after"]); },
2138
+ ],
2139
+ });
1930
2140
  data = parsedOutput.body;
1931
- if (data.message !== undefined && data.message !== null) {
2141
+ if (data.message != null) {
1932
2142
  contents.message = __expectString(data.message);
1933
2143
  }
1934
2144
  exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1938,15 +2148,15 @@ var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOu
1938
2148
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1939
2149
  var contents, data, exception;
1940
2150
  return __generator(this, function (_a) {
1941
- contents = {};
2151
+ contents = map({});
1942
2152
  data = parsedOutput.body;
1943
- if (data.message !== undefined && data.message !== null) {
2153
+ if (data.message != null) {
1944
2154
  contents.message = __expectString(data.message);
1945
2155
  }
1946
- if (data.resourceId !== undefined && data.resourceId !== null) {
2156
+ if (data.resourceId != null) {
1947
2157
  contents.resourceId = __expectString(data.resourceId);
1948
2158
  }
1949
- if (data.resourceType !== undefined && data.resourceType !== null) {
2159
+ if (data.resourceType != null) {
1950
2160
  contents.resourceType = __expectString(data.resourceType);
1951
2161
  }
1952
2162
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1956,21 +2166,21 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
1956
2166
  var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1957
2167
  var contents, data, exception;
1958
2168
  return __generator(this, function (_a) {
1959
- contents = {};
2169
+ contents = map({});
1960
2170
  data = parsedOutput.body;
1961
- if (data.message !== undefined && data.message !== null) {
2171
+ if (data.message != null) {
1962
2172
  contents.message = __expectString(data.message);
1963
2173
  }
1964
- if (data.quotaCode !== undefined && data.quotaCode !== null) {
2174
+ if (data.quotaCode != null) {
1965
2175
  contents.quotaCode = __expectString(data.quotaCode);
1966
2176
  }
1967
- if (data.resourceId !== undefined && data.resourceId !== null) {
2177
+ if (data.resourceId != null) {
1968
2178
  contents.resourceId = __expectString(data.resourceId);
1969
2179
  }
1970
- if (data.resourceType !== undefined && data.resourceType !== null) {
2180
+ if (data.resourceType != null) {
1971
2181
  contents.resourceType = __expectString(data.resourceType);
1972
2182
  }
1973
- if (data.serviceCode !== undefined && data.serviceCode !== null) {
2183
+ if (data.serviceCode != null) {
1974
2184
  contents.serviceCode = __expectString(data.serviceCode);
1975
2185
  }
1976
2186
  exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1980,18 +2190,20 @@ var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (pa
1980
2190
  var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1981
2191
  var contents, data, exception;
1982
2192
  return __generator(this, function (_a) {
1983
- contents = {};
1984
- if (parsedOutput.headers["retry-after"] !== undefined) {
1985
- contents.retryAfterSeconds = __strictParseInt32(parsedOutput.headers["retry-after"]);
1986
- }
2193
+ contents = map({
2194
+ retryAfterSeconds: [
2195
+ function () { return void 0 !== parsedOutput.headers["retry-after"]; },
2196
+ function () { return __strictParseInt32(parsedOutput.headers["retry-after"]); },
2197
+ ],
2198
+ });
1987
2199
  data = parsedOutput.body;
1988
- if (data.message !== undefined && data.message !== null) {
2200
+ if (data.message != null) {
1989
2201
  contents.message = __expectString(data.message);
1990
2202
  }
1991
- if (data.quotaCode !== undefined && data.quotaCode !== null) {
2203
+ if (data.quotaCode != null) {
1992
2204
  contents.quotaCode = __expectString(data.quotaCode);
1993
2205
  }
1994
- if (data.serviceCode !== undefined && data.serviceCode !== null) {
2206
+ if (data.serviceCode != null) {
1995
2207
  contents.serviceCode = __expectString(data.serviceCode);
1996
2208
  }
1997
2209
  exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2001,15 +2213,15 @@ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput
2001
2213
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
2002
2214
  var contents, data, exception;
2003
2215
  return __generator(this, function (_a) {
2004
- contents = {};
2216
+ contents = map({});
2005
2217
  data = parsedOutput.body;
2006
- if (data.fieldList !== undefined && data.fieldList !== null) {
2218
+ if (data.fieldList != null) {
2007
2219
  contents.fieldList = deserializeAws_restJson1ValidationExceptionFieldList(data.fieldList, context);
2008
2220
  }
2009
- if (data.message !== undefined && data.message !== null) {
2221
+ if (data.message != null) {
2010
2222
  contents.message = __expectString(data.message);
2011
2223
  }
2012
- if (data.reason !== undefined && data.reason !== null) {
2224
+ if (data.reason != null) {
2013
2225
  contents.reason = __expectString(data.reason);
2014
2226
  }
2015
2227
  exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -2040,6 +2252,21 @@ var deserializeAws_restJson1AlertManagerDefinitionStatus = function (output, con
2040
2252
  statusReason: __expectString(output.statusReason),
2041
2253
  };
2042
2254
  };
2255
+ var deserializeAws_restJson1LoggingConfigurationMetadata = function (output, context) {
2256
+ return {
2257
+ createdAt: output.createdAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt))) : undefined,
2258
+ logGroupArn: __expectString(output.logGroupArn),
2259
+ modifiedAt: output.modifiedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.modifiedAt))) : undefined,
2260
+ status: output.status != null ? deserializeAws_restJson1LoggingConfigurationStatus(output.status, context) : undefined,
2261
+ workspace: __expectString(output.workspace),
2262
+ };
2263
+ };
2264
+ var deserializeAws_restJson1LoggingConfigurationStatus = function (output, context) {
2265
+ return {
2266
+ statusCode: __expectString(output.statusCode),
2267
+ statusReason: __expectString(output.statusReason),
2268
+ };
2269
+ };
2043
2270
  var deserializeAws_restJson1RuleGroupsNamespaceDescription = function (output, context) {
2044
2271
  return {
2045
2272
  arn: __expectString(output.arn),