@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,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deserializeAws_restJson1UpdateWorkspaceAliasCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1PutRuleGroupsNamespaceCommand = exports.deserializeAws_restJson1PutAlertManagerDefinitionCommand = exports.deserializeAws_restJson1ListWorkspacesCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListRuleGroupsNamespacesCommand = exports.deserializeAws_restJson1DescribeWorkspaceCommand = exports.deserializeAws_restJson1DescribeRuleGroupsNamespaceCommand = exports.deserializeAws_restJson1DescribeAlertManagerDefinitionCommand = exports.deserializeAws_restJson1DeleteWorkspaceCommand = exports.deserializeAws_restJson1DeleteRuleGroupsNamespaceCommand = exports.deserializeAws_restJson1DeleteAlertManagerDefinitionCommand = exports.deserializeAws_restJson1CreateWorkspaceCommand = exports.deserializeAws_restJson1CreateRuleGroupsNamespaceCommand = exports.deserializeAws_restJson1CreateAlertManagerDefinitionCommand = exports.serializeAws_restJson1UpdateWorkspaceAliasCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1PutRuleGroupsNamespaceCommand = exports.serializeAws_restJson1PutAlertManagerDefinitionCommand = exports.serializeAws_restJson1ListWorkspacesCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListRuleGroupsNamespacesCommand = exports.serializeAws_restJson1DescribeWorkspaceCommand = exports.serializeAws_restJson1DescribeRuleGroupsNamespaceCommand = exports.serializeAws_restJson1DescribeAlertManagerDefinitionCommand = exports.serializeAws_restJson1DeleteWorkspaceCommand = exports.serializeAws_restJson1DeleteRuleGroupsNamespaceCommand = exports.serializeAws_restJson1DeleteAlertManagerDefinitionCommand = exports.serializeAws_restJson1CreateWorkspaceCommand = exports.serializeAws_restJson1CreateRuleGroupsNamespaceCommand = exports.serializeAws_restJson1CreateAlertManagerDefinitionCommand = void 0;
3
+ exports.deserializeAws_restJson1UpdateWorkspaceAliasCommand = exports.deserializeAws_restJson1UpdateLoggingConfigurationCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1PutRuleGroupsNamespaceCommand = exports.deserializeAws_restJson1PutAlertManagerDefinitionCommand = exports.deserializeAws_restJson1ListWorkspacesCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListRuleGroupsNamespacesCommand = exports.deserializeAws_restJson1DescribeWorkspaceCommand = exports.deserializeAws_restJson1DescribeRuleGroupsNamespaceCommand = exports.deserializeAws_restJson1DescribeLoggingConfigurationCommand = exports.deserializeAws_restJson1DescribeAlertManagerDefinitionCommand = exports.deserializeAws_restJson1DeleteWorkspaceCommand = exports.deserializeAws_restJson1DeleteRuleGroupsNamespaceCommand = exports.deserializeAws_restJson1DeleteLoggingConfigurationCommand = exports.deserializeAws_restJson1DeleteAlertManagerDefinitionCommand = exports.deserializeAws_restJson1CreateWorkspaceCommand = exports.deserializeAws_restJson1CreateRuleGroupsNamespaceCommand = exports.deserializeAws_restJson1CreateLoggingConfigurationCommand = exports.deserializeAws_restJson1CreateAlertManagerDefinitionCommand = exports.serializeAws_restJson1UpdateWorkspaceAliasCommand = exports.serializeAws_restJson1UpdateLoggingConfigurationCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1PutRuleGroupsNamespaceCommand = exports.serializeAws_restJson1PutAlertManagerDefinitionCommand = exports.serializeAws_restJson1ListWorkspacesCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListRuleGroupsNamespacesCommand = exports.serializeAws_restJson1DescribeWorkspaceCommand = exports.serializeAws_restJson1DescribeRuleGroupsNamespaceCommand = exports.serializeAws_restJson1DescribeLoggingConfigurationCommand = exports.serializeAws_restJson1DescribeAlertManagerDefinitionCommand = exports.serializeAws_restJson1DeleteWorkspaceCommand = exports.serializeAws_restJson1DeleteRuleGroupsNamespaceCommand = exports.serializeAws_restJson1DeleteLoggingConfigurationCommand = exports.serializeAws_restJson1DeleteAlertManagerDefinitionCommand = exports.serializeAws_restJson1CreateWorkspaceCommand = exports.serializeAws_restJson1CreateRuleGroupsNamespaceCommand = exports.serializeAws_restJson1CreateLoggingConfigurationCommand = exports.serializeAws_restJson1CreateAlertManagerDefinitionCommand = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const uuid_1 = require("uuid");
@@ -14,16 +14,7 @@ const serializeAws_restJson1CreateAlertManagerDefinitionCommand = async (input,
14
14
  };
15
15
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
16
16
  "/workspaces/{workspaceId}/alertmanager/definition";
17
- if (input.workspaceId !== undefined) {
18
- const labelValue = input.workspaceId;
19
- if (labelValue.length <= 0) {
20
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
21
- }
22
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
23
- }
24
- else {
25
- throw new Error("No value provided for input HTTP label: workspaceId.");
26
- }
17
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
27
18
  let body;
28
19
  body = JSON.stringify({
29
20
  clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : (0, uuid_1.v4)(),
@@ -40,6 +31,30 @@ const serializeAws_restJson1CreateAlertManagerDefinitionCommand = async (input,
40
31
  });
41
32
  };
42
33
  exports.serializeAws_restJson1CreateAlertManagerDefinitionCommand = serializeAws_restJson1CreateAlertManagerDefinitionCommand;
