@aws-sdk/client-resource-groups 3.927.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 (44) hide show
  1. package/dist-cjs/index.js +793 -1042
  2. package/dist-cjs/runtimeConfig.shared.js +2 -0
  3. package/dist-es/ResourceGroupsClient.js +2 -0
  4. package/dist-es/commands/CancelTagSyncTaskCommand.js +3 -9
  5. package/dist-es/commands/CreateGroupCommand.js +3 -9
  6. package/dist-es/commands/DeleteGroupCommand.js +3 -9
  7. package/dist-es/commands/GetAccountSettingsCommand.js +3 -9
  8. package/dist-es/commands/GetGroupCommand.js +3 -9
  9. package/dist-es/commands/GetGroupConfigurationCommand.js +3 -9
  10. package/dist-es/commands/GetGroupQueryCommand.js +3 -9
  11. package/dist-es/commands/GetTagSyncTaskCommand.js +3 -9
  12. package/dist-es/commands/GetTagsCommand.js +3 -9
  13. package/dist-es/commands/GroupResourcesCommand.js +3 -9
  14. package/dist-es/commands/ListGroupResourcesCommand.js +3 -9
  15. package/dist-es/commands/ListGroupingStatusesCommand.js +3 -9
  16. package/dist-es/commands/ListGroupsCommand.js +3 -9
  17. package/dist-es/commands/ListTagSyncTasksCommand.js +3 -9
  18. package/dist-es/commands/PutGroupConfigurationCommand.js +3 -9
  19. package/dist-es/commands/SearchResourcesCommand.js +3 -9
  20. package/dist-es/commands/StartTagSyncTaskCommand.js +3 -9
  21. package/dist-es/commands/TagCommand.js +3 -9
  22. package/dist-es/commands/UngroupResourcesCommand.js +3 -9
  23. package/dist-es/commands/UntagCommand.js +3 -9
  24. package/dist-es/commands/UpdateAccountSettingsCommand.js +3 -9
  25. package/dist-es/commands/UpdateGroupCommand.js +3 -9
  26. package/dist-es/commands/UpdateGroupQueryCommand.js +3 -9
  27. package/dist-es/runtimeConfig.shared.js +2 -0
  28. package/dist-es/schemas/schemas_0.js +736 -0
  29. package/dist-types/ResourceGroupsClient.d.ts +10 -1
  30. package/dist-types/runtimeConfig.browser.d.ts +1 -0
  31. package/dist-types/runtimeConfig.d.ts +1 -0
  32. package/dist-types/runtimeConfig.native.d.ts +1 -0
  33. package/dist-types/runtimeConfig.shared.d.ts +1 -0
  34. package/dist-types/schemas/schemas_0.d.ts +120 -0
  35. package/dist-types/ts3.4/ResourceGroupsClient.d.ts +4 -0
  36. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +4 -0
  37. package/dist-types/ts3.4/runtimeConfig.d.ts +4 -0
  38. package/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -0
  39. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +4 -0
  40. package/dist-types/ts3.4/schemas/schemas_0.d.ts +125 -0
  41. package/package.json +5 -5
  42. package/dist-es/protocols/Aws_restJson1.js +0 -865
  43. package/dist-types/protocols/Aws_restJson1.d.ts +0 -209
  44. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +0 -278
