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