@aws-sdk/client-organizations 3.55.0 → 3.59.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 (66) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +28 -27
  3. package/dist-cjs/Organizations.js +15 -0
  4. package/dist-cjs/commands/CloseAccountCommand.js +36 -0
  5. package/dist-cjs/commands/index.js +1 -0
  6. package/dist-cjs/models/models_0.js +44 -4
  7. package/dist-cjs/protocols/Aws_json1_1.js +109 -3
  8. package/dist-es/Organizations.js +15 -0
  9. package/dist-es/commands/CloseAccountCommand.js +39 -0
  10. package/dist-es/commands/index.js +1 -0
  11. package/dist-es/models/models_0.js +36 -0
  12. package/dist-es/protocols/Aws_json1_1.js +133 -1
  13. package/dist-types/Organizations.d.ts +213 -205
  14. package/dist-types/OrganizationsClient.d.ts +31 -29
  15. package/dist-types/commands/AcceptHandshakeCommand.d.ts +8 -7
  16. package/dist-types/commands/AttachPolicyCommand.d.ts +1 -1
  17. package/dist-types/commands/CloseAccountCommand.d.ts +35 -0
  18. package/dist-types/commands/CreateAccountCommand.d.ts +24 -27
  19. package/dist-types/commands/CreateGovCloudAccountCommand.d.ts +39 -40
  20. package/dist-types/commands/CreateOrganizationCommand.d.ts +1 -1
  21. package/dist-types/commands/CreateOrganizationalUnitCommand.d.ts +1 -1
  22. package/dist-types/commands/CreatePolicyCommand.d.ts +1 -1
  23. package/dist-types/commands/DeregisterDelegatedAdministratorCommand.d.ts +6 -6
  24. package/dist-types/commands/DescribeAccountCommand.d.ts +2 -2
  25. package/dist-types/commands/DescribeCreateAccountStatusCommand.d.ts +1 -1
  26. package/dist-types/commands/DescribeEffectivePolicyCommand.d.ts +3 -3
  27. package/dist-types/commands/DescribeOrganizationalUnitCommand.d.ts +1 -1
  28. package/dist-types/commands/DescribePolicyCommand.d.ts +1 -1
  29. package/dist-types/commands/DetachPolicyCommand.d.ts +1 -1
  30. package/dist-types/commands/DisableAWSServiceAccessCommand.d.ts +12 -12
  31. package/dist-types/commands/DisablePolicyTypeCommand.d.ts +2 -2
  32. package/dist-types/commands/EnableAWSServiceAccessCommand.d.ts +9 -8
  33. package/dist-types/commands/EnableAllFeaturesCommand.d.ts +2 -2
  34. package/dist-types/commands/EnablePolicyTypeCommand.d.ts +1 -1
  35. package/dist-types/commands/InviteAccountToOrganizationCommand.d.ts +6 -6
  36. package/dist-types/commands/LeaveOrganizationCommand.d.ts +9 -9
  37. package/dist-types/commands/ListAWSServiceAccessForOrganizationCommand.d.ts +5 -5
  38. package/dist-types/commands/ListAccountsCommand.d.ts +1 -1
  39. package/dist-types/commands/ListAccountsForParentCommand.d.ts +1 -1
  40. package/dist-types/commands/ListChildrenCommand.d.ts +1 -1
  41. package/dist-types/commands/ListCreateAccountStatusCommand.d.ts +1 -1
  42. package/dist-types/commands/ListDelegatedAdministratorsCommand.d.ts +2 -2
  43. package/dist-types/commands/ListDelegatedServicesForAccountCommand.d.ts +2 -2
  44. package/dist-types/commands/ListHandshakesForAccountCommand.d.ts +4 -3
  45. package/dist-types/commands/ListHandshakesForOrganizationCommand.d.ts +5 -4
  46. package/dist-types/commands/ListOrganizationalUnitsForParentCommand.d.ts +1 -1
  47. package/dist-types/commands/ListParentsCommand.d.ts +1 -1
  48. package/dist-types/commands/ListPoliciesCommand.d.ts +1 -1
  49. package/dist-types/commands/ListPoliciesForTargetCommand.d.ts +1 -1
  50. package/dist-types/commands/ListRootsCommand.d.ts +1 -1
  51. package/dist-types/commands/ListTagsForResourceCommand.d.ts +3 -3
  52. package/dist-types/commands/ListTargetsForPolicyCommand.d.ts +1 -1
  53. package/dist-types/commands/RegisterDelegatedAdministratorCommand.d.ts +5 -5
  54. package/dist-types/commands/RemoveAccountFromOrganizationCommand.d.ts +7 -7
  55. package/dist-types/commands/TagResourceCommand.d.ts +2 -2
  56. package/dist-types/commands/UntagResourceCommand.d.ts +2 -2
  57. package/dist-types/commands/index.d.ts +1 -0
  58. package/dist-types/models/models_0.d.ts +255 -148
  59. package/dist-types/protocols/Aws_json1_1.d.ts +3 -0
  60. package/dist-types/ts3.4/Organizations.d.ts +5 -0
  61. package/dist-types/ts3.4/OrganizationsClient.d.ts +3 -2
  62. package/dist-types/ts3.4/commands/CloseAccountCommand.d.ts +17 -0
  63. package/dist-types/ts3.4/commands/index.d.ts +1 -0
  64. package/dist-types/ts3.4/models/models_0.d.ts +30 -0
  65. package/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +3 -0
  66. package/package.json +18 -18
