@aws-sdk/client-grafana 3.489.0 → 3.495.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist-cjs/Grafana.js +1 -49
  2. package/dist-cjs/GrafanaClient.js +1 -43
  3. package/dist-cjs/commands/AssociateLicenseCommand.js +1 -29
  4. package/dist-cjs/commands/CreateWorkspaceApiKeyCommand.js +1 -29
  5. package/dist-cjs/commands/CreateWorkspaceCommand.js +1 -29
  6. package/dist-cjs/commands/DeleteWorkspaceApiKeyCommand.js +1 -28
  7. package/dist-cjs/commands/DeleteWorkspaceCommand.js +1 -29
  8. package/dist-cjs/commands/DescribeWorkspaceAuthenticationCommand.js +1 -29
  9. package/dist-cjs/commands/DescribeWorkspaceCommand.js +1 -29
  10. package/dist-cjs/commands/DescribeWorkspaceConfigurationCommand.js +1 -28
  11. package/dist-cjs/commands/DisassociateLicenseCommand.js +1 -29
  12. package/dist-cjs/commands/ListPermissionsCommand.js +1 -28
  13. package/dist-cjs/commands/ListTagsForResourceCommand.js +1 -28
  14. package/dist-cjs/commands/ListVersionsCommand.js +1 -28
  15. package/dist-cjs/commands/ListWorkspacesCommand.js +1 -29
  16. package/dist-cjs/commands/TagResourceCommand.js +1 -28
  17. package/dist-cjs/commands/UntagResourceCommand.js +1 -28
  18. package/dist-cjs/commands/UpdatePermissionsCommand.js +1 -28
  19. package/dist-cjs/commands/UpdateWorkspaceAuthenticationCommand.js +1 -29
  20. package/dist-cjs/commands/UpdateWorkspaceCommand.js +1 -29
  21. package/dist-cjs/commands/UpdateWorkspaceConfigurationCommand.js +1 -28
  22. package/dist-cjs/commands/index.js +1 -22
  23. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  24. package/dist-cjs/extensionConfiguration.js +1 -2
  25. package/dist-cjs/index.js +2415 -11
  26. package/dist-cjs/models/GrafanaServiceException.js +1 -12
  27. package/dist-cjs/models/index.js +1 -4
  28. package/dist-cjs/models/models_0.js +1 -300
  29. package/dist-cjs/pagination/Interfaces.js +1 -2
  30. package/dist-cjs/pagination/ListPermissionsPaginator.js +1 -7
  31. package/dist-cjs/pagination/ListVersionsPaginator.js +1 -7
  32. package/dist-cjs/pagination/ListWorkspacesPaginator.js +1 -7
  33. package/dist-cjs/pagination/index.js +1 -7
  34. package/dist-cjs/protocols/Aws_restJson1.js +1 -1393
  35. package/dist-cjs/runtimeExtensions.js +1 -22
  36. package/package.json +40 -40
