@aws-sdk/client-grafana 3.928.0 → 3.929.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 (49) hide show
  1. package/dist-cjs/index.js +1241 -1245
  2. package/dist-cjs/runtimeConfig.shared.js +2 -0
  3. package/dist-es/GrafanaClient.js +2 -0
  4. package/dist-es/commands/AssociateLicenseCommand.js +3 -10
  5. package/dist-es/commands/CreateWorkspaceApiKeyCommand.js +3 -10
  6. package/dist-es/commands/CreateWorkspaceCommand.js +3 -10
  7. package/dist-es/commands/CreateWorkspaceServiceAccountCommand.js +3 -9
  8. package/dist-es/commands/CreateWorkspaceServiceAccountTokenCommand.js +3 -10
  9. package/dist-es/commands/DeleteWorkspaceApiKeyCommand.js +3 -9
  10. package/dist-es/commands/DeleteWorkspaceCommand.js +3 -10
  11. package/dist-es/commands/DeleteWorkspaceServiceAccountCommand.js +3 -9
  12. package/dist-es/commands/DeleteWorkspaceServiceAccountTokenCommand.js +3 -9
  13. package/dist-es/commands/DescribeWorkspaceAuthenticationCommand.js +3 -10
  14. package/dist-es/commands/DescribeWorkspaceCommand.js +3 -10
  15. package/dist-es/commands/DescribeWorkspaceConfigurationCommand.js +3 -9
  16. package/dist-es/commands/DisassociateLicenseCommand.js +3 -10
  17. package/dist-es/commands/ListPermissionsCommand.js +3 -9
  18. package/dist-es/commands/ListTagsForResourceCommand.js +3 -9
  19. package/dist-es/commands/ListVersionsCommand.js +3 -9
  20. package/dist-es/commands/ListWorkspaceServiceAccountTokensCommand.js +3 -9
  21. package/dist-es/commands/ListWorkspaceServiceAccountsCommand.js +3 -9
  22. package/dist-es/commands/ListWorkspacesCommand.js +3 -10
  23. package/dist-es/commands/TagResourceCommand.js +3 -9
  24. package/dist-es/commands/UntagResourceCommand.js +3 -9
  25. package/dist-es/commands/UpdatePermissionsCommand.js +3 -9
  26. package/dist-es/commands/UpdateWorkspaceAuthenticationCommand.js +3 -10
  27. package/dist-es/commands/UpdateWorkspaceCommand.js +3 -10
  28. package/dist-es/commands/UpdateWorkspaceConfigurationCommand.js +3 -9
  29. package/dist-es/models/models_0.js +0 -102
  30. package/dist-es/runtimeConfig.shared.js +2 -0
  31. package/dist-es/schemas/schemas_0.js +1189 -0
  32. package/dist-types/GrafanaClient.d.ts +10 -1
  33. package/dist-types/models/models_0.d.ts +0 -84
  34. package/dist-types/runtimeConfig.browser.d.ts +1 -0
  35. package/dist-types/runtimeConfig.d.ts +1 -0
  36. package/dist-types/runtimeConfig.native.d.ts +1 -0
  37. package/dist-types/runtimeConfig.shared.d.ts +1 -0
  38. package/dist-types/schemas/schemas_0.d.ts +132 -0
  39. package/dist-types/ts3.4/GrafanaClient.d.ts +4 -0
  40. package/dist-types/ts3.4/models/models_0.d.ts +0 -61
  41. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +4 -0
  42. package/dist-types/ts3.4/runtimeConfig.d.ts +4 -0
  43. package/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -0
  44. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +4 -0
  45. package/dist-types/ts3.4/schemas/schemas_0.d.ts +138 -0
  46. package/package.json +2 -3
  47. package/dist-es/protocols/Aws_restJson1.js +0 -938
  48. package/dist-types/protocols/Aws_restJson1.d.ts +0 -227
  49. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +0 -305