34
+ const serializeAws_restJson1CreateLoggingConfigurationCommand = async (input, context) => {
35
+ var _a;
36
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
37
+ const headers = {
38
+ "content-type": "application/json",
39
+ };
40
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}/logging";
41
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
42
+ let body;
43
+ body = JSON.stringify({
44
+ clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : (0, uuid_1.v4)(),
45
+ ...(input.logGroupArn != null && { logGroupArn: input.logGroupArn }),
46
+ });
47
+ return new protocol_http_1.HttpRequest({
48
+ protocol,
49
+ hostname,
50
+ port,
51
+ method: "POST",
52
+ headers,
53
+ path: resolvedPath,
54
+ body,
55
+ });
56
+ };
57
+ exports.serializeAws_restJson1CreateLoggingConfigurationCommand = serializeAws_restJson1CreateLoggingConfigurationCommand;
43
58
  const serializeAws_restJson1CreateRuleGroupsNamespaceCommand = async (input, context) => {
44
59
  var _a;
45
60
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -48,16 +63,7 @@ const serializeAws_restJson1CreateRuleGroupsNamespaceCommand = async (input, con
48
63
  };
49
64
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
50
65
  "/workspaces/{workspaceId}/rulegroupsnamespaces";
51
- if (input.workspaceId !== undefined) {
52
- const labelValue = input.workspaceId;
53
- if (labelValue.length <= 0) {
54
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
55
- }
56
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
57
- }
58
- else {
59
- throw new Error("No value provided for input HTTP label: workspaceId.");
60
- }
66
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
61
67
  let body;
62
68
  body = JSON.stringify({
63
69
  clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : (0, uuid_1.v4)(),
@@ -105,19 +111,10 @@ const serializeAws_restJson1DeleteAlertManagerDefinitionCommand = async (input,
105
111
  const headers = {};
106
112
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
107
113
  "/workspaces/{workspaceId}/alertmanager/definition";
108
- if (input.workspaceId !== undefined) {
109
- const labelValue = input.workspaceId;
110
- if (labelValue.length <= 0) {
111
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
112
- }
113
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
114
- }
115
- else {
116
- throw new Error("No value provided for input HTTP label: workspaceId.");
117
- }
118
- const query = {
119
- ...(input.clientToken !== undefined && { clientToken: input.clientToken }),
120
- };
114
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
115
+ const query = map({
116
+ clientToken: [, input.clientToken],
117
+ });
121
118
  let body;
122
119
  return new protocol_http_1.HttpRequest({
123
120
  protocol,
@@ -131,34 +128,37 @@ const serializeAws_restJson1DeleteAlertManagerDefinitionCommand = async (input,
131
128
  });
132
129
  };
133
130
  exports.serializeAws_restJson1DeleteAlertManagerDefinitionCommand = serializeAws_restJson1DeleteAlertManagerDefinitionCommand;
131
+ const serializeAws_restJson1DeleteLoggingConfigurationCommand = async (input, context) => {
132
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
133
+ const headers = {};
134
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}/logging";
135
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
136
+ const query = map({
137
+ clientToken: [, input.clientToken],
138
+ });
139
+ let body;
140
+ return new protocol_http_1.HttpRequest({
141
+ protocol,
142
+ hostname,
143
+ port,
144
+ method: "DELETE",
145
+ headers,
146
+ path: resolvedPath,
147
+ query,
148
+ body,
149
+ });
150
+ };
151
+ exports.serializeAws_restJson1DeleteLoggingConfigurationCommand = serializeAws_restJson1DeleteLoggingConfigurationCommand;
134
152
  const serializeAws_restJson1DeleteRuleGroupsNamespaceCommand = async (input, context) => {
135
153
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
136
154
  const headers = {};
137
155
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
138
156
  "/workspaces/{workspaceId}/rulegroupsnamespaces/{name}";
139
- if (input.workspaceId !== undefined) {
140
- const labelValue = input.workspaceId;
141
- if (labelValue.length <= 0) {
142
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
143
- }
144
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
145
- }
146
- else {
147
- throw new Error("No value provided for input HTTP label: workspaceId.");
148
- }
149
- if (input.name !== undefined) {
150
- const labelValue = input.name;
151
- if (labelValue.length <= 0) {
152
- throw new Error("Empty value provided for input HTTP label: name.");
153
- }
154
- resolvedPath = resolvedPath.replace("{name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
155
- }
156
- else {
157
- throw new Error("No value provided for input HTTP label: name.");
158
- }
159
- const query = {
160
- ...(input.clientToken !== undefined && { clientToken: input.clientToken }),
161
- };
157
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
158
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "name", () => input.name, "{name}", false);
159
+ const query = map({
160
+ clientToken: [, input.clientToken],
161
+ });
162
162
  let body;
163
163
  return new protocol_http_1.HttpRequest({
164
164
  protocol,
@@ -176,19 +176,10 @@ const serializeAws_restJson1DeleteWorkspaceCommand = async (input, context) => {
176
176
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
177
177
  const headers = {};
178
178
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}";
179
- if (input.workspaceId !== undefined) {
180
- const labelValue = input.workspaceId;
181
- if (labelValue.length <= 0) {
182
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
183
- }
184
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
185
- }
186
- else {
187
- throw new Error("No value provided for input HTTP label: workspaceId.");
188
- }
189
- const query = {
190
- ...(input.clientToken !== undefined && { clientToken: input.clientToken }),
191
- };
179
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
180
+ const query = map({
181
+ clientToken: [, input.clientToken],
182
+ });
192
183
  let body;
193
184
  return new protocol_http_1.HttpRequest({
194
185
  protocol,
@@ -207,16 +198,7 @@ const serializeAws_restJson1DescribeAlertManagerDefinitionCommand = async (input
207
198
  const headers = {};
208
199
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
209
200
  "/workspaces/{workspaceId}/alertmanager/definition";
210
- if (input.workspaceId !== undefined) {
211
- const labelValue = input.workspaceId;
212
- if (labelValue.length <= 0) {
213
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
214
- }
215
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
216
- }
217
- else {
218
- throw new Error("No value provided for input HTTP label: workspaceId.");
219
- }
201
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
220
202
  let body;
221
203
  return new protocol_http_1.HttpRequest({
222
204
  protocol,
@@ -229,31 +211,30 @@ const serializeAws_restJson1DescribeAlertManagerDefinitionCommand = async (input
229
211
  });
230
212
  };
231
213
  exports.serializeAws_restJson1DescribeAlertManagerDefinitionCommand = serializeAws_restJson1DescribeAlertManagerDefinitionCommand;
214
+ const serializeAws_restJson1DescribeLoggingConfigurationCommand = async (input, context) => {
215
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
216
+ const headers = {};
217
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}/logging";
218
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
219
+ let body;
220
+ return new protocol_http_1.HttpRequest({
221
+ protocol,
222
+ hostname,
223
+ port,
224
+ method: "GET",
225
+ headers,
226
+ path: resolvedPath,
227
+ body,
228
+ });
229
+ };
230
+ exports.serializeAws_restJson1DescribeLoggingConfigurationCommand = serializeAws_restJson1DescribeLoggingConfigurationCommand;
232
231
  const serializeAws_restJson1DescribeRuleGroupsNamespaceCommand = async (input, context) => {
233
232
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
234
233
  const headers = {};
235
234
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
236
235
  "/workspaces/{workspaceId}/rulegroupsnamespaces/{name}";
237
- if (input.workspaceId !== undefined) {
238
- const labelValue = input.workspaceId;
239
- if (labelValue.length <= 0) {
240
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
241
- }
242
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
243
- }
244
- else {
245
- throw new Error("No value provided for input HTTP label: workspaceId.");
246
- }
247
- if (input.name !== undefined) {
248
- const labelValue = input.name;
249
- if (labelValue.length <= 0) {
250
- throw new Error("Empty value provided for input HTTP label: name.");
251
- }
252
- resolvedPath = resolvedPath.replace("{name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
253
- }
254
- else {
255
- throw new Error("No value provided for input HTTP label: name.");
256
- }
236
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
237
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "name", () => input.name, "{name}", false);
257
238
  let body;
258
239
  return new protocol_http_1.HttpRequest({
259
240
  protocol,
@@ -270,16 +251,7 @@ const serializeAws_restJson1DescribeWorkspaceCommand = async (input, context) =>
270
251
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
271
252
  const headers = {};
272
253
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}";
273
- if (input.workspaceId !== undefined) {
274
- const labelValue = input.workspaceId;
275
- if (labelValue.length <= 0) {
276
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
277
- }
278
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
279
- }
280
- else {
281
- throw new Error("No value provided for input HTTP label: workspaceId.");
282
- }
254
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
283
255
  let body;
284
256
  return new protocol_http_1.HttpRequest({
285
257
  protocol,
@@ -297,21 +269,12 @@ const serializeAws_restJson1ListRuleGroupsNamespacesCommand = async (input, cont
297
269
  const headers = {};
298
270
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
299
271
  "/workspaces/{workspaceId}/rulegroupsnamespaces";
300
- if (input.workspaceId !== undefined) {
301
- const labelValue = input.workspaceId;
302
- if (labelValue.length <= 0) {
303
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
304
- }
305
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
306
- }
307
- else {
308
- throw new Error("No value provided for input HTTP label: workspaceId.");
309
- }
310
- const query = {
311
- ...(input.name !== undefined && { name: input.name }),
312
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
313
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
314
- };
272
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
273
+ const query = map({
274
+ name: [, input.name],
275
+ nextToken: [, input.nextToken],
276
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
277
+ });
315
278
  let body;
316
279
  return new protocol_http_1.HttpRequest({
317
280
  protocol,
@@ -329,16 +292,7 @@ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context)
329
292
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
330
293
  const headers = {};
331
294
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
332
- if (input.resourceArn !== undefined) {
333
- const labelValue = input.resourceArn;
334
- if (labelValue.length <= 0) {
335
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
336
- }
337
- resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
338
- }
339
- else {
340
- throw new Error("No value provided for input HTTP label: resourceArn.");
341
- }
295
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
342
296
  let body;
343
297
  return new protocol_http_1.HttpRequest({
344
298
  protocol,
@@ -355,11 +309,11 @@ const serializeAws_restJson1ListWorkspacesCommand = async (input, context) => {
355
309
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
356
310
  const headers = {};
357
311
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces";
358
- const query = {
359
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
360
- ...(input.alias !== undefined && { alias: input.alias }),
361
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
362
- };
312
+ const query = map({
313
+ nextToken: [, input.nextToken],
314
+ alias: [, input.alias],
315
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
316
+ });
363
317
  let body;
364
318
  return new protocol_http_1.HttpRequest({
365
319
  protocol,
@@ -381,16 +335,7 @@ const serializeAws_restJson1PutAlertManagerDefinitionCommand = async (input, con
381
335
  };
382
336
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
383
337
  "/workspaces/{workspaceId}/alertmanager/definition";
384
- if (input.workspaceId !== undefined) {
385
- const labelValue = input.workspaceId;
386
- if (labelValue.length <= 0) {
387
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
388
- }
389
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
390
- }
391
- else {
392
- throw new Error("No value provided for input HTTP label: workspaceId.");
393
- }
338
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
394
339
  let body;
395
340
  body = JSON.stringify({
396
341
  clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : (0, uuid_1.v4)(),
@@ -415,26 +360,8 @@ const serializeAws_restJson1PutRuleGroupsNamespaceCommand = async (input, contex
415
360
  };
416
361
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
417
362
  "/workspaces/{workspaceId}/rulegroupsnamespaces/{name}";
418
- if (input.workspaceId !== undefined) {
419
- const labelValue = input.workspaceId;
420
- if (labelValue.length <= 0) {
421
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
422
- }
423
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
424
- }
425
- else {
426
- throw new Error("No value provided for input HTTP label: workspaceId.");
427
- }
428
- if (input.name !== undefined) {
429
- const labelValue = input.name;
430
- if (labelValue.length <= 0) {
431
- throw new Error("Empty value provided for input HTTP label: name.");
432
- }
433
- resolvedPath = resolvedPath.replace("{name}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
434
- }
435
- else {
436
- throw new Error("No value provided for input HTTP label: name.");
437
- }
363
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
364
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "name", () => input.name, "{name}", false);
438
365
  let body;
439
366
  body = JSON.stringify({
440
367
  clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : (0, uuid_1.v4)(),
@@ -457,16 +384,7 @@ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
457
384
  "content-type": "application/json",
458
385
  };
459
386
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
460
- if (input.resourceArn !== undefined) {
461
- const labelValue = input.resourceArn;
462
- if (labelValue.length <= 0) {
463
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
464
- }
465
- resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
466
- }
467
- else {
468
- throw new Error("No value provided for input HTTP label: resourceArn.");
469
- }
387
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
470
388
  let body;
471
389
  body = JSON.stringify({
472
390
  ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
@@ -486,19 +404,10 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
486
404
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
487
405
  const headers = {};
488
406
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
489
- if (input.resourceArn !== undefined) {
490
- const labelValue = input.resourceArn;
491
- if (labelValue.length <= 0) {
492
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
493
- }
494
- resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
495
- }
496
- else {
497
- throw new Error("No value provided for input HTTP label: resourceArn.");
498
- }
499
- const query = {
500
- ...(input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map((_entry) => _entry) }),
501
- };
407
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
408
+ const query = map({
409
+ tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys || []).map((_entry) => _entry)],
410
+ });
502
411
  let body;
503
412
  return new protocol_http_1.HttpRequest({
504
413
  protocol,
@@ -512,6 +421,30 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
512
421
  });
513
422
  };
514
423
  exports.serializeAws_restJson1UntagResourceCommand = serializeAws_restJson1UntagResourceCommand;
424
+ const serializeAws_restJson1UpdateLoggingConfigurationCommand = async (input, context) => {
425
+ var _a;
426
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
427
+ const headers = {
428
+ "content-type": "application/json",
429
+ };
430
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}/logging";
431
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
432
+ let body;
433
+ body = JSON.stringify({
434
+ clientToken: (_a = input.clientToken) !== null && _a !== void 0 ? _a : (0, uuid_1.v4)(),
435
+ ...(input.logGroupArn != null && { logGroupArn: input.logGroupArn }),
436
+ });
437
+ return new protocol_http_1.HttpRequest({
438
+ protocol,
439
+ hostname,
440
+ port,
441
+ method: "PUT",
442
+ headers,
443
+ path: resolvedPath,
444
+ body,
445
+ });
446
+ };
447
+ exports.serializeAws_restJson1UpdateLoggingConfigurationCommand = serializeAws_restJson1UpdateLoggingConfigurationCommand;
515
448
  const serializeAws_restJson1UpdateWorkspaceAliasCommand = async (input, context) => {
516
449
  var _a;
517
450
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -519,16 +452,7 @@ const serializeAws_restJson1UpdateWorkspaceAliasCommand = async (input, context)
519
452
  "content-type": "application/json",
520
453
  };
521
454
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}/alias";
522
- if (input.workspaceId !== undefined) {
523
- const labelValue = input.workspaceId;
524
- if (labelValue.length <= 0) {
525
- throw new Error("Empty value provided for input HTTP label: workspaceId.");
526
- }
527
- resolvedPath = resolvedPath.replace("{workspaceId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
528
- }
529
- else {
530
- throw new Error("No value provided for input HTTP label: workspaceId.");
531
- }
455
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workspaceId", () => input.workspaceId, "{workspaceId}", false);
532
456
  let body;
533
457
  body = JSON.stringify({
534
458
  ...(input.alias != null && { alias: input.alias }),
@@ -549,15 +473,14 @@ const deserializeAws_restJson1CreateAlertManagerDefinitionCommand = async (outpu
549
473
  if (output.statusCode !== 202 && output.statusCode >= 300) {
550
474
  return deserializeAws_restJson1CreateAlertManagerDefinitionCommandError(output, context);
551
475
  }
552
- const contents = {
476
+ const contents = map({
553
477
  $metadata: deserializeMetadata(output),
554
- status: undefined,
555
- };
478
+ });
556
479
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
557
- if (data.status !== undefined && data.status !== null) {
480
+ if (data.status != null) {
558
481
  contents.status = deserializeAws_restJson1AlertManagerDefinitionStatus(data.status, context);
559
482
  }
560
- return Promise.resolve(contents);
483
+ return contents;
561
484
  };
562
485
  exports.deserializeAws_restJson1CreateAlertManagerDefinitionCommand = deserializeAws_restJson1CreateAlertManagerDefinitionCommand;
563
486
  const deserializeAws_restJson1CreateAlertManagerDefinitionCommandError = async (output, context) => {
@@ -565,7 +488,6 @@ const deserializeAws_restJson1CreateAlertManagerDefinitionCommandError = async (
565
488
  ...output,
566
489
  body: await parseBody(output.body, context),
567
490
  };
568
- let response;
569
491
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
570
492
  switch (errorCode) {
571
493
  case "AccessDeniedException":
@@ -591,41 +513,78 @@ const deserializeAws_restJson1CreateAlertManagerDefinitionCommandError = async (
591
513
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
592
514
  default:
593
515
  const parsedBody = parsedOutput.body;
594
- const $metadata = deserializeMetadata(output);
595
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
596
- response = new AmpServiceException_1.AmpServiceException({
597
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
598
- $fault: "client",
599
- $metadata,
516
+ (0, smithy_client_1.throwDefaultError)({
517
+ output,
518
+ parsedBody,
519
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
520
+ errorCode,
521
+ });
522
+ }
523
+ };
524
+ const deserializeAws_restJson1CreateLoggingConfigurationCommand = async (output, context) => {
525
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
526
+ return deserializeAws_restJson1CreateLoggingConfigurationCommandError(output, context);
527
+ }
528
+ const contents = map({
529
+ $metadata: deserializeMetadata(output),
530
+ });
531
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
532
+ if (data.status != null) {
533
+ contents.status = deserializeAws_restJson1LoggingConfigurationStatus(data.status, context);
534
+ }
535
+ return contents;
536
+ };
537
+ exports.deserializeAws_restJson1CreateLoggingConfigurationCommand = deserializeAws_restJson1CreateLoggingConfigurationCommand;
538
+ const deserializeAws_restJson1CreateLoggingConfigurationCommandError = async (output, context) => {
539
+ const parsedOutput = {
540
+ ...output,
541
+ body: await parseBody(output.body, context),
542
+ };
543
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
544
+ switch (errorCode) {
545
+ case "AccessDeniedException":
546
+ case "com.amazonaws.amp#AccessDeniedException":
547
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
548
+ case "InternalServerException":
549
+ case "com.amazonaws.amp#InternalServerException":
550
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
551
+ case "ResourceNotFoundException":
552
+ case "com.amazonaws.amp#ResourceNotFoundException":
553
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
554
+ case "ValidationException":
555
+ case "com.amazonaws.amp#ValidationException":
556
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
557
+ default:
558
+ const parsedBody = parsedOutput.body;
559
+ (0, smithy_client_1.throwDefaultError)({
560
+ output,
561
+ parsedBody,
562
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
563
+ errorCode,
600
564
  });
601
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
602
565
  }
603
566
  };
604
567
  const deserializeAws_restJson1CreateRuleGroupsNamespaceCommand = async (output, context) => {
605
568
  if (output.statusCode !== 202 && output.statusCode >= 300) {
606
569
  return deserializeAws_restJson1CreateRuleGroupsNamespaceCommandError(output, context);
607
570
  }
608
- const contents = {
571
+ const contents = map({
609
572
  $metadata: deserializeMetadata(output),
610
- arn: undefined,
611
- name: undefined,
612
- status: undefined,
613
- tags: undefined,
614
- };
573
+ });
615
574
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
616
- if (data.arn !== undefined && data.arn !== null) {
575
+ if (data.arn != null) {
617
576
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
618
577
  }
619
- if (data.name !== undefined && data.name !== null) {
578
+ if (data.name != null) {
620
579
  contents.name = (0, smithy_client_1.expectString)(data.name);
621
580
  }
622
- if (data.status !== undefined && data.status !== null) {
581
+ if (data.status != null) {
623
582
  contents.status = deserializeAws_restJson1RuleGroupsNamespaceStatus(data.status, context);
624
583
  }
625
- if (data.tags !== undefined && data.tags !== null) {
584
+ if (data.tags != null) {
626
585
  contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
627
586
  }
628
- return Promise.resolve(contents);
587
+ return contents;
629
588
  };
630
589
  exports.deserializeAws_restJson1CreateRuleGroupsNamespaceCommand = deserializeAws_restJson1CreateRuleGroupsNamespaceCommand;
631
590
  const deserializeAws_restJson1CreateRuleGroupsNamespaceCommandError = async (output, context) => {
@@ -633,7 +592,6 @@ const deserializeAws_restJson1CreateRuleGroupsNamespaceCommandError = async (out
633
592
  ...output,
634
593
  body: await parseBody(output.body, context),
635
594
  };
636
- let response;
637
595
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
638
596
  switch (errorCode) {
639
597
  case "AccessDeniedException":
@@ -659,41 +617,35 @@ const deserializeAws_restJson1CreateRuleGroupsNamespaceCommandError = async (out
659
617
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
660
618
  default:
661
619
  const parsedBody = parsedOutput.body;
662
- const $metadata = deserializeMetadata(output);
663
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
664
- response = new AmpServiceException_1.AmpServiceException({
665
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
666
- $fault: "client",
667
- $metadata,
620
+ (0, smithy_client_1.throwDefaultError)({
621
+ output,
622
+ parsedBody,
623
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
624
+ errorCode,
668
625
  });
669
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
670
626
  }
671
627
  };
672
628
  const deserializeAws_restJson1CreateWorkspaceCommand = async (output, context) => {
673
629
  if (output.statusCode !== 202 && output.statusCode >= 300) {
674
630
  return deserializeAws_restJson1CreateWorkspaceCommandError(output, context);
675
631
  }
676
- const contents = {
632
+ const contents = map({
677
633
  $metadata: deserializeMetadata(output),
678
- arn: undefined,
679
- status: undefined,
680
- tags: undefined,
681
- workspaceId: undefined,
682
- };
634
+ });
683
635
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
684
- if (data.arn !== undefined && data.arn !== null) {
636
+ if (data.arn != null) {
685
637
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
686
638
  }
687
- if (data.status !== undefined && data.status !== null) {
639
+ if (data.status != null) {
688
640
  contents.status = deserializeAws_restJson1WorkspaceStatus(data.status, context);
689
641
  }
690
- if (data.tags !== undefined && data.tags !== null) {
642
+ if (data.tags != null) {
691
643
  contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
692
644
  }
693
- if (data.workspaceId !== undefined && data.workspaceId !== null) {
645
+ if (data.workspaceId != null) {
694
646
  contents.workspaceId = (0, smithy_client_1.expectString)(data.workspaceId);
695
647
  }
696
- return Promise.resolve(contents);
648
+ return contents;
697
649
  };
698
650
  exports.deserializeAws_restJson1CreateWorkspaceCommand = deserializeAws_restJson1CreateWorkspaceCommand;
699
651
  const deserializeAws_restJson1CreateWorkspaceCommandError = async (output, context) => {
@@ -701,7 +653,6 @@ const deserializeAws_restJson1CreateWorkspaceCommandError = async (output, conte
701
653
  ...output,
702
654
  body: await parseBody(output.body, context),
703
655
  };
704
- let response;
705
656
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
706
657
  switch (errorCode) {
707
658
  case "AccessDeniedException":
@@ -724,25 +675,23 @@ const deserializeAws_restJson1CreateWorkspaceCommandError = async (output, conte
724
675
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
725
676
  default:
726
677
  const parsedBody = parsedOutput.body;
727
- const $metadata = deserializeMetadata(output);
728
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
729
- response = new AmpServiceException_1.AmpServiceException({
730
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
731
- $fault: "client",
732
- $metadata,
678
+ (0, smithy_client_1.throwDefaultError)({
679
+ output,
680
+ parsedBody,
681
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
682
+ errorCode,
733
683
  });
734
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
735
684
  }
736
685
  };
737
686
  const deserializeAws_restJson1DeleteAlertManagerDefinitionCommand = async (output, context) => {
738
687
  if (output.statusCode !== 202 && output.statusCode >= 300) {
739
688
  return deserializeAws_restJson1DeleteAlertManagerDefinitionCommandError(output, context);
740
689
  }
741
- const contents = {
690
+ const contents = map({
742
691
  $metadata: deserializeMetadata(output),
743
- };
692
+ });
744
693
  await collectBody(output.body, context);
745
- return Promise.resolve(contents);
694
+ return contents;
746
695
  };
747
696
  exports.deserializeAws_restJson1DeleteAlertManagerDefinitionCommand = deserializeAws_restJson1DeleteAlertManagerDefinitionCommand;
748
697
  const deserializeAws_restJson1DeleteAlertManagerDefinitionCommandError = async (output, context) => {
@@ -750,7 +699,6 @@ const deserializeAws_restJson1DeleteAlertManagerDefinitionCommandError = async (
750
699
  ...output,
751
700
  body: await parseBody(output.body, context),
752
701
  };
753
- let response;
754
702
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
755
703
  switch (errorCode) {
756
704
  case "AccessDeniedException":
@@ -773,25 +721,66 @@ const deserializeAws_restJson1DeleteAlertManagerDefinitionCommandError = async (
773
721
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
774
722
  default:
775
723
  const parsedBody = parsedOutput.body;
776
- const $metadata = deserializeMetadata(output);
777
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
778
- response = new AmpServiceException_1.AmpServiceException({
779
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
780
- $fault: "client",
781
- $metadata,
724
+ (0, smithy_client_1.throwDefaultError)({
725
+ output,
726
+ parsedBody,
727
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
728
+ errorCode,
729
+ });
730
+ }
731
+ };
732
+ const deserializeAws_restJson1DeleteLoggingConfigurationCommand = async (output, context) => {
733
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
734
+ return deserializeAws_restJson1DeleteLoggingConfigurationCommandError(output, context);
735
+ }
736
+ const contents = map({
737
+ $metadata: deserializeMetadata(output),
738
+ });
739
+ await collectBody(output.body, context);
740
+ return contents;
741
+ };
742
+ exports.deserializeAws_restJson1DeleteLoggingConfigurationCommand = deserializeAws_restJson1DeleteLoggingConfigurationCommand;
743
+ const deserializeAws_restJson1DeleteLoggingConfigurationCommandError = async (output, context) => {
744
+ const parsedOutput = {
745
+ ...output,
746
+ body: await parseBody(output.body, context),
747
+ };
748
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
749
+ switch (errorCode) {
750
+ case "AccessDeniedException":
751
+ case "com.amazonaws.amp#AccessDeniedException":
752
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
753
+ case "ConflictException":
754
+ case "com.amazonaws.amp#ConflictException":
755
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
756
+ case "InternalServerException":
757
+ case "com.amazonaws.amp#InternalServerException":
758
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
759
+ case "ResourceNotFoundException":
760
+ case "com.amazonaws.amp#ResourceNotFoundException":
761
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
762
+ case "ValidationException":
763
+ case "com.amazonaws.amp#ValidationException":
764
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
765
+ default:
766
+ const parsedBody = parsedOutput.body;
767
+ (0, smithy_client_1.throwDefaultError)({
768
+ output,
769
+ parsedBody,
770
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
771
+ errorCode,
782
772
  });
783
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
784
773
  }
785
774
  };
786
775
  const deserializeAws_restJson1DeleteRuleGroupsNamespaceCommand = async (output, context) => {
787
776
  if (output.statusCode !== 202 && output.statusCode >= 300) {
788
777
  return deserializeAws_restJson1DeleteRuleGroupsNamespaceCommandError(output, context);
789
778
  }
790
- const contents = {
779
+ const contents = map({
791
780
  $metadata: deserializeMetadata(output),
792
- };
781
+ });
793
782
  await collectBody(output.body, context);
794
- return Promise.resolve(contents);
783
+ return contents;
795
784
  };
796
785
  exports.deserializeAws_restJson1DeleteRuleGroupsNamespaceCommand = deserializeAws_restJson1DeleteRuleGroupsNamespaceCommand;
797
786
  const deserializeAws_restJson1DeleteRuleGroupsNamespaceCommandError = async (output, context) => {
@@ -799,7 +788,6 @@ const deserializeAws_restJson1DeleteRuleGroupsNamespaceCommandError = async (out
799
788
  ...output,
800
789
  body: await parseBody(output.body, context),
801
790
  };
802
- let response;
803
791
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
804
792
  switch (errorCode) {
805
793
  case "AccessDeniedException":
@@ -822,25 +810,23 @@ const deserializeAws_restJson1DeleteRuleGroupsNamespaceCommandError = async (out
822
810
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
823
811
  default:
824
812
  const parsedBody = parsedOutput.body;
825
- const $metadata = deserializeMetadata(output);
826
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
827
- response = new AmpServiceException_1.AmpServiceException({
828
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
829
- $fault: "client",
830
- $metadata,
813
+ (0, smithy_client_1.throwDefaultError)({
814
+ output,
815
+ parsedBody,
816
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
817
+ errorCode,
831
818
  });
832
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
833
819
  }
834
820
  };
835
821
  const deserializeAws_restJson1DeleteWorkspaceCommand = async (output, context) => {
836
822
  if (output.statusCode !== 202 && output.statusCode >= 300) {
837
823
  return deserializeAws_restJson1DeleteWorkspaceCommandError(output, context);
838
824
  }
839
- const contents = {
825
+ const contents = map({
840
826
  $metadata: deserializeMetadata(output),
841
- };
827
+ });
842
828
  await collectBody(output.body, context);
843
- return Promise.resolve(contents);
829
+ return contents;
844
830
  };
845
831
  exports.deserializeAws_restJson1DeleteWorkspaceCommand = deserializeAws_restJson1DeleteWorkspaceCommand;
846
832
  const deserializeAws_restJson1DeleteWorkspaceCommandError = async (output, context) => {
@@ -848,7 +834,6 @@ const deserializeAws_restJson1DeleteWorkspaceCommandError = async (output, conte
848
834
  ...output,
849
835
  body: await parseBody(output.body, context),
850
836
  };
851
- let response;
852
837
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
853
838
  switch (errorCode) {
854
839
  case "AccessDeniedException":
@@ -871,29 +856,26 @@ const deserializeAws_restJson1DeleteWorkspaceCommandError = async (output, conte
871
856
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
872
857
  default:
873
858
  const parsedBody = parsedOutput.body;
874
- const $metadata = deserializeMetadata(output);
875
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
876
- response = new AmpServiceException_1.AmpServiceException({
877
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
878
- $fault: "client",
879
- $metadata,
859
+ (0, smithy_client_1.throwDefaultError)({
860
+ output,
861
+ parsedBody,
862
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
863
+ errorCode,
880
864
  });
881
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
882
865
  }
883
866
  };
884
867
  const deserializeAws_restJson1DescribeAlertManagerDefinitionCommand = async (output, context) => {
885
868
  if (output.statusCode !== 200 && output.statusCode >= 300) {
886
869
  return deserializeAws_restJson1DescribeAlertManagerDefinitionCommandError(output, context);
887
870
  }
888
- const contents = {
871
+ const contents = map({
889
872
  $metadata: deserializeMetadata(output),
890
- alertManagerDefinition: undefined,
891
- };
873
+ });
892
874
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
893
- if (data.alertManagerDefinition !== undefined && data.alertManagerDefinition !== null) {
875
+ if (data.alertManagerDefinition != null) {
894
876
  contents.alertManagerDefinition = deserializeAws_restJson1AlertManagerDefinitionDescription(data.alertManagerDefinition, context);
895
877
  }
896
- return Promise.resolve(contents);
878
+ return contents;
897
879
  };
898
880
  exports.deserializeAws_restJson1DescribeAlertManagerDefinitionCommand = deserializeAws_restJson1DescribeAlertManagerDefinitionCommand;
899
881
  const deserializeAws_restJson1DescribeAlertManagerDefinitionCommandError = async (output, context) => {
@@ -901,7 +883,6 @@ const deserializeAws_restJson1DescribeAlertManagerDefinitionCommandError = async
901
883
  ...output,
902
884
  body: await parseBody(output.body, context),
903
885
  };
904
- let response;
905
886
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
906
887
  switch (errorCode) {
907
888
  case "AccessDeniedException":
@@ -921,29 +902,69 @@ const deserializeAws_restJson1DescribeAlertManagerDefinitionCommandError = async
921
902
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
922
903
  default:
923
904
  const parsedBody = parsedOutput.body;
924
- const $metadata = deserializeMetadata(output);
925
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
926
- response = new AmpServiceException_1.AmpServiceException({
927
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
928
- $fault: "client",
929
- $metadata,
905
+ (0, smithy_client_1.throwDefaultError)({
906
+ output,
907
+ parsedBody,
908
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
909
+ errorCode,
910
+ });
911
+ }
912
+ };
913
+ const deserializeAws_restJson1DescribeLoggingConfigurationCommand = async (output, context) => {
914
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
915
+ return deserializeAws_restJson1DescribeLoggingConfigurationCommandError(output, context);
916
+ }
917
+ const contents = map({
918
+ $metadata: deserializeMetadata(output),
919
+ });
920
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
921
+ if (data.loggingConfiguration != null) {
922
+ contents.loggingConfiguration = deserializeAws_restJson1LoggingConfigurationMetadata(data.loggingConfiguration, context);
923
+ }
924
+ return contents;
925
+ };
926
+ exports.deserializeAws_restJson1DescribeLoggingConfigurationCommand = deserializeAws_restJson1DescribeLoggingConfigurationCommand;
927
+ const deserializeAws_restJson1DescribeLoggingConfigurationCommandError = async (output, context) => {
928
+ const parsedOutput = {
929
+ ...output,
930
+ body: await parseBody(output.body, context),
931
+ };
932
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
933
+ switch (errorCode) {
934
+ case "AccessDeniedException":
935
+ case "com.amazonaws.amp#AccessDeniedException":
936
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
937
+ case "InternalServerException":
938
+ case "com.amazonaws.amp#InternalServerException":
939
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
940
+ case "ResourceNotFoundException":
941
+ case "com.amazonaws.amp#ResourceNotFoundException":
942
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
943
+ case "ValidationException":
944
+ case "com.amazonaws.amp#ValidationException":
945
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
946
+ default:
947
+ const parsedBody = parsedOutput.body;
948
+ (0, smithy_client_1.throwDefaultError)({
949
+ output,
950
+ parsedBody,
951
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
952
+ errorCode,
930
953
  });
931
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
932
954
  }
933
955
  };
934
956
  const deserializeAws_restJson1DescribeRuleGroupsNamespaceCommand = async (output, context) => {
935
957
  if (output.statusCode !== 200 && output.statusCode >= 300) {
936
958
  return deserializeAws_restJson1DescribeRuleGroupsNamespaceCommandError(output, context);
937
959
  }
938
- const contents = {
960
+ const contents = map({
939
961
  $metadata: deserializeMetadata(output),
940
- ruleGroupsNamespace: undefined,
941
- };
962
+ });
942
963
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
943
- if (data.ruleGroupsNamespace !== undefined && data.ruleGroupsNamespace !== null) {
964
+ if (data.ruleGroupsNamespace != null) {
944
965
  contents.ruleGroupsNamespace = deserializeAws_restJson1RuleGroupsNamespaceDescription(data.ruleGroupsNamespace, context);
945
966
  }
946
- return Promise.resolve(contents);
967
+ return contents;
947
968
  };
948
969
  exports.deserializeAws_restJson1DescribeRuleGroupsNamespaceCommand = deserializeAws_restJson1DescribeRuleGroupsNamespaceCommand;
949
970
  const deserializeAws_restJson1DescribeRuleGroupsNamespaceCommandError = async (output, context) => {
@@ -951,7 +972,6 @@ const deserializeAws_restJson1DescribeRuleGroupsNamespaceCommandError = async (o
951
972
  ...output,
952
973
  body: await parseBody(output.body, context),
953
974
  };
954
- let response;
955
975
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
956
976
  switch (errorCode) {
957
977
  case "AccessDeniedException":
@@ -971,29 +991,26 @@ const deserializeAws_restJson1DescribeRuleGroupsNamespaceCommandError = async (o
971
991
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
972
992
  default:
973
993
  const parsedBody = parsedOutput.body;
974
- const $metadata = deserializeMetadata(output);
975
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
976
- response = new AmpServiceException_1.AmpServiceException({
977
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
978
- $fault: "client",
979
- $metadata,
994
+ (0, smithy_client_1.throwDefaultError)({
995
+ output,
996
+ parsedBody,
997
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
998
+ errorCode,
980
999
  });
981
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
982
1000
  }
983
1001
  };
984
1002
  const deserializeAws_restJson1DescribeWorkspaceCommand = async (output, context) => {
985
1003
  if (output.statusCode !== 200 && output.statusCode >= 300) {
986
1004
  return deserializeAws_restJson1DescribeWorkspaceCommandError(output, context);
987
1005
  }
988
- const contents = {
1006
+ const contents = map({
989
1007
  $metadata: deserializeMetadata(output),
990
- workspace: undefined,
991
- };
1008
+ });
992
1009
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
993
- if (data.workspace !== undefined && data.workspace !== null) {
1010
+ if (data.workspace != null) {
994
1011
  contents.workspace = deserializeAws_restJson1WorkspaceDescription(data.workspace, context);
995
1012
  }
996
- return Promise.resolve(contents);
1013
+ return contents;
997
1014
  };
998
1015
  exports.deserializeAws_restJson1DescribeWorkspaceCommand = deserializeAws_restJson1DescribeWorkspaceCommand;
999
1016
  const deserializeAws_restJson1DescribeWorkspaceCommandError = async (output, context) => {
@@ -1001,7 +1018,6 @@ const deserializeAws_restJson1DescribeWorkspaceCommandError = async (output, con
1001
1018
  ...output,
1002
1019
  body: await parseBody(output.body, context),
1003
1020
  };
1004
- let response;
1005
1021
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1006
1022
  switch (errorCode) {
1007
1023
  case "AccessDeniedException":
@@ -1021,33 +1037,29 @@ const deserializeAws_restJson1DescribeWorkspaceCommandError = async (output, con
1021
1037
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1022
1038
  default:
1023
1039
  const parsedBody = parsedOutput.body;
1024
- const $metadata = deserializeMetadata(output);
1025
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1026
- response = new AmpServiceException_1.AmpServiceException({
1027
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1028
- $fault: "client",
1029
- $metadata,
1040
+ (0, smithy_client_1.throwDefaultError)({
1041
+ output,
1042
+ parsedBody,
1043
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
1044
+ errorCode,
1030
1045
  });
1031
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1032
1046
  }
1033
1047
  };
1034
1048
  const deserializeAws_restJson1ListRuleGroupsNamespacesCommand = async (output, context) => {
1035
1049
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1036
1050
  return deserializeAws_restJson1ListRuleGroupsNamespacesCommandError(output, context);
1037
1051
  }
1038
- const contents = {
1052
+ const contents = map({
1039
1053
  $metadata: deserializeMetadata(output),
1040
- nextToken: undefined,
1041
- ruleGroupsNamespaces: undefined,
1042
- };
1054
+ });
1043
1055
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1044
- if (data.nextToken !== undefined && data.nextToken !== null) {
1056
+ if (data.nextToken != null) {
1045
1057
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1046
1058
  }
1047
- if (data.ruleGroupsNamespaces !== undefined && data.ruleGroupsNamespaces !== null) {
1059
+ if (data.ruleGroupsNamespaces != null) {
1048
1060
  contents.ruleGroupsNamespaces = deserializeAws_restJson1RuleGroupsNamespaceSummaryList(data.ruleGroupsNamespaces, context);
1049
1061
  }
1050
- return Promise.resolve(contents);
1062
+ return contents;
1051
1063
  };
1052
1064
  exports.deserializeAws_restJson1ListRuleGroupsNamespacesCommand = deserializeAws_restJson1ListRuleGroupsNamespacesCommand;
1053
1065
  const deserializeAws_restJson1ListRuleGroupsNamespacesCommandError = async (output, context) => {
@@ -1055,7 +1067,6 @@ const deserializeAws_restJson1ListRuleGroupsNamespacesCommandError = async (outp
1055
1067
  ...output,
1056
1068
  body: await parseBody(output.body, context),
1057
1069
  };
1058
- let response;
1059
1070
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1060
1071
  switch (errorCode) {
1061
1072
  case "AccessDeniedException":
@@ -1075,29 +1086,26 @@ const deserializeAws_restJson1ListRuleGroupsNamespacesCommandError = async (outp
1075
1086
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1076
1087
  default:
1077
1088
  const parsedBody = parsedOutput.body;
1078
- const $metadata = deserializeMetadata(output);
1079
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1080
- response = new AmpServiceException_1.AmpServiceException({
1081
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1082
- $fault: "client",
1083
- $metadata,
1089
+ (0, smithy_client_1.throwDefaultError)({
1090
+ output,
1091
+ parsedBody,
1092
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
1093
+ errorCode,
1084
1094
  });
1085
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1086
1095
  }
1087
1096
  };
1088
1097
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1089
1098
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1090
1099
  return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
1091
1100
  }
1092
- const contents = {
1101
+ const contents = map({
1093
1102
  $metadata: deserializeMetadata(output),
1094
- tags: undefined,
1095
- };
1103
+ });
1096
1104
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1097
- if (data.tags !== undefined && data.tags !== null) {
1105
+ if (data.tags != null) {
1098
1106
  contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
1099
1107
  }
1100
- return Promise.resolve(contents);
1108
+ return contents;
1101
1109
  };
1102
1110
  exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
1103
1111
  const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
@@ -1105,7 +1113,6 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
1105
1113
  ...output,
1106
1114
  body: await parseBody(output.body, context),
1107
1115
  };
1108
- let response;
1109
1116
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1110
1117
  switch (errorCode) {
1111
1118
  case "AccessDeniedException":
@@ -1125,33 +1132,29 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
1125
1132
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1126
1133
  default:
1127
1134
  const parsedBody = parsedOutput.body;
1128
- const $metadata = deserializeMetadata(output);
1129
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1130
- response = new AmpServiceException_1.AmpServiceException({
1131
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1132
- $fault: "client",
1133
- $metadata,
1135
+ (0, smithy_client_1.throwDefaultError)({
1136
+ output,
1137
+ parsedBody,
1138
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
1139
+ errorCode,
1134
1140
  });
1135
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1136
1141
  }
1137
1142
  };
1138
1143
  const deserializeAws_restJson1ListWorkspacesCommand = async (output, context) => {
1139
1144
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1140
1145
  return deserializeAws_restJson1ListWorkspacesCommandError(output, context);
1141
1146
  }
1142
- const contents = {
1147
+ const contents = map({
1143
1148
  $metadata: deserializeMetadata(output),
1144
- nextToken: undefined,
1145
- workspaces: undefined,
1146
- };
1149
+ });
1147
1150
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1148
- if (data.nextToken !== undefined && data.nextToken !== null) {
1151
+ if (data.nextToken != null) {
1149
1152
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1150
1153
  }
1151
- if (data.workspaces !== undefined && data.workspaces !== null) {
1154
+ if (data.workspaces != null) {
1152
1155
  contents.workspaces = deserializeAws_restJson1WorkspaceSummaryList(data.workspaces, context);
1153
1156
  }
1154
- return Promise.resolve(contents);
1157
+ return contents;
1155
1158
  };
1156
1159
  exports.deserializeAws_restJson1ListWorkspacesCommand = deserializeAws_restJson1ListWorkspacesCommand;
1157
1160
  const deserializeAws_restJson1ListWorkspacesCommandError = async (output, context) => {
@@ -1159,7 +1162,6 @@ const deserializeAws_restJson1ListWorkspacesCommandError = async (output, contex
1159
1162
  ...output,
1160
1163
  body: await parseBody(output.body, context),
1161
1164
  };
1162
- let response;
1163
1165
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1164
1166
  switch (errorCode) {
1165
1167
  case "AccessDeniedException":
@@ -1176,29 +1178,26 @@ const deserializeAws_restJson1ListWorkspacesCommandError = async (output, contex
1176
1178
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1177
1179
  default:
1178
1180
  const parsedBody = parsedOutput.body;
1179
- const $metadata = deserializeMetadata(output);
1180
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1181
- response = new AmpServiceException_1.AmpServiceException({
1182
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1183
- $fault: "client",
1184
- $metadata,
1181
+ (0, smithy_client_1.throwDefaultError)({
1182
+ output,
1183
+ parsedBody,
1184
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
1185
+ errorCode,
1185
1186
  });
1186
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1187
1187
  }
1188
1188
  };
1189
1189
  const deserializeAws_restJson1PutAlertManagerDefinitionCommand = async (output, context) => {
1190
1190
  if (output.statusCode !== 202 && output.statusCode >= 300) {
1191
1191
  return deserializeAws_restJson1PutAlertManagerDefinitionCommandError(output, context);
1192
1192
  }
1193
- const contents = {
1193
+ const contents = map({
1194
1194
  $metadata: deserializeMetadata(output),
1195
- status: undefined,
1196
- };
1195
+ });
1197
1196
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1198
- if (data.status !== undefined && data.status !== null) {
1197
+ if (data.status != null) {
1199
1198
  contents.status = deserializeAws_restJson1AlertManagerDefinitionStatus(data.status, context);
1200
1199
  }
1201
- return Promise.resolve(contents);
1200
+ return contents;
1202
1201
  };
1203
1202
  exports.deserializeAws_restJson1PutAlertManagerDefinitionCommand = deserializeAws_restJson1PutAlertManagerDefinitionCommand;
1204
1203
  const deserializeAws_restJson1PutAlertManagerDefinitionCommandError = async (output, context) => {
@@ -1206,7 +1205,6 @@ const deserializeAws_restJson1PutAlertManagerDefinitionCommandError = async (out
1206
1205
  ...output,
1207
1206
  body: await parseBody(output.body, context),
1208
1207
  };
1209
- let response;
1210
1208
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1211
1209
  switch (errorCode) {
1212
1210
  case "AccessDeniedException":
@@ -1232,41 +1230,35 @@ const deserializeAws_restJson1PutAlertManagerDefinitionCommandError = async (out
1232
1230
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1233
1231
  default:
1234
1232
  const parsedBody = parsedOutput.body;
1235
- const $metadata = deserializeMetadata(output);
1236
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1237
- response = new AmpServiceException_1.AmpServiceException({
1238
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1239
- $fault: "client",
1240
- $metadata,
1233
+ (0, smithy_client_1.throwDefaultError)({
1234
+ output,
1235
+ parsedBody,
1236
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
1237
+ errorCode,
1241
1238
  });
1242
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1243
1239
  }
1244
1240
  };
1245
1241
  const deserializeAws_restJson1PutRuleGroupsNamespaceCommand = async (output, context) => {
1246
1242
  if (output.statusCode !== 202 && output.statusCode >= 300) {
1247
1243
  return deserializeAws_restJson1PutRuleGroupsNamespaceCommandError(output, context);
1248
1244
  }
1249
- const contents = {
1245
+ const contents = map({
1250
1246
  $metadata: deserializeMetadata(output),
1251
- arn: undefined,
1252
- name: undefined,
1253
- status: undefined,
1254
- tags: undefined,
1255
- };
1247
+ });
1256
1248
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1257
- if (data.arn !== undefined && data.arn !== null) {
1249
+ if (data.arn != null) {
1258
1250
  contents.arn = (0, smithy_client_1.expectString)(data.arn);
1259
1251
  }
1260
- if (data.name !== undefined && data.name !== null) {
1252
+ if (data.name != null) {
1261
1253
  contents.name = (0, smithy_client_1.expectString)(data.name);
1262
1254
  }
1263
- if (data.status !== undefined && data.status !== null) {
1255
+ if (data.status != null) {
1264
1256
  contents.status = deserializeAws_restJson1RuleGroupsNamespaceStatus(data.status, context);
1265
1257
  }
1266
- if (data.tags !== undefined && data.tags !== null) {
1258
+ if (data.tags != null) {
1267
1259
  contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
1268
1260
  }
1269
- return Promise.resolve(contents);
1261
+ return contents;
1270
1262
  };
1271
1263
  exports.deserializeAws_restJson1PutRuleGroupsNamespaceCommand = deserializeAws_restJson1PutRuleGroupsNamespaceCommand;
1272
1264
  const deserializeAws_restJson1PutRuleGroupsNamespaceCommandError = async (output, context) => {
@@ -1274,7 +1266,6 @@ const deserializeAws_restJson1PutRuleGroupsNamespaceCommandError = async (output
1274
1266
  ...output,
1275
1267
  body: await parseBody(output.body, context),
1276
1268
  };
1277
- let response;
1278
1269
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1279
1270
  switch (errorCode) {
1280
1271
  case "AccessDeniedException":
@@ -1300,25 +1291,23 @@ const deserializeAws_restJson1PutRuleGroupsNamespaceCommandError = async (output
1300
1291
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1301
1292
  default:
1302
1293
  const parsedBody = parsedOutput.body;
1303
- const $metadata = deserializeMetadata(output);
1304
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1305
- response = new AmpServiceException_1.AmpServiceException({
1306
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1307
- $fault: "client",
1308
- $metadata,
1294
+ (0, smithy_client_1.throwDefaultError)({
1295
+ output,
1296
+ parsedBody,
1297
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
1298
+ errorCode,
1309
1299
  });
1310
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1311
1300
  }
1312
1301
  };
1313
1302
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
1314
1303
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1315
1304
  return deserializeAws_restJson1TagResourceCommandError(output, context);
1316
1305
  }
1317
- const contents = {
1306
+ const contents = map({
1318
1307
  $metadata: deserializeMetadata(output),
1319
- };
1308
+ });
1320
1309
  await collectBody(output.body, context);
1321
- return Promise.resolve(contents);
1310
+ return contents;
1322
1311
  };
1323
1312
  exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
1324
1313
  const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
@@ -1326,7 +1315,6 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
1326
1315
  ...output,
1327
1316
  body: await parseBody(output.body, context),
1328
1317
  };
1329
- let response;
1330
1318
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1331
1319
  switch (errorCode) {
1332
1320
  case "AccessDeniedException":
@@ -1346,25 +1334,23 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
1346
1334
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1347
1335
  default:
1348
1336
  const parsedBody = parsedOutput.body;
1349
- const $metadata = deserializeMetadata(output);
1350
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1351
- response = new AmpServiceException_1.AmpServiceException({
1352
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1353
- $fault: "client",
1354
- $metadata,
1337
+ (0, smithy_client_1.throwDefaultError)({
1338
+ output,
1339
+ parsedBody,
1340
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
1341
+ errorCode,
1355
1342
  });
1356
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1357
1343
  }
1358
1344
  };
1359
1345
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1360
1346
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1361
1347
  return deserializeAws_restJson1UntagResourceCommandError(output, context);
1362
1348
  }
1363
- const contents = {
1349
+ const contents = map({
1364
1350
  $metadata: deserializeMetadata(output),
1365
- };
1351
+ });
1366
1352
  await collectBody(output.body, context);
1367
- return Promise.resolve(contents);
1353
+ return contents;
1368
1354
  };
1369
1355
  exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
1370
1356
  const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
@@ -1372,7 +1358,6 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
1372
1358
  ...output,
1373
1359
  body: await parseBody(output.body, context),
1374
1360
  };
1375
- let response;
1376
1361
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1377
1362
  switch (errorCode) {
1378
1363
  case "AccessDeniedException":
@@ -1392,25 +1377,69 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
1392
1377
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1393
1378
  default:
1394
1379
  const parsedBody = parsedOutput.body;
1395
- const $metadata = deserializeMetadata(output);
1396
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1397
- response = new AmpServiceException_1.AmpServiceException({
1398
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1399
- $fault: "client",
1400
- $metadata,
1380
+ (0, smithy_client_1.throwDefaultError)({
1381
+ output,
1382
+ parsedBody,
1383
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
1384
+ errorCode,
1385
+ });
1386
+ }
1387
+ };
1388
+ const deserializeAws_restJson1UpdateLoggingConfigurationCommand = async (output, context) => {
1389
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
1390
+ return deserializeAws_restJson1UpdateLoggingConfigurationCommandError(output, context);
1391
+ }
1392
+ const contents = map({
1393
+ $metadata: deserializeMetadata(output),
1394
+ });
1395
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1396
+ if (data.status != null) {
1397
+ contents.status = deserializeAws_restJson1LoggingConfigurationStatus(data.status, context);
1398
+ }
1399
+ return contents;
1400
+ };
1401
+ exports.deserializeAws_restJson1UpdateLoggingConfigurationCommand = deserializeAws_restJson1UpdateLoggingConfigurationCommand;
1402
+ const deserializeAws_restJson1UpdateLoggingConfigurationCommandError = async (output, context) => {
1403
+ const parsedOutput = {
1404
+ ...output,
1405
+ body: await parseBody(output.body, context),
1406
+ };
1407
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1408
+ switch (errorCode) {
1409
+ case "AccessDeniedException":
1410
+ case "com.amazonaws.amp#AccessDeniedException":
1411
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1412
+ case "ConflictException":
1413
+ case "com.amazonaws.amp#ConflictException":
1414
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
1415
+ case "InternalServerException":
1416
+ case "com.amazonaws.amp#InternalServerException":
1417
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1418
+ case "ResourceNotFoundException":
1419
+ case "com.amazonaws.amp#ResourceNotFoundException":
1420
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1421
+ case "ValidationException":
1422
+ case "com.amazonaws.amp#ValidationException":
1423
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1424
+ default:
1425
+ const parsedBody = parsedOutput.body;
1426
+ (0, smithy_client_1.throwDefaultError)({
1427
+ output,
1428
+ parsedBody,
1429
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
1430
+ errorCode,
1401
1431
  });
1402
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1403
1432
  }
1404
1433
  };
1405
1434
  const deserializeAws_restJson1UpdateWorkspaceAliasCommand = async (output, context) => {
1406
1435
  if (output.statusCode !== 204 && output.statusCode >= 300) {
1407
1436
  return deserializeAws_restJson1UpdateWorkspaceAliasCommandError(output, context);
1408
1437
  }
1409
- const contents = {
1438
+ const contents = map({
1410
1439
  $metadata: deserializeMetadata(output),
1411
- };
1440
+ });
1412
1441
  await collectBody(output.body, context);
1413
- return Promise.resolve(contents);
1442
+ return contents;
1414
1443
  };
1415
1444
  exports.deserializeAws_restJson1UpdateWorkspaceAliasCommand = deserializeAws_restJson1UpdateWorkspaceAliasCommand;
1416
1445
  const deserializeAws_restJson1UpdateWorkspaceAliasCommandError = async (output, context) => {
@@ -1418,7 +1447,6 @@ const deserializeAws_restJson1UpdateWorkspaceAliasCommandError = async (output,
1418
1447
  ...output,
1419
1448
  body: await parseBody(output.body, context),
1420
1449
  };
1421
- let response;
1422
1450
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1423
1451
  switch (errorCode) {
1424
1452
  case "AccessDeniedException":
@@ -1444,20 +1472,19 @@ const deserializeAws_restJson1UpdateWorkspaceAliasCommandError = async (output,
1444
1472
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1445
1473
  default:
1446
1474
  const parsedBody = parsedOutput.body;
1447
- const $metadata = deserializeMetadata(output);
1448
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1449
- response = new AmpServiceException_1.AmpServiceException({
1450
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1451
- $fault: "client",
1452
- $metadata,
1475
+ (0, smithy_client_1.throwDefaultError)({
1476
+ output,
1477
+ parsedBody,
1478
+ exceptionCtor: AmpServiceException_1.AmpServiceException,
1479
+ errorCode,
1453
1480
  });
1454
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1455
1481
  }
1456
1482
  };
1483
+ const map = smithy_client_1.map;
1457
1484
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
1458
- const contents = {};
1485
+ const contents = map({});
1459
1486
  const data = parsedOutput.body;
1460
- if (data.message !== undefined && data.message !== null) {
1487
+ if (data.message != null) {
1461
1488
  contents.message = (0, smithy_client_1.expectString)(data.message);
1462
1489
  }
1463
1490
  const exception = new models_0_1.AccessDeniedException({
@@ -1467,15 +1494,15 @@ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutpu
1467
1494
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1468
1495
  };
1469
1496
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1470
- const contents = {};
1497
+ const contents = map({});
1471
1498
  const data = parsedOutput.body;
1472
- if (data.message !== undefined && data.message !== null) {
1499
+ if (data.message != null) {
1473
1500
  contents.message = (0, smithy_client_1.expectString)(data.message);
1474
1501
  }
1475
- if (data.resourceId !== undefined && data.resourceId !== null) {
1502
+ if (data.resourceId != null) {
1476
1503
  contents.resourceId = (0, smithy_client_1.expectString)(data.resourceId);
1477
1504
  }
1478
- if (data.resourceType !== undefined && data.resourceType !== null) {
1505
+ if (data.resourceType != null) {
1479
1506
  contents.resourceType = (0, smithy_client_1.expectString)(data.resourceType);
1480
1507
  }
1481
1508
  const exception = new models_0_1.ConflictException({
@@ -1485,12 +1512,14 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
1485
1512
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1486
1513
  };
1487
1514
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
1488
- const contents = {};
1489
- if (parsedOutput.headers["retry-after"] !== undefined) {
1490
- contents.retryAfterSeconds = (0, smithy_client_1.strictParseInt32)(parsedOutput.headers["retry-after"]);
1491
- }
1515
+ const contents = map({
1516
+ retryAfterSeconds: [
1517
+ () => void 0 !== parsedOutput.headers["retry-after"],
1518
+ () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers["retry-after"]),
1519
+ ],
1520
+ });
1492
1521
  const data = parsedOutput.body;
1493
- if (data.message !== undefined && data.message !== null) {
1522
+ if (data.message != null) {
1494
1523
  contents.message = (0, smithy_client_1.expectString)(data.message);
1495
1524
  }
1496
1525
  const exception = new models_0_1.InternalServerException({
@@ -1500,15 +1529,15 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
1500
1529
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1501
1530
  };
1502
1531
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1503
- const contents = {};
1532
+ const contents = map({});
1504
1533
  const data = parsedOutput.body;
1505
- if (data.message !== undefined && data.message !== null) {
1534
+ if (data.message != null) {
1506
1535
  contents.message = (0, smithy_client_1.expectString)(data.message);
1507
1536
  }
1508
- if (data.resourceId !== undefined && data.resourceId !== null) {
1537
+ if (data.resourceId != null) {
1509
1538
  contents.resourceId = (0, smithy_client_1.expectString)(data.resourceId);
1510
1539
  }
1511
- if (data.resourceType !== undefined && data.resourceType !== null) {
1540
+ if (data.resourceType != null) {
1512
1541
  contents.resourceType = (0, smithy_client_1.expectString)(data.resourceType);
1513
1542
  }
1514
1543
  const exception = new models_0_1.ResourceNotFoundException({
@@ -1518,21 +1547,21 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
1518
1547
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1519
1548
  };
1520
1549
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
1521
- const contents = {};
1550
+ const contents = map({});
1522
1551
  const data = parsedOutput.body;
1523
- if (data.message !== undefined && data.message !== null) {
1552
+ if (data.message != null) {
1524
1553
  contents.message = (0, smithy_client_1.expectString)(data.message);
1525
1554
  }
1526
- if (data.quotaCode !== undefined && data.quotaCode !== null) {
1555
+ if (data.quotaCode != null) {
1527
1556
  contents.quotaCode = (0, smithy_client_1.expectString)(data.quotaCode);
1528
1557
  }
1529
- if (data.resourceId !== undefined && data.resourceId !== null) {
1558
+ if (data.resourceId != null) {
1530
1559
  contents.resourceId = (0, smithy_client_1.expectString)(data.resourceId);
1531
1560
  }
1532
- if (data.resourceType !== undefined && data.resourceType !== null) {
1561
+ if (data.resourceType != null) {
1533
1562
  contents.resourceType = (0, smithy_client_1.expectString)(data.resourceType);
1534
1563
  }
1535
- if (data.serviceCode !== undefined && data.serviceCode !== null) {
1564
+ if (data.serviceCode != null) {
1536
1565
  contents.serviceCode = (0, smithy_client_1.expectString)(data.serviceCode);
1537
1566
  }
1538
1567
  const exception = new models_0_1.ServiceQuotaExceededException({
@@ -1542,18 +1571,20 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (par
1542
1571
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1543
1572
  };
1544
1573
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
1545
- const contents = {};
1546
- if (parsedOutput.headers["retry-after"] !== undefined) {
1547
- contents.retryAfterSeconds = (0, smithy_client_1.strictParseInt32)(parsedOutput.headers["retry-after"]);
1548
- }
1574
+ const contents = map({
1575
+ retryAfterSeconds: [
1576
+ () => void 0 !== parsedOutput.headers["retry-after"],
1577
+ () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers["retry-after"]),
1578
+ ],
1579
+ });
1549
1580
  const data = parsedOutput.body;
1550
- if (data.message !== undefined && data.message !== null) {
1581
+ if (data.message != null) {
1551
1582
  contents.message = (0, smithy_client_1.expectString)(data.message);
1552
1583
  }
1553
- if (data.quotaCode !== undefined && data.quotaCode !== null) {
1584
+ if (data.quotaCode != null) {
1554
1585
  contents.quotaCode = (0, smithy_client_1.expectString)(data.quotaCode);
1555
1586
  }
1556
- if (data.serviceCode !== undefined && data.serviceCode !== null) {
1587
+ if (data.serviceCode != null) {
1557
1588
  contents.serviceCode = (0, smithy_client_1.expectString)(data.serviceCode);
1558
1589
  }
1559
1590
  const exception = new models_0_1.ThrottlingException({
@@ -1563,15 +1594,15 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput,
1563
1594
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1564
1595
  };
1565
1596
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1566
- const contents = {};
1597
+ const contents = map({});
1567
1598
  const data = parsedOutput.body;
1568
- if (data.fieldList !== undefined && data.fieldList !== null) {
1599
+ if (data.fieldList != null) {
1569
1600
  contents.fieldList = deserializeAws_restJson1ValidationExceptionFieldList(data.fieldList, context);
1570
1601
  }
1571
- if (data.message !== undefined && data.message !== null) {
1602
+ if (data.message != null) {
1572
1603
  contents.message = (0, smithy_client_1.expectString)(data.message);
1573
1604
  }
1574
- if (data.reason !== undefined && data.reason !== null) {
1605
+ if (data.reason != null) {
1575
1606
  contents.reason = (0, smithy_client_1.expectString)(data.reason);
1576
1607
  }
1577
1608
  const exception = new models_0_1.ValidationException({
@@ -1605,6 +1636,21 @@ const deserializeAws_restJson1AlertManagerDefinitionStatus = (output, context) =
1605
1636
  statusReason: (0, smithy_client_1.expectString)(output.statusReason),
1606
1637
  };
1607
1638
  };
1639
+ const deserializeAws_restJson1LoggingConfigurationMetadata = (output, context) => {
1640
+ return {
1641
+ createdAt: output.createdAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.createdAt))) : undefined,
1642
+ logGroupArn: (0, smithy_client_1.expectString)(output.logGroupArn),
1643
+ modifiedAt: output.modifiedAt != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.modifiedAt))) : undefined,
1644
+ status: output.status != null ? deserializeAws_restJson1LoggingConfigurationStatus(output.status, context) : undefined,
1645
+ workspace: (0, smithy_client_1.expectString)(output.workspace),
1646
+ };
1647
+ };
1648
+ const deserializeAws_restJson1LoggingConfigurationStatus = (output, context) => {
1649
+ return {
1650
+ statusCode: (0, smithy_client_1.expectString)(output.statusCode),
1651
+ statusReason: (0, smithy_client_1.expectString)(output.statusReason),
1652
+ };
1653
+ };
1608
1654
  const deserializeAws_restJson1RuleGroupsNamespaceDescription = (output, context) => {
1609
1655
  return {
1610
1656
  arn: (0, smithy_client_1.expectString)(output.arn),