package/CHANGELOG.md CHANGED
@@ -3,6 +3,33 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.59.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.58.0...v3.59.0) (2022-03-29)
7
+
8
+
9
+ ### Features
10
+
11
+ * **client-organizations:** This release provides the new CloseAccount API that enables principals in the management account to close any member account within an organization. ([be368b0](https://github.com/aws/aws-sdk-js-v3/commit/be368b035fc95aeba02ded15ce4ddfe02e22d488))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.58.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.57.0...v3.58.0) (2022-03-28)
18
+
19
+ **Note:** Version bump only for package @aws-sdk/client-organizations
20
+
21
+
22
+
23
+
24
+
25
+ # [3.56.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.55.0...v3.56.0) (2022-03-24)
26
+
27
+ **Note:** Version bump only for package @aws-sdk/client-organizations
28
+
29
+
30
+
31
+
32
+
6
33
  # [3.55.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.54.1...v3.55.0) (2022-03-21)
7
34
 
8
35
  **Note:** Version bump only for package @aws-sdk/client-organizations
package/README.md CHANGED
@@ -7,39 +7,39 @@
7
7
 
8
8
  AWS SDK for JavaScript Organizations Client for Node.js, Browser and React Native.
9
9
 
10
- <p>AWS Organizations is a web service that enables you to consolidate your multiple AWS accounts
11
- into an <i>organization</i> and centrally manage your accounts and their
12
- resources.</p>
13
- <p>This guide provides descriptions of the Organizations operations. For more information about
14
- using this service, see the <a href="http://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html">AWS Organizations User Guide</a>.</p>
10
+ <p>Organizations is a web service that enables you to consolidate your multiple
11
+ Amazon Web Services accounts into an <i>organization</i> and centrally manage your
12
+ accounts and their resources.</p>
13
+ <p>This guide provides descriptions of the Organizations operations. For more
14
+ information about using this service, see the <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html">Organizations User Guide</a>.</p>
15
15
  <p>
16
- <b>Support and feedback for AWS Organizations</b>
16
+ <b>Support and feedback for Organizations</b>
17
17
  </p>
18
18
  <p>We welcome your feedback. Send your comments to <a href="mailto:feedback-awsorganizations@amazon.com">feedback-awsorganizations@amazon.com</a> or post your feedback and questions in
19
- the <a href="http://forums.aws.amazon.com/forum.jspa?forumID=219">AWS Organizations support forum</a>. For
20
- more information about the AWS support forums, see <a href="http://forums.aws.amazon.com/help.jspa">Forums Help</a>.</p>
19
+ the <a href="http://forums.aws.amazon.com/forum.jspa?forumID=219">Organizations support forum</a>. For
20
+ more information about the Amazon Web Services support forums, see <a href="http://forums.aws.amazon.com/help.jspa">Forums Help</a>.</p>
21
21
  <p>
22
- <b>Endpoint to call When using the AWS CLI or the AWS
22
+ <b>Endpoint to call When using the CLI or the Amazon Web Services
23
23
  SDK</b>
24
24
  </p>
25
- <p>For the current release of Organizations, specify the <code>us-east-1</code> region for all
26
- AWS API and AWS CLI calls made from the commercial AWS Regions outside of China. If
27
- calling from one of the AWS Regions in China, then specify
28
- <code>cn-northwest-1</code>. You can do this in the AWS CLI by using these parameters and
29
- commands:</p>
25
+ <p>For the current release of Organizations, specify the <code>us-east-1</code> region
26
+ for all Amazon Web Services API and CLI calls made from the commercial Amazon Web Services Regions outside of
27
+ China. If calling from one of the Amazon Web Services Regions in China, then specify
28
+ <code>cn-northwest-1</code>. You can do this in the CLI by using these parameters
29
+ and commands:</p>
30
30
  <ul>
31
31
  <li>
32
32
  <p>Use the following parameter with each command to specify both the endpoint and
33
33
  its region:</p>
34
34
  <p>
35
35
  <code>--endpoint-url https://organizations.us-east-1.amazonaws.com</code>
36
- <i>(from commercial AWS Regions outside of China)</i>
36
+ <i>(from commercial Amazon Web Services Regions outside of China)</i>
37
37
  </p>
38
38
  <p>or</p>
39
39
  <p>
40
40
  <code>--endpoint-url
41
41
  https://organizations.cn-northwest-1.amazonaws.com.cn</code>
42
- <i>(from AWS Regions in China)</i>
42
+ <i>(from Amazon Web Services Regions in China)</i>
43
43
  </p>
44
44
  </li>
45
45
  <li>
@@ -47,37 +47,38 @@ https://organizations.cn-northwest-1.amazonaws.com.cn</code>
47
47
  command:</p>
48
48
  <p>
49
49
  <code>aws configure set default.region us-east-1</code>
50
- <i>(from commercial AWS Regions outside of China)</i>
50
+ <i>(from commercial Amazon Web Services Regions outside of China)</i>
51
51
  </p>
52
52
  <p>or</p>
53
53
  <p>
54
54
  <code>aws configure set default.region cn-northwest-1</code>
55
- <i>(from AWS Regions in China)</i>
55
+ <i>(from Amazon Web Services Regions in China)</i>
56
56
  </p>
57
57
  </li>
58
58
  <li>
59
59
  <p>Use the following parameter with each command to specify the endpoint:</p>
60
60
  <p>
61
61
  <code>--region us-east-1</code>
62
- <i>(from commercial AWS Regions outside of China)</i>
62
+ <i>(from commercial Amazon Web Services Regions outside of China)</i>
63
63
  </p>
64
64
  <p>or</p>
65
65
  <p>
66
66
  <code>--region cn-northwest-1</code>
67
- <i>(from AWS Regions in China)</i>
67
+ <i>(from Amazon Web Services Regions in China)</i>
68
68
  </p>
69
69
  </li>
70
70
  </ul>
71
71
  <p>
72
72
  <b>Recording API Requests</b>
73
73
  </p>
74
- <p>AWS Organizations supports AWS CloudTrail, a service that records AWS API calls for your AWS
75
- account and delivers log files to an Amazon S3 bucket. By using information collected by
76
- AWS CloudTrail, you can determine which requests the Organizations service received, who made the request
77
- and when, and so on. For more about AWS Organizations and its support for AWS CloudTrail, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_incident-response.html#orgs_cloudtrail-integration">Logging
78
- AWS Organizations Events with AWS CloudTrail</a> in the <i>AWS Organizations User Guide</i>.
79
- To learn more about AWS CloudTrail, including how to turn it on and find your log files, see the
80
- <a href="http://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html">AWS CloudTrail User Guide</a>.</p>
74
+ <p>Organizations supports CloudTrail, a service that records Amazon Web Services API calls for your
75
+ Amazon Web Services account and delivers log files to an Amazon S3 bucket. By using information collected
76
+ by CloudTrail, you can determine which requests the Organizations service received, who made the
77
+ request and when, and so on. For more about Organizations and its support for CloudTrail, see
78
+ <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_incident-response.html#orgs_cloudtrail-integration">Logging
79
+ Organizations Events with CloudTrail</a> in the <i>Organizations User Guide</i>.
80
+ To learn more about CloudTrail, including how to turn it on and find your log files, see the
81
+ <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html">CloudTrail User Guide</a>.</p>
81
82
 
82
83
  ## Installing
83
84
 
@@ -4,6 +4,7 @@ exports.Organizations = void 0;
4
4
  const AcceptHandshakeCommand_1 = require("./commands/AcceptHandshakeCommand");
5
5
  const AttachPolicyCommand_1 = require("./commands/AttachPolicyCommand");
6
6
  const CancelHandshakeCommand_1 = require("./commands/CancelHandshakeCommand");
7
+ const CloseAccountCommand_1 = require("./commands/CloseAccountCommand");
7
8
  const CreateAccountCommand_1 = require("./commands/CreateAccountCommand");
8
9
  const CreateGovCloudAccountCommand_1 = require("./commands/CreateGovCloudAccountCommand");
9
10
  const CreateOrganizationalUnitCommand_1 = require("./commands/CreateOrganizationalUnitCommand");
@@ -96,6 +97,20 @@ class Organizations extends OrganizationsClient_1.OrganizationsClient {
96
97
  return this.send(command, optionsOrCb);
97
98
  }
98
99
  }
100
+ closeAccount(args, optionsOrCb, cb) {
101
+ const command = new CloseAccountCommand_1.CloseAccountCommand(args);
102
+ if (typeof optionsOrCb === "function") {
103
+ this.send(command, optionsOrCb);
104
+ }
105
+ else if (typeof cb === "function") {
106
+ if (typeof optionsOrCb !== "object")
107
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
108
+ this.send(command, optionsOrCb || {}, cb);
109
+ }
110
+ else {
111
+ return this.send(command, optionsOrCb);
112
+ }
113
+ }
99
114
  createAccount(args, optionsOrCb, cb) {
100
115
  const command = new CreateAccountCommand_1.CreateAccountCommand(args);
101
116
  if (typeof optionsOrCb === "function") {
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CloseAccountCommand = void 0;
4
+ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
5
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const models_0_1 = require("../models/models_0");
7
+ const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
8
+ class CloseAccountCommand extends smithy_client_1.Command {
9
+ constructor(input) {
10
+ super();
11
+ this.input = input;
12
+ }
13
+ resolveMiddleware(clientStack, configuration, options) {
14
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
15
+ const stack = clientStack.concat(this.middlewareStack);
16
+ const { logger } = configuration;
17
+ const clientName = "OrganizationsClient";
18
+ const commandName = "CloseAccountCommand";
19
+ const handlerExecutionContext = {
20
+ logger,
21
+ clientName,
22
+ commandName,
23
+ inputFilterSensitiveLog: models_0_1.CloseAccountRequest.filterSensitiveLog,
24
+ outputFilterSensitiveLog: (output) => output,
25
+ };
26
+ const { requestHandler } = configuration;
27
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
28
+ }
29
+ serialize(input, context) {
30
+ return (0, Aws_json1_1_1.serializeAws_json1_1CloseAccountCommand)(input, context);
31
+ }
32
+ deserialize(output, context) {
33
+ return (0, Aws_json1_1_1.deserializeAws_json1_1CloseAccountCommand)(output, context);
34
+ }
35
+ }
36
+ exports.CloseAccountCommand = CloseAccountCommand;
@@ -4,6 +4,7 @@ const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./AcceptHandshakeCommand"), exports);
5
5
  tslib_1.__exportStar(require("./AttachPolicyCommand"), exports);
6
6
  tslib_1.__exportStar(require("./CancelHandshakeCommand"), exports);
7
+ tslib_1.__exportStar(require("./CloseAccountCommand"), exports);
7
8
  tslib_1.__exportStar(require("./CreateAccountCommand"), exports);
8
9
  tslib_1.__exportStar(require("./CreateGovCloudAccountCommand"), exports);
9
10
  tslib_1.__exportStar(require("./CreateOrganizationCommand"), exports);
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreateOrganizationRequest = exports.OrganizationFeatureSet = exports.CreateGovCloudAccountResponse = exports.CreateGovCloudAccountRequest = exports.FinalizingOrganizationException = exports.CreateAccountResponse = exports.CreateAccountStatus = exports.CreateAccountState = exports.CreateAccountFailureReason = exports.CreateAccountRequest = exports.Tag = exports.IAMUserAccessToBilling = exports.CancelHandshakeRequest = exports.UnsupportedAPIEndpointException = exports.TargetNotFoundException = exports.PolicyTypeNotEnabledException = exports.PolicyNotFoundException = exports.PolicyChangesInProgressException = exports.DuplicatePolicyAttachmentException = exports.ConstraintViolationException = exports.ConstraintViolationExceptionReason = exports.AttachPolicyRequest = exports.AlreadyInOrganizationException = exports.AccountOwnerNotVerifiedException = exports.AccountNotRegisteredException = exports.AccountNotFoundException = exports.AccountAlreadyRegisteredException = exports.Account = exports.AccountStatus = exports.AccountJoinedMethod = exports.TooManyRequestsException = exports.ServiceException = exports.InvalidInputException = exports.InvalidInputExceptionReason = exports.InvalidHandshakeTransitionException = exports.HandshakeNotFoundException = exports.HandshakeConstraintViolationException = exports.HandshakeConstraintViolationExceptionReason = exports.HandshakeAlreadyInStateException = exports.ConcurrentModificationException = exports.AWSOrganizationsNotInUseException = exports.AccessDeniedForDependencyException = exports.AccessDeniedForDependencyExceptionReason = exports.AccessDeniedException = exports.HandshakeState = exports.HandshakeResourceType = exports.HandshakeParty = exports.HandshakePartyType = exports.ActionType = exports.AcceptHandshakeRequest = void 0;
4
- exports.EnableAWSServiceAccessRequest = exports.EnableAllFeaturesRequest = exports.RootNotFoundException = exports.DisablePolicyTypeResponse = exports.Root = exports.DisablePolicyTypeRequest = exports.DisableAWSServiceAccessRequest = exports.PolicyNotAttachedException = exports.DetachPolicyRequest = exports.DescribePolicyResponse = exports.DescribePolicyRequest = exports.DescribeOrganizationalUnitResponse = exports.DescribeOrganizationalUnitRequest = exports.DescribeOrganizationResponse = exports.DescribeHandshakeRequest = exports.EffectivePolicyNotFoundException = exports.DescribeEffectivePolicyResponse = exports.EffectivePolicy = exports.DescribeEffectivePolicyRequest = exports.EffectivePolicyType = exports.DescribeCreateAccountStatusResponse = exports.DescribeCreateAccountStatusRequest = exports.CreateAccountStatusNotFoundException = exports.DescribeAccountResponse = exports.DescribeAccountRequest = exports.DeregisterDelegatedAdministratorRequest = exports.PolicyInUseException = exports.DeletePolicyRequest = exports.OrganizationalUnitNotFoundException = exports.OrganizationalUnitNotEmptyException = exports.DeleteOrganizationalUnitRequest = exports.OrganizationNotEmptyException = exports.DeclineHandshakeRequest = exports.PolicyTypeNotAvailableForOrganizationException = exports.MalformedPolicyDocumentException = exports.DuplicatePolicyException = exports.CreatePolicyResponse = exports.Policy = exports.PolicySummary = exports.CreatePolicyRequest = exports.ParentNotFoundException = exports.DuplicateOrganizationalUnitException = exports.CreateOrganizationalUnitResponse = exports.OrganizationalUnit = exports.CreateOrganizationalUnitRequest = exports.CreateOrganizationResponse = exports.Organization = exports.PolicyTypeSummary = exports.PolicyType = exports.PolicyTypeStatus = void 0;
5
- exports.MoveAccountRequest = exports.DuplicateAccountException = exports.DestinationParentNotFoundException = exports.ListTargetsForPolicyResponse = exports.PolicyTargetSummary = exports.TargetType = exports.ListTargetsForPolicyRequest = exports.ListTagsForResourceResponse = exports.ListTagsForResourceRequest = exports.ListRootsResponse = exports.ListRootsRequest = exports.ListPoliciesForTargetResponse = exports.ListPoliciesForTargetRequest = exports.ListPoliciesResponse = exports.ListPoliciesRequest = exports.ListParentsResponse = exports.Parent = exports.ParentType = exports.ListParentsRequest = exports.ChildNotFoundException = exports.ListOrganizationalUnitsForParentResponse = exports.ListOrganizationalUnitsForParentRequest = exports.ListHandshakesForOrganizationRequest = exports.ListHandshakesForAccountRequest = exports.HandshakeFilter = exports.ListDelegatedServicesForAccountResponse = exports.DelegatedService = exports.ListDelegatedServicesForAccountRequest = exports.ListDelegatedAdministratorsResponse = exports.DelegatedAdministrator = exports.ListDelegatedAdministratorsRequest = exports.ListCreateAccountStatusResponse = exports.ListCreateAccountStatusRequest = exports.ListChildrenResponse = exports.Child = exports.ListChildrenRequest = exports.ChildType = exports.ListAWSServiceAccessForOrganizationResponse = exports.EnabledServicePrincipal = exports.ListAWSServiceAccessForOrganizationRequest = exports.ListAccountsForParentResponse = exports.ListAccountsForParentRequest = exports.ListAccountsResponse = exports.ListAccountsRequest = exports.MasterCannotLeaveOrganizationException = exports.InviteAccountToOrganizationRequest = exports.DuplicateHandshakeException = exports.PolicyTypeAlreadyEnabledException = exports.EnablePolicyTypeResponse = exports.EnablePolicyTypeRequest = void 0;
6
- exports.ListHandshakesForOrganizationResponse = exports.ListHandshakesForAccountResponse = exports.InviteAccountToOrganizationResponse = exports.EnableAllFeaturesResponse = exports.DescribeHandshakeResponse = exports.DeclineHandshakeResponse = exports.CancelHandshakeResponse = exports.AcceptHandshakeResponse = exports.Handshake = exports.HandshakeResource = exports.UpdatePolicyResponse = exports.UpdatePolicyRequest = exports.UpdateOrganizationalUnitResponse = exports.UpdateOrganizationalUnitRequest = exports.UntagResourceRequest = exports.TagResourceRequest = exports.RemoveAccountFromOrganizationRequest = exports.RegisterDelegatedAdministratorRequest = exports.SourceParentNotFoundException = void 0;
3
+ exports.CreateGovCloudAccountRequest = exports.FinalizingOrganizationException = exports.CreateAccountResponse = exports.CreateAccountStatus = exports.CreateAccountState = exports.CreateAccountFailureReason = exports.CreateAccountRequest = exports.Tag = exports.IAMUserAccessToBilling = exports.ConflictException = exports.CloseAccountRequest = exports.CancelHandshakeRequest = exports.UnsupportedAPIEndpointException = exports.TargetNotFoundException = exports.PolicyTypeNotEnabledException = exports.PolicyNotFoundException = exports.PolicyChangesInProgressException = exports.DuplicatePolicyAttachmentException = exports.ConstraintViolationException = exports.ConstraintViolationExceptionReason = exports.AttachPolicyRequest = exports.AlreadyInOrganizationException = exports.AccountOwnerNotVerifiedException = exports.AccountNotRegisteredException = exports.AccountNotFoundException = exports.AccountAlreadyRegisteredException = exports.AccountAlreadyClosedException = exports.Account = exports.AccountStatus = exports.AccountJoinedMethod = exports.TooManyRequestsException = exports.ServiceException = exports.InvalidInputException = exports.InvalidInputExceptionReason = exports.InvalidHandshakeTransitionException = exports.HandshakeNotFoundException = exports.HandshakeConstraintViolationException = exports.HandshakeConstraintViolationExceptionReason = exports.HandshakeAlreadyInStateException = exports.ConcurrentModificationException = exports.AWSOrganizationsNotInUseException = exports.AccessDeniedForDependencyException = exports.AccessDeniedForDependencyExceptionReason = exports.AccessDeniedException = exports.HandshakeState = exports.HandshakeResourceType = exports.HandshakeParty = exports.HandshakePartyType = exports.ActionType = exports.AcceptHandshakeRequest = void 0;
4
+ exports.DisablePolicyTypeResponse = exports.Root = exports.DisablePolicyTypeRequest = exports.DisableAWSServiceAccessRequest = exports.PolicyNotAttachedException = exports.DetachPolicyRequest = exports.DescribePolicyResponse = exports.DescribePolicyRequest = exports.DescribeOrganizationalUnitResponse = exports.DescribeOrganizationalUnitRequest = exports.DescribeOrganizationResponse = exports.DescribeHandshakeRequest = exports.EffectivePolicyNotFoundException = exports.DescribeEffectivePolicyResponse = exports.EffectivePolicy = exports.DescribeEffectivePolicyRequest = exports.EffectivePolicyType = exports.DescribeCreateAccountStatusResponse = exports.DescribeCreateAccountStatusRequest = exports.CreateAccountStatusNotFoundException = exports.DescribeAccountResponse = exports.DescribeAccountRequest = exports.DeregisterDelegatedAdministratorRequest = exports.PolicyInUseException = exports.DeletePolicyRequest = exports.OrganizationalUnitNotFoundException = exports.OrganizationalUnitNotEmptyException = exports.DeleteOrganizationalUnitRequest = exports.OrganizationNotEmptyException = exports.DeclineHandshakeRequest = exports.PolicyTypeNotAvailableForOrganizationException = exports.MalformedPolicyDocumentException = exports.DuplicatePolicyException = exports.CreatePolicyResponse = exports.Policy = exports.PolicySummary = exports.CreatePolicyRequest = exports.ParentNotFoundException = exports.DuplicateOrganizationalUnitException = exports.CreateOrganizationalUnitResponse = exports.OrganizationalUnit = exports.CreateOrganizationalUnitRequest = exports.CreateOrganizationResponse = exports.Organization = exports.PolicyTypeSummary = exports.PolicyType = exports.PolicyTypeStatus = exports.CreateOrganizationRequest = exports.OrganizationFeatureSet = exports.CreateGovCloudAccountResponse = void 0;
5
+ exports.ListTargetsForPolicyResponse = exports.PolicyTargetSummary = exports.TargetType = exports.ListTargetsForPolicyRequest = exports.ListTagsForResourceResponse = exports.ListTagsForResourceRequest = exports.ListRootsResponse = exports.ListRootsRequest = exports.ListPoliciesForTargetResponse = exports.ListPoliciesForTargetRequest = exports.ListPoliciesResponse = exports.ListPoliciesRequest = exports.ListParentsResponse = exports.Parent = exports.ParentType = exports.ListParentsRequest = exports.ChildNotFoundException = exports.ListOrganizationalUnitsForParentResponse = exports.ListOrganizationalUnitsForParentRequest = exports.ListHandshakesForOrganizationRequest = exports.ListHandshakesForAccountRequest = exports.HandshakeFilter = exports.ListDelegatedServicesForAccountResponse = exports.DelegatedService = exports.ListDelegatedServicesForAccountRequest = exports.ListDelegatedAdministratorsResponse = exports.DelegatedAdministrator = exports.ListDelegatedAdministratorsRequest = exports.ListCreateAccountStatusResponse = exports.ListCreateAccountStatusRequest = exports.ListChildrenResponse = exports.Child = exports.ListChildrenRequest = exports.ChildType = exports.ListAWSServiceAccessForOrganizationResponse = exports.EnabledServicePrincipal = exports.ListAWSServiceAccessForOrganizationRequest = exports.ListAccountsForParentResponse = exports.ListAccountsForParentRequest = exports.ListAccountsResponse = exports.ListAccountsRequest = exports.MasterCannotLeaveOrganizationException = exports.InviteAccountToOrganizationRequest = exports.DuplicateHandshakeException = exports.PolicyTypeAlreadyEnabledException = exports.EnablePolicyTypeResponse = exports.EnablePolicyTypeRequest = exports.EnableAWSServiceAccessRequest = exports.EnableAllFeaturesRequest = exports.RootNotFoundException = void 0;
6
+ exports.ListHandshakesForOrganizationResponse = exports.ListHandshakesForAccountResponse = exports.InviteAccountToOrganizationResponse = exports.EnableAllFeaturesResponse = exports.DescribeHandshakeResponse = exports.DeclineHandshakeResponse = exports.CancelHandshakeResponse = exports.AcceptHandshakeResponse = exports.Handshake = exports.HandshakeResource = exports.UpdatePolicyResponse = exports.UpdatePolicyRequest = exports.UpdateOrganizationalUnitResponse = exports.UpdateOrganizationalUnitRequest = exports.UntagResourceRequest = exports.TagResourceRequest = exports.RemoveAccountFromOrganizationRequest = exports.RegisterDelegatedAdministratorRequest = exports.SourceParentNotFoundException = exports.MoveAccountRequest = exports.DuplicateAccountException = exports.DestinationParentNotFoundException = void 0;
7
7
  const smithy_client_1 = require("@aws-sdk/smithy-client");
8
8
  const OrganizationsServiceException_1 = require("./OrganizationsServiceException");
9
9
  var AcceptHandshakeRequest;
@@ -133,6 +133,7 @@ var HandshakeConstraintViolationExceptionReason;
133
133
  HandshakeConstraintViolationExceptionReason["ALREADY_IN_AN_ORGANIZATION"] = "ALREADY_IN_AN_ORGANIZATION";
134
134
  HandshakeConstraintViolationExceptionReason["HANDSHAKE_RATE_LIMIT_EXCEEDED"] = "HANDSHAKE_RATE_LIMIT_EXCEEDED";
135
135
  HandshakeConstraintViolationExceptionReason["INVITE_DISABLED_DURING_ENABLE_ALL_FEATURES"] = "INVITE_DISABLED_DURING_ENABLE_ALL_FEATURES";
136
+ HandshakeConstraintViolationExceptionReason["MANAGEMENT_ACCOUNT_EMAIL_NOT_VERIFIED"] = "MANAGEMENT_ACCOUNT_EMAIL_NOT_VERIFIED";
136
137
  HandshakeConstraintViolationExceptionReason["ORGANIZATION_ALREADY_HAS_ALL_FEATURES"] = "ORGANIZATION_ALREADY_HAS_ALL_FEATURES";
137
138
  HandshakeConstraintViolationExceptionReason["ORGANIZATION_FROM_DIFFERENT_SELLER_OF_RECORD"] = "ORGANIZATION_FROM_DIFFERENT_SELLER_OF_RECORD";
138
139
  HandshakeConstraintViolationExceptionReason["ORGANIZATION_IS_ALREADY_PENDING_ALL_FEATURES_MIGRATION"] = "ORGANIZATION_IS_ALREADY_PENDING_ALL_FEATURES_MIGRATION";
@@ -261,6 +262,7 @@ var AccountJoinedMethod;
261
262
  var AccountStatus;
262
263
  (function (AccountStatus) {
263
264
  AccountStatus["ACTIVE"] = "ACTIVE";
265
+ AccountStatus["PENDING_CLOSURE"] = "PENDING_CLOSURE";
264
266
  AccountStatus["SUSPENDED"] = "SUSPENDED";
265
267
  })(AccountStatus = exports.AccountStatus || (exports.AccountStatus = {}));
266
268
  var Account;
@@ -271,6 +273,20 @@ var Account;
271
273
  ...(obj.Name && { Name: smithy_client_1.SENSITIVE_STRING }),
272
274
  });
273
275
  })(Account = exports.Account || (exports.Account = {}));
