@aws-sdk/client-organizations 3.216.0 → 3.222.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 (39) hide show
  1. package/dist-cjs/Organizations.js +45 -0
  2. package/dist-cjs/commands/DeleteResourcePolicyCommand.js +45 -0
  3. package/dist-cjs/commands/DescribeResourcePolicyCommand.js +46 -0
  4. package/dist-cjs/commands/PutResourcePolicyCommand.js +46 -0
  5. package/dist-cjs/commands/index.js +3 -0
  6. package/dist-cjs/endpoint/ruleset.js +16 -16
  7. package/dist-cjs/models/models_0.js +42 -3
  8. package/dist-cjs/protocols/Aws_json1_1.js +234 -3
  9. package/dist-es/Organizations.js +45 -0
  10. package/dist-es/commands/DeleteResourcePolicyCommand.js +41 -0
  11. package/dist-es/commands/DescribeResourcePolicyCommand.js +42 -0
  12. package/dist-es/commands/PutResourcePolicyCommand.js +42 -0
  13. package/dist-es/commands/index.js +3 -0
  14. package/dist-es/endpoint/ruleset.js +16 -16
  15. package/dist-es/models/models_0.js +33 -0
  16. package/dist-es/protocols/Aws_json1_1.js +226 -1
  17. package/dist-types/Organizations.d.ts +31 -7
  18. package/dist-types/OrganizationsClient.d.ts +5 -2
  19. package/dist-types/commands/AcceptHandshakeCommand.d.ts +1 -1
  20. package/dist-types/commands/CloseAccountCommand.d.ts +3 -3
  21. package/dist-types/commands/CreateAccountCommand.d.ts +2 -2
  22. package/dist-types/commands/DeleteResourcePolicyCommand.d.ts +37 -0
  23. package/dist-types/commands/DescribeResourcePolicyCommand.d.ts +38 -0
  24. package/dist-types/commands/EnableAWSServiceAccessCommand.d.ts +1 -1
  25. package/dist-types/commands/PutResourcePolicyCommand.d.ts +38 -0
  26. package/dist-types/commands/index.d.ts +3 -0
  27. package/dist-types/endpoint/EndpointParameters.d.ts +1 -1
  28. package/dist-types/models/models_0.d.ts +99 -4
  29. package/dist-types/protocols/Aws_json1_1.d.ts +9 -0
  30. package/dist-types/ts3.4/Organizations.d.ts +51 -0
  31. package/dist-types/ts3.4/OrganizationsClient.d.ts +18 -0
  32. package/dist-types/ts3.4/commands/DeleteResourcePolicyCommand.d.ts +34 -0
  33. package/dist-types/ts3.4/commands/DescribeResourcePolicyCommand.d.ts +37 -0
  34. package/dist-types/ts3.4/commands/PutResourcePolicyCommand.d.ts +38 -0
  35. package/dist-types/ts3.4/commands/index.d.ts +3 -0
  36. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +1 -1
  37. package/dist-types/ts3.4/models/models_0.d.ts +49 -0
  38. package/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +36 -0
  39. package/package.json +29 -28
