@aws-sdk/client-amp 3.183.0 → 3.186.0

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