@@ -1,865 +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, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
4
- import { BadRequestException, ForbiddenException, InternalServerErrorException, MethodNotAllowedException, NotFoundException, TooManyRequestsException, UnauthorizedException, } from "../models/models_0";
5
- import { ResourceGroupsServiceException as __BaseException } from "../models/ResourceGroupsServiceException";
6
- export const se_CancelTagSyncTaskCommand = async (input, context) => {
7
- const b = rb(input, context);
8
- const headers = {
9
- "content-type": "application/json",
10
- };
11
- b.bp("/cancel-tag-sync-task");
12
- let body;
13
- body = JSON.stringify(take(input, {
14
- TaskArn: [],
15
- }));
16
- b.m("POST").h(headers).b(body);
17
- return b.build();
18
- };
19
- export const se_CreateGroupCommand = async (input, context) => {
20
- const b = rb(input, context);
21
- const headers = {
22
- "content-type": "application/json",
23
- };
24
- b.bp("/groups");
25
- let body;
26
- body = JSON.stringify(take(input, {
27
- Configuration: (_) => _json(_),
28
- Criticality: [],
29
- Description: [],
30
- DisplayName: [],
31
- Name: [],
32
- Owner: [],
33
- ResourceQuery: (_) => _json(_),
34
- Tags: (_) => _json(_),
35
- }));
36
- b.m("POST").h(headers).b(body);
37
- return b.build();
38
- };
39
- export const se_DeleteGroupCommand = async (input, context) => {
40
- const b = rb(input, context);
41
- const headers = {
42
- "content-type": "application/json",
43
- };
44
- b.bp("/delete-group");
45
- let body;
46
- body = JSON.stringify(take(input, {
47
- Group: [],
48
- GroupName: [],
49
- }));
50
- b.m("POST").h(headers).b(body);
51
- return b.build();
52
- };
53
- export const se_GetAccountSettingsCommand = async (input, context) => {
54
- const b = rb(input, context);
55
- const headers = {};
56
- b.bp("/get-account-settings");
57
- let body;
58
- b.m("POST").h(headers).b(body);
59
- return b.build();
60
- };
61
- export const se_GetGroupCommand = async (input, context) => {
62
- const b = rb(input, context);
63
- const headers = {
64
- "content-type": "application/json",
65
- };
66
- b.bp("/get-group");
67
- let body;
68
- body = JSON.stringify(take(input, {
69
- Group: [],
70
- GroupName: [],
71
- }));
72
- b.m("POST").h(headers).b(body);
73
- return b.build();
74
- };
75
- export const se_GetGroupConfigurationCommand = async (input, context) => {
76
- const b = rb(input, context);
77
- const headers = {
78
- "content-type": "application/json",
79
- };
80
- b.bp("/get-group-configuration");
81
- let body;
82
- body = JSON.stringify(take(input, {
83
- Group: [],
84
- }));
85
- b.m("POST").h(headers).b(body);
86
- return b.build();
87
- };
88
- export const se_GetGroupQueryCommand = async (input, context) => {
89
- const b = rb(input, context);
90
- const headers = {
91
- "content-type": "application/json",
92
- };
93
- b.bp("/get-group-query");
94
- let body;
95
- body = JSON.stringify(take(input, {
96
- Group: [],
97
- GroupName: [],
98
- }));
99
- b.m("POST").h(headers).b(body);
100
- return b.build();
101
- };
102
- export const se_GetTagsCommand = async (input, context) => {
103
- const b = rb(input, context);
104
- const headers = {};
105
- b.bp("/resources/{Arn}/tags");
106
- b.p("Arn", () => input.Arn, "{Arn}", false);
107
- let body;
108
- b.m("GET").h(headers).b(body);
109
- return b.build();
110
- };
111
- export const se_GetTagSyncTaskCommand = async (input, context) => {
112
- const b = rb(input, context);
113
- const headers = {
114
- "content-type": "application/json",
115
- };
116
- b.bp("/get-tag-sync-task");
117
- let body;
118
- body = JSON.stringify(take(input, {
119
- TaskArn: [],
120
- }));
121
- b.m("POST").h(headers).b(body);
122
- return b.build();
123
- };
124
- export const se_GroupResourcesCommand = async (input, context) => {
125
- const b = rb(input, context);
126
- const headers = {
127
- "content-type": "application/json",
128
- };
129
- b.bp("/group-resources");
130
- let body;
131
- body = JSON.stringify(take(input, {
132
- Group: [],
133
- ResourceArns: (_) => _json(_),
134
- }));
135
- b.m("POST").h(headers).b(body);
136
- return b.build();
137
- };
138
- export const se_ListGroupingStatusesCommand = async (input, context) => {
139
- const b = rb(input, context);
140
- const headers = {
141
- "content-type": "application/json",
142
- };
143
- b.bp("/list-grouping-statuses");
144
- let body;
145
- body = JSON.stringify(take(input, {
146
- Filters: (_) => _json(_),
147
- Group: [],
148
- MaxResults: [],
149
- NextToken: [],
150
- }));
151
- b.m("POST").h(headers).b(body);
152
- return b.build();
153
- };
154
- export const se_ListGroupResourcesCommand = async (input, context) => {
155
- const b = rb(input, context);
156
- const headers = {
157
- "content-type": "application/json",
158
- };
159
- b.bp("/list-group-resources");
160
- let body;
161
- body = JSON.stringify(take(input, {
162
- Filters: (_) => _json(_),
163
- Group: [],
164
- GroupName: [],
165
- MaxResults: [],
166
- NextToken: [],
167
- }));
168
- b.m("POST").h(headers).b(body);
169
- return b.build();
170
- };
171
- export const se_ListGroupsCommand = async (input, context) => {
172
- const b = rb(input, context);
173
- const headers = {
174
- "content-type": "application/json",
175
- };
176
- b.bp("/groups-list");
177
- const query = map({
178
- [_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
179
- [_nT]: [, input[_NT]],
180
- });
181
- let body;
182
- body = JSON.stringify(take(input, {
183
- Filters: (_) => _json(_),
184
- }));
185
- b.m("POST").h(headers).q(query).b(body);
186
- return b.build();
187
- };
188
- export const se_ListTagSyncTasksCommand = async (input, context) => {
189
- const b = rb(input, context);
190
- const headers = {
191
- "content-type": "application/json",
192
- };
193
- b.bp("/list-tag-sync-tasks");
194
- let body;
195
- body = JSON.stringify(take(input, {
196
- Filters: (_) => _json(_),
197
- MaxResults: [],
198
- NextToken: [],
199
- }));
200
- b.m("POST").h(headers).b(body);
201
- return b.build();
202
- };
203
- export const se_PutGroupConfigurationCommand = async (input, context) => {
204
- const b = rb(input, context);
205
- const headers = {
206
- "content-type": "application/json",
207
- };
208
- b.bp("/put-group-configuration");
209
- let body;
210
- body = JSON.stringify(take(input, {
211
- Configuration: (_) => _json(_),
212
- Group: [],
213
- }));
214
- b.m("POST").h(headers).b(body);
215
- return b.build();
216
- };
217
- export const se_SearchResourcesCommand = async (input, context) => {
218
- const b = rb(input, context);
219
- const headers = {
220
- "content-type": "application/json",
221
- };
222
- b.bp("/resources/search");
223
- let body;
224
- body = JSON.stringify(take(input, {
225
- MaxResults: [],
226
- NextToken: [],
227
- ResourceQuery: (_) => _json(_),
228
- }));
229
- b.m("POST").h(headers).b(body);
230
- return b.build();
231
- };
232
- export const se_StartTagSyncTaskCommand = async (input, context) => {
233
- const b = rb(input, context);
234
- const headers = {
235
- "content-type": "application/json",
236
- };
237
- b.bp("/start-tag-sync-task");
238
- let body;
239
- body = JSON.stringify(take(input, {
240
- Group: [],
241
- ResourceQuery: (_) => _json(_),
242
- RoleArn: [],
243
- TagKey: [],
244
- TagValue: [],
245
- }));
246
- b.m("POST").h(headers).b(body);
247
- return b.build();
248
- };
249
- export const se_TagCommand = async (input, context) => {
250
- const b = rb(input, context);
251
- const headers = {
252
- "content-type": "application/json",
253
- };
254
- b.bp("/resources/{Arn}/tags");
255
- b.p("Arn", () => input.Arn, "{Arn}", false);
256
- let body;
257
- body = JSON.stringify(take(input, {
258
- Tags: (_) => _json(_),
259
- }));
260
- b.m("PUT").h(headers).b(body);
261
- return b.build();
262
- };
263
- export const se_UngroupResourcesCommand = async (input, context) => {
264
- const b = rb(input, context);
265
- const headers = {
266
- "content-type": "application/json",
267
- };
268
- b.bp("/ungroup-resources");
269
- let body;
270
- body = JSON.stringify(take(input, {
271
- Group: [],
272
- ResourceArns: (_) => _json(_),
273
- }));
274
- b.m("POST").h(headers).b(body);
275
- return b.build();
276
- };
277
- export const se_UntagCommand = async (input, context) => {
278
- const b = rb(input, context);
279
- const headers = {
280
- "content-type": "application/json",
281
- };
282
- b.bp("/resources/{Arn}/tags");
283
- b.p("Arn", () => input.Arn, "{Arn}", false);
284
- let body;
285
- body = JSON.stringify(take(input, {
286
- Keys: (_) => _json(_),
287
- }));
288
- b.m("PATCH").h(headers).b(body);
289
- return b.build();
290
- };
291
- export const se_UpdateAccountSettingsCommand = async (input, context) => {
292
- const b = rb(input, context);
293
- const headers = {
294
- "content-type": "application/json",
295
- };
296
- b.bp("/update-account-settings");
297
- let body;
298
- body = JSON.stringify(take(input, {
299
- GroupLifecycleEventsDesiredStatus: [],
300
- }));
301
- b.m("POST").h(headers).b(body);
302
- return b.build();
303
- };
304
- export const se_UpdateGroupCommand = async (input, context) => {
305
- const b = rb(input, context);
306
- const headers = {
307
- "content-type": "application/json",
308
- };
309
- b.bp("/update-group");
310
- let body;
311
- body = JSON.stringify(take(input, {
312
- Criticality: [],
313
- Description: [],
314
- DisplayName: [],
315
- Group: [],
316
- GroupName: [],
317
- Owner: [],
318
- }));
319
- b.m("POST").h(headers).b(body);
320
- return b.build();
321
- };
322
- export const se_UpdateGroupQueryCommand = async (input, context) => {
323
- const b = rb(input, context);
324
- const headers = {
325
- "content-type": "application/json",
326
- };
327
- b.bp("/update-group-query");
328
- let body;
329
- body = JSON.stringify(take(input, {
330
- Group: [],
331
- GroupName: [],
332
- ResourceQuery: (_) => _json(_),
333
- }));
334
- b.m("POST").h(headers).b(body);
335
- return b.build();
336
- };
337
- export const de_CancelTagSyncTaskCommand = async (output, context) => {
338
- if (output.statusCode !== 200 && output.statusCode >= 300) {
339
- return de_CommandError(output, context);
340
- }
341
- const contents = map({
342
- $metadata: deserializeMetadata(output),
343
- });
344
- await collectBody(output.body, context);
345
- return contents;
346
- };
347
- export const de_CreateGroupCommand = async (output, context) => {
348
- if (output.statusCode !== 200 && output.statusCode >= 300) {
349
- return de_CommandError(output, context);
350
- }
351
- const contents = map({
352
- $metadata: deserializeMetadata(output),
353
- });
354
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
355
- const doc = take(data, {
356
- Group: _json,
357
- GroupConfiguration: _json,
358
- ResourceQuery: _json,
359
- Tags: _json,
360
- });
361
- Object.assign(contents, doc);
362
- return contents;
363
- };
364
- export const de_DeleteGroupCommand = async (output, context) => {
365
- if (output.statusCode !== 200 && output.statusCode >= 300) {
366
- return de_CommandError(output, context);
367
- }
368
- const contents = map({
369
- $metadata: deserializeMetadata(output),
370
- });
371
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
372
- const doc = take(data, {
373
- Group: _json,
374
- });
375
- Object.assign(contents, doc);
376
- return contents;
377
- };
378
- export const de_GetAccountSettingsCommand = async (output, context) => {
379
- if (output.statusCode !== 200 && output.statusCode >= 300) {
380
- return de_CommandError(output, context);
381
- }
382
- const contents = map({
383
- $metadata: deserializeMetadata(output),
384
- });
385
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
386
- const doc = take(data, {
387
- AccountSettings: _json,
388
- });
389
- Object.assign(contents, doc);
390
- return contents;
391
- };
392
- export const de_GetGroupCommand = async (output, context) => {
393
- if (output.statusCode !== 200 && output.statusCode >= 300) {
394
- return de_CommandError(output, context);
395
- }
396
- const contents = map({
397
- $metadata: deserializeMetadata(output),
398
- });
399
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
400
- const doc = take(data, {
401
- Group: _json,
402
- });
403
- Object.assign(contents, doc);
404
- return contents;
405
- };
406
- export const de_GetGroupConfigurationCommand = async (output, context) => {
407
- if (output.statusCode !== 200 && output.statusCode >= 300) {
408
- return de_CommandError(output, context);
409
- }
410
- const contents = map({
411
- $metadata: deserializeMetadata(output),
412
- });
413
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
414
- const doc = take(data, {
415
- GroupConfiguration: _json,
416
- });
417
- Object.assign(contents, doc);
418
- return contents;
419
- };
420
- export const de_GetGroupQueryCommand = async (output, context) => {
421
- if (output.statusCode !== 200 && output.statusCode >= 300) {
422
- return de_CommandError(output, context);
423
- }
424
- const contents = map({
425
- $metadata: deserializeMetadata(output),
426
- });
427
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
428
- const doc = take(data, {
429
- GroupQuery: _json,
430
- });
431
- Object.assign(contents, doc);
432
- return contents;
433
- };
434
- export const de_GetTagsCommand = async (output, context) => {
435
- if (output.statusCode !== 200 && output.statusCode >= 300) {
436
- return de_CommandError(output, context);
437
- }
438
- const contents = map({
439
- $metadata: deserializeMetadata(output),
440
- });
441
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
442
- const doc = take(data, {
443
- Arn: __expectString,
444
- Tags: _json,
445
- });
446
- Object.assign(contents, doc);
447
- return contents;
448
- };
449
- export const de_GetTagSyncTaskCommand = async (output, context) => {
450
- if (output.statusCode !== 200 && output.statusCode >= 300) {
451
- return de_CommandError(output, context);
452
- }
453
- const contents = map({
454
- $metadata: deserializeMetadata(output),
455
- });
456
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
457
- const doc = take(data, {
458
- CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
459
- ErrorMessage: __expectString,
460
- GroupArn: __expectString,
461
- GroupName: __expectString,
462
- ResourceQuery: _json,
463
- RoleArn: __expectString,
464
- Status: __expectString,
465
- TagKey: __expectString,
466
- TagValue: __expectString,
467
- TaskArn: __expectString,
468
- });
469
- Object.assign(contents, doc);
470
- return contents;
471
- };
472
- export const de_GroupResourcesCommand = async (output, context) => {
473
- if (output.statusCode !== 200 && output.statusCode >= 300) {
474
- return de_CommandError(output, context);
475
- }
476
- const contents = map({
477
- $metadata: deserializeMetadata(output),
478
- });
479
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
480
- const doc = take(data, {
481
- Failed: _json,
482
- Pending: _json,
483
- Succeeded: _json,
484
- });
485
- Object.assign(contents, doc);
486
- return contents;
487
- };
488
- export const de_ListGroupingStatusesCommand = async (output, context) => {
489
- if (output.statusCode !== 200 && output.statusCode >= 300) {
490
- return de_CommandError(output, context);
491
- }
492
- const contents = map({
493
- $metadata: deserializeMetadata(output),
494
- });
495
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
496
- const doc = take(data, {
497
- Group: __expectString,
498
- GroupingStatuses: (_) => de_GroupingStatusesList(_, context),
499
- NextToken: __expectString,
500
- });
501
- Object.assign(contents, doc);
502
- return contents;
503
- };
504
- export const de_ListGroupResourcesCommand = async (output, context) => {
505
- if (output.statusCode !== 200 && output.statusCode >= 300) {
506
- return de_CommandError(output, context);
507
- }
508
- const contents = map({
509
- $metadata: deserializeMetadata(output),
510
- });
511
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
512
- const doc = take(data, {
513
- NextToken: __expectString,
514
- QueryErrors: _json,
515
- ResourceIdentifiers: _json,
516
- Resources: _json,
517
- });
518
- Object.assign(contents, doc);
519
- return contents;
520
- };
521
- export const de_ListGroupsCommand = async (output, context) => {
522
- if (output.statusCode !== 200 && output.statusCode >= 300) {
523
- return de_CommandError(output, context);
524
- }
525
- const contents = map({
526
- $metadata: deserializeMetadata(output),
527
- });
528
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
529
- const doc = take(data, {
530
- GroupIdentifiers: _json,
531
- Groups: _json,
532
- NextToken: __expectString,
533
- });
534
- Object.assign(contents, doc);
535
- return contents;
536
- };
537
- export const de_ListTagSyncTasksCommand = async (output, context) => {
538
- if (output.statusCode !== 200 && output.statusCode >= 300) {
539
- return de_CommandError(output, context);
540
- }
541
- const contents = map({
542
- $metadata: deserializeMetadata(output),
543
- });
544
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
545
- const doc = take(data, {
546
- NextToken: __expectString,
547
- TagSyncTasks: (_) => de_TagSyncTaskList(_, context),
548
- });
549
- Object.assign(contents, doc);
550
- return contents;
551
- };
552
- export const de_PutGroupConfigurationCommand = async (output, context) => {
553
- if (output.statusCode !== 202 && output.statusCode >= 300) {
554
- return de_CommandError(output, context);
555
- }
556
- const contents = map({
557
- $metadata: deserializeMetadata(output),
558
- });
559
- await collectBody(output.body, context);
560
- return contents;
561
- };
562
- export const de_SearchResourcesCommand = async (output, context) => {
563
- if (output.statusCode !== 200 && output.statusCode >= 300) {
564
- return de_CommandError(output, context);
565
- }
566
- const contents = map({
567
- $metadata: deserializeMetadata(output),
568
- });
569
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
570
- const doc = take(data, {
571
- NextToken: __expectString,
572
- QueryErrors: _json,
573
- ResourceIdentifiers: _json,
574
- });
575
- Object.assign(contents, doc);
576
- return contents;
577
- };
578
- export const de_StartTagSyncTaskCommand = async (output, context) => {
579
- if (output.statusCode !== 200 && output.statusCode >= 300) {
580
- return de_CommandError(output, context);
581
- }
582
- const contents = map({
583
- $metadata: deserializeMetadata(output),
584
- });
585
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
586
- const doc = take(data, {
587
- GroupArn: __expectString,
588
- GroupName: __expectString,
589
- ResourceQuery: _json,
590
- RoleArn: __expectString,
591
- TagKey: __expectString,
592
- TagValue: __expectString,
593
- TaskArn: __expectString,
594
- });
595
- Object.assign(contents, doc);
596
- return contents;
597
- };
598
- export const de_TagCommand = async (output, context) => {
599
- if (output.statusCode !== 200 && output.statusCode >= 300) {
600
- return de_CommandError(output, context);
601
- }
602
- const contents = map({
603
- $metadata: deserializeMetadata(output),
604
- });
605
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
606
- const doc = take(data, {
607
- Arn: __expectString,
608
- Tags: _json,
609
- });
610
- Object.assign(contents, doc);
611
- return contents;
612
- };
613
- export const de_UngroupResourcesCommand = async (output, context) => {
614
- if (output.statusCode !== 200 && output.statusCode >= 300) {
615
- return de_CommandError(output, context);
616
- }
617
- const contents = map({
618
- $metadata: deserializeMetadata(output),
619
- });
620
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
621
- const doc = take(data, {
622
- Failed: _json,
623
- Pending: _json,
624
- Succeeded: _json,
625
- });
626
- Object.assign(contents, doc);
627
- return contents;
628
- };
629
- export const de_UntagCommand = async (output, context) => {
630
- if (output.statusCode !== 200 && output.statusCode >= 300) {
631
- return de_CommandError(output, context);
632
- }
633
- const contents = map({
634
- $metadata: deserializeMetadata(output),
635
- });
636
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
637
- const doc = take(data, {
638
- Arn: __expectString,
639
- Keys: _json,
640
- });
641
- Object.assign(contents, doc);
642
- return contents;
643
- };
644
- export const de_UpdateAccountSettingsCommand = async (output, context) => {
645
- if (output.statusCode !== 200 && output.statusCode >= 300) {
646
- return de_CommandError(output, context);
647
- }
648
- const contents = map({
649
- $metadata: deserializeMetadata(output),
650
- });
651
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
652
- const doc = take(data, {
653
- AccountSettings: _json,
654
- });
655
- Object.assign(contents, doc);
656
- return contents;
657
- };
658
- export const de_UpdateGroupCommand = async (output, context) => {
659
- if (output.statusCode !== 200 && output.statusCode >= 300) {
660
- return de_CommandError(output, context);
661
- }
662
- const contents = map({
663
- $metadata: deserializeMetadata(output),
664
- });
665
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
666
- const doc = take(data, {
667
- Group: _json,
668
- });
669
- Object.assign(contents, doc);
670
- return contents;
671
- };
672
- export const de_UpdateGroupQueryCommand = async (output, context) => {
673
- if (output.statusCode !== 200 && output.statusCode >= 300) {
674
- return de_CommandError(output, context);
675
- }
676
- const contents = map({
677
- $metadata: deserializeMetadata(output),
678
- });
679
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
680
- const doc = take(data, {
681
- GroupQuery: _json,
682
- });
683
- Object.assign(contents, doc);
684
- return contents;
685
- };
686
- const de_CommandError = async (output, context) => {
687
- const parsedOutput = {
688
- ...output,
689
- body: await parseErrorBody(output.body, context),
690
- };
691
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
692
- switch (errorCode) {
693
- case "BadRequestException":
694
- case "com.amazonaws.resourcegroups#BadRequestException":
695
- throw await de_BadRequestExceptionRes(parsedOutput, context);
696
- case "ForbiddenException":
697
- case "com.amazonaws.resourcegroups#ForbiddenException":
698
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
699
- case "InternalServerErrorException":
700
- case "com.amazonaws.resourcegroups#InternalServerErrorException":
701
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
702
- case "MethodNotAllowedException":
703
- case "com.amazonaws.resourcegroups#MethodNotAllowedException":
704
- throw await de_MethodNotAllowedExceptionRes(parsedOutput, context);
705
- case "TooManyRequestsException":
706
- case "com.amazonaws.resourcegroups#TooManyRequestsException":
707
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
708
- case "UnauthorizedException":
709
- case "com.amazonaws.resourcegroups#UnauthorizedException":
710
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
711
- case "NotFoundException":
712
- case "com.amazonaws.resourcegroups#NotFoundException":
713
- throw await de_NotFoundExceptionRes(parsedOutput, context);
714
- default:
715
- const parsedBody = parsedOutput.body;
716
- return throwDefaultError({
717
- output,
718
- parsedBody,
719
- errorCode,
720
- });
721
- }
722
- };
723
- const throwDefaultError = withBaseException(__BaseException);
724
- const de_BadRequestExceptionRes = async (parsedOutput, context) => {
725
- const contents = map({});
726
- const data = parsedOutput.body;
727
- const doc = take(data, {
728
- Message: __expectString,
729
- });
730
- Object.assign(contents, doc);
731
- const exception = new BadRequestException({
732
- $metadata: deserializeMetadata(parsedOutput),
733
- ...contents,
734
- });
735
- return __decorateServiceException(exception, parsedOutput.body);
736
- };
737
- const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
738
- const contents = map({});
739
- const data = parsedOutput.body;
740
- const doc = take(data, {
741
- Message: __expectString,
742
- });
743
- Object.assign(contents, doc);
744
- const exception = new ForbiddenException({
745
- $metadata: deserializeMetadata(parsedOutput),
746
- ...contents,
747
- });
748
- return __decorateServiceException(exception, parsedOutput.body);
749
- };
750
- const de_InternalServerErrorExceptionRes = async (parsedOutput, context) => {
751
- const contents = map({});
752
- const data = parsedOutput.body;
753
- const doc = take(data, {
754
- Message: __expectString,
755
- });
756
- Object.assign(contents, doc);
757
- const exception = new InternalServerErrorException({
758
- $metadata: deserializeMetadata(parsedOutput),
759
- ...contents,
760
- });
761
- return __decorateServiceException(exception, parsedOutput.body);
762
- };
763
- const de_MethodNotAllowedExceptionRes = async (parsedOutput, context) => {
764
- const contents = map({});
765
- const data = parsedOutput.body;
766
- const doc = take(data, {
767
- Message: __expectString,
768
- });
769
- Object.assign(contents, doc);
770
- const exception = new MethodNotAllowedException({
771
- $metadata: deserializeMetadata(parsedOutput),
772
- ...contents,
773
- });
774
- return __decorateServiceException(exception, parsedOutput.body);
775
- };
776
- const de_NotFoundExceptionRes = async (parsedOutput, context) => {
777
- const contents = map({});
778
- const data = parsedOutput.body;
779
- const doc = take(data, {
780
- Message: __expectString,
781
- });
782
- Object.assign(contents, doc);
783
- const exception = new NotFoundException({
784
- $metadata: deserializeMetadata(parsedOutput),
785
- ...contents,
786
- });
787
- return __decorateServiceException(exception, parsedOutput.body);
788
- };
789
- const de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
790
- const contents = map({});
791
- const data = parsedOutput.body;
792
- const doc = take(data, {
793
- Message: __expectString,
794
- });
795
- Object.assign(contents, doc);
796
- const exception = new TooManyRequestsException({
797
- $metadata: deserializeMetadata(parsedOutput),
798
- ...contents,
799
- });
800
- return __decorateServiceException(exception, parsedOutput.body);
801
- };
802
- const de_UnauthorizedExceptionRes = async (parsedOutput, context) => {
803
- const contents = map({});
804
- const data = parsedOutput.body;
805
- const doc = take(data, {
806
- Message: __expectString,
807
- });
808
- Object.assign(contents, doc);
809
- const exception = new UnauthorizedException({
810
- $metadata: deserializeMetadata(parsedOutput),
811
- ...contents,
812
- });
813
- return __decorateServiceException(exception, parsedOutput.body);
814
- };
815
- const de_GroupingStatusesItem = (output, context) => {
816
- return take(output, {
817
- Action: __expectString,
818
- ErrorCode: __expectString,
819
- ErrorMessage: __expectString,
820
- ResourceArn: __expectString,
821
- Status: __expectString,
822
- UpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
823
- });
824
- };
825
- const de_GroupingStatusesList = (output, context) => {
826
- const retVal = (output || [])
827
- .filter((e) => e != null)
828
- .map((entry) => {
829
- return de_GroupingStatusesItem(entry, context);
830
- });
831
- return retVal;
832
- };
833
- const de_TagSyncTaskItem = (output, context) => {
834
- return take(output, {
835
- CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
836
- ErrorMessage: __expectString,
837
- GroupArn: __expectString,
838
- GroupName: __expectString,
839
- ResourceQuery: _json,
840
- RoleArn: __expectString,
841
- Status: __expectString,
842
- TagKey: __expectString,
843
- TagValue: __expectString,
844
- TaskArn: __expectString,
845
- });
846
- };
847
- const de_TagSyncTaskList = (output, context) => {
848
- const retVal = (output || [])
849
- .filter((e) => e != null)
850
- .map((entry) => {
851
- return de_TagSyncTaskItem(entry, context);
852
- });
853
- return retVal;
854
- };
855
- const deserializeMetadata = (output) => ({
856
- httpStatusCode: output.statusCode,
857
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
858
- extendedRequestId: output.headers["x-amz-id-2"],
859
- cfId: output.headers["x-amz-cf-id"],
860
- });
861
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
862
- const _MR = "MaxResults";
863
- const _NT = "NextToken";
864
- const _mR = "maxResults";
865
- const _nT = "nextToken";