@@ -3,7 +3,7 @@ export const ruleSet = {
3
3
  parameters: {
4
4
  Region: {
5
5
  builtIn: "AWS::Region",
6
- required: false,
6
+ required: true,
7
7
  documentation: "The AWS region used to dispatch the request.",
8
8
  type: "String",
9
9
  },
@@ -200,8 +200,8 @@ export const ruleSet = {
200
200
  authSchemes: [
201
201
  {
202
202
  name: "sigv4",
203
- signingName: "organizations",
204
203
  signingRegion: "us-east-1",
204
+ signingName: "organizations",
205
205
  },
206
206
  ],
207
207
  },
@@ -260,8 +260,8 @@ export const ruleSet = {
260
260
  authSchemes: [
261
261
  {
262
262
  name: "sigv4",
263
- signingName: "organizations",
264
263
  signingRegion: "us-east-1",
264
+ signingName: "organizations",
265
265
  },
266
266
  ],
267
267
  },
@@ -320,8 +320,8 @@ export const ruleSet = {
320
320
  authSchemes: [
321
321
  {
322
322
  name: "sigv4",
323
- signingName: "organizations",
324
323
  signingRegion: "us-east-1",
324
+ signingName: "organizations",
325
325
  },
326
326
  ],
327
327
  },
@@ -346,8 +346,8 @@ export const ruleSet = {
346
346
  authSchemes: [
347
347
  {
348
348
  name: "sigv4",
349
- signingName: "organizations",
350
349
  signingRegion: "us-east-1",
350
+ signingName: "organizations",
351
351
  },
352
352
  ],
353
353
  },
@@ -443,8 +443,8 @@ export const ruleSet = {
443
443
  authSchemes: [
444
444
  {
445
445
  name: "sigv4",
446
- signingName: "organizations",
447
446
  signingRegion: "cn-northwest-1",
447
+ signingName: "organizations",
448
448
  },
449
449
  ],
450
450
  },
@@ -503,8 +503,8 @@ export const ruleSet = {
503
503
  authSchemes: [
504
504
  {
505
505
  name: "sigv4",
506
- signingName: "organizations",
507
506
  signingRegion: "cn-northwest-1",
507
+ signingName: "organizations",
508
508
  },
509
509
  ],
510
510
  },
@@ -563,8 +563,8 @@ export const ruleSet = {
563
563
  authSchemes: [
564
564
  {
565
565
  name: "sigv4",
566
- signingName: "organizations",
567
566
  signingRegion: "cn-northwest-1",
567
+ signingName: "organizations",
568
568
  },
569
569
  ],
570
570
  },
@@ -589,8 +589,8 @@ export const ruleSet = {
589
589
  authSchemes: [
590
590
  {
591
591
  name: "sigv4",
592
- signingName: "organizations",
593
592
  signingRegion: "cn-northwest-1",
593
+ signingName: "organizations",
594
594
  },
595
595
  ],
596
596
  },
@@ -686,8 +686,8 @@ export const ruleSet = {
686
686
  authSchemes: [
687
687
  {
688
688
  name: "sigv4",
689
- signingName: "organizations",
690
689
  signingRegion: "us-gov-west-1",
690
+ signingName: "organizations",
691
691
  },
692
692
  ],
693
693
  },
@@ -746,8 +746,8 @@ export const ruleSet = {
746
746
  authSchemes: [
747
747
  {
748
748
  name: "sigv4",
749
- signingName: "organizations",
750
749
  signingRegion: "us-gov-west-1",
750
+ signingName: "organizations",
751
751
  },
752
752
  ],
753
753
  },
@@ -806,8 +806,8 @@ export const ruleSet = {
806
806
  authSchemes: [
807
807
  {
808
808
  name: "sigv4",
809
- signingName: "organizations",
810
809
  signingRegion: "us-gov-west-1",
810
+ signingName: "organizations",
811
811
  },
812
812
  ],
813
813
  },
@@ -832,8 +832,8 @@ export const ruleSet = {
832
832
  authSchemes: [
833
833
  {
834
834
  name: "sigv4",
835
- signingName: "organizations",
836
835
  signingRegion: "us-gov-west-1",
836
+ signingName: "organizations",
837
837
  },
838
838
  ],
839
839
  },
@@ -1089,8 +1089,8 @@ export const ruleSet = {
1089
1089
  authSchemes: [
1090
1090
  {
1091
1091
  name: "sigv4",
1092
- signingName: "organizations",
1093
1092
  signingRegion: "us-east-1",
1093
+ signingName: "organizations",
1094
1094
  },
1095
1095
  ],
1096
1096
  },
@@ -1116,8 +1116,8 @@ export const ruleSet = {
1116
1116
  authSchemes: [
1117
1117
  {
1118
1118
  name: "sigv4",
1119
- signingName: "organizations",
1120
1119
  signingRegion: "cn-northwest-1",
1120
+ signingName: "organizations",
1121
1121
  },
1122
1122
  ],
1123
1123
  },
@@ -1143,8 +1143,8 @@ export const ruleSet = {
1143
1143
  authSchemes: [
1144
1144
  {
1145
1145
  name: "sigv4",
1146
- signingName: "organizations",
1147
1146
  signingRegion: "us-gov-west-1",
1147
+ signingName: "organizations",
1148
1148
  },
1149
1149
  ],
1150
1150
  },
@@ -170,6 +170,7 @@ export var InvalidInputExceptionReason;
170
170
  InvalidInputExceptionReason["INVALID_PARTY_TYPE_TARGET"] = "INVALID_PARTY_TYPE_TARGET";
171
171
  InvalidInputExceptionReason["INVALID_PATTERN"] = "INVALID_PATTERN";
172
172
  InvalidInputExceptionReason["INVALID_PATTERN_TARGET_ID"] = "INVALID_PATTERN_TARGET_ID";
173
+ InvalidInputExceptionReason["INVALID_RESOURCE_POLICY_JSON"] = "INVALID_RESOURCE_POLICY_JSON";
173
174
  InvalidInputExceptionReason["INVALID_ROLE_NAME"] = "INVALID_ROLE_NAME";
174
175
  InvalidInputExceptionReason["INVALID_SYNTAX_ORGANIZATION"] = "INVALID_SYNTAX_ORGANIZATION_ARN";
175
176
  InvalidInputExceptionReason["INVALID_SYNTAX_POLICY"] = "INVALID_SYNTAX_POLICY_ID";
@@ -182,6 +183,9 @@ export var InvalidInputExceptionReason;
182
183
  InvalidInputExceptionReason["MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS"] = "MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS";
183
184
  InvalidInputExceptionReason["TARGET_NOT_SUPPORTED"] = "TARGET_NOT_SUPPORTED";
184
185
  InvalidInputExceptionReason["UNRECOGNIZED_SERVICE_PRINCIPAL"] = "UNRECOGNIZED_SERVICE_PRINCIPAL";
186
+ InvalidInputExceptionReason["UNSUPPORTED_ACTION_IN_RESOURCE_POLICY"] = "UNSUPPORTED_ACTION_IN_RESOURCE_POLICY";
187
+ InvalidInputExceptionReason["UNSUPPORTED_POLICY_TYPE_IN_RESOURCE_POLICY"] = "UNSUPPORTED_POLICY_TYPE_IN_RESOURCE_POLICY";
188
+ InvalidInputExceptionReason["UNSUPPORTED_RESOURCE_IN_RESOURCE_POLICY"] = "UNSUPPORTED_RESOURCE_IN_RESOURCE_POLICY";
185
189
  })(InvalidInputExceptionReason || (InvalidInputExceptionReason = {}));