276
+ class AccountAlreadyClosedException extends OrganizationsServiceException_1.OrganizationsServiceException {
277
+ constructor(opts) {
278
+ super({
279
+ name: "AccountAlreadyClosedException",
280
+ $fault: "client",
281
+ ...opts,
282
+ });
283
+ this.name = "AccountAlreadyClosedException";
284
+ this.$fault = "client";
285
+ Object.setPrototypeOf(this, AccountAlreadyClosedException.prototype);
286
+ this.Message = opts.Message;
287
+ }
288
+ }
289
+ exports.AccountAlreadyClosedException = AccountAlreadyClosedException;
274
290
  class AccountAlreadyRegisteredException extends OrganizationsServiceException_1.OrganizationsServiceException {
275
291
  constructor(opts) {
276
292
  super({
@@ -354,8 +370,11 @@ var ConstraintViolationExceptionReason;
354
370
  ConstraintViolationExceptionReason["ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION"] = "ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION";
355
371
  ConstraintViolationExceptionReason["ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED"] = "ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED";
356
372
  ConstraintViolationExceptionReason["ACCOUNT_NUMBER_LIMIT_EXCEEDED"] = "ACCOUNT_NUMBER_LIMIT_EXCEEDED";
373
+ ConstraintViolationExceptionReason["CANNOT_CLOSE_MANAGEMENT_ACCOUNT"] = "CANNOT_CLOSE_MANAGEMENT_ACCOUNT";
357
374
  ConstraintViolationExceptionReason["CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR"] = "CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR";
358
375
  ConstraintViolationExceptionReason["CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG"] = "CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG";
376
+ ConstraintViolationExceptionReason["CLOSE_ACCOUNT_QUOTA_EXCEEDED"] = "CLOSE_ACCOUNT_QUOTA_EXCEEDED";
377
+ ConstraintViolationExceptionReason["CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED"] = "CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED";
359
378
  ConstraintViolationExceptionReason["CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION"] = "CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION";
360
379
  ConstraintViolationExceptionReason["DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE"] = "DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE";
361
380
  ConstraintViolationExceptionReason["EMAIL_VERIFICATION_CODE_EXPIRED"] = "EMAIL_VERIFICATION_CODE_EXPIRED";
@@ -375,6 +394,7 @@ var ConstraintViolationExceptionReason;
375
394
  ConstraintViolationExceptionReason["OU_NUMBER_LIMIT_EXCEEDED"] = "OU_NUMBER_LIMIT_EXCEEDED";
376
395
  ConstraintViolationExceptionReason["POLICY_CONTENT_LIMIT_EXCEEDED"] = "POLICY_CONTENT_LIMIT_EXCEEDED";
377
396
  ConstraintViolationExceptionReason["POLICY_NUMBER_LIMIT_EXCEEDED"] = "POLICY_NUMBER_LIMIT_EXCEEDED";
397
+ ConstraintViolationExceptionReason["SERVICE_ACCESS_NOT_ENABLED"] = "SERVICE_ACCESS_NOT_ENABLED";
378
398
  ConstraintViolationExceptionReason["TAG_POLICY_VIOLATION"] = "TAG_POLICY_VIOLATION";
379
399
  ConstraintViolationExceptionReason["WAIT_PERIOD_ACTIVE"] = "WAIT_PERIOD_ACTIVE";
380
400
  })(ConstraintViolationExceptionReason = exports.ConstraintViolationExceptionReason || (exports.ConstraintViolationExceptionReason = {}));
@@ -483,6 +503,26 @@ var CancelHandshakeRequest;
483
503
  ...obj,
484
504
  });