@@ -1,1393 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UpdateWorkspaceConfigurationCommand = exports.de_UpdateWorkspaceAuthenticationCommand = exports.de_UpdateWorkspaceCommand = exports.de_UpdatePermissionsCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_ListWorkspacesCommand = exports.de_ListVersionsCommand = exports.de_ListTagsForResourceCommand = exports.de_ListPermissionsCommand = exports.de_DisassociateLicenseCommand = exports.de_DescribeWorkspaceConfigurationCommand = exports.de_DescribeWorkspaceAuthenticationCommand = exports.de_DescribeWorkspaceCommand = exports.de_DeleteWorkspaceApiKeyCommand = exports.de_DeleteWorkspaceCommand = exports.de_CreateWorkspaceApiKeyCommand = exports.de_CreateWorkspaceCommand = exports.de_AssociateLicenseCommand = exports.se_UpdateWorkspaceConfigurationCommand = exports.se_UpdateWorkspaceAuthenticationCommand = exports.se_UpdateWorkspaceCommand = exports.se_UpdatePermissionsCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_ListWorkspacesCommand = exports.se_ListVersionsCommand = exports.se_ListTagsForResourceCommand = exports.se_ListPermissionsCommand = exports.se_DisassociateLicenseCommand = exports.se_DescribeWorkspaceConfigurationCommand = exports.se_DescribeWorkspaceAuthenticationCommand = exports.se_DescribeWorkspaceCommand = exports.se_DeleteWorkspaceApiKeyCommand = exports.se_DeleteWorkspaceCommand = exports.se_CreateWorkspaceApiKeyCommand = exports.se_CreateWorkspaceCommand = exports.se_AssociateLicenseCommand = void 0;
4
- const core_1 = require("@smithy/core");
5
- const smithy_client_1 = require("@smithy/smithy-client");
6
- const uuid_1 = require("uuid");
7
- const GrafanaServiceException_1 = require("../models/GrafanaServiceException");
8
- const models_0_1 = require("../models/models_0");
9
- const se_AssociateLicenseCommand = async (input, context) => {
10
- const b = (0, core_1.requestBuilder)(input, context);
11
- const headers = {};
12
- b.bp("/workspaces/{workspaceId}/licenses/{licenseType}");
13
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
14
- b.p("licenseType", () => input.licenseType, "{licenseType}", false);
15
- let body;
16
- b.m("POST").h(headers).b(body);
17
- return b.build();
18
- };
19
- exports.se_AssociateLicenseCommand = se_AssociateLicenseCommand;
20
- const se_CreateWorkspaceCommand = async (input, context) => {
21
- const b = (0, core_1.requestBuilder)(input, context);
22
- const headers = {
23
- "content-type": "application/json",
24
- };
25
- b.bp("/workspaces");
26
- let body;
27
- body = JSON.stringify((0, smithy_client_1.take)(input, {
28
- accountAccessType: [],
29
- authenticationProviders: (_) => (0, smithy_client_1._json)(_),
30
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
31
- configuration: (_) => smithy_client_1.LazyJsonString.fromObject(_),
32
- grafanaVersion: [],
33
- networkAccessControl: (_) => (0, smithy_client_1._json)(_),
34
- organizationRoleName: [],
35
- permissionType: [],
36
- stackSetName: [],
37
- tags: (_) => (0, smithy_client_1._json)(_),
38
- vpcConfiguration: (_) => (0, smithy_client_1._json)(_),
39
- workspaceDataSources: (_) => (0, smithy_client_1._json)(_),
40
- workspaceDescription: [],
41
- workspaceName: [],
42
- workspaceNotificationDestinations: (_) => (0, smithy_client_1._json)(_),
43
- workspaceOrganizationalUnits: (_) => (0, smithy_client_1._json)(_),
44
- workspaceRoleArn: [],
45
- }));
46
- b.m("POST").h(headers).b(body);
47
- return b.build();
48
- };
49
- exports.se_CreateWorkspaceCommand = se_CreateWorkspaceCommand;
50
- const se_CreateWorkspaceApiKeyCommand = async (input, context) => {
51
- const b = (0, core_1.requestBuilder)(input, context);
52
- const headers = {
53
- "content-type": "application/json",
54
- };
55
- b.bp("/workspaces/{workspaceId}/apikeys");
56
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
57
- let body;
58
- body = JSON.stringify((0, smithy_client_1.take)(input, {
59
- keyName: [],
60
- keyRole: [],
61
- secondsToLive: [],
62
- }));
63
- b.m("POST").h(headers).b(body);
64
- return b.build();
65
- };
66
- exports.se_CreateWorkspaceApiKeyCommand = se_CreateWorkspaceApiKeyCommand;
67
- const se_DeleteWorkspaceCommand = async (input, context) => {
68
- const b = (0, core_1.requestBuilder)(input, context);
69
- const headers = {};
70
- b.bp("/workspaces/{workspaceId}");
71
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
72
- let body;
73
- b.m("DELETE").h(headers).b(body);
74
- return b.build();
75
- };
76
- exports.se_DeleteWorkspaceCommand = se_DeleteWorkspaceCommand;
77
- const se_DeleteWorkspaceApiKeyCommand = async (input, context) => {
78
- const b = (0, core_1.requestBuilder)(input, context);
79
- const headers = {};
80
- b.bp("/workspaces/{workspaceId}/apikeys/{keyName}");
81
- b.p("keyName", () => input.keyName, "{keyName}", false);
82
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
83
- let body;
84
- b.m("DELETE").h(headers).b(body);
85
- return b.build();
86
- };
87
- exports.se_DeleteWorkspaceApiKeyCommand = se_DeleteWorkspaceApiKeyCommand;
88
- const se_DescribeWorkspaceCommand = async (input, context) => {
89
- const b = (0, core_1.requestBuilder)(input, context);
90
- const headers = {};
91
- b.bp("/workspaces/{workspaceId}");
92
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
93
- let body;
94
- b.m("GET").h(headers).b(body);
95
- return b.build();
96
- };
97
- exports.se_DescribeWorkspaceCommand = se_DescribeWorkspaceCommand;
98
- const se_DescribeWorkspaceAuthenticationCommand = async (input, context) => {
99
- const b = (0, core_1.requestBuilder)(input, context);
100
- const headers = {};
101
- b.bp("/workspaces/{workspaceId}/authentication");
102
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
103
- let body;
104
- b.m("GET").h(headers).b(body);
105
- return b.build();
106
- };
107
- exports.se_DescribeWorkspaceAuthenticationCommand = se_DescribeWorkspaceAuthenticationCommand;
108
- const se_DescribeWorkspaceConfigurationCommand = async (input, context) => {
109
- const b = (0, core_1.requestBuilder)(input, context);
110
- const headers = {};
111
- b.bp("/workspaces/{workspaceId}/configuration");
112
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
113
- let body;
114
- b.m("GET").h(headers).b(body);
115
- return b.build();
116
- };
117
- exports.se_DescribeWorkspaceConfigurationCommand = se_DescribeWorkspaceConfigurationCommand;
118
- const se_DisassociateLicenseCommand = async (input, context) => {
119
- const b = (0, core_1.requestBuilder)(input, context);
120
- const headers = {};
121
- b.bp("/workspaces/{workspaceId}/licenses/{licenseType}");
122
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
123
- b.p("licenseType", () => input.licenseType, "{licenseType}", false);
124
- let body;
125
- b.m("DELETE").h(headers).b(body);
126
- return b.build();
127
- };
128
- exports.se_DisassociateLicenseCommand = se_DisassociateLicenseCommand;
129
- const se_ListPermissionsCommand = async (input, context) => {
130
- const b = (0, core_1.requestBuilder)(input, context);
131
- const headers = {};
132
- b.bp("/workspaces/{workspaceId}/permissions");
133
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
134
- const query = (0, smithy_client_1.map)({
135
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
136
- [_nT]: [, input[_nT]],
137
- [_uT]: [, input[_uT]],
138
- [_uI]: [, input[_uI]],
139
- [_gI]: [, input[_gI]],
140
- });
141
- let body;
142
- b.m("GET").h(headers).q(query).b(body);
143
- return b.build();
144
- };
145
- exports.se_ListPermissionsCommand = se_ListPermissionsCommand;
146
- const se_ListTagsForResourceCommand = async (input, context) => {
147
- const b = (0, core_1.requestBuilder)(input, context);
148
- const headers = {};
149
- b.bp("/tags/{resourceArn}");
150
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
151
- let body;
152
- b.m("GET").h(headers).b(body);
153
- return b.build();
154
- };
155
- exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
156
- const se_ListVersionsCommand = async (input, context) => {
157
- const b = (0, core_1.requestBuilder)(input, context);
158
- const headers = {};
159
- b.bp("/versions");
160
- const query = (0, smithy_client_1.map)({
161
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
162
- [_nT]: [, input[_nT]],
163
- [_wi]: [, input[_wI]],
164
- });
165
- let body;
166
- b.m("GET").h(headers).q(query).b(body);
167
- return b.build();
168
- };
169
- exports.se_ListVersionsCommand = se_ListVersionsCommand;
170
- const se_ListWorkspacesCommand = async (input, context) => {
171
- const b = (0, core_1.requestBuilder)(input, context);
172
- const headers = {};
173
- b.bp("/workspaces");
174
- const query = (0, smithy_client_1.map)({
175
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
176
- [_nT]: [, input[_nT]],
177
- });
178
- let body;
179
- b.m("GET").h(headers).q(query).b(body);
180
- return b.build();
181
- };
182
- exports.se_ListWorkspacesCommand = se_ListWorkspacesCommand;
183
- const se_TagResourceCommand = async (input, context) => {
184
- const b = (0, core_1.requestBuilder)(input, context);
185
- const headers = {
186
- "content-type": "application/json",
187
- };
188
- b.bp("/tags/{resourceArn}");
189
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
190
- let body;
191
- body = JSON.stringify((0, smithy_client_1.take)(input, {
192
- tags: (_) => (0, smithy_client_1._json)(_),
193
- }));
194
- b.m("POST").h(headers).b(body);
195
- return b.build();
196
- };
197
- exports.se_TagResourceCommand = se_TagResourceCommand;
198
- const se_UntagResourceCommand = async (input, context) => {
199
- const b = (0, core_1.requestBuilder)(input, context);
200
- const headers = {};
201
- b.bp("/tags/{resourceArn}");
202
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
203
- const query = (0, smithy_client_1.map)({
204
- [_tK]: [
205
- (0, smithy_client_1.expectNonNull)(input.tagKeys, `tagKeys`) != null,
206
- () => (input[_tK] || []).map((_entry) => _entry),
207
- ],
208
- });
209
- let body;
210
- b.m("DELETE").h(headers).q(query).b(body);
211
- return b.build();
212
- };
213
- exports.se_UntagResourceCommand = se_UntagResourceCommand;
214
- const se_UpdatePermissionsCommand = async (input, context) => {
215
- const b = (0, core_1.requestBuilder)(input, context);
216
- const headers = {
217
- "content-type": "application/json",
218
- };
219
- b.bp("/workspaces/{workspaceId}/permissions");
220
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
221
- let body;
222
- body = JSON.stringify((0, smithy_client_1.take)(input, {
223
- updateInstructionBatch: (_) => (0, smithy_client_1._json)(_),
224
- }));
225
- b.m("PATCH").h(headers).b(body);
226
- return b.build();
227
- };
228
- exports.se_UpdatePermissionsCommand = se_UpdatePermissionsCommand;
229
- const se_UpdateWorkspaceCommand = async (input, context) => {
230
- const b = (0, core_1.requestBuilder)(input, context);
231
- const headers = {
232
- "content-type": "application/json",
233
- };
234
- b.bp("/workspaces/{workspaceId}");
235
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
236
- let body;
237
- body = JSON.stringify((0, smithy_client_1.take)(input, {
238
- accountAccessType: [],
239
- networkAccessControl: (_) => (0, smithy_client_1._json)(_),
240
- organizationRoleName: [],
241
- permissionType: [],
242
- removeNetworkAccessConfiguration: [],
243
- removeVpcConfiguration: [],
244
- stackSetName: [],
245
- vpcConfiguration: (_) => (0, smithy_client_1._json)(_),
246
- workspaceDataSources: (_) => (0, smithy_client_1._json)(_),
247
- workspaceDescription: [],
248
- workspaceName: [],
249
- workspaceNotificationDestinations: (_) => (0, smithy_client_1._json)(_),
250
- workspaceOrganizationalUnits: (_) => (0, smithy_client_1._json)(_),
251
- workspaceRoleArn: [],
252
- }));
253
- b.m("PUT").h(headers).b(body);
254
- return b.build();
255
- };
256
- exports.se_UpdateWorkspaceCommand = se_UpdateWorkspaceCommand;
257
- const se_UpdateWorkspaceAuthenticationCommand = async (input, context) => {
258
- const b = (0, core_1.requestBuilder)(input, context);
259
- const headers = {
260
- "content-type": "application/json",
261
- };
262
- b.bp("/workspaces/{workspaceId}/authentication");
263
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
264
- let body;
265
- body = JSON.stringify((0, smithy_client_1.take)(input, {
266
- authenticationProviders: (_) => (0, smithy_client_1._json)(_),
267
- samlConfiguration: (_) => (0, smithy_client_1._json)(_),
268
- }));
269
- b.m("POST").h(headers).b(body);
270
- return b.build();
271
- };
272
- exports.se_UpdateWorkspaceAuthenticationCommand = se_UpdateWorkspaceAuthenticationCommand;
273
- const se_UpdateWorkspaceConfigurationCommand = async (input, context) => {
274
- const b = (0, core_1.requestBuilder)(input, context);
275
- const headers = {
276
- "content-type": "application/json",
277
- };
278
- b.bp("/workspaces/{workspaceId}/configuration");
279
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
280
- let body;
281
- body = JSON.stringify((0, smithy_client_1.take)(input, {
282
- configuration: (_) => smithy_client_1.LazyJsonString.fromObject(_),
283
- grafanaVersion: [],
284
- }));
285
- b.m("PUT").h(headers).b(body);
286
- return b.build();
287
- };
288
- exports.se_UpdateWorkspaceConfigurationCommand = se_UpdateWorkspaceConfigurationCommand;
289
- const de_AssociateLicenseCommand = async (output, context) => {
290
- if (output.statusCode !== 202 && output.statusCode >= 300) {
291
- return de_AssociateLicenseCommandError(output, context);
292
- }
293
- const contents = (0, smithy_client_1.map)({
294
- $metadata: deserializeMetadata(output),
295
- });
296
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
297
- const doc = (0, smithy_client_1.take)(data, {
298
- workspace: (_) => de_WorkspaceDescription(_, context),
299
- });
300
- Object.assign(contents, doc);
301
- return contents;
302
- };
303
- exports.de_AssociateLicenseCommand = de_AssociateLicenseCommand;
304
- const de_AssociateLicenseCommandError = async (output, context) => {
305
- const parsedOutput = {
306
- ...output,
307
- body: await parseErrorBody(output.body, context),
308
- };
309
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
310
- switch (errorCode) {
311
- case "AccessDeniedException":
312
- case "com.amazonaws.grafana#AccessDeniedException":
313
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
314
- case "InternalServerException":
315
- case "com.amazonaws.grafana#InternalServerException":
316
- throw await de_InternalServerExceptionRes(parsedOutput, context);
317
- case "ResourceNotFoundException":
318
- case "com.amazonaws.grafana#ResourceNotFoundException":
319
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
320
- case "ThrottlingException":
321
- case "com.amazonaws.grafana#ThrottlingException":
322
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
323
- case "ValidationException":
324
- case "com.amazonaws.grafana#ValidationException":
325
- throw await de_ValidationExceptionRes(parsedOutput, context);
326
- default:
327
- const parsedBody = parsedOutput.body;
328
- return throwDefaultError({
329
- output,
330
- parsedBody,
331
- errorCode,
332
- });
333
- }
334
- };
335
- const de_CreateWorkspaceCommand = async (output, context) => {
336
- if (output.statusCode !== 202 && output.statusCode >= 300) {
337
- return de_CreateWorkspaceCommandError(output, context);
338
- }
339
- const contents = (0, smithy_client_1.map)({
340
- $metadata: deserializeMetadata(output),
341
- });
342
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
343
- const doc = (0, smithy_client_1.take)(data, {
344
- workspace: (_) => de_WorkspaceDescription(_, context),
345
- });
346
- Object.assign(contents, doc);
347
- return contents;
348
- };
349
- exports.de_CreateWorkspaceCommand = de_CreateWorkspaceCommand;
350
- const de_CreateWorkspaceCommandError = async (output, context) => {
351
- const parsedOutput = {
352
- ...output,
353
- body: await parseErrorBody(output.body, context),
354
- };
355
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
356
- switch (errorCode) {
357
- case "AccessDeniedException":
358
- case "com.amazonaws.grafana#AccessDeniedException":
359
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
360
- case "ConflictException":
361
- case "com.amazonaws.grafana#ConflictException":
362
- throw await de_ConflictExceptionRes(parsedOutput, context);
363
- case "InternalServerException":
364
- case "com.amazonaws.grafana#InternalServerException":
365
- throw await de_InternalServerExceptionRes(parsedOutput, context);
366
- case "ServiceQuotaExceededException":
367
- case "com.amazonaws.grafana#ServiceQuotaExceededException":
368
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
369
- case "ThrottlingException":
370
- case "com.amazonaws.grafana#ThrottlingException":
371
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
372
- case "ValidationException":
373
- case "com.amazonaws.grafana#ValidationException":
374
- throw await de_ValidationExceptionRes(parsedOutput, context);
375
- default:
376
- const parsedBody = parsedOutput.body;
377
- return throwDefaultError({
378
- output,
379
- parsedBody,
380
- errorCode,
381
- });
382
- }
383
- };
384
- const de_CreateWorkspaceApiKeyCommand = async (output, context) => {
385
- if (output.statusCode !== 200 && output.statusCode >= 300) {
386
- return de_CreateWorkspaceApiKeyCommandError(output, context);
387
- }
388
- const contents = (0, smithy_client_1.map)({
389
- $metadata: deserializeMetadata(output),
390
- });
391
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
392
- const doc = (0, smithy_client_1.take)(data, {
393
- key: smithy_client_1.expectString,
394
- keyName: smithy_client_1.expectString,
395
- workspaceId: smithy_client_1.expectString,
396
- });
397
- Object.assign(contents, doc);
398
- return contents;
399
- };
400
- exports.de_CreateWorkspaceApiKeyCommand = de_CreateWorkspaceApiKeyCommand;
401
- const de_CreateWorkspaceApiKeyCommandError = async (output, context) => {
402
- const parsedOutput = {
403
- ...output,
404
- body: await parseErrorBody(output.body, context),
405
- };
406
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
407
- switch (errorCode) {
408
- case "AccessDeniedException":
409
- case "com.amazonaws.grafana#AccessDeniedException":
410
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
411
- case "ConflictException":
412
- case "com.amazonaws.grafana#ConflictException":
413
- throw await de_ConflictExceptionRes(parsedOutput, context);
414
- case "InternalServerException":
415
- case "com.amazonaws.grafana#InternalServerException":
416
- throw await de_InternalServerExceptionRes(parsedOutput, context);
417
- case "ResourceNotFoundException":
418
- case "com.amazonaws.grafana#ResourceNotFoundException":
419
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
420
- case "ServiceQuotaExceededException":
421
- case "com.amazonaws.grafana#ServiceQuotaExceededException":
422
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
423
- case "ThrottlingException":
424
- case "com.amazonaws.grafana#ThrottlingException":
425
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
426
- case "ValidationException":
427
- case "com.amazonaws.grafana#ValidationException":
428
- throw await de_ValidationExceptionRes(parsedOutput, context);
429
- default:
430
- const parsedBody = parsedOutput.body;
431
- return throwDefaultError({
432
- output,
433
- parsedBody,
434
- errorCode,
435
- });
436
- }
437
- };
438
- const de_DeleteWorkspaceCommand = async (output, context) => {
439
- if (output.statusCode !== 202 && output.statusCode >= 300) {
440
- return de_DeleteWorkspaceCommandError(output, context);
441
- }
442
- const contents = (0, smithy_client_1.map)({
443
- $metadata: deserializeMetadata(output),
444
- });
445
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
446
- const doc = (0, smithy_client_1.take)(data, {
447
- workspace: (_) => de_WorkspaceDescription(_, context),
448
- });
449
- Object.assign(contents, doc);
450
- return contents;
451
- };
452
- exports.de_DeleteWorkspaceCommand = de_DeleteWorkspaceCommand;
453
- const de_DeleteWorkspaceCommandError = async (output, context) => {
454
- const parsedOutput = {
455
- ...output,
456
- body: await parseErrorBody(output.body, context),
457
- };
458
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
459
- switch (errorCode) {
460
- case "AccessDeniedException":
461
- case "com.amazonaws.grafana#AccessDeniedException":
462
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
463
- case "ConflictException":
464
- case "com.amazonaws.grafana#ConflictException":
465
- throw await de_ConflictExceptionRes(parsedOutput, context);
466
- case "InternalServerException":
467
- case "com.amazonaws.grafana#InternalServerException":
468
- throw await de_InternalServerExceptionRes(parsedOutput, context);
469
- case "ResourceNotFoundException":
470
- case "com.amazonaws.grafana#ResourceNotFoundException":
471
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
472
- case "ThrottlingException":
473
- case "com.amazonaws.grafana#ThrottlingException":
474
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
475
- case "ValidationException":
476
- case "com.amazonaws.grafana#ValidationException":
477
- throw await de_ValidationExceptionRes(parsedOutput, context);
478
- default:
479
- const parsedBody = parsedOutput.body;
480
- return throwDefaultError({
481
- output,
482
- parsedBody,
483
- errorCode,
484
- });
485
- }
486
- };
487
- const de_DeleteWorkspaceApiKeyCommand = async (output, context) => {
488
- if (output.statusCode !== 200 && output.statusCode >= 300) {
489
- return de_DeleteWorkspaceApiKeyCommandError(output, context);
490
- }
491
- const contents = (0, smithy_client_1.map)({
492
- $metadata: deserializeMetadata(output),
493
- });
494
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
495
- const doc = (0, smithy_client_1.take)(data, {
496
- keyName: smithy_client_1.expectString,
497
- workspaceId: smithy_client_1.expectString,
498
- });
499
- Object.assign(contents, doc);
500
- return contents;
501
- };
502
- exports.de_DeleteWorkspaceApiKeyCommand = de_DeleteWorkspaceApiKeyCommand;
503
- const de_DeleteWorkspaceApiKeyCommandError = async (output, context) => {
504
- const parsedOutput = {
505
- ...output,
506
- body: await parseErrorBody(output.body, context),
507
- };
508
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
509
- switch (errorCode) {
510
- case "AccessDeniedException":
511
- case "com.amazonaws.grafana#AccessDeniedException":
512
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
513
- case "ConflictException":
514
- case "com.amazonaws.grafana#ConflictException":
515
- throw await de_ConflictExceptionRes(parsedOutput, context);
516
- case "InternalServerException":
517
- case "com.amazonaws.grafana#InternalServerException":
518
- throw await de_InternalServerExceptionRes(parsedOutput, context);
519
- case "ResourceNotFoundException":
520
- case "com.amazonaws.grafana#ResourceNotFoundException":
521
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
522
- case "ThrottlingException":
523
- case "com.amazonaws.grafana#ThrottlingException":
524
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
525
- case "ValidationException":
526
- case "com.amazonaws.grafana#ValidationException":
527
- throw await de_ValidationExceptionRes(parsedOutput, context);
528
- default:
529
- const parsedBody = parsedOutput.body;
530
- return throwDefaultError({
531
- output,
532
- parsedBody,
533
- errorCode,
534
- });
535
- }
536
- };
537
- const de_DescribeWorkspaceCommand = async (output, context) => {
538
- if (output.statusCode !== 200 && output.statusCode >= 300) {
539
- return de_DescribeWorkspaceCommandError(output, context);
540
- }
541
- const contents = (0, smithy_client_1.map)({
542
- $metadata: deserializeMetadata(output),
543
- });
544
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
545
- const doc = (0, smithy_client_1.take)(data, {
546
- workspace: (_) => de_WorkspaceDescription(_, context),
547
- });
548
- Object.assign(contents, doc);
549
- return contents;
550
- };
551
- exports.de_DescribeWorkspaceCommand = de_DescribeWorkspaceCommand;
552
- const de_DescribeWorkspaceCommandError = async (output, context) => {
553
- const parsedOutput = {
554
- ...output,
555
- body: await parseErrorBody(output.body, context),
556
- };
557
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
558
- switch (errorCode) {
559
- case "AccessDeniedException":
560
- case "com.amazonaws.grafana#AccessDeniedException":
561
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
562
- case "InternalServerException":
563
- case "com.amazonaws.grafana#InternalServerException":
564
- throw await de_InternalServerExceptionRes(parsedOutput, context);
565
- case "ResourceNotFoundException":
566
- case "com.amazonaws.grafana#ResourceNotFoundException":
567
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
568
- case "ThrottlingException":
569
- case "com.amazonaws.grafana#ThrottlingException":
570
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
571
- case "ValidationException":
572
- case "com.amazonaws.grafana#ValidationException":
573
- throw await de_ValidationExceptionRes(parsedOutput, context);
574
- default:
575
- const parsedBody = parsedOutput.body;
576
- return throwDefaultError({
577
- output,
578
- parsedBody,
579
- errorCode,
580
- });
581
- }
582
- };
583
- const de_DescribeWorkspaceAuthenticationCommand = async (output, context) => {
584
- if (output.statusCode !== 200 && output.statusCode >= 300) {
585
- return de_DescribeWorkspaceAuthenticationCommandError(output, context);
586
- }
587
- const contents = (0, smithy_client_1.map)({
588
- $metadata: deserializeMetadata(output),
589
- });
590
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
591
- const doc = (0, smithy_client_1.take)(data, {
592
- authentication: smithy_client_1._json,
593
- });
594
- Object.assign(contents, doc);
595
- return contents;
596
- };
597
- exports.de_DescribeWorkspaceAuthenticationCommand = de_DescribeWorkspaceAuthenticationCommand;
598
- const de_DescribeWorkspaceAuthenticationCommandError = async (output, context) => {
599
- const parsedOutput = {
600
- ...output,
601
- body: await parseErrorBody(output.body, context),
602
- };
603
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
604
- switch (errorCode) {
605
- case "AccessDeniedException":
606
- case "com.amazonaws.grafana#AccessDeniedException":
607
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
608
- case "InternalServerException":
609
- case "com.amazonaws.grafana#InternalServerException":
610
- throw await de_InternalServerExceptionRes(parsedOutput, context);
611
- case "ResourceNotFoundException":
612
- case "com.amazonaws.grafana#ResourceNotFoundException":
613
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
614
- case "ThrottlingException":
615
- case "com.amazonaws.grafana#ThrottlingException":
616
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
617
- case "ValidationException":
618
- case "com.amazonaws.grafana#ValidationException":
619
- throw await de_ValidationExceptionRes(parsedOutput, context);
620
- default:
621
- const parsedBody = parsedOutput.body;
622
- return throwDefaultError({
623
- output,
624
- parsedBody,
625
- errorCode,
626
- });
627
- }
628
- };
629
- const de_DescribeWorkspaceConfigurationCommand = async (output, context) => {
630
- if (output.statusCode !== 200 && output.statusCode >= 300) {
631
- return de_DescribeWorkspaceConfigurationCommandError(output, context);
632
- }
633
- const contents = (0, smithy_client_1.map)({
634
- $metadata: deserializeMetadata(output),
635
- });
636
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
637
- const doc = (0, smithy_client_1.take)(data, {
638
- configuration: (_) => new smithy_client_1.LazyJsonString(_),
639
- grafanaVersion: smithy_client_1.expectString,
640
- });
641
- Object.assign(contents, doc);
642
- return contents;
643
- };
644
- exports.de_DescribeWorkspaceConfigurationCommand = de_DescribeWorkspaceConfigurationCommand;
645
- const de_DescribeWorkspaceConfigurationCommandError = async (output, context) => {
646
- const parsedOutput = {
647
- ...output,
648
- body: await parseErrorBody(output.body, context),
649
- };
650
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
651
- switch (errorCode) {
652
- case "AccessDeniedException":
653
- case "com.amazonaws.grafana#AccessDeniedException":
654
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
655
- case "InternalServerException":
656
- case "com.amazonaws.grafana#InternalServerException":
657
- throw await de_InternalServerExceptionRes(parsedOutput, context);
658
- case "ResourceNotFoundException":
659
- case "com.amazonaws.grafana#ResourceNotFoundException":
660
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
661
- case "ThrottlingException":
662
- case "com.amazonaws.grafana#ThrottlingException":
663
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
664
- default:
665
- const parsedBody = parsedOutput.body;
666
- return throwDefaultError({
667
- output,
668
- parsedBody,
669
- errorCode,
670
- });
671
- }
672
- };
673
- const de_DisassociateLicenseCommand = async (output, context) => {
674
- if (output.statusCode !== 202 && output.statusCode >= 300) {
675
- return de_DisassociateLicenseCommandError(output, context);
676
- }
677
- const contents = (0, smithy_client_1.map)({
678
- $metadata: deserializeMetadata(output),
679
- });
680
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
681
- const doc = (0, smithy_client_1.take)(data, {
682
- workspace: (_) => de_WorkspaceDescription(_, context),
683
- });
684
- Object.assign(contents, doc);
685
- return contents;
686
- };
687
- exports.de_DisassociateLicenseCommand = de_DisassociateLicenseCommand;
688
- const de_DisassociateLicenseCommandError = async (output, context) => {
689
- const parsedOutput = {
690
- ...output,
691
- body: await parseErrorBody(output.body, context),
692
- };
693
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
694
- switch (errorCode) {
695
- case "AccessDeniedException":
696
- case "com.amazonaws.grafana#AccessDeniedException":
697
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
698
- case "InternalServerException":
699
- case "com.amazonaws.grafana#InternalServerException":
700
- throw await de_InternalServerExceptionRes(parsedOutput, context);
701
- case "ResourceNotFoundException":
702
- case "com.amazonaws.grafana#ResourceNotFoundException":
703
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
704
- case "ThrottlingException":
705
- case "com.amazonaws.grafana#ThrottlingException":
706
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
707
- case "ValidationException":
708
- case "com.amazonaws.grafana#ValidationException":
709
- throw await de_ValidationExceptionRes(parsedOutput, context);
710
- default:
711
- const parsedBody = parsedOutput.body;
712
- return throwDefaultError({
713
- output,
714
- parsedBody,
715
- errorCode,
716
- });
717
- }
718
- };
719
- const de_ListPermissionsCommand = async (output, context) => {
720
- if (output.statusCode !== 200 && output.statusCode >= 300) {
721
- return de_ListPermissionsCommandError(output, context);
722
- }
723
- const contents = (0, smithy_client_1.map)({
724
- $metadata: deserializeMetadata(output),
725
- });
726
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
727
- const doc = (0, smithy_client_1.take)(data, {
728
- nextToken: smithy_client_1.expectString,
729
- permissions: smithy_client_1._json,
730
- });
731
- Object.assign(contents, doc);
732
- return contents;
733
- };
734
- exports.de_ListPermissionsCommand = de_ListPermissionsCommand;
735
- const de_ListPermissionsCommandError = async (output, context) => {
736
- const parsedOutput = {
737
- ...output,
738
- body: await parseErrorBody(output.body, context),
739
- };
740
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
741
- switch (errorCode) {
742
- case "AccessDeniedException":
743
- case "com.amazonaws.grafana#AccessDeniedException":
744
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
745
- case "InternalServerException":
746
- case "com.amazonaws.grafana#InternalServerException":
747
- throw await de_InternalServerExceptionRes(parsedOutput, context);
748
- case "ResourceNotFoundException":
749
- case "com.amazonaws.grafana#ResourceNotFoundException":
750
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
751
- case "ThrottlingException":
752
- case "com.amazonaws.grafana#ThrottlingException":
753
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
754
- case "ValidationException":
755
- case "com.amazonaws.grafana#ValidationException":
756
- throw await de_ValidationExceptionRes(parsedOutput, context);
757
- default:
758
- const parsedBody = parsedOutput.body;
759
- return throwDefaultError({
760
- output,
761
- parsedBody,
762
- errorCode,
763
- });
764
- }
765
- };
766
- const de_ListTagsForResourceCommand = async (output, context) => {
767
- if (output.statusCode !== 200 && output.statusCode >= 300) {
768
- return de_ListTagsForResourceCommandError(output, context);
769
- }
770
- const contents = (0, smithy_client_1.map)({
771
- $metadata: deserializeMetadata(output),
772
- });
773
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
774
- const doc = (0, smithy_client_1.take)(data, {
775
- tags: smithy_client_1._json,
776
- });
777
- Object.assign(contents, doc);
778
- return contents;
779
- };
780
- exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
781
- const de_ListTagsForResourceCommandError = async (output, context) => {
782
- const parsedOutput = {
783
- ...output,
784
- body: await parseErrorBody(output.body, context),
785
- };
786
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
787
- switch (errorCode) {
788
- case "AccessDeniedException":
789
- case "com.amazonaws.grafana#AccessDeniedException":
790
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
791
- case "InternalServerException":
792
- case "com.amazonaws.grafana#InternalServerException":
793
- throw await de_InternalServerExceptionRes(parsedOutput, context);
794
- case "ResourceNotFoundException":
795
- case "com.amazonaws.grafana#ResourceNotFoundException":
796
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
797
- case "ThrottlingException":
798
- case "com.amazonaws.grafana#ThrottlingException":
799
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
800
- case "ValidationException":
801
- case "com.amazonaws.grafana#ValidationException":
802
- throw await de_ValidationExceptionRes(parsedOutput, context);
803
- default:
804
- const parsedBody = parsedOutput.body;
805
- return throwDefaultError({
806
- output,
807
- parsedBody,
808
- errorCode,
809
- });
810
- }
811
- };
812
- const de_ListVersionsCommand = async (output, context) => {
813
- if (output.statusCode !== 200 && output.statusCode >= 300) {
814
- return de_ListVersionsCommandError(output, context);
815
- }
816
- const contents = (0, smithy_client_1.map)({
817
- $metadata: deserializeMetadata(output),
818
- });
819
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
820
- const doc = (0, smithy_client_1.take)(data, {
821
- grafanaVersions: smithy_client_1._json,
822
- nextToken: smithy_client_1.expectString,
823
- });
824
- Object.assign(contents, doc);
825
- return contents;
826
- };
827
- exports.de_ListVersionsCommand = de_ListVersionsCommand;
828
- const de_ListVersionsCommandError = async (output, context) => {
829
- const parsedOutput = {
830
- ...output,
831
- body: await parseErrorBody(output.body, context),
832
- };
833
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
834
- switch (errorCode) {
835
- case "AccessDeniedException":
836
- case "com.amazonaws.grafana#AccessDeniedException":
837
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
838
- case "InternalServerException":
839
- case "com.amazonaws.grafana#InternalServerException":
840
- throw await de_InternalServerExceptionRes(parsedOutput, context);
841
- case "ResourceNotFoundException":
842
- case "com.amazonaws.grafana#ResourceNotFoundException":
843
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
844
- case "ThrottlingException":
845
- case "com.amazonaws.grafana#ThrottlingException":
846
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
847
- case "ValidationException":
848
- case "com.amazonaws.grafana#ValidationException":
849
- throw await de_ValidationExceptionRes(parsedOutput, context);
850
- default:
851
- const parsedBody = parsedOutput.body;
852
- return throwDefaultError({
853
- output,
854
- parsedBody,
855
- errorCode,
856
- });
857
- }
858
- };
859
- const de_ListWorkspacesCommand = async (output, context) => {
860
- if (output.statusCode !== 200 && output.statusCode >= 300) {
861
- return de_ListWorkspacesCommandError(output, context);
862
- }
863
- const contents = (0, smithy_client_1.map)({
864
- $metadata: deserializeMetadata(output),
865
- });
866
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
867
- const doc = (0, smithy_client_1.take)(data, {
868
- nextToken: smithy_client_1.expectString,
869
- workspaces: (_) => de_WorkspaceList(_, context),
870
- });
871
- Object.assign(contents, doc);
872
- return contents;
873
- };
874
- exports.de_ListWorkspacesCommand = de_ListWorkspacesCommand;
875
- const de_ListWorkspacesCommandError = async (output, context) => {
876
- const parsedOutput = {
877
- ...output,
878
- body: await parseErrorBody(output.body, context),
879
- };
880
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
881
- switch (errorCode) {
882
- case "AccessDeniedException":
883
- case "com.amazonaws.grafana#AccessDeniedException":
884
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
885
- case "InternalServerException":
886
- case "com.amazonaws.grafana#InternalServerException":
887
- throw await de_InternalServerExceptionRes(parsedOutput, context);
888
- case "ThrottlingException":
889
- case "com.amazonaws.grafana#ThrottlingException":
890
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
891
- default:
892
- const parsedBody = parsedOutput.body;
893
- return throwDefaultError({
894
- output,
895
- parsedBody,
896
- errorCode,
897
- });
898
- }
899
- };
900
- const de_TagResourceCommand = async (output, context) => {
901
- if (output.statusCode !== 200 && output.statusCode >= 300) {
902
- return de_TagResourceCommandError(output, context);
903
- }
904
- const contents = (0, smithy_client_1.map)({
905
- $metadata: deserializeMetadata(output),
906
- });
907
- await (0, smithy_client_1.collectBody)(output.body, context);
908
- return contents;
909
- };
910
- exports.de_TagResourceCommand = de_TagResourceCommand;
911
- const de_TagResourceCommandError = async (output, context) => {
912
- const parsedOutput = {
913
- ...output,
914
- body: await parseErrorBody(output.body, context),
915
- };
916
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
917
- switch (errorCode) {
918
- case "AccessDeniedException":
919
- case "com.amazonaws.grafana#AccessDeniedException":
920
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
921
- case "InternalServerException":
922
- case "com.amazonaws.grafana#InternalServerException":
923
- throw await de_InternalServerExceptionRes(parsedOutput, context);
924
- case "ResourceNotFoundException":
925
- case "com.amazonaws.grafana#ResourceNotFoundException":
926
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
927
- case "ThrottlingException":
928
- case "com.amazonaws.grafana#ThrottlingException":
929
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
930
- case "ValidationException":
931
- case "com.amazonaws.grafana#ValidationException":
932
- throw await de_ValidationExceptionRes(parsedOutput, context);
933
- default:
934
- const parsedBody = parsedOutput.body;
935
- return throwDefaultError({
936
- output,
937
- parsedBody,
938
- errorCode,
939
- });
940
- }
941
- };
942
- const de_UntagResourceCommand = async (output, context) => {
943
- if (output.statusCode !== 200 && output.statusCode >= 300) {
944
- return de_UntagResourceCommandError(output, context);
945
- }
946
- const contents = (0, smithy_client_1.map)({
947
- $metadata: deserializeMetadata(output),
948
- });
949
- await (0, smithy_client_1.collectBody)(output.body, context);
950
- return contents;
951
- };
952
- exports.de_UntagResourceCommand = de_UntagResourceCommand;
953
- const de_UntagResourceCommandError = async (output, context) => {
954
- const parsedOutput = {
955
- ...output,
956
- body: await parseErrorBody(output.body, context),
957
- };
958
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
959
- switch (errorCode) {
960
- case "AccessDeniedException":
961
- case "com.amazonaws.grafana#AccessDeniedException":
962
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
963
- case "InternalServerException":
964
- case "com.amazonaws.grafana#InternalServerException":
965
- throw await de_InternalServerExceptionRes(parsedOutput, context);
966
- case "ResourceNotFoundException":
967
- case "com.amazonaws.grafana#ResourceNotFoundException":
968
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
969
- case "ThrottlingException":
970
- case "com.amazonaws.grafana#ThrottlingException":
971
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
972
- case "ValidationException":
973
- case "com.amazonaws.grafana#ValidationException":
974
- throw await de_ValidationExceptionRes(parsedOutput, context);
975
- default:
976
- const parsedBody = parsedOutput.body;
977
- return throwDefaultError({
978
- output,
979
- parsedBody,
980
- errorCode,
981
- });
982
- }
983
- };
984
- const de_UpdatePermissionsCommand = async (output, context) => {
985
- if (output.statusCode !== 200 && output.statusCode >= 300) {
986
- return de_UpdatePermissionsCommandError(output, context);
987
- }
988
- const contents = (0, smithy_client_1.map)({
989
- $metadata: deserializeMetadata(output),
990
- });
991
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
992
- const doc = (0, smithy_client_1.take)(data, {
993
- errors: smithy_client_1._json,
994
- });
995
- Object.assign(contents, doc);
996
- return contents;
997
- };
998
- exports.de_UpdatePermissionsCommand = de_UpdatePermissionsCommand;
999
- const de_UpdatePermissionsCommandError = async (output, context) => {
1000
- const parsedOutput = {
1001
- ...output,
1002
- body: await parseErrorBody(output.body, context),
1003
- };
1004
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1005
- switch (errorCode) {
1006
- case "AccessDeniedException":
1007
- case "com.amazonaws.grafana#AccessDeniedException":
1008
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1009
- case "InternalServerException":
1010
- case "com.amazonaws.grafana#InternalServerException":
1011
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1012
- case "ResourceNotFoundException":
1013
- case "com.amazonaws.grafana#ResourceNotFoundException":
1014
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1015
- case "ThrottlingException":
1016
- case "com.amazonaws.grafana#ThrottlingException":
1017
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1018
- case "ValidationException":
1019
- case "com.amazonaws.grafana#ValidationException":
1020
- throw await de_ValidationExceptionRes(parsedOutput, context);
1021
- default:
1022
- const parsedBody = parsedOutput.body;
1023
- return throwDefaultError({
1024
- output,
1025
- parsedBody,
1026
- errorCode,
1027
- });
1028
- }
1029
- };
1030
- const de_UpdateWorkspaceCommand = async (output, context) => {
1031
- if (output.statusCode !== 202 && output.statusCode >= 300) {
1032
- return de_UpdateWorkspaceCommandError(output, context);
1033
- }
1034
- const contents = (0, smithy_client_1.map)({
1035
- $metadata: deserializeMetadata(output),
1036
- });
1037
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1038
- const doc = (0, smithy_client_1.take)(data, {
1039
- workspace: (_) => de_WorkspaceDescription(_, context),
1040
- });
1041
- Object.assign(contents, doc);
1042
- return contents;
1043
- };
1044
- exports.de_UpdateWorkspaceCommand = de_UpdateWorkspaceCommand;
1045
- const de_UpdateWorkspaceCommandError = async (output, context) => {
1046
- const parsedOutput = {
1047
- ...output,
1048
- body: await parseErrorBody(output.body, context),
1049
- };
1050
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1051
- switch (errorCode) {
1052
- case "AccessDeniedException":
1053
- case "com.amazonaws.grafana#AccessDeniedException":
1054
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1055
- case "ConflictException":
1056
- case "com.amazonaws.grafana#ConflictException":
1057
- throw await de_ConflictExceptionRes(parsedOutput, context);
1058
- case "InternalServerException":
1059
- case "com.amazonaws.grafana#InternalServerException":
1060
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1061
- case "ResourceNotFoundException":
1062
- case "com.amazonaws.grafana#ResourceNotFoundException":
1063
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1064
- case "ThrottlingException":
1065
- case "com.amazonaws.grafana#ThrottlingException":
1066
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1067
- case "ValidationException":
1068
- case "com.amazonaws.grafana#ValidationException":
1069
- throw await de_ValidationExceptionRes(parsedOutput, context);
1070
- default:
1071
- const parsedBody = parsedOutput.body;
1072
- return throwDefaultError({
1073
- output,
1074
- parsedBody,
1075
- errorCode,
1076
- });
1077
- }
1078
- };
1079
- const de_UpdateWorkspaceAuthenticationCommand = async (output, context) => {
1080
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1081
- return de_UpdateWorkspaceAuthenticationCommandError(output, context);
1082
- }
1083
- const contents = (0, smithy_client_1.map)({
1084
- $metadata: deserializeMetadata(output),
1085
- });
1086
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1087
- const doc = (0, smithy_client_1.take)(data, {
1088
- authentication: smithy_client_1._json,
1089
- });
1090
- Object.assign(contents, doc);
1091
- return contents;
1092
- };
1093
- exports.de_UpdateWorkspaceAuthenticationCommand = de_UpdateWorkspaceAuthenticationCommand;
1094
- const de_UpdateWorkspaceAuthenticationCommandError = async (output, context) => {
1095
- const parsedOutput = {
1096
- ...output,
1097
- body: await parseErrorBody(output.body, context),
1098
- };
1099
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1100
- switch (errorCode) {
1101
- case "AccessDeniedException":
1102
- case "com.amazonaws.grafana#AccessDeniedException":
1103
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1104
- case "ConflictException":
1105
- case "com.amazonaws.grafana#ConflictException":
1106
- throw await de_ConflictExceptionRes(parsedOutput, context);
1107
- case "InternalServerException":
1108
- case "com.amazonaws.grafana#InternalServerException":
1109
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1110
- case "ResourceNotFoundException":
1111
- case "com.amazonaws.grafana#ResourceNotFoundException":
1112
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1113
- case "ThrottlingException":
1114
- case "com.amazonaws.grafana#ThrottlingException":
1115
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1116
- case "ValidationException":
1117
- case "com.amazonaws.grafana#ValidationException":
1118
- throw await de_ValidationExceptionRes(parsedOutput, context);
1119
- default:
1120
- const parsedBody = parsedOutput.body;
1121
- return throwDefaultError({
1122
- output,
1123
- parsedBody,
1124
- errorCode,
1125
- });
1126
- }
1127
- };
1128
- const de_UpdateWorkspaceConfigurationCommand = async (output, context) => {
1129
- if (output.statusCode !== 202 && output.statusCode >= 300) {
1130
- return de_UpdateWorkspaceConfigurationCommandError(output, context);
1131
- }
1132
- const contents = (0, smithy_client_1.map)({
1133
- $metadata: deserializeMetadata(output),
1134
- });
1135
- await (0, smithy_client_1.collectBody)(output.body, context);
1136
- return contents;
1137
- };
1138
- exports.de_UpdateWorkspaceConfigurationCommand = de_UpdateWorkspaceConfigurationCommand;
1139
- const de_UpdateWorkspaceConfigurationCommandError = async (output, context) => {
1140
- const parsedOutput = {
1141
- ...output,
1142
- body: await parseErrorBody(output.body, context),
1143
- };
1144
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1145
- switch (errorCode) {
1146
- case "AccessDeniedException":
1147
- case "com.amazonaws.grafana#AccessDeniedException":
1148
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1149
- case "ConflictException":
1150
- case "com.amazonaws.grafana#ConflictException":
1151
- throw await de_ConflictExceptionRes(parsedOutput, context);
1152
- case "InternalServerException":
1153
- case "com.amazonaws.grafana#InternalServerException":
1154
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1155
- case "ResourceNotFoundException":
1156
- case "com.amazonaws.grafana#ResourceNotFoundException":
1157
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1158
- case "ThrottlingException":
1159
- case "com.amazonaws.grafana#ThrottlingException":
1160
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1161
- case "ValidationException":
1162
- case "com.amazonaws.grafana#ValidationException":
1163
- throw await de_ValidationExceptionRes(parsedOutput, context);
1164
- default:
1165
- const parsedBody = parsedOutput.body;
1166
- return throwDefaultError({
1167
- output,
1168
- parsedBody,
1169
- errorCode,
1170
- });
1171
- }
1172
- };
1173
- const throwDefaultError = (0, smithy_client_1.withBaseException)(GrafanaServiceException_1.GrafanaServiceException);
1174
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
1175
- const contents = (0, smithy_client_1.map)({});
1176
- const data = parsedOutput.body;
1177
- const doc = (0, smithy_client_1.take)(data, {
1178
- message: smithy_client_1.expectString,
1179
- });
1180
- Object.assign(contents, doc);
1181
- const exception = new models_0_1.AccessDeniedException({
1182
- $metadata: deserializeMetadata(parsedOutput),
1183
- ...contents,
1184
- });
1185
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1186
- };
1187
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
1188
- const contents = (0, smithy_client_1.map)({});
1189
- const data = parsedOutput.body;
1190
- const doc = (0, smithy_client_1.take)(data, {
1191
- message: smithy_client_1.expectString,
1192
- resourceId: smithy_client_1.expectString,
1193
- resourceType: smithy_client_1.expectString,
1194
- });
1195
- Object.assign(contents, doc);
1196
- const exception = new models_0_1.ConflictException({
1197
- $metadata: deserializeMetadata(parsedOutput),
1198
- ...contents,
1199
- });
1200
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1201
- };
1202
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
1203
- const contents = (0, smithy_client_1.map)({
1204
- [_rAS]: [() => void 0 !== parsedOutput.headers[_ra], () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers[_ra])],
1205
- });
1206
- const data = parsedOutput.body;
1207
- const doc = (0, smithy_client_1.take)(data, {
1208
- message: smithy_client_1.expectString,
1209
- });
1210
- Object.assign(contents, doc);
1211
- const exception = new models_0_1.InternalServerException({
1212
- $metadata: deserializeMetadata(parsedOutput),
1213
- ...contents,
1214
- });
1215
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1216
- };
1217
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1218
- const contents = (0, smithy_client_1.map)({});
1219
- const data = parsedOutput.body;
1220
- const doc = (0, smithy_client_1.take)(data, {
1221
- message: smithy_client_1.expectString,
1222
- resourceId: smithy_client_1.expectString,
1223
- resourceType: smithy_client_1.expectString,
1224
- });
1225
- Object.assign(contents, doc);
1226
- const exception = new models_0_1.ResourceNotFoundException({
1227
- $metadata: deserializeMetadata(parsedOutput),
1228
- ...contents,
1229
- });
1230
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1231
- };
1232
- const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
1233
- const contents = (0, smithy_client_1.map)({});
1234
- const data = parsedOutput.body;
1235
- const doc = (0, smithy_client_1.take)(data, {
1236
- message: smithy_client_1.expectString,
1237
- quotaCode: smithy_client_1.expectString,
1238
- resourceId: smithy_client_1.expectString,
1239
- resourceType: smithy_client_1.expectString,
1240
- serviceCode: smithy_client_1.expectString,
1241
- });
1242
- Object.assign(contents, doc);
1243
- const exception = new models_0_1.ServiceQuotaExceededException({
1244
- $metadata: deserializeMetadata(parsedOutput),
1245
- ...contents,
1246
- });
1247
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1248
- };
1249
- const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
1250
- const contents = (0, smithy_client_1.map)({
1251
- [_rAS]: [() => void 0 !== parsedOutput.headers[_ra], () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers[_ra])],
1252
- });
1253
- const data = parsedOutput.body;
1254
- const doc = (0, smithy_client_1.take)(data, {
1255
- message: smithy_client_1.expectString,
1256
- quotaCode: smithy_client_1.expectString,
1257
- serviceCode: smithy_client_1.expectString,
1258
- });
1259
- Object.assign(contents, doc);
1260
- const exception = new models_0_1.ThrottlingException({
1261
- $metadata: deserializeMetadata(parsedOutput),
1262
- ...contents,
1263
- });
1264
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1265
- };
1266
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
1267
- const contents = (0, smithy_client_1.map)({});
1268
- const data = parsedOutput.body;
1269
- const doc = (0, smithy_client_1.take)(data, {
1270
- fieldList: smithy_client_1._json,
1271
- message: smithy_client_1.expectString,
1272
- reason: smithy_client_1.expectString,
1273
- });
1274
- Object.assign(contents, doc);
1275
- const exception = new models_0_1.ValidationException({
1276
- $metadata: deserializeMetadata(parsedOutput),
1277
- ...contents,
1278
- });
1279
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1280
- };
1281
- const de_WorkspaceDescription = (output, context) => {
1282
- return (0, smithy_client_1.take)(output, {
1283
- accountAccessType: smithy_client_1.expectString,
1284
- authentication: smithy_client_1._json,
1285
- created: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1286
- dataSources: smithy_client_1._json,
1287
- description: smithy_client_1.expectString,
1288
- endpoint: smithy_client_1.expectString,
1289
- freeTrialConsumed: smithy_client_1.expectBoolean,
1290
- freeTrialExpiration: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1291
- grafanaVersion: smithy_client_1.expectString,
1292
- id: smithy_client_1.expectString,
1293
- licenseExpiration: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1294
- licenseType: smithy_client_1.expectString,
1295
- modified: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1296
- name: smithy_client_1.expectString,
1297
- networkAccessControl: smithy_client_1._json,
1298
- notificationDestinations: smithy_client_1._json,
1299
- organizationRoleName: smithy_client_1.expectString,
1300
- organizationalUnits: smithy_client_1._json,
1301
- permissionType: smithy_client_1.expectString,
1302
- stackSetName: smithy_client_1.expectString,
1303
- status: smithy_client_1.expectString,
1304
- tags: smithy_client_1._json,
1305
- vpcConfiguration: smithy_client_1._json,
1306
- workspaceRoleArn: smithy_client_1.expectString,
1307
- });
1308
- };
1309
- const de_WorkspaceList = (output, context) => {
1310
- const retVal = (output || [])
1311
- .filter((e) => e != null)
1312
- .map((entry) => {
1313
- return de_WorkspaceSummary(entry, context);
1314
- });
1315
- return retVal;
1316
- };
1317
- const de_WorkspaceSummary = (output, context) => {
1318
- return (0, smithy_client_1.take)(output, {
1319
- authentication: smithy_client_1._json,
1320
- created: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1321
- description: smithy_client_1.expectString,
1322
- endpoint: smithy_client_1.expectString,
1323
- grafanaVersion: smithy_client_1.expectString,
1324
- id: smithy_client_1.expectString,
1325
- modified: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1326
- name: smithy_client_1.expectString,
1327
- notificationDestinations: smithy_client_1._json,
1328
- status: smithy_client_1.expectString,
1329
- tags: smithy_client_1._json,
1330
- });
1331
- };
1332
- const deserializeMetadata = (output) => ({
1333
- httpStatusCode: output.statusCode,
1334
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1335
- extendedRequestId: output.headers["x-amz-id-2"],
1336
- cfId: output.headers["x-amz-cf-id"],
1337
- });
1338
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
1339
- const isSerializableHeaderValue = (value) => value !== undefined &&
1340
- value !== null &&
1341
- value !== "" &&
1342
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1343
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1344
- const _gI = "groupId";
1345
- const _mR = "maxResults";
1346
- const _nT = "nextToken";
1347
- const _rAS = "retryAfterSeconds";
1348
- const _ra = "retry-after";
1349
- const _tK = "tagKeys";
1350
- const _uI = "userId";
1351
- const _uT = "userType";
1352
- const _wI = "workspaceId";
1353
- const _wi = "workspace-id";
1354
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1355
- if (encoded.length) {
1356
- return JSON.parse(encoded);
1357
- }
1358
- return {};
1359
- });
1360
- const parseErrorBody = async (errorBody, context) => {
1361
- const value = await parseBody(errorBody, context);
1362
- value.message = value.message ?? value.Message;
1363
- return value;
1364
- };
1365
- const loadRestJsonErrorCode = (output, data) => {
1366
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1367
- const sanitizeErrorCode = (rawValue) => {
1368
- let cleanValue = rawValue;
1369
- if (typeof cleanValue === "number") {
1370
- cleanValue = cleanValue.toString();
1371
- }
1372
- if (cleanValue.indexOf(",") >= 0) {
1373
- cleanValue = cleanValue.split(",")[0];
1374
- }
1375
- if (cleanValue.indexOf(":") >= 0) {
1376
- cleanValue = cleanValue.split(":")[0];
1377
- }
1378
- if (cleanValue.indexOf("#") >= 0) {
1379
- cleanValue = cleanValue.split("#")[1];
1380
- }
1381
- return cleanValue;
1382
- };
1383
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1384
- if (headerKey !== undefined) {
1385
- return sanitizeErrorCode(output.headers[headerKey]);
1386
- }
1387
- if (data.code !== undefined) {
1388
- return sanitizeErrorCode(data.code);
1389
- }
1390
- if (data["__type"] !== undefined) {
1391
- return sanitizeErrorCode(data["__type"]);
1392
- }
1393
- };
1
+ module.exports = require("../index.js");