186
190
  export class InvalidInputException extends __BaseException {
187
191
  constructor(opts) {
@@ -475,6 +479,7 @@ export var CreateAccountFailureReason;
475
479
  CreateAccountFailureReason["MISSING_PAYMENT_INSTRUMENT"] = "MISSING_PAYMENT_INSTRUMENT";
476
480
  CreateAccountFailureReason["PENDING_BUSINESS_VALIDATIONv"] = "PENDING_BUSINESS_VALIDATION";
477
481
  CreateAccountFailureReason["UNKNOWN_BUSINESS_VALIDATION"] = "UNKNOWN_BUSINESS_VALIDATION";
482
+ CreateAccountFailureReason["UPDATE_EXISTING_RESOURCE_POLICY_WITH_TAGS_NOT_SUPPORTED"] = "UPDATE_EXISTING_RESOURCE_POLICY_WITH_TAGS_NOT_SUPPORTED";
478
483
  })(CreateAccountFailureReason || (CreateAccountFailureReason = {}));
479
484
  export var CreateAccountState;
480
485
  (function (CreateAccountState) {
@@ -630,6 +635,19 @@ export class PolicyInUseException extends __BaseException {
630
635
  this.Message = opts.Message;
631
636
  }
632
637
  }
638
+ export class ResourcePolicyNotFoundException extends __BaseException {
639
+ constructor(opts) {
640
+ super({
641
+ name: "ResourcePolicyNotFoundException",
642
+ $fault: "client",
643
+ ...opts,
644
+ });
645
+ this.name = "ResourcePolicyNotFoundException";
646
+ this.$fault = "client";
647
+ Object.setPrototypeOf(this, ResourcePolicyNotFoundException.prototype);
648
+ this.Message = opts.Message;
649
+ }
650
+ }
633
651
  export class CreateAccountStatusNotFoundException extends __BaseException {
634
652
  constructor(opts) {
635
653
  super({
@@ -936,6 +954,15 @@ export const DescribePolicyRequestFilterSensitiveLog = (obj) => ({
936
954
  export const DescribePolicyResponseFilterSensitiveLog = (obj) => ({
937
955
  ...obj,
938
956
  });
957
+ export const ResourcePolicySummaryFilterSensitiveLog = (obj) => ({
958
+ ...obj,
959
+ });
960
+ export const ResourcePolicyFilterSensitiveLog = (obj) => ({
961
+ ...obj,
962
+ });
963
+ export const DescribeResourcePolicyResponseFilterSensitiveLog = (obj) => ({
964
+ ...obj,
965
+ });
939
966
  export const DetachPolicyRequestFilterSensitiveLog = (obj) => ({
940
967
  ...obj,
941
968
  });
@@ -1092,6 +1119,12 @@ export const ListTargetsForPolicyResponseFilterSensitiveLog = (obj) => ({
1092
1119
  export const MoveAccountRequestFilterSensitiveLog = (obj) => ({
1093
1120
  ...obj,
1094
1121
  });
1122
+ export const PutResourcePolicyRequestFilterSensitiveLog = (obj) => ({
1123
+ ...obj,
1124
+ });
1125
+ export const PutResourcePolicyResponseFilterSensitiveLog = (obj) => ({
1126
+ ...obj,
1127
+ });
1095
1128
  export const RegisterDelegatedAdministratorRequestFilterSensitiveLog = (obj) => ({
1096
1129
  ...obj,
1097
1130
  });
@@ -1,6 +1,6 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
2
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
3
- import { AccessDeniedException, AccessDeniedForDependencyException, AccountAlreadyClosedException, AccountAlreadyRegisteredException, AccountNotFoundException, AccountNotRegisteredException, AccountOwnerNotVerifiedException, AlreadyInOrganizationException, AWSOrganizationsNotInUseException, ChildNotFoundException, ConcurrentModificationException, ConflictException, ConstraintViolationException, CreateAccountStatusNotFoundException, DestinationParentNotFoundException, DuplicateAccountException, DuplicateHandshakeException, DuplicateOrganizationalUnitException, DuplicatePolicyAttachmentException, DuplicatePolicyException, EffectivePolicyNotFoundException, FinalizingOrganizationException, HandshakeAlreadyInStateException, HandshakeConstraintViolationException, HandshakeNotFoundException, InvalidHandshakeTransitionException, InvalidInputException, MalformedPolicyDocumentException, MasterCannotLeaveOrganizationException, OrganizationalUnitNotEmptyException, OrganizationalUnitNotFoundException, OrganizationNotEmptyException, ParentNotFoundException, PolicyChangesInProgressException, PolicyInUseException, PolicyNotAttachedException, PolicyNotFoundException, PolicyTypeAlreadyEnabledException, PolicyTypeNotAvailableForOrganizationException, PolicyTypeNotEnabledException, RootNotFoundException, ServiceException, SourceParentNotFoundException, TargetNotFoundException, TooManyRequestsException, UnsupportedAPIEndpointException, } from "../models/models_0";
3
+ import { AccessDeniedException, AccessDeniedForDependencyException, AccountAlreadyClosedException, AccountAlreadyRegisteredException, AccountNotFoundException, AccountNotRegisteredException, AccountOwnerNotVerifiedException, AlreadyInOrganizationException, AWSOrganizationsNotInUseException, ChildNotFoundException, ConcurrentModificationException, ConflictException, ConstraintViolationException, CreateAccountStatusNotFoundException, DestinationParentNotFoundException, DuplicateAccountException, DuplicateHandshakeException, DuplicateOrganizationalUnitException, DuplicatePolicyAttachmentException, DuplicatePolicyException, EffectivePolicyNotFoundException, FinalizingOrganizationException, HandshakeAlreadyInStateException, HandshakeConstraintViolationException, HandshakeNotFoundException, InvalidHandshakeTransitionException, InvalidInputException, MalformedPolicyDocumentException, MasterCannotLeaveOrganizationException, OrganizationalUnitNotEmptyException, OrganizationalUnitNotFoundException, OrganizationNotEmptyException, ParentNotFoundException, PolicyChangesInProgressException, PolicyInUseException, PolicyNotAttachedException, PolicyNotFoundException, PolicyTypeAlreadyEnabledException, PolicyTypeNotAvailableForOrganizationException, PolicyTypeNotEnabledException, ResourcePolicyNotFoundException, RootNotFoundException, ServiceException, SourceParentNotFoundException, TargetNotFoundException, TooManyRequestsException, UnsupportedAPIEndpointException, } from "../models/models_0";
4
4
  import { OrganizationsServiceException as __BaseException } from "../models/OrganizationsServiceException";
5
5
  export const serializeAws_json1_1AcceptHandshakeCommand = async (input, context) => {
6
6
  const headers = {
@@ -118,6 +118,14 @@ export const serializeAws_json1_1DeletePolicyCommand = async (input, context) =>
118
118
  body = JSON.stringify(serializeAws_json1_1DeletePolicyRequest(input, context));
119
119
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
120
120
  };
121
+ export const serializeAws_json1_1DeleteResourcePolicyCommand = async (input, context) => {
122
+ const headers = {
123
+ "content-type": "application/x-amz-json-1.1",
124
+ "x-amz-target": "AWSOrganizationsV20161128.DeleteResourcePolicy",
125
+ };
126
+ const body = "{}";
127
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
128
+ };
121
129
  export const serializeAws_json1_1DeregisterDelegatedAdministratorCommand = async (input, context) => {
122
130
  const headers = {
123
131
  "content-type": "application/x-amz-json-1.1",
@@ -189,6 +197,14 @@ export const serializeAws_json1_1DescribePolicyCommand = async (input, context)
189
197
  body = JSON.stringify(serializeAws_json1_1DescribePolicyRequest(input, context));
190
198
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
191
199
  };
200
+ export const serializeAws_json1_1DescribeResourcePolicyCommand = async (input, context) => {
201
+ const headers = {
202
+ "content-type": "application/x-amz-json-1.1",
203
+ "x-amz-target": "AWSOrganizationsV20161128.DescribeResourcePolicy",
204
+ };
205
+ const body = "{}";
206
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
207
+ };
192
208
  export const serializeAws_json1_1DetachPolicyCommand = async (input, context) => {
193
209
  const headers = {
194
210
  "content-type": "application/x-amz-json-1.1",
@@ -413,6 +429,15 @@ export const serializeAws_json1_1MoveAccountCommand = async (input, context) =>
413
429
  body = JSON.stringify(serializeAws_json1_1MoveAccountRequest(input, context));
414
430
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
415
431
  };
432
+ export const serializeAws_json1_1PutResourcePolicyCommand = async (input, context) => {
433
+ const headers = {
434
+ "content-type": "application/x-amz-json-1.1",
435
+ "x-amz-target": "AWSOrganizationsV20161128.PutResourcePolicy",
436
+ };
437
+ let body;
438
+ body = JSON.stringify(serializeAws_json1_1PutResourcePolicyRequest(input, context));
439
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
440
+ };
416
441
  export const serializeAws_json1_1RegisterDelegatedAdministratorCommand = async (input, context) => {
417
442
  const headers = {
418
443
  "content-type": "application/x-amz-json-1.1",
@@ -1205,6 +1230,57 @@ const deserializeAws_json1_1DeletePolicyCommandError = async (output, context) =
1205
1230
  });
1206
1231
  }
1207
1232
  };
1233
+ export const deserializeAws_json1_1DeleteResourcePolicyCommand = async (output, context) => {
1234
+ if (output.statusCode >= 300) {
1235
+ return deserializeAws_json1_1DeleteResourcePolicyCommandError(output, context);
1236
+ }
1237
+ await collectBody(output.body, context);
1238
+ const response = {
1239
+ $metadata: deserializeMetadata(output),
1240
+ };
1241
+ return Promise.resolve(response);
1242
+ };
1243
+ const deserializeAws_json1_1DeleteResourcePolicyCommandError = async (output, context) => {
1244
+ const parsedOutput = {
1245
+ ...output,
1246
+ body: await parseErrorBody(output.body, context),
1247
+ };
1248
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1249
+ switch (errorCode) {
1250
+ case "AWSOrganizationsNotInUseException":
1251
+ case "com.amazonaws.organizations#AWSOrganizationsNotInUseException":
1252
+ throw await deserializeAws_json1_1AWSOrganizationsNotInUseExceptionResponse(parsedOutput, context);
1253
+ case "AccessDeniedException":
1254
+ case "com.amazonaws.organizations#AccessDeniedException":
1255
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
1256
+ case "ConcurrentModificationException":
1257
+ case "com.amazonaws.organizations#ConcurrentModificationException":
1258
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
1259
+ case "ConstraintViolationException":
1260
+ case "com.amazonaws.organizations#ConstraintViolationException":
1261
+ throw await deserializeAws_json1_1ConstraintViolationExceptionResponse(parsedOutput, context);
1262
+ case "ResourcePolicyNotFoundException":
1263
+ case "com.amazonaws.organizations#ResourcePolicyNotFoundException":
1264
+ throw await deserializeAws_json1_1ResourcePolicyNotFoundExceptionResponse(parsedOutput, context);
1265
+ case "ServiceException":
1266
+ case "com.amazonaws.organizations#ServiceException":
1267
+ throw await deserializeAws_json1_1ServiceExceptionResponse(parsedOutput, context);
1268
+ case "TooManyRequestsException":
1269
+ case "com.amazonaws.organizations#TooManyRequestsException":
1270
+ throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context);
1271
+ case "UnsupportedAPIEndpointException":
1272
+ case "com.amazonaws.organizations#UnsupportedAPIEndpointException":
1273
+ throw await deserializeAws_json1_1UnsupportedAPIEndpointExceptionResponse(parsedOutput, context);
1274
+ default:
1275
+ const parsedBody = parsedOutput.body;
1276
+ throwDefaultError({
1277
+ output,
1278
+ parsedBody,
1279
+ exceptionCtor: __BaseException,
1280
+ errorCode,
1281
+ });
1282
+ }
1283
+ };
1208
1284
  export const deserializeAws_json1_1DeregisterDelegatedAdministratorCommand = async (output, context) => {
1209
1285
  if (output.statusCode >= 300) {
1210
1286
  return deserializeAws_json1_1DeregisterDelegatedAdministratorCommandError(output, context);
@@ -1610,6 +1686,57 @@ const deserializeAws_json1_1DescribePolicyCommandError = async (output, context)
1610
1686
  });
1611
1687
  }
1612
1688
  };
1689
+ export const deserializeAws_json1_1DescribeResourcePolicyCommand = async (output, context) => {
1690
+ if (output.statusCode >= 300) {
1691
+ return deserializeAws_json1_1DescribeResourcePolicyCommandError(output, context);
1692
+ }
1693
+ const data = await parseBody(output.body, context);
1694
+ let contents = {};
1695
+ contents = deserializeAws_json1_1DescribeResourcePolicyResponse(data, context);
1696
+ const response = {
1697
+ $metadata: deserializeMetadata(output),
1698
+ ...contents,
1699
+ };
1700
+ return Promise.resolve(response);
1701
+ };
1702
+ const deserializeAws_json1_1DescribeResourcePolicyCommandError = async (output, context) => {
1703
+ const parsedOutput = {
1704
+ ...output,
1705
+ body: await parseErrorBody(output.body, context),
1706
+ };
1707
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1708
+ switch (errorCode) {
1709
+ case "AWSOrganizationsNotInUseException":
1710
+ case "com.amazonaws.organizations#AWSOrganizationsNotInUseException":
1711
+ throw await deserializeAws_json1_1AWSOrganizationsNotInUseExceptionResponse(parsedOutput, context);
1712
+ case "AccessDeniedException":
1713
+ case "com.amazonaws.organizations#AccessDeniedException":
1714
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
1715
+ case "ConstraintViolationException":
1716
+ case "com.amazonaws.organizations#ConstraintViolationException":
1717
+ throw await deserializeAws_json1_1ConstraintViolationExceptionResponse(parsedOutput, context);
1718
+ case "ResourcePolicyNotFoundException":
1719
+ case "com.amazonaws.organizations#ResourcePolicyNotFoundException":
1720
+ throw await deserializeAws_json1_1ResourcePolicyNotFoundExceptionResponse(parsedOutput, context);
1721
+ case "ServiceException":
1722
+ case "com.amazonaws.organizations#ServiceException":
1723
+ throw await deserializeAws_json1_1ServiceExceptionResponse(parsedOutput, context);
1724
+ case "TooManyRequestsException":
1725
+ case "com.amazonaws.organizations#TooManyRequestsException":
1726
+ throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context);
1727
+ case "UnsupportedAPIEndpointException":
1728
+ case "com.amazonaws.organizations#UnsupportedAPIEndpointException":
1729
+ throw await deserializeAws_json1_1UnsupportedAPIEndpointExceptionResponse(parsedOutput, context);
1730
+ default:
1731
+ const parsedBody = parsedOutput.body;
1732
+ throwDefaultError({
1733
+ output,
1734
+ parsedBody,
1735
+ exceptionCtor: __BaseException,
1736
+ errorCode,
1737
+ });
1738
+ }
1739
+ };
1613
1740
  export const deserializeAws_json1_1DetachPolicyCommand = async (output, context) => {
1614
1741
  if (output.statusCode >= 300) {
1615
1742
  return deserializeAws_json1_1DetachPolicyCommandError(output, context);
@@ -2909,6 +3036,60 @@ const deserializeAws_json1_1MoveAccountCommandError = async (output, context) =>
2909
3036
  });
2910
3037
  }
2911
3038
  };
3039
+ export const deserializeAws_json1_1PutResourcePolicyCommand = async (output, context) => {
3040
+ if (output.statusCode >= 300) {
3041
+ return deserializeAws_json1_1PutResourcePolicyCommandError(output, context);
3042
+ }
3043
+ const data = await parseBody(output.body, context);
3044
+ let contents = {};
3045
+ contents = deserializeAws_json1_1PutResourcePolicyResponse(data, context);
3046
+ const response = {
3047
+ $metadata: deserializeMetadata(output),
3048
+ ...contents,
3049
+ };
3050
+ return Promise.resolve(response);
3051
+ };
3052
+ const deserializeAws_json1_1PutResourcePolicyCommandError = async (output, context) => {
3053
+ const parsedOutput = {
3054
+ ...output,
3055
+ body: await parseErrorBody(output.body, context),
3056
+ };
3057
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3058
+ switch (errorCode) {
3059
+ case "AWSOrganizationsNotInUseException":
3060
+ case "com.amazonaws.organizations#AWSOrganizationsNotInUseException":
3061
+ throw await deserializeAws_json1_1AWSOrganizationsNotInUseExceptionResponse(parsedOutput, context);
3062
+ case "AccessDeniedException":
3063
+ case "com.amazonaws.organizations#AccessDeniedException":
3064
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
3065
+ case "ConcurrentModificationException":
3066
+ case "com.amazonaws.organizations#ConcurrentModificationException":
3067
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
3068
+ case "ConstraintViolationException":
3069
+ case "com.amazonaws.organizations#ConstraintViolationException":
3070
+ throw await deserializeAws_json1_1ConstraintViolationExceptionResponse(parsedOutput, context);
3071
+ case "InvalidInputException":
3072
+ case "com.amazonaws.organizations#InvalidInputException":
3073
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
3074
+ case "ServiceException":
3075
+ case "com.amazonaws.organizations#ServiceException":
3076
+ throw await deserializeAws_json1_1ServiceExceptionResponse(parsedOutput, context);
3077
+ case "TooManyRequestsException":
3078
+ case "com.amazonaws.organizations#TooManyRequestsException":
3079
+ throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context);
3080
+ case "UnsupportedAPIEndpointException":
3081
+ case "com.amazonaws.organizations#UnsupportedAPIEndpointException":
3082
+ throw await deserializeAws_json1_1UnsupportedAPIEndpointExceptionResponse(parsedOutput, context);
3083
+ default:
3084
+ const parsedBody = parsedOutput.body;
3085
+ throwDefaultError({
3086
+ output,
3087
+ parsedBody,
3088
+ exceptionCtor: __BaseException,
3089
+ errorCode,
3090
+ });
3091
+ }
3092
+ };
2912
3093
  export const deserializeAws_json1_1RegisterDelegatedAdministratorCommand = async (output, context) => {
2913
3094
  if (output.statusCode >= 300) {
2914
3095
  return deserializeAws_json1_1RegisterDelegatedAdministratorCommandError(output, context);
@@ -3602,6 +3783,15 @@ const deserializeAws_json1_1PolicyTypeNotEnabledExceptionResponse = async (parse
3602
3783
  });
3603
3784
  return __decorateServiceException(exception, body);
3604
3785
  };
3786
+ const deserializeAws_json1_1ResourcePolicyNotFoundExceptionResponse = async (parsedOutput, context) => {
3787
+ const body = parsedOutput.body;
3788
+ const deserialized = deserializeAws_json1_1ResourcePolicyNotFoundException(body, context);
3789
+ const exception = new ResourcePolicyNotFoundException({
3790
+ $metadata: deserializeMetadata(parsedOutput),
3791
+ ...deserialized,
3792
+ });
3793
+ return __decorateServiceException(exception, body);
3794
+ };
3605
3795
  const deserializeAws_json1_1RootNotFoundExceptionResponse = async (parsedOutput, context) => {
3606
3796
  const body = parsedOutput.body;
3607
3797
  const deserialized = deserializeAws_json1_1RootNotFoundException(body, context);
@@ -3942,6 +4132,12 @@ const serializeAws_json1_1MoveAccountRequest = (input, context) => {
3942
4132
  ...(input.SourceParentId != null && { SourceParentId: input.SourceParentId }),
3943
4133
  };
3944
4134
  };
4135
+ const serializeAws_json1_1PutResourcePolicyRequest = (input, context) => {
4136
+ return {
4137
+ ...(input.Content != null && { Content: input.Content }),
4138
+ ...(input.Tags != null && { Tags: serializeAws_json1_1Tags(input.Tags, context) }),
4139
+ };
4140
+ };
3945
4141
  const serializeAws_json1_1RegisterDelegatedAdministratorRequest = (input, context) => {
3946
4142
  return {
3947
4143
  ...(input.AccountId != null && { AccountId: input.AccountId }),
@@ -4272,6 +4468,11 @@ const deserializeAws_json1_1DescribePolicyResponse = (output, context) => {
4272
4468
  Policy: output.Policy != null ? deserializeAws_json1_1Policy(output.Policy, context) : undefined,
4273
4469
  };
4274
4470
  };
4471
+ const deserializeAws_json1_1DescribeResourcePolicyResponse = (output, context) => {
4472
+ return {
4473
+ ResourcePolicy: output.ResourcePolicy != null ? deserializeAws_json1_1ResourcePolicy(output.ResourcePolicy, context) : undefined,
4474
+ };
4475
+ };
4275
4476
  const deserializeAws_json1_1DestinationParentNotFoundException = (output, context) => {
4276
4477
  return {
4277
4478
  Message: __expectString(output.Message),
@@ -4732,6 +4933,30 @@ const deserializeAws_json1_1PolicyTypeSummary = (output, context) => {
4732
4933
  Type: __expectString(output.Type),
4733
4934
  };
4734
4935
  };
4936
+ const deserializeAws_json1_1PutResourcePolicyResponse = (output, context) => {
4937
+ return {
4938
+ ResourcePolicy: output.ResourcePolicy != null ? deserializeAws_json1_1ResourcePolicy(output.ResourcePolicy, context) : undefined,
4939
+ };
4940
+ };
4941
+ const deserializeAws_json1_1ResourcePolicy = (output, context) => {
4942
+ return {
4943
+ Content: __expectString(output.Content),
4944
+ ResourcePolicySummary: output.ResourcePolicySummary != null
4945
+ ? deserializeAws_json1_1ResourcePolicySummary(output.ResourcePolicySummary, context)
4946
+ : undefined,
4947
+ };
4948
+ };
4949
+ const deserializeAws_json1_1ResourcePolicyNotFoundException = (output, context) => {
4950
+ return {
4951
+ Message: __expectString(output.Message),
4952
+ };
4953
+ };
4954
+ const deserializeAws_json1_1ResourcePolicySummary = (output, context) => {
4955
+ return {
4956
+ Arn: __expectString(output.Arn),
4957
+ Id: __expectString(output.Id),
4958
+ };
4959
+ };
4735
4960
  const deserializeAws_json1_1Root = (output, context) => {
4736
4961
  return {
4737
4962
  Arn: __expectString(output.Arn),
@@ -12,6 +12,7 @@ import { DeclineHandshakeCommandInput, DeclineHandshakeCommandOutput } from "./c
12
12
  import { DeleteOrganizationalUnitCommandInput, DeleteOrganizationalUnitCommandOutput } from "./commands/DeleteOrganizationalUnitCommand";
13
13
  import { DeleteOrganizationCommandInput, DeleteOrganizationCommandOutput } from "./commands/DeleteOrganizationCommand";
14
14
  import { DeletePolicyCommandInput, DeletePolicyCommandOutput } from "./commands/DeletePolicyCommand";
15
+ import { DeleteResourcePolicyCommandInput, DeleteResourcePolicyCommandOutput } from "./commands/DeleteResourcePolicyCommand";
15
16
  import { DeregisterDelegatedAdministratorCommandInput, DeregisterDelegatedAdministratorCommandOutput } from "./commands/DeregisterDelegatedAdministratorCommand";
16
17
  import { DescribeAccountCommandInput, DescribeAccountCommandOutput } from "./commands/DescribeAccountCommand";
17
18
  import { DescribeCreateAccountStatusCommandInput, DescribeCreateAccountStatusCommandOutput } from "./commands/DescribeCreateAccountStatusCommand";
@@ -20,6 +21,7 @@ import { DescribeHandshakeCommandInput, DescribeHandshakeCommandOutput } from ".
20
21
  import { DescribeOrganizationalUnitCommandInput, DescribeOrganizationalUnitCommandOutput } from "./commands/DescribeOrganizationalUnitCommand";
21
22
  import { DescribeOrganizationCommandInput, DescribeOrganizationCommandOutput } from "./commands/DescribeOrganizationCommand";
22
23
  import { DescribePolicyCommandInput, DescribePolicyCommandOutput } from "./commands/DescribePolicyCommand";
24
+ import { DescribeResourcePolicyCommandInput, DescribeResourcePolicyCommandOutput } from "./commands/DescribeResourcePolicyCommand";
23
25
  import { DetachPolicyCommandInput, DetachPolicyCommandOutput } from "./commands/DetachPolicyCommand";
24
26
  import { DisableAWSServiceAccessCommandInput, DisableAWSServiceAccessCommandOutput } from "./commands/DisableAWSServiceAccessCommand";
25
27
  import { DisablePolicyTypeCommandInput, DisablePolicyTypeCommandOutput } from "./commands/DisablePolicyTypeCommand";
@@ -45,6 +47,7 @@ import { ListRootsCommandInput, ListRootsCommandOutput } from "./commands/ListRo
45
47
  import { ListTagsForResourceCommandInput, ListTagsForResourceCommandOutput } from "./commands/ListTagsForResourceCommand";
46
48
  import { ListTargetsForPolicyCommandInput, ListTargetsForPolicyCommandOutput } from "./commands/ListTargetsForPolicyCommand";
47
49
  import { MoveAccountCommandInput, MoveAccountCommandOutput } from "./commands/MoveAccountCommand";
50
+ import { PutResourcePolicyCommandInput, PutResourcePolicyCommandOutput } from "./commands/PutResourcePolicyCommand";
48
51
  import { RegisterDelegatedAdministratorCommandInput, RegisterDelegatedAdministratorCommandOutput } from "./commands/RegisterDelegatedAdministratorCommand";
49
52
  import { RemoveAccountFromOrganizationCommandInput, RemoveAccountFromOrganizationCommandOutput } from "./commands/RemoveAccountFromOrganizationCommand";
50
53
  import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
@@ -130,7 +133,7 @@ export declare class Organizations extends OrganizationsClient {
130
133
  /**
131
134
  * <p>Sends a response to the originator of a handshake agreeing to the action proposed by
132
135
  * the handshake request.</p>
133
- * <p>This operation can be called only by the following principals when they also have the
136
+ * <p>You can only call this operation by the following principals when they also have the
134
137
  * relevant IAM permissions:</p>
135
138
  * <ul>
136
139
  * <li>
@@ -242,9 +245,9 @@ export declare class Organizations extends OrganizationsClient {
242
245
  * grace period while the account is in SUSPENDED status. </p>
243
246
  * </li>
244
247
  * <li>
245
- * <p>If the Amazon Web Services account you attempt to close is linked to an Amazon Web Services GovCloud (US)
246
- * account, the <code>CloseAccount</code> request will close both accounts. To
247
- * learn important pre-closure details, see <a href="https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/Closing-govcloud-account.html">
248
+ * <p>If the Amazon Web Services account you attempt to close is linked to an Amazon Web Services GovCloud
249
+ * (US) account, the <code>CloseAccount</code> request will close both
250
+ * accounts. To learn important pre-closure details, see <a href="https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/Closing-govcloud-account.html">
248
251
  * Closing an Amazon Web Services GovCloud (US) account</a> in the <i>
249
252
  * Amazon Web Services GovCloud User Guide</i>.</p>
250
253
  * </li>
@@ -266,8 +269,8 @@ export declare class Organizations extends OrganizationsClient {
266
269
  * account. To check the status of the request, do one of the following:</p>
267
270
  * <ul>
268
271
  * <li>
269
- * <p>Use the <code>Id</code> member of the <code>CreateAccountStatus</code>
270
- * response element from this operation to provide as a parameter to the <a>DescribeCreateAccountStatus</a> operation.</p>
272
+ * <p>Use the <code>Id</code> value of the <code>CreateAccountStatus</code> response
273
+ * element from this operation to provide as a parameter to the <a>DescribeCreateAccountStatus</a> operation.</p>
271
274
  * </li>
272
275
  * <li>
273
276
  * <p>Check the CloudTrail log for the <code>CreateAccountResult</code> event. For
@@ -555,6 +558,13 @@ export declare class Organizations extends OrganizationsClient {
555
558
  deletePolicy(args: DeletePolicyCommandInput, options?: __HttpHandlerOptions): Promise<DeletePolicyCommandOutput>;
556
559
  deletePolicy(args: DeletePolicyCommandInput, cb: (err: any, data?: DeletePolicyCommandOutput) => void): void;
557
560
  deletePolicy(args: DeletePolicyCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DeletePolicyCommandOutput) => void): void;
561
+ /**
562
+ * <p>Deletes the resource policy from your organization.</p>
563
+ * <p>You can only call this operation from the organization's management account.</p>
564
+ */
565
+ deleteResourcePolicy(args: DeleteResourcePolicyCommandInput, options?: __HttpHandlerOptions): Promise<DeleteResourcePolicyCommandOutput>;
566
+ deleteResourcePolicy(args: DeleteResourcePolicyCommandInput, cb: (err: any, data?: DeleteResourcePolicyCommandOutput) => void): void;
567
+ deleteResourcePolicy(args: DeleteResourcePolicyCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DeleteResourcePolicyCommandOutput) => void): void;
558
568
  /**
559
569
  * <p>Removes the specified member Amazon Web Services account as a delegated administrator for the
560
570
  * specified Amazon Web Services service.</p>
@@ -646,6 +656,13 @@ export declare class Organizations extends OrganizationsClient {
646
656
  describePolicy(args: DescribePolicyCommandInput, options?: __HttpHandlerOptions): Promise<DescribePolicyCommandOutput>;
647
657
  describePolicy(args: DescribePolicyCommandInput, cb: (err: any, data?: DescribePolicyCommandOutput) => void): void;
648
658
  describePolicy(args: DescribePolicyCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DescribePolicyCommandOutput) => void): void;
659
+ /**
660
+ * <p>Retrieves information about a resource policy.</p>
661
+ * <p>You can only call this operation from the organization's management account or by a member account that is a delegated administrator for an AWS service.</p>
662
+ */
663
+ describeResourcePolicy(args: DescribeResourcePolicyCommandInput, options?: __HttpHandlerOptions): Promise<DescribeResourcePolicyCommandOutput>;
664
+ describeResourcePolicy(args: DescribeResourcePolicyCommandInput, cb: (err: any, data?: DescribeResourcePolicyCommandOutput) => void): void;
665
+ describeResourcePolicy(args: DescribeResourcePolicyCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DescribeResourcePolicyCommandOutput) => void): void;
649
666
  /**
650
667
  * <p>Detaches a policy from a target root, organizational unit (OU), or account.</p>
651
668
  * <important>
@@ -792,7 +809,7 @@ export declare class Organizations extends OrganizationsClient {
792
809
  * Organizations with Other Amazon Web Services Services</a> in the
793
810
  * <i>Organizations User Guide.</i>
794
811
  * </p>
795
- * <p>This operation can be called only from the organization's management account and only
812
+ * <p>You can only call this operation from the organization's management account and only
796
813
  * if the organization has <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html">enabled all
797
814
  * features</a>.</p>
798
815
  */
@@ -1205,6 +1222,13 @@ export declare class Organizations extends OrganizationsClient {
1205
1222
  moveAccount(args: MoveAccountCommandInput, options?: __HttpHandlerOptions): Promise<MoveAccountCommandOutput>;
1206
1223
  moveAccount(args: MoveAccountCommandInput, cb: (err: any, data?: MoveAccountCommandOutput) => void): void;
1207
1224
  moveAccount(args: MoveAccountCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: MoveAccountCommandOutput) => void): void;
1225
+ /**
1226
+ * <p>Creates or updates a resource policy.</p>
1227
+ * <p>You can only call this operation from the organization's management account.</p>
1228
+ */
1229
+ putResourcePolicy(args: PutResourcePolicyCommandInput, options?: __HttpHandlerOptions): Promise<PutResourcePolicyCommandOutput>;
1230
+ putResourcePolicy(args: PutResourcePolicyCommandInput, cb: (err: any, data?: PutResourcePolicyCommandOutput) => void): void;
1231
+ putResourcePolicy(args: PutResourcePolicyCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: PutResourcePolicyCommandOutput) => void): void;
1208
1232
  /**
1209
1233
  * <p>Enables the specified member account to administer the Organizations features of the specified
1210
1234
  * Amazon Web Services service. It grants read-only access to Organizations service data. The account still