485
505
  })(CancelHandshakeRequest = exports.CancelHandshakeRequest || (exports.CancelHandshakeRequest = {}));
506
+ var CloseAccountRequest;
507
+ (function (CloseAccountRequest) {
508
+ CloseAccountRequest.filterSensitiveLog = (obj) => ({
509
+ ...obj,
510
+ });
511
+ })(CloseAccountRequest = exports.CloseAccountRequest || (exports.CloseAccountRequest = {}));
512
+ class ConflictException extends OrganizationsServiceException_1.OrganizationsServiceException {
513
+ constructor(opts) {
514
+ super({
515
+ name: "ConflictException",
516
+ $fault: "client",
517
+ ...opts,
518
+ });
519
+ this.name = "ConflictException";
520
+ this.$fault = "client";
521
+ Object.setPrototypeOf(this, ConflictException.prototype);
522
+ this.Message = opts.Message;
523
+ }
524
+ }
525
+ exports.ConflictException = ConflictException;
486
526
  var IAMUserAccessToBilling;
487
527
  (function (IAMUserAccessToBilling) {
488
528
  IAMUserAccessToBilling["ALLOW"] = "ALLOW";
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.serializeAws_json1_1UpdateOrganizationalUnitCommand = exports.serializeAws_json1_1UntagResourceCommand = exports.serializeAws_json1_1TagResourceCommand = exports.serializeAws_json1_1RemoveAccountFromOrganizationCommand = exports.serializeAws_json1_1RegisterDelegatedAdministratorCommand = exports.serializeAws_json1_1MoveAccountCommand = exports.serializeAws_json1_1ListTargetsForPolicyCommand = exports.serializeAws_json1_1ListTagsForResourceCommand = exports.serializeAws_json1_1ListRootsCommand = exports.serializeAws_json1_1ListPoliciesForTargetCommand = exports.serializeAws_json1_1ListPoliciesCommand = exports.serializeAws_json1_1ListParentsCommand = exports.serializeAws_json1_1ListOrganizationalUnitsForParentCommand = exports.serializeAws_json1_1ListHandshakesForOrganizationCommand = exports.serializeAws_json1_1ListHandshakesForAccountCommand = exports.serializeAws_json1_1ListDelegatedServicesForAccountCommand = exports.serializeAws_json1_1ListDelegatedAdministratorsCommand = exports.serializeAws_json1_1ListCreateAccountStatusCommand = exports.serializeAws_json1_1ListChildrenCommand = exports.serializeAws_json1_1ListAWSServiceAccessForOrganizationCommand = exports.serializeAws_json1_1ListAccountsForParentCommand = exports.serializeAws_json1_1ListAccountsCommand = exports.serializeAws_json1_1LeaveOrganizationCommand = exports.serializeAws_json1_1InviteAccountToOrganizationCommand = exports.serializeAws_json1_1EnablePolicyTypeCommand = exports.serializeAws_json1_1EnableAWSServiceAccessCommand = exports.serializeAws_json1_1EnableAllFeaturesCommand = exports.serializeAws_json1_1DisablePolicyTypeCommand = exports.serializeAws_json1_1DisableAWSServiceAccessCommand = exports.serializeAws_json1_1DetachPolicyCommand = exports.serializeAws_json1_1DescribePolicyCommand = exports.serializeAws_json1_1DescribeOrganizationalUnitCommand = exports.serializeAws_json1_1DescribeOrganizationCommand = exports.serializeAws_json1_1DescribeHandshakeCommand = exports.serializeAws_json1_1DescribeEffectivePolicyCommand = exports.serializeAws_json1_1DescribeCreateAccountStatusCommand = exports.serializeAws_json1_1DescribeAccountCommand = exports.serializeAws_json1_1DeregisterDelegatedAdministratorCommand = exports.serializeAws_json1_1DeletePolicyCommand = exports.serializeAws_json1_1DeleteOrganizationalUnitCommand = exports.serializeAws_json1_1DeleteOrganizationCommand = exports.serializeAws_json1_1DeclineHandshakeCommand = exports.serializeAws_json1_1CreatePolicyCommand = exports.serializeAws_json1_1CreateOrganizationalUnitCommand = exports.serializeAws_json1_1CreateOrganizationCommand = exports.serializeAws_json1_1CreateGovCloudAccountCommand = exports.serializeAws_json1_1CreateAccountCommand = exports.serializeAws_json1_1CancelHandshakeCommand = exports.serializeAws_json1_1AttachPolicyCommand = exports.serializeAws_json1_1AcceptHandshakeCommand = void 0;
4
- exports.deserializeAws_json1_1UntagResourceCommand = exports.deserializeAws_json1_1TagResourceCommand = exports.deserializeAws_json1_1RemoveAccountFromOrganizationCommand = exports.deserializeAws_json1_1RegisterDelegatedAdministratorCommand = exports.deserializeAws_json1_1MoveAccountCommand = exports.deserializeAws_json1_1ListTargetsForPolicyCommand = exports.deserializeAws_json1_1ListTagsForResourceCommand = exports.deserializeAws_json1_1ListRootsCommand = exports.deserializeAws_json1_1ListPoliciesForTargetCommand = exports.deserializeAws_json1_1ListPoliciesCommand = exports.deserializeAws_json1_1ListParentsCommand = exports.deserializeAws_json1_1ListOrganizationalUnitsForParentCommand = exports.deserializeAws_json1_1ListHandshakesForOrganizationCommand = exports.deserializeAws_json1_1ListHandshakesForAccountCommand = exports.deserializeAws_json1_1ListDelegatedServicesForAccountCommand = exports.deserializeAws_json1_1ListDelegatedAdministratorsCommand = exports.deserializeAws_json1_1ListCreateAccountStatusCommand = exports.deserializeAws_json1_1ListChildrenCommand = exports.deserializeAws_json1_1ListAWSServiceAccessForOrganizationCommand = exports.deserializeAws_json1_1ListAccountsForParentCommand = exports.deserializeAws_json1_1ListAccountsCommand = exports.deserializeAws_json1_1LeaveOrganizationCommand = exports.deserializeAws_json1_1InviteAccountToOrganizationCommand = exports.deserializeAws_json1_1EnablePolicyTypeCommand = exports.deserializeAws_json1_1EnableAWSServiceAccessCommand = exports.deserializeAws_json1_1EnableAllFeaturesCommand = exports.deserializeAws_json1_1DisablePolicyTypeCommand = exports.deserializeAws_json1_1DisableAWSServiceAccessCommand = exports.deserializeAws_json1_1DetachPolicyCommand = exports.deserializeAws_json1_1DescribePolicyCommand = exports.deserializeAws_json1_1DescribeOrganizationalUnitCommand = exports.deserializeAws_json1_1DescribeOrganizationCommand = exports.deserializeAws_json1_1DescribeHandshakeCommand = exports.deserializeAws_json1_1DescribeEffectivePolicyCommand = exports.deserializeAws_json1_1DescribeCreateAccountStatusCommand = exports.deserializeAws_json1_1DescribeAccountCommand = exports.deserializeAws_json1_1DeregisterDelegatedAdministratorCommand = exports.deserializeAws_json1_1DeletePolicyCommand = exports.deserializeAws_json1_1DeleteOrganizationalUnitCommand = exports.deserializeAws_json1_1DeleteOrganizationCommand = exports.deserializeAws_json1_1DeclineHandshakeCommand = exports.deserializeAws_json1_1CreatePolicyCommand = exports.deserializeAws_json1_1CreateOrganizationalUnitCommand = exports.deserializeAws_json1_1CreateOrganizationCommand = exports.deserializeAws_json1_1CreateGovCloudAccountCommand = exports.deserializeAws_json1_1CreateAccountCommand = exports.deserializeAws_json1_1CancelHandshakeCommand = exports.deserializeAws_json1_1AttachPolicyCommand = exports.deserializeAws_json1_1AcceptHandshakeCommand = exports.serializeAws_json1_1UpdatePolicyCommand = void 0;
5
- exports.deserializeAws_json1_1UpdatePolicyCommand = exports.deserializeAws_json1_1UpdateOrganizationalUnitCommand = void 0;
3
+ exports.serializeAws_json1_1UntagResourceCommand = exports.serializeAws_json1_1TagResourceCommand = exports.serializeAws_json1_1RemoveAccountFromOrganizationCommand = exports.serializeAws_json1_1RegisterDelegatedAdministratorCommand = exports.serializeAws_json1_1MoveAccountCommand = exports.serializeAws_json1_1ListTargetsForPolicyCommand = exports.serializeAws_json1_1ListTagsForResourceCommand = exports.serializeAws_json1_1ListRootsCommand = exports.serializeAws_json1_1ListPoliciesForTargetCommand = exports.serializeAws_json1_1ListPoliciesCommand = exports.serializeAws_json1_1ListParentsCommand = exports.serializeAws_json1_1ListOrganizationalUnitsForParentCommand = exports.serializeAws_json1_1ListHandshakesForOrganizationCommand = exports.serializeAws_json1_1ListHandshakesForAccountCommand = exports.serializeAws_json1_1ListDelegatedServicesForAccountCommand = exports.serializeAws_json1_1ListDelegatedAdministratorsCommand = exports.serializeAws_json1_1ListCreateAccountStatusCommand = exports.serializeAws_json1_1ListChildrenCommand = exports.serializeAws_json1_1ListAWSServiceAccessForOrganizationCommand = exports.serializeAws_json1_1ListAccountsForParentCommand = exports.serializeAws_json1_1ListAccountsCommand = exports.serializeAws_json1_1LeaveOrganizationCommand = exports.serializeAws_json1_1InviteAccountToOrganizationCommand = exports.serializeAws_json1_1EnablePolicyTypeCommand = exports.serializeAws_json1_1EnableAWSServiceAccessCommand = exports.serializeAws_json1_1EnableAllFeaturesCommand = exports.serializeAws_json1_1DisablePolicyTypeCommand = exports.serializeAws_json1_1DisableAWSServiceAccessCommand = exports.serializeAws_json1_1DetachPolicyCommand = exports.serializeAws_json1_1DescribePolicyCommand = exports.serializeAws_json1_1DescribeOrganizationalUnitCommand = exports.serializeAws_json1_1DescribeOrganizationCommand = exports.serializeAws_json1_1DescribeHandshakeCommand = exports.serializeAws_json1_1DescribeEffectivePolicyCommand = exports.serializeAws_json1_1DescribeCreateAccountStatusCommand = exports.serializeAws_json1_1DescribeAccountCommand = exports.serializeAws_json1_1DeregisterDelegatedAdministratorCommand = exports.serializeAws_json1_1DeletePolicyCommand = exports.serializeAws_json1_1DeleteOrganizationalUnitCommand = exports.serializeAws_json1_1DeleteOrganizationCommand = exports.serializeAws_json1_1DeclineHandshakeCommand = exports.serializeAws_json1_1CreatePolicyCommand = exports.serializeAws_json1_1CreateOrganizationalUnitCommand = exports.serializeAws_json1_1CreateOrganizationCommand = exports.serializeAws_json1_1CreateGovCloudAccountCommand = exports.serializeAws_json1_1CreateAccountCommand = exports.serializeAws_json1_1CloseAccountCommand = exports.serializeAws_json1_1CancelHandshakeCommand = exports.serializeAws_json1_1AttachPolicyCommand = exports.serializeAws_json1_1AcceptHandshakeCommand = void 0;
4
+ exports.deserializeAws_json1_1RemoveAccountFromOrganizationCommand = exports.deserializeAws_json1_1RegisterDelegatedAdministratorCommand = exports.deserializeAws_json1_1MoveAccountCommand = exports.deserializeAws_json1_1ListTargetsForPolicyCommand = exports.deserializeAws_json1_1ListTagsForResourceCommand = exports.deserializeAws_json1_1ListRootsCommand = exports.deserializeAws_json1_1ListPoliciesForTargetCommand = exports.deserializeAws_json1_1ListPoliciesCommand = exports.deserializeAws_json1_1ListParentsCommand = exports.deserializeAws_json1_1ListOrganizationalUnitsForParentCommand = exports.deserializeAws_json1_1ListHandshakesForOrganizationCommand = exports.deserializeAws_json1_1ListHandshakesForAccountCommand = exports.deserializeAws_json1_1ListDelegatedServicesForAccountCommand = exports.deserializeAws_json1_1ListDelegatedAdministratorsCommand = exports.deserializeAws_json1_1ListCreateAccountStatusCommand = exports.deserializeAws_json1_1ListChildrenCommand = exports.deserializeAws_json1_1ListAWSServiceAccessForOrganizationCommand = exports.deserializeAws_json1_1ListAccountsForParentCommand = exports.deserializeAws_json1_1ListAccountsCommand = exports.deserializeAws_json1_1LeaveOrganizationCommand = exports.deserializeAws_json1_1InviteAccountToOrganizationCommand = exports.deserializeAws_json1_1EnablePolicyTypeCommand = exports.deserializeAws_json1_1EnableAWSServiceAccessCommand = exports.deserializeAws_json1_1EnableAllFeaturesCommand = exports.deserializeAws_json1_1DisablePolicyTypeCommand = exports.deserializeAws_json1_1DisableAWSServiceAccessCommand = exports.deserializeAws_json1_1DetachPolicyCommand = exports.deserializeAws_json1_1DescribePolicyCommand = exports.deserializeAws_json1_1DescribeOrganizationalUnitCommand = exports.deserializeAws_json1_1DescribeOrganizationCommand = exports.deserializeAws_json1_1DescribeHandshakeCommand = exports.deserializeAws_json1_1DescribeEffectivePolicyCommand = exports.deserializeAws_json1_1DescribeCreateAccountStatusCommand = exports.deserializeAws_json1_1DescribeAccountCommand = exports.deserializeAws_json1_1DeregisterDelegatedAdministratorCommand = exports.deserializeAws_json1_1DeletePolicyCommand = exports.deserializeAws_json1_1DeleteOrganizationalUnitCommand = exports.deserializeAws_json1_1DeleteOrganizationCommand = exports.deserializeAws_json1_1DeclineHandshakeCommand = exports.deserializeAws_json1_1CreatePolicyCommand = exports.deserializeAws_json1_1CreateOrganizationalUnitCommand = exports.deserializeAws_json1_1CreateOrganizationCommand = exports.deserializeAws_json1_1CreateGovCloudAccountCommand = exports.deserializeAws_json1_1CreateAccountCommand = exports.deserializeAws_json1_1CloseAccountCommand = exports.deserializeAws_json1_1CancelHandshakeCommand = exports.deserializeAws_json1_1AttachPolicyCommand = exports.deserializeAws_json1_1AcceptHandshakeCommand = exports.serializeAws_json1_1UpdatePolicyCommand = exports.serializeAws_json1_1UpdateOrganizationalUnitCommand = void 0;
5
+ exports.deserializeAws_json1_1UpdatePolicyCommand = exports.deserializeAws_json1_1UpdateOrganizationalUnitCommand = exports.deserializeAws_json1_1UntagResourceCommand = exports.deserializeAws_json1_1TagResourceCommand = void 0;
6
6
  const protocol_http_1 = require("@aws-sdk/protocol-http");
7
7
  const smithy_client_1 = require("@aws-sdk/smithy-client");
8
8
  const models_0_1 = require("../models/models_0");
@@ -37,6 +37,16 @@ const serializeAws_json1_1CancelHandshakeCommand = async (input, context) => {
37
37
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
38
38
  };
39
39
  exports.serializeAws_json1_1CancelHandshakeCommand = serializeAws_json1_1CancelHandshakeCommand;
40
+ const serializeAws_json1_1CloseAccountCommand = async (input, context) => {
41
+ const headers = {
42
+ "content-type": "application/x-amz-json-1.1",
43
+ "x-amz-target": "AWSOrganizationsV20161128.CloseAccount",
44
+ };
45
+ let body;
46
+ body = JSON.stringify(serializeAws_json1_1CloseAccountRequest(input, context));
47
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
48
+ };
49
+ exports.serializeAws_json1_1CloseAccountCommand = serializeAws_json1_1CloseAccountCommand;
40
50
  const serializeAws_json1_1CreateAccountCommand = async (input, context) => {
41
51
  const headers = {
42
52
  "content-type": "application/x-amz-json-1.1",
@@ -706,6 +716,69 @@ const deserializeAws_json1_1CancelHandshakeCommandError = async (output, context
706
716
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
707
717
  }
708
718
  };
719
+ const deserializeAws_json1_1CloseAccountCommand = async (output, context) => {
720
+ if (output.statusCode >= 300) {
721
+ return deserializeAws_json1_1CloseAccountCommandError(output, context);
722
+ }
723
+ await collectBody(output.body, context);
724
+ const response = {
725
+ $metadata: deserializeMetadata(output),
726
+ };
727
+ return Promise.resolve(response);
728
+ };
729
+ exports.deserializeAws_json1_1CloseAccountCommand = deserializeAws_json1_1CloseAccountCommand;
730
+ const deserializeAws_json1_1CloseAccountCommandError = async (output, context) => {
731
+ const parsedOutput = {
732
+ ...output,
733
+ body: await parseBody(output.body, context),
734
+ };
735
+ let response;
736
+ let errorCode = "UnknownError";
737
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
738
+ switch (errorCode) {
739
+ case "AccessDeniedException":
740
+ case "com.amazonaws.organizations#AccessDeniedException":
741
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
742
+ case "AccountAlreadyClosedException":
743
+ case "com.amazonaws.organizations#AccountAlreadyClosedException":
744
+ throw await deserializeAws_json1_1AccountAlreadyClosedExceptionResponse(parsedOutput, context);
745
+ case "AccountNotFoundException":
746
+ case "com.amazonaws.organizations#AccountNotFoundException":
747
+ throw await deserializeAws_json1_1AccountNotFoundExceptionResponse(parsedOutput, context);
748
+ case "AWSOrganizationsNotInUseException":
749
+ case "com.amazonaws.organizations#AWSOrganizationsNotInUseException":
750
+ throw await deserializeAws_json1_1AWSOrganizationsNotInUseExceptionResponse(parsedOutput, context);
751
+ case "ConcurrentModificationException":
752
+ case "com.amazonaws.organizations#ConcurrentModificationException":
753
+ throw await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context);
754
+ case "ConflictException":
755
+ case "com.amazonaws.organizations#ConflictException":
756
+ throw await deserializeAws_json1_1ConflictExceptionResponse(parsedOutput, context);
757
+ case "ConstraintViolationException":
758
+ case "com.amazonaws.organizations#ConstraintViolationException":
759
+ throw await deserializeAws_json1_1ConstraintViolationExceptionResponse(parsedOutput, context);
760
+ case "InvalidInputException":
761
+ case "com.amazonaws.organizations#InvalidInputException":
762
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
763
+ case "ServiceException":
764
+ case "com.amazonaws.organizations#ServiceException":
765
+ throw await deserializeAws_json1_1ServiceExceptionResponse(parsedOutput, context);
766
+ case "TooManyRequestsException":
767
+ case "com.amazonaws.organizations#TooManyRequestsException":
768
+ throw await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context);
769
+ case "UnsupportedAPIEndpointException":
770
+ case "com.amazonaws.organizations#UnsupportedAPIEndpointException":
771
+ throw await deserializeAws_json1_1UnsupportedAPIEndpointExceptionResponse(parsedOutput, context);
772
+ default:
773
+ const parsedBody = parsedOutput.body;
774
+ response = new OrganizationsServiceException_1.OrganizationsServiceException({
775
+ name: parsedBody.code || parsedBody.Code || errorCode,
776
+ $fault: "client",
777
+ $metadata: deserializeMetadata(output),
778
+ });
779
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
780
+ }
781
+ };
709
782
  const deserializeAws_json1_1CreateAccountCommand = async (output, context) => {
710
783
  if (output.statusCode >= 300) {
711
784
  return deserializeAws_json1_1CreateAccountCommandError(output, context);
@@ -3400,6 +3473,15 @@ const deserializeAws_json1_1AccessDeniedForDependencyExceptionResponse = async (
3400
3473
  });
3401
3474
  return (0, smithy_client_1.decorateServiceException)(exception, body);
3402
3475
  };
3476
+ const deserializeAws_json1_1AccountAlreadyClosedExceptionResponse = async (parsedOutput, context) => {
3477
+ const body = parsedOutput.body;
3478
+ const deserialized = deserializeAws_json1_1AccountAlreadyClosedException(body, context);
3479
+ const exception = new models_0_1.AccountAlreadyClosedException({
3480
+ $metadata: deserializeMetadata(parsedOutput),
3481
+ ...deserialized,
3482
+ });
3483
+ return (0, smithy_client_1.decorateServiceException)(exception, body);
3484
+ };
3403
3485
  const deserializeAws_json1_1AccountAlreadyRegisteredExceptionResponse = async (parsedOutput, context) => {
3404
3486
  const body = parsedOutput.body;
3405
3487
  const deserialized = deserializeAws_json1_1AccountAlreadyRegisteredException(body, context);
@@ -3472,6 +3554,15 @@ const deserializeAws_json1_1ConcurrentModificationExceptionResponse = async (par
3472
3554
  });
3473
3555
  return (0, smithy_client_1.decorateServiceException)(exception, body);
3474
3556
  };