@@ -1,938 +0,0 @@
1
- import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
2
- import { requestBuilder as rb } from "@smithy/core";
3
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, isSerializableHeaderValue, LazyJsonString as __LazyJsonString, map, parseEpochTimestamp as __parseEpochTimestamp, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@smithy/smithy-client";
4
- import { v4 as generateIdempotencyToken } from "@smithy/uuid";
5
- import { GrafanaServiceException as __BaseException } from "../models/GrafanaServiceException";
6
- import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
7
- export const se_AssociateLicenseCommand = async (input, context) => {
8
- const b = rb(input, context);
9
- const headers = map({}, isSerializableHeaderValue, {
10
- [_gt]: input[_gT],
11
- });
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
- export const se_CreateWorkspaceCommand = async (input, context) => {
20
- const b = rb(input, context);
21
- const headers = {
22
- "content-type": "application/json",
23
- };
24
- b.bp("/workspaces");
25
- let body;
26
- body = JSON.stringify(take(input, {
27
- accountAccessType: [],
28
- authenticationProviders: (_) => _json(_),
29
- clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
30
- configuration: (_) => __LazyJsonString.from(_),
31
- grafanaVersion: [],
32
- networkAccessControl: (_) => _json(_),
33
- organizationRoleName: [],
34
- permissionType: [],
35
- stackSetName: [],
36
- tags: (_) => _json(_),
37
- vpcConfiguration: (_) => _json(_),
38
- workspaceDataSources: (_) => _json(_),
39
- workspaceDescription: [],
40
- workspaceName: [],
41
- workspaceNotificationDestinations: (_) => _json(_),
42
- workspaceOrganizationalUnits: (_) => _json(_),
43
- workspaceRoleArn: [],
44
- }));
45
- b.m("POST").h(headers).b(body);
46
- return b.build();
47
- };
48
- export const se_CreateWorkspaceApiKeyCommand = async (input, context) => {
49
- const b = rb(input, context);
50
- const headers = {
51
- "content-type": "application/json",
52
- };
53
- b.bp("/workspaces/{workspaceId}/apikeys");
54
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
55
- let body;
56
- body = JSON.stringify(take(input, {
57
- keyName: [],
58
- keyRole: [],
59
- secondsToLive: [],
60
- }));
61
- b.m("POST").h(headers).b(body);
62
- return b.build();
63
- };
64
- export const se_CreateWorkspaceServiceAccountCommand = async (input, context) => {
65
- const b = rb(input, context);
66
- const headers = {
67
- "content-type": "application/json",
68
- };
69
- b.bp("/workspaces/{workspaceId}/serviceaccounts");
70
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
71
- let body;
72
- body = JSON.stringify(take(input, {
73
- grafanaRole: [],
74
- name: [],
75
- }));
76
- b.m("POST").h(headers).b(body);
77
- return b.build();
78
- };
79
- export const se_CreateWorkspaceServiceAccountTokenCommand = async (input, context) => {
80
- const b = rb(input, context);
81
- const headers = {
82
- "content-type": "application/json",
83
- };
84
- b.bp("/workspaces/{workspaceId}/serviceaccounts/{serviceAccountId}/tokens");
85
- b.p("serviceAccountId", () => input.serviceAccountId, "{serviceAccountId}", false);
86
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
87
- let body;
88
- body = JSON.stringify(take(input, {
89
- name: [],
90
- secondsToLive: [],
91
- }));
92
- b.m("POST").h(headers).b(body);
93
- return b.build();
94
- };
95
- export const se_DeleteWorkspaceCommand = async (input, context) => {
96
- const b = rb(input, context);
97
- const headers = {};
98
- b.bp("/workspaces/{workspaceId}");
99
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
100
- let body;
101
- b.m("DELETE").h(headers).b(body);
102
- return b.build();
103
- };
104
- export const se_DeleteWorkspaceApiKeyCommand = async (input, context) => {
105
- const b = rb(input, context);
106
- const headers = {};
107
- b.bp("/workspaces/{workspaceId}/apikeys/{keyName}");
108
- b.p("keyName", () => input.keyName, "{keyName}", false);
109
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
110
- let body;
111
- b.m("DELETE").h(headers).b(body);
112
- return b.build();
113
- };
114
- export const se_DeleteWorkspaceServiceAccountCommand = async (input, context) => {
115
- const b = rb(input, context);
116
- const headers = {};
117
- b.bp("/workspaces/{workspaceId}/serviceaccounts/{serviceAccountId}");
118
- b.p("serviceAccountId", () => input.serviceAccountId, "{serviceAccountId}", false);
119
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
120
- let body;
121
- b.m("DELETE").h(headers).b(body);
122
- return b.build();
123
- };
124
- export const se_DeleteWorkspaceServiceAccountTokenCommand = async (input, context) => {
125
- const b = rb(input, context);
126
- const headers = {};
127
- b.bp("/workspaces/{workspaceId}/serviceaccounts/{serviceAccountId}/tokens/{tokenId}");
128
- b.p("tokenId", () => input.tokenId, "{tokenId}", false);
129
- b.p("serviceAccountId", () => input.serviceAccountId, "{serviceAccountId}", false);
130
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
131
- let body;
132
- b.m("DELETE").h(headers).b(body);
133
- return b.build();
134
- };
135
- export const se_DescribeWorkspaceCommand = async (input, context) => {
136
- const b = rb(input, context);
137
- const headers = {};
138
- b.bp("/workspaces/{workspaceId}");
139
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
140
- let body;
141
- b.m("GET").h(headers).b(body);
142
- return b.build();
143
- };
144
- export const se_DescribeWorkspaceAuthenticationCommand = async (input, context) => {
145
- const b = rb(input, context);
146
- const headers = {};
147
- b.bp("/workspaces/{workspaceId}/authentication");
148
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
149
- let body;
150
- b.m("GET").h(headers).b(body);
151
- return b.build();
152
- };
153
- export const se_DescribeWorkspaceConfigurationCommand = async (input, context) => {
154
- const b = rb(input, context);
155
- const headers = {};
156
- b.bp("/workspaces/{workspaceId}/configuration");
157
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
158
- let body;
159
- b.m("GET").h(headers).b(body);
160
- return b.build();
161
- };
162
- export const se_DisassociateLicenseCommand = async (input, context) => {
163
- const b = rb(input, context);
164
- const headers = {};
165
- b.bp("/workspaces/{workspaceId}/licenses/{licenseType}");
166
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
167
- b.p("licenseType", () => input.licenseType, "{licenseType}", false);
168
- let body;
169
- b.m("DELETE").h(headers).b(body);
170
- return b.build();
171
- };
172
- export const se_ListPermissionsCommand = async (input, context) => {
173
- const b = rb(input, context);
174
- const headers = {};
175
- b.bp("/workspaces/{workspaceId}/permissions");
176
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
177
- const query = map({
178
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
179
- [_nT]: [, input[_nT]],
180
- [_uT]: [, input[_uT]],
181
- [_uI]: [, input[_uI]],
182
- [_gI]: [, input[_gI]],
183
- });
184
- let body;
185
- b.m("GET").h(headers).q(query).b(body);
186
- return b.build();
187
- };
188
- export const se_ListTagsForResourceCommand = async (input, context) => {
189
- const b = rb(input, context);
190
- const headers = {};
191
- b.bp("/tags/{resourceArn}");
192
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
193
- let body;
194
- b.m("GET").h(headers).b(body);
195
- return b.build();
196
- };
197
- export const se_ListVersionsCommand = async (input, context) => {
198
- const b = rb(input, context);
199
- const headers = {};
200
- b.bp("/versions");
201
- const query = map({
202
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
203
- [_nT]: [, input[_nT]],
204
- [_wi]: [, input[_wI]],
205
- });
206
- let body;
207
- b.m("GET").h(headers).q(query).b(body);
208
- return b.build();
209
- };
210
- export const se_ListWorkspacesCommand = async (input, context) => {
211
- const b = rb(input, context);
212
- const headers = {};
213
- b.bp("/workspaces");
214
- const query = map({
215
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
216
- [_nT]: [, input[_nT]],
217
- });
218
- let body;
219
- b.m("GET").h(headers).q(query).b(body);
220
- return b.build();
221
- };
222
- export const se_ListWorkspaceServiceAccountsCommand = async (input, context) => {
223
- const b = rb(input, context);
224
- const headers = {};
225
- b.bp("/workspaces/{workspaceId}/serviceaccounts");
226
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
227
- const query = map({
228
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
229
- [_nT]: [, input[_nT]],
230
- });
231
- let body;
232
- b.m("GET").h(headers).q(query).b(body);
233
- return b.build();
234
- };
235
- export const se_ListWorkspaceServiceAccountTokensCommand = async (input, context) => {
236
- const b = rb(input, context);
237
- const headers = {};
238
- b.bp("/workspaces/{workspaceId}/serviceaccounts/{serviceAccountId}/tokens");
239
- b.p("serviceAccountId", () => input.serviceAccountId, "{serviceAccountId}", false);
240
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
241
- const query = map({
242
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
243
- [_nT]: [, input[_nT]],
244
- });
245
- let body;
246
- b.m("GET").h(headers).q(query).b(body);
247
- return b.build();
248
- };
249
- export const se_TagResourceCommand = async (input, context) => {
250
- const b = rb(input, context);
251
- const headers = {
252
- "content-type": "application/json",
253
- };
254
- b.bp("/tags/{resourceArn}");
255
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
256
- let body;
257
- body = JSON.stringify(take(input, {
258
- tags: (_) => _json(_),
259
- }));
260
- b.m("POST").h(headers).b(body);
261
- return b.build();
262
- };
263
- export const se_UntagResourceCommand = async (input, context) => {
264
- const b = rb(input, context);
265
- const headers = {};
266
- b.bp("/tags/{resourceArn}");
267
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
268
- const query = map({
269
- [_tK]: [__expectNonNull(input.tagKeys, `tagKeys`) != null, () => input[_tK] || []],
270
- });
271
- let body;
272
- b.m("DELETE").h(headers).q(query).b(body);
273
- return b.build();
274
- };
275
- export const se_UpdatePermissionsCommand = async (input, context) => {
276
- const b = rb(input, context);
277
- const headers = {
278
- "content-type": "application/json",
279
- };
280
- b.bp("/workspaces/{workspaceId}/permissions");
281
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
282
- let body;
283
- body = JSON.stringify(take(input, {
284
- updateInstructionBatch: (_) => _json(_),
285
- }));
286
- b.m("PATCH").h(headers).b(body);
287
- return b.build();
288
- };
289
- export const se_UpdateWorkspaceCommand = async (input, context) => {
290
- const b = rb(input, context);
291
- const headers = {
292
- "content-type": "application/json",
293
- };
294
- b.bp("/workspaces/{workspaceId}");
295
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
296
- let body;
297
- body = JSON.stringify(take(input, {
298
- accountAccessType: [],
299
- networkAccessControl: (_) => _json(_),
300
- organizationRoleName: [],
301
- permissionType: [],
302
- removeNetworkAccessConfiguration: [],
303
- removeVpcConfiguration: [],
304
- stackSetName: [],
305
- vpcConfiguration: (_) => _json(_),
306
- workspaceDataSources: (_) => _json(_),
307
- workspaceDescription: [],
308
- workspaceName: [],
309
- workspaceNotificationDestinations: (_) => _json(_),
310
- workspaceOrganizationalUnits: (_) => _json(_),
311
- workspaceRoleArn: [],
312
- }));
313
- b.m("PUT").h(headers).b(body);
314
- return b.build();
315
- };
316
- export const se_UpdateWorkspaceAuthenticationCommand = async (input, context) => {
317
- const b = rb(input, context);
318
- const headers = {
319
- "content-type": "application/json",
320
- };
321
- b.bp("/workspaces/{workspaceId}/authentication");
322
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
323
- let body;
324
- body = JSON.stringify(take(input, {
325
- authenticationProviders: (_) => _json(_),
326
- samlConfiguration: (_) => _json(_),
327
- }));
328
- b.m("POST").h(headers).b(body);
329
- return b.build();
330
- };
331
- export const se_UpdateWorkspaceConfigurationCommand = async (input, context) => {
332
- const b = rb(input, context);
333
- const headers = {
334
- "content-type": "application/json",
335
- };
336
- b.bp("/workspaces/{workspaceId}/configuration");
337
- b.p("workspaceId", () => input.workspaceId, "{workspaceId}", false);
338
- let body;
339
- body = JSON.stringify(take(input, {
340
- configuration: (_) => __LazyJsonString.from(_),
341
- grafanaVersion: [],
342
- }));
343
- b.m("PUT").h(headers).b(body);
344
- return b.build();
345
- };
346
- export const de_AssociateLicenseCommand = async (output, context) => {
347
- if (output.statusCode !== 202 && output.statusCode >= 300) {
348
- return de_CommandError(output, context);
349
- }
350
- const contents = map({
351
- $metadata: deserializeMetadata(output),
352
- });
353
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
354
- const doc = take(data, {
355
- workspace: (_) => de_WorkspaceDescription(_, context),
356
- });
357
- Object.assign(contents, doc);
358
- return contents;
359
- };
360
- export const de_CreateWorkspaceCommand = async (output, context) => {
361
- if (output.statusCode !== 202 && output.statusCode >= 300) {
362
- return de_CommandError(output, context);
363
- }
364
- const contents = map({
365
- $metadata: deserializeMetadata(output),
366
- });
367
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
368
- const doc = take(data, {
369
- workspace: (_) => de_WorkspaceDescription(_, context),
370
- });
371
- Object.assign(contents, doc);
372
- return contents;
373
- };
374
- export const de_CreateWorkspaceApiKeyCommand = async (output, context) => {
375
- if (output.statusCode !== 200 && output.statusCode >= 300) {
376
- return de_CommandError(output, context);
377
- }
378
- const contents = map({
379
- $metadata: deserializeMetadata(output),
380
- });
381
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
382
- const doc = take(data, {
383
- key: __expectString,
384
- keyName: __expectString,
385
- workspaceId: __expectString,
386
- });
387
- Object.assign(contents, doc);
388
- return contents;
389
- };
390
- export const de_CreateWorkspaceServiceAccountCommand = async (output, context) => {
391
- if (output.statusCode !== 200 && output.statusCode >= 300) {
392
- return de_CommandError(output, context);
393
- }
394
- const contents = map({
395
- $metadata: deserializeMetadata(output),
396
- });
397
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
398
- const doc = take(data, {
399
- grafanaRole: __expectString,
400
- id: __expectString,
401
- name: __expectString,
402
- workspaceId: __expectString,
403
- });
404
- Object.assign(contents, doc);
405
- return contents;
406
- };
407
- export const de_CreateWorkspaceServiceAccountTokenCommand = async (output, context) => {
408
- if (output.statusCode !== 200 && output.statusCode >= 300) {
409
- return de_CommandError(output, context);
410
- }
411
- const contents = map({
412
- $metadata: deserializeMetadata(output),
413
- });
414
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
415
- const doc = take(data, {
416
- serviceAccountId: __expectString,
417
- serviceAccountToken: _json,
418
- workspaceId: __expectString,
419
- });
420
- Object.assign(contents, doc);
421
- return contents;
422
- };
423
- export const de_DeleteWorkspaceCommand = async (output, context) => {
424
- if (output.statusCode !== 202 && output.statusCode >= 300) {
425
- return de_CommandError(output, context);
426
- }
427
- const contents = map({
428
- $metadata: deserializeMetadata(output),
429
- });
430
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
431
- const doc = take(data, {
432
- workspace: (_) => de_WorkspaceDescription(_, context),
433
- });
434
- Object.assign(contents, doc);
435
- return contents;
436
- };
437
- export const de_DeleteWorkspaceApiKeyCommand = async (output, context) => {
438
- if (output.statusCode !== 200 && output.statusCode >= 300) {
439
- return de_CommandError(output, context);
440
- }
441
- const contents = map({
442
- $metadata: deserializeMetadata(output),
443
- });
444
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
445
- const doc = take(data, {
446
- keyName: __expectString,
447
- workspaceId: __expectString,
448
- });
449
- Object.assign(contents, doc);
450
- return contents;
451
- };
452
- export const de_DeleteWorkspaceServiceAccountCommand = async (output, context) => {
453
- if (output.statusCode !== 200 && output.statusCode >= 300) {
454
- return de_CommandError(output, context);
455
- }
456
- const contents = map({
457
- $metadata: deserializeMetadata(output),
458
- });
459
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
460
- const doc = take(data, {
461
- serviceAccountId: __expectString,
462
- workspaceId: __expectString,
463
- });
464
- Object.assign(contents, doc);
465
- return contents;
466
- };
467
- export const de_DeleteWorkspaceServiceAccountTokenCommand = async (output, context) => {
468
- if (output.statusCode !== 200 && output.statusCode >= 300) {
469
- return de_CommandError(output, context);
470
- }
471
- const contents = map({
472
- $metadata: deserializeMetadata(output),
473
- });
474
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
475
- const doc = take(data, {
476
- serviceAccountId: __expectString,
477
- tokenId: __expectString,
478
- workspaceId: __expectString,
479
- });
480
- Object.assign(contents, doc);
481
- return contents;
482
- };
483
- export const de_DescribeWorkspaceCommand = async (output, context) => {
484
- if (output.statusCode !== 200 && output.statusCode >= 300) {
485
- return de_CommandError(output, context);
486
- }
487
- const contents = map({
488
- $metadata: deserializeMetadata(output),
489
- });
490
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
491
- const doc = take(data, {
492
- workspace: (_) => de_WorkspaceDescription(_, context),
493
- });
494
- Object.assign(contents, doc);
495
- return contents;
496
- };
497
- export const de_DescribeWorkspaceAuthenticationCommand = async (output, context) => {
498
- if (output.statusCode !== 200 && output.statusCode >= 300) {
499
- return de_CommandError(output, context);
500
- }
501
- const contents = map({
502
- $metadata: deserializeMetadata(output),
503
- });
504
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
505
- const doc = take(data, {
506
- authentication: _json,
507
- });
508
- Object.assign(contents, doc);
509
- return contents;
510
- };
511
- export const de_DescribeWorkspaceConfigurationCommand = async (output, context) => {
512
- if (output.statusCode !== 200 && output.statusCode >= 300) {
513
- return de_CommandError(output, context);
514
- }
515
- const contents = map({
516
- $metadata: deserializeMetadata(output),
517
- });
518
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
519
- const doc = take(data, {
520
- configuration: __LazyJsonString.from,
521
- grafanaVersion: __expectString,
522
- });
523
- Object.assign(contents, doc);
524
- return contents;
525
- };
526
- export const de_DisassociateLicenseCommand = async (output, context) => {
527
- if (output.statusCode !== 202 && output.statusCode >= 300) {
528
- return de_CommandError(output, context);
529
- }
530
- const contents = map({
531
- $metadata: deserializeMetadata(output),
532
- });
533
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
534
- const doc = take(data, {
535
- workspace: (_) => de_WorkspaceDescription(_, context),
536
- });
537
- Object.assign(contents, doc);
538
- return contents;
539
- };
540
- export const de_ListPermissionsCommand = async (output, context) => {
541
- if (output.statusCode !== 200 && output.statusCode >= 300) {
542
- return de_CommandError(output, context);
543
- }
544
- const contents = map({
545
- $metadata: deserializeMetadata(output),
546
- });
547
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
548
- const doc = take(data, {
549
- nextToken: __expectString,
550
- permissions: _json,
551
- });
552
- Object.assign(contents, doc);
553
- return contents;
554
- };
555
- export const de_ListTagsForResourceCommand = async (output, context) => {
556
- if (output.statusCode !== 200 && output.statusCode >= 300) {
557
- return de_CommandError(output, context);
558
- }
559
- const contents = map({
560
- $metadata: deserializeMetadata(output),
561
- });
562
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
563
- const doc = take(data, {
564
- tags: _json,
565
- });
566
- Object.assign(contents, doc);
567
- return contents;
568
- };
569
- export const de_ListVersionsCommand = async (output, context) => {
570
- if (output.statusCode !== 200 && output.statusCode >= 300) {
571
- return de_CommandError(output, context);
572
- }
573
- const contents = map({
574
- $metadata: deserializeMetadata(output),
575
- });
576
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
577
- const doc = take(data, {
578
- grafanaVersions: _json,
579
- nextToken: __expectString,
580
- });
581
- Object.assign(contents, doc);
582
- return contents;
583
- };
584
- export const de_ListWorkspacesCommand = async (output, context) => {
585
- if (output.statusCode !== 200 && output.statusCode >= 300) {
586
- return de_CommandError(output, context);
587
- }
588
- const contents = map({
589
- $metadata: deserializeMetadata(output),
590
- });
591
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
592
- const doc = take(data, {
593
- nextToken: __expectString,
594
- workspaces: (_) => de_WorkspaceList(_, context),
595
- });
596
- Object.assign(contents, doc);
597
- return contents;
598
- };
599
- export const de_ListWorkspaceServiceAccountsCommand = async (output, context) => {
600
- if (output.statusCode !== 200 && output.statusCode >= 300) {
601
- return de_CommandError(output, context);
602
- }
603
- const contents = map({
604
- $metadata: deserializeMetadata(output),
605
- });
606
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
607
- const doc = take(data, {
608
- nextToken: __expectString,
609
- serviceAccounts: _json,
610
- workspaceId: __expectString,
611
- });
612
- Object.assign(contents, doc);
613
- return contents;
614
- };
615
- export const de_ListWorkspaceServiceAccountTokensCommand = async (output, context) => {
616
- if (output.statusCode !== 200 && output.statusCode >= 300) {
617
- return de_CommandError(output, context);
618
- }
619
- const contents = map({
620
- $metadata: deserializeMetadata(output),
621
- });
622
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
623
- const doc = take(data, {
624
- nextToken: __expectString,
625
- serviceAccountId: __expectString,
626
- serviceAccountTokens: (_) => de_ServiceAccountTokenList(_, context),
627
- workspaceId: __expectString,
628
- });
629
- Object.assign(contents, doc);
630
- return contents;
631
- };
632
- export const de_TagResourceCommand = async (output, context) => {
633
- if (output.statusCode !== 200 && output.statusCode >= 300) {
634
- return de_CommandError(output, context);
635
- }
636
- const contents = map({
637
- $metadata: deserializeMetadata(output),
638
- });
639
- await collectBody(output.body, context);
640
- return contents;
641
- };
642
- export const de_UntagResourceCommand = async (output, context) => {
643
- if (output.statusCode !== 200 && output.statusCode >= 300) {
644
- return de_CommandError(output, context);
645
- }
646
- const contents = map({
647
- $metadata: deserializeMetadata(output),
648
- });
649
- await collectBody(output.body, context);
650
- return contents;
651
- };
652
- export const de_UpdatePermissionsCommand = async (output, context) => {
653
- if (output.statusCode !== 200 && output.statusCode >= 300) {
654
- return de_CommandError(output, context);
655
- }
656
- const contents = map({
657
- $metadata: deserializeMetadata(output),
658
- });
659
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
660
- const doc = take(data, {
661
- errors: _json,
662
- });
663
- Object.assign(contents, doc);
664
- return contents;
665
- };
666
- export const de_UpdateWorkspaceCommand = async (output, context) => {
667
- if (output.statusCode !== 202 && output.statusCode >= 300) {
668
- return de_CommandError(output, context);
669
- }
670
- const contents = map({
671
- $metadata: deserializeMetadata(output),
672
- });
673
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
674
- const doc = take(data, {
675
- workspace: (_) => de_WorkspaceDescription(_, context),
676
- });
677
- Object.assign(contents, doc);
678
- return contents;
679
- };
680
- export const de_UpdateWorkspaceAuthenticationCommand = async (output, context) => {
681
- if (output.statusCode !== 200 && output.statusCode >= 300) {
682
- return de_CommandError(output, context);
683
- }
684
- const contents = map({
685
- $metadata: deserializeMetadata(output),
686
- });
687
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
688
- const doc = take(data, {
689
- authentication: _json,
690
- });
691
- Object.assign(contents, doc);
692
- return contents;
693
- };
694
- export const de_UpdateWorkspaceConfigurationCommand = async (output, context) => {
695
- if (output.statusCode !== 202 && output.statusCode >= 300) {
696
- return de_CommandError(output, context);
697
- }
698
- const contents = map({
699
- $metadata: deserializeMetadata(output),
700
- });
701
- await collectBody(output.body, context);
702
- return contents;
703
- };
704
- const de_CommandError = async (output, context) => {
705
- const parsedOutput = {
706
- ...output,
707
- body: await parseErrorBody(output.body, context),
708
- };
709
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
710
- switch (errorCode) {
711
- case "AccessDeniedException":
712
- case "com.amazonaws.grafana#AccessDeniedException":
713
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
714
- case "InternalServerException":
715
- case "com.amazonaws.grafana#InternalServerException":
716
- throw await de_InternalServerExceptionRes(parsedOutput, context);
717
- case "ResourceNotFoundException":
718
- case "com.amazonaws.grafana#ResourceNotFoundException":
719
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
720
- case "ThrottlingException":
721
- case "com.amazonaws.grafana#ThrottlingException":
722
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
723
- case "ValidationException":
724
- case "com.amazonaws.grafana#ValidationException":
725
- throw await de_ValidationExceptionRes(parsedOutput, context);
726
- case "ConflictException":
727
- case "com.amazonaws.grafana#ConflictException":
728
- throw await de_ConflictExceptionRes(parsedOutput, context);
729
- case "ServiceQuotaExceededException":
730
- case "com.amazonaws.grafana#ServiceQuotaExceededException":
731
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
732
- default:
733
- const parsedBody = parsedOutput.body;
734
- return throwDefaultError({
735
- output,
736
- parsedBody,
737
- errorCode,
738
- });
739
- }
740
- };
741
- const throwDefaultError = withBaseException(__BaseException);
742
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
743
- const contents = map({});
744
- const data = parsedOutput.body;
745
- const doc = take(data, {
746
- message: __expectString,
747
- });
748
- Object.assign(contents, doc);
749
- const exception = new AccessDeniedException({
750
- $metadata: deserializeMetadata(parsedOutput),
751
- ...contents,
752
- });
753
- return __decorateServiceException(exception, parsedOutput.body);
754
- };
755
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
756
- const contents = map({});
757
- const data = parsedOutput.body;
758
- const doc = take(data, {
759
- message: __expectString,
760
- resourceId: __expectString,
761
- resourceType: __expectString,
762
- });
763
- Object.assign(contents, doc);
764
- const exception = new ConflictException({
765
- $metadata: deserializeMetadata(parsedOutput),
766
- ...contents,
767
- });
768
- return __decorateServiceException(exception, parsedOutput.body);
769
- };
770
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
771
- const contents = map({
772
- [_rAS]: [() => void 0 !== parsedOutput.headers[_ra], () => __strictParseInt32(parsedOutput.headers[_ra])],
773
- });
774
- const data = parsedOutput.body;
775
- const doc = take(data, {
776
- message: __expectString,
777
- });
778
- Object.assign(contents, doc);
779
- const exception = new InternalServerException({
780
- $metadata: deserializeMetadata(parsedOutput),
781
- ...contents,
782
- });
783
- return __decorateServiceException(exception, parsedOutput.body);
784
- };
785
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
786
- const contents = map({});
787
- const data = parsedOutput.body;
788
- const doc = take(data, {
789
- message: __expectString,
790
- resourceId: __expectString,
791
- resourceType: __expectString,
792
- });
793
- Object.assign(contents, doc);
794
- const exception = new ResourceNotFoundException({
795
- $metadata: deserializeMetadata(parsedOutput),
796
- ...contents,
797
- });
798
- return __decorateServiceException(exception, parsedOutput.body);
799
- };
800
- const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
801
- const contents = map({});
802
- const data = parsedOutput.body;
803
- const doc = take(data, {
804
- message: __expectString,
805
- quotaCode: __expectString,
806
- resourceId: __expectString,
807
- resourceType: __expectString,
808
- serviceCode: __expectString,
809
- });
810
- Object.assign(contents, doc);
811
- const exception = new ServiceQuotaExceededException({
812
- $metadata: deserializeMetadata(parsedOutput),
813
- ...contents,
814
- });
815
- return __decorateServiceException(exception, parsedOutput.body);
816
- };
817
- const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
818
- const contents = map({
819
- [_rAS]: [() => void 0 !== parsedOutput.headers[_ra], () => __strictParseInt32(parsedOutput.headers[_ra])],
820
- });
821
- const data = parsedOutput.body;
822
- const doc = take(data, {
823
- message: __expectString,
824
- quotaCode: __expectString,
825
- serviceCode: __expectString,
826
- });
827
- Object.assign(contents, doc);
828
- const exception = new ThrottlingException({
829
- $metadata: deserializeMetadata(parsedOutput),
830
- ...contents,
831
- });
832
- return __decorateServiceException(exception, parsedOutput.body);
833
- };
834
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
835
- const contents = map({});
836
- const data = parsedOutput.body;
837
- const doc = take(data, {
838
- fieldList: _json,
839
- message: __expectString,
840
- reason: __expectString,
841
- });
842
- Object.assign(contents, doc);
843
- const exception = new ValidationException({
844
- $metadata: deserializeMetadata(parsedOutput),
845
- ...contents,
846
- });
847
- return __decorateServiceException(exception, parsedOutput.body);
848
- };
849
- const de_ServiceAccountTokenList = (output, context) => {
850
- const retVal = (output || [])
851
- .filter((e) => e != null)
852
- .map((entry) => {
853
- return de_ServiceAccountTokenSummary(entry, context);
854
- });
855
- return retVal;
856
- };
857
- const de_ServiceAccountTokenSummary = (output, context) => {
858
- return take(output, {
859
- createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
860
- expiresAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
861
- id: __expectString,
862
- lastUsedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
863
- name: __expectString,
864
- });
865
- };
866
- const de_WorkspaceDescription = (output, context) => {
867
- return take(output, {
868
- accountAccessType: __expectString,
869
- authentication: _json,
870
- created: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
871
- dataSources: _json,
872
- description: __expectString,
873
- endpoint: __expectString,
874
- freeTrialConsumed: __expectBoolean,
875
- freeTrialExpiration: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
876
- grafanaToken: __expectString,
877
- grafanaVersion: __expectString,
878
- id: __expectString,
879
- licenseExpiration: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
880
- licenseType: __expectString,
881
- modified: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
882
- name: __expectString,
883
- networkAccessControl: _json,
884
- notificationDestinations: _json,
885
- organizationRoleName: __expectString,
886
- organizationalUnits: _json,
887
- permissionType: __expectString,
888
- stackSetName: __expectString,
889
- status: __expectString,
890
- tags: _json,
891
- vpcConfiguration: _json,
892
- workspaceRoleArn: __expectString,
893
- });
894
- };
895
- const de_WorkspaceList = (output, context) => {
896
- const retVal = (output || [])
897
- .filter((e) => e != null)
898
- .map((entry) => {
899
- return de_WorkspaceSummary(entry, context);
900
- });
901
- return retVal;
902
- };
903
- const de_WorkspaceSummary = (output, context) => {
904
- return take(output, {
905
- authentication: _json,
906
- created: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
907
- description: __expectString,
908
- endpoint: __expectString,
909
- grafanaToken: __expectString,
910
- grafanaVersion: __expectString,
911
- id: __expectString,
912
- licenseType: __expectString,
913
- modified: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
914
- name: __expectString,
915
- notificationDestinations: _json,
916
- status: __expectString,
917
- tags: _json,
918
- });
919
- };
920
- const deserializeMetadata = (output) => ({
921
- httpStatusCode: output.statusCode,
922
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
923
- extendedRequestId: output.headers["x-amz-id-2"],
924
- cfId: output.headers["x-amz-cf-id"],
925
- });
926
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
927
- const _gI = "groupId";
928
- const _gT = "grafanaToken";
929
- const _gt = "grafana-token";
930
- const _mR = "maxResults";
931
- const _nT = "nextToken";
932
- const _rAS = "retryAfterSeconds";
933
- const _ra = "retry-after";
934
- const _tK = "tagKeys";
935
- const _uI = "userId";
936
- const _uT = "userType";
937
- const _wI = "workspaceId";
938
- const _wi = "workspace-id";