3557
+ const deserializeAws_json1_1ConflictExceptionResponse = async (parsedOutput, context) => {
3558
+ const body = parsedOutput.body;
3559
+ const deserialized = deserializeAws_json1_1ConflictException(body, context);
3560
+ const exception = new models_0_1.ConflictException({
3561
+ $metadata: deserializeMetadata(parsedOutput),
3562
+ ...deserialized,
3563
+ });
3564
+ return (0, smithy_client_1.decorateServiceException)(exception, body);
3565
+ };
3475
3566
  const deserializeAws_json1_1ConstraintViolationExceptionResponse = async (parsedOutput, context) => {
3476
3567
  const body = parsedOutput.body;
3477
3568
  const deserialized = deserializeAws_json1_1ConstraintViolationException(body, context);
@@ -3794,6 +3885,11 @@ const serializeAws_json1_1CancelHandshakeRequest = (input, context) => {
3794
3885
  ...(input.HandshakeId !== undefined && input.HandshakeId !== null && { HandshakeId: input.HandshakeId }),
3795
3886
  };
3796
3887
  };
3888
+ const serializeAws_json1_1CloseAccountRequest = (input, context) => {
3889
+ return {
3890
+ ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }),
3891
+ };
3892
+ };
3797
3893
  const serializeAws_json1_1CreateAccountRequest = (input, context) => {
3798
3894
  return {
3799
3895
  ...(input.AccountName !== undefined && input.AccountName !== null && { AccountName: input.AccountName }),
@@ -4175,6 +4271,11 @@ const deserializeAws_json1_1Account = (output, context) => {
4175
4271
  Status: (0, smithy_client_1.expectString)(output.Status),
4176
4272
  };
4177
4273
  };
4274
+ const deserializeAws_json1_1AccountAlreadyClosedException = (output, context) => {
4275
+ return {
4276
+ Message: (0, smithy_client_1.expectString)(output.Message),
4277
+ };
4278
+ };
4178
4279
  const deserializeAws_json1_1AccountAlreadyRegisteredException = (output, context) => {
4179
4280
  return {
4180
4281
  Message: (0, smithy_client_1.expectString)(output.Message),
@@ -4250,6 +4351,11 @@ const deserializeAws_json1_1ConcurrentModificationException = (output, context)
4250
4351
  Message: (0, smithy_client_1.expectString)(output.Message),
4251
4352
  };
4252
4353
  };
4354
+ const deserializeAws_json1_1ConflictException = (output, context) => {
4355
+ return {
4356
+ Message: (0, smithy_client_1.expectString)(output.Message),
4357
+ };
4358
+ };
4253
4359
  const deserializeAws_json1_1ConstraintViolationException = (output, context) => {
4254
4360
  return {
4255
4361
  Message: (0, smithy_client_1.expectString)(output.Message),
@@ -2,6 +2,7 @@ import { __extends } from "tslib";
2
2
  import { AcceptHandshakeCommand, } from "./commands/AcceptHandshakeCommand";
3
3
  import { AttachPolicyCommand, } from "./commands/AttachPolicyCommand";
4
4
  import { CancelHandshakeCommand, } from "./commands/CancelHandshakeCommand";
5
+ import { CloseAccountCommand, } from "./commands/CloseAccountCommand";
5
6
  import { CreateAccountCommand, } from "./commands/CreateAccountCommand";
6
7
  import { CreateGovCloudAccountCommand, } from "./commands/CreateGovCloudAccountCommand";
7
8
  import { CreateOrganizationalUnitCommand, } from "./commands/CreateOrganizationalUnitCommand";
@@ -98,6 +99,20 @@ var Organizations = (function (_super) {
98
99
  return this.send(command, optionsOrCb);
99
100
  }
100
101
  };
102
+ Organizations.prototype.closeAccount = function (args, optionsOrCb, cb) {
103
+ var command = new CloseAccountCommand(args);
104
+ if (typeof optionsOrCb === "function") {
105
+ this.send(command, optionsOrCb);
106
+ }
107
+ else if (typeof cb === "function") {
108
+ if (typeof optionsOrCb !== "object")
109
+ throw new Error("Expect http options but get ".concat(typeof optionsOrCb));
110
+ this.send(command, optionsOrCb || {}, cb);
111
+ }
112
+ else {
113
+ return this.send(command, optionsOrCb);
114
+ }
115
+ };
101
116
  Organizations.prototype.createAccount = function (args, optionsOrCb, cb) {
102
117
  var command = new CreateAccountCommand(args);
103
118
  if (typeof optionsOrCb === "function") {
@@ -0,0 +1,39 @@
1
+ import { __extends } from "tslib";
2
+ import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { CloseAccountRequest } from "../models/models_0";
5
+ import { deserializeAws_json1_1CloseAccountCommand, serializeAws_json1_1CloseAccountCommand, } from "../protocols/Aws_json1_1";
6
+ var CloseAccountCommand = (function (_super) {
7
+ __extends(CloseAccountCommand, _super);
8
+ function CloseAccountCommand(input) {
9
+ var _this = _super.call(this) || this;
10
+ _this.input = input;
11
+ return _this;
12
+ }
13
+ CloseAccountCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {
14
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
15
+ var stack = clientStack.concat(this.middlewareStack);
16
+ var logger = configuration.logger;
17
+ var clientName = "OrganizationsClient";
18
+ var commandName = "CloseAccountCommand";
19
+ var handlerExecutionContext = {
20
+ logger: logger,
21
+ clientName: clientName,
22
+ commandName: commandName,
23
+ inputFilterSensitiveLog: CloseAccountRequest.filterSensitiveLog,
24
+ outputFilterSensitiveLog: function (output) { return output; },
25
+ };
26
+ var requestHandler = configuration.requestHandler;
27
+ return stack.resolve(function (request) {
28
+ return requestHandler.handle(request.request, options || {});
29
+ }, handlerExecutionContext);
30
+ };
31
+ CloseAccountCommand.prototype.serialize = function (input, context) {
32
+ return serializeAws_json1_1CloseAccountCommand(input, context);
33
+ };
34
+ CloseAccountCommand.prototype.deserialize = function (output, context) {
35
+ return deserializeAws_json1_1CloseAccountCommand(output, context);
36
+ };
37
+ return CloseAccountCommand;
38
+ }($Command));
39
+ export { CloseAccountCommand };
@@ -1,6 +1,7 @@
1
1
  export * from "./AcceptHandshakeCommand";
2
2
  export * from "./AttachPolicyCommand";
3
3
  export * from "./CancelHandshakeCommand";
4
+ export * from "./CloseAccountCommand";
4
5
  export * from "./CreateAccountCommand";
5
6
  export * from "./CreateGovCloudAccountCommand";
6
7
  export * from "./CreateOrganizationCommand";