Skip to content

Commit

Permalink
feat(client-account): This release adds 3 new APIs (AcceptPrimaryEmai…
Browse files Browse the repository at this point in the history
…lUpdate, GetPrimaryEmail, and StartPrimaryEmailUpdate) used to centrally manage the root user email address of member accounts within an AWS organization.
  • Loading branch information
awstools committed Jun 6, 2024
1 parent b381cca commit 23c9d39
Show file tree
Hide file tree
Showing 12 changed files with 1,158 additions and 129 deletions.
24 changes: 24 additions & 0 deletions clients/client-account/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,14 @@ see LICENSE for more information.

## Client Commands (Operations List)

<details>
<summary>
AcceptPrimaryEmailUpdate
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/account/command/AcceptPrimaryEmailUpdateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-account/Interface/AcceptPrimaryEmailUpdateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-account/Interface/AcceptPrimaryEmailUpdateCommandOutput/)

</details>
<details>
<summary>
DeleteAlternateContact
Expand Down Expand Up @@ -242,6 +250,14 @@ GetContactInformation

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/account/command/GetContactInformationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-account/Interface/GetContactInformationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-account/Interface/GetContactInformationCommandOutput/)

</details>
<details>
<summary>
GetPrimaryEmail
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/account/command/GetPrimaryEmailCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-account/Interface/GetPrimaryEmailCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-account/Interface/GetPrimaryEmailCommandOutput/)

</details>
<details>
<summary>
Expand Down Expand Up @@ -275,3 +291,11 @@ PutContactInformation
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/account/command/PutContactInformationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-account/Interface/PutContactInformationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-account/Interface/PutContactInformationCommandOutput/)

</details>
<details>
<summary>
StartPrimaryEmailUpdate
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/account/command/StartPrimaryEmailUpdateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-account/Interface/StartPrimaryEmailUpdateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-account/Interface/StartPrimaryEmailUpdateCommandOutput/)

</details>
66 changes: 66 additions & 0 deletions clients/client-account/src/Account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import { createAggregatedClient } from "@smithy/smithy-client";
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";

import { AccountClient, AccountClientConfig } from "./AccountClient";
import {
AcceptPrimaryEmailUpdateCommand,
AcceptPrimaryEmailUpdateCommandInput,
AcceptPrimaryEmailUpdateCommandOutput,
} from "./commands/AcceptPrimaryEmailUpdateCommand";
import {
DeleteAlternateContactCommand,
DeleteAlternateContactCommandInput,
Expand All @@ -28,6 +33,11 @@ import {
GetContactInformationCommandInput,
GetContactInformationCommandOutput,
} from "./commands/GetContactInformationCommand";
import {
GetPrimaryEmailCommand,
GetPrimaryEmailCommandInput,
GetPrimaryEmailCommandOutput,
} from "./commands/GetPrimaryEmailCommand";
import {
GetRegionOptStatusCommand,
GetRegionOptStatusCommandInput,
Expand All @@ -44,20 +54,45 @@ import {
PutContactInformationCommandInput,
PutContactInformationCommandOutput,
} from "./commands/PutContactInformationCommand";
import {
StartPrimaryEmailUpdateCommand,
StartPrimaryEmailUpdateCommandInput,
StartPrimaryEmailUpdateCommandOutput,
} from "./commands/StartPrimaryEmailUpdateCommand";

const commands = {
AcceptPrimaryEmailUpdateCommand,
DeleteAlternateContactCommand,
DisableRegionCommand,
EnableRegionCommand,
GetAlternateContactCommand,
GetContactInformationCommand,
GetPrimaryEmailCommand,
GetRegionOptStatusCommand,
ListRegionsCommand,
PutAlternateContactCommand,
PutContactInformationCommand,
StartPrimaryEmailUpdateCommand,
};

export interface Account {
/**
* @see {@link AcceptPrimaryEmailUpdateCommand}
*/
acceptPrimaryEmailUpdate(
args: AcceptPrimaryEmailUpdateCommandInput,
options?: __HttpHandlerOptions
): Promise<AcceptPrimaryEmailUpdateCommandOutput>;
acceptPrimaryEmailUpdate(
args: AcceptPrimaryEmailUpdateCommandInput,
cb: (err: any, data?: AcceptPrimaryEmailUpdateCommandOutput) => void
): void;
acceptPrimaryEmailUpdate(
args: AcceptPrimaryEmailUpdateCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: AcceptPrimaryEmailUpdateCommandOutput) => void
): void;

/**
* @see {@link DeleteAlternateContactCommand}
*/
Expand Down Expand Up @@ -132,6 +167,20 @@ export interface Account {
cb: (err: any, data?: GetContactInformationCommandOutput) => void
): void;

/**
* @see {@link GetPrimaryEmailCommand}
*/
getPrimaryEmail(
args: GetPrimaryEmailCommandInput,
options?: __HttpHandlerOptions
): Promise<GetPrimaryEmailCommandOutput>;
getPrimaryEmail(args: GetPrimaryEmailCommandInput, cb: (err: any, data?: GetPrimaryEmailCommandOutput) => void): void;
getPrimaryEmail(
args: GetPrimaryEmailCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetPrimaryEmailCommandOutput) => void
): void;

/**
* @see {@link GetRegionOptStatusCommand}
*/
Expand Down Expand Up @@ -194,6 +243,23 @@ export interface Account {
options: __HttpHandlerOptions,
cb: (err: any, data?: PutContactInformationCommandOutput) => void
): void;

/**
* @see {@link StartPrimaryEmailUpdateCommand}
*/
startPrimaryEmailUpdate(
args: StartPrimaryEmailUpdateCommandInput,
options?: __HttpHandlerOptions
): Promise<StartPrimaryEmailUpdateCommandOutput>;
startPrimaryEmailUpdate(
args: StartPrimaryEmailUpdateCommandInput,
cb: (err: any, data?: StartPrimaryEmailUpdateCommandOutput) => void
): void;
startPrimaryEmailUpdate(
args: StartPrimaryEmailUpdateCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: StartPrimaryEmailUpdateCommandOutput) => void
): void;
}

/**
Expand Down
19 changes: 17 additions & 2 deletions clients/client-account/src/AccountClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ import {
HttpAuthSchemeResolvedConfig,
resolveHttpAuthSchemeConfig,
} from "./auth/httpAuthSchemeProvider";
import {
AcceptPrimaryEmailUpdateCommandInput,
AcceptPrimaryEmailUpdateCommandOutput,
} from "./commands/AcceptPrimaryEmailUpdateCommand";
import {
DeleteAlternateContactCommandInput,
DeleteAlternateContactCommandOutput,
Expand All @@ -67,6 +71,7 @@ import {
GetContactInformationCommandInput,
GetContactInformationCommandOutput,
} from "./commands/GetContactInformationCommand";
import { GetPrimaryEmailCommandInput, GetPrimaryEmailCommandOutput } from "./commands/GetPrimaryEmailCommand";
import { GetRegionOptStatusCommandInput, GetRegionOptStatusCommandOutput } from "./commands/GetRegionOptStatusCommand";
import { ListRegionsCommandInput, ListRegionsCommandOutput } from "./commands/ListRegionsCommand";
import {
Expand All @@ -77,6 +82,10 @@ import {
PutContactInformationCommandInput,
PutContactInformationCommandOutput,
} from "./commands/PutContactInformationCommand";
import {
StartPrimaryEmailUpdateCommandInput,
StartPrimaryEmailUpdateCommandOutput,
} from "./commands/StartPrimaryEmailUpdateCommand";
import {
ClientInputEndpointParameters,
ClientResolvedEndpointParameters,
Expand All @@ -92,29 +101,35 @@ export { __Client };
* @public
*/
export type ServiceInputTypes =
| AcceptPrimaryEmailUpdateCommandInput
| DeleteAlternateContactCommandInput
| DisableRegionCommandInput
| EnableRegionCommandInput
| GetAlternateContactCommandInput
| GetContactInformationCommandInput
| GetPrimaryEmailCommandInput
| GetRegionOptStatusCommandInput
| ListRegionsCommandInput
| PutAlternateContactCommandInput
| PutContactInformationCommandInput;
| PutContactInformationCommandInput
| StartPrimaryEmailUpdateCommandInput;

/**
* @public
*/
export type ServiceOutputTypes =
| AcceptPrimaryEmailUpdateCommandOutput
| DeleteAlternateContactCommandOutput
| DisableRegionCommandOutput
| EnableRegionCommandOutput
| GetAlternateContactCommandOutput
| GetContactInformationCommandOutput
| GetPrimaryEmailCommandOutput
| GetRegionOptStatusCommandOutput
| ListRegionsCommandOutput
| PutAlternateContactCommandOutput
| PutContactInformationCommandOutput;
| PutContactInformationCommandOutput
| StartPrimaryEmailUpdateCommandOutput;

/**
* @public
Expand Down
112 changes: 112 additions & 0 deletions clients/client-account/src/commands/AcceptPrimaryEmailUpdateCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { AccountClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../AccountClient";
import { commonParams } from "../endpoint/EndpointParameters";
import {
AcceptPrimaryEmailUpdateRequest,
AcceptPrimaryEmailUpdateRequestFilterSensitiveLog,
AcceptPrimaryEmailUpdateResponse,
} from "../models/models_0";
import { de_AcceptPrimaryEmailUpdateCommand, se_AcceptPrimaryEmailUpdateCommand } from "../protocols/Aws_restJson1";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link AcceptPrimaryEmailUpdateCommand}.
*/
export interface AcceptPrimaryEmailUpdateCommandInput extends AcceptPrimaryEmailUpdateRequest {}
/**
* @public
*
* The output of {@link AcceptPrimaryEmailUpdateCommand}.
*/
export interface AcceptPrimaryEmailUpdateCommandOutput extends AcceptPrimaryEmailUpdateResponse, __MetadataBearer {}

/**
* <p>Accepts the request that originated from <a>StartPrimaryEmailUpdate</a> to update the primary email address (also known
* as the root user email address) for the specified account.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccountClient, AcceptPrimaryEmailUpdateCommand } from "@aws-sdk/client-account"; // ES Modules import
* // const { AccountClient, AcceptPrimaryEmailUpdateCommand } = require("@aws-sdk/client-account"); // CommonJS import
* const client = new AccountClient(config);
* const input = { // AcceptPrimaryEmailUpdateRequest
* AccountId: "STRING_VALUE", // required
* PrimaryEmail: "STRING_VALUE", // required
* Otp: "STRING_VALUE", // required
* };
* const command = new AcceptPrimaryEmailUpdateCommand(input);
* const response = await client.send(command);
* // { // AcceptPrimaryEmailUpdateResponse
* // Status: "STRING_VALUE",
* // };
*
* ```
*
* @param AcceptPrimaryEmailUpdateCommandInput - {@link AcceptPrimaryEmailUpdateCommandInput}
* @returns {@link AcceptPrimaryEmailUpdateCommandOutput}
* @see {@link AcceptPrimaryEmailUpdateCommandInput} for command's `input` shape.
* @see {@link AcceptPrimaryEmailUpdateCommandOutput} for command's `response` shape.
* @see {@link AccountClientResolvedConfig | config} for AccountClient's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>The operation failed because the calling identity doesn't have the minimum required
* permissions.</p>
*
* @throws {@link ConflictException} (client fault)
* <p>The request could not be processed because of a conflict in the current status of the
* resource. For example, this happens if you try to enable a Region that is currently being disabled
* (in a status of DISABLING).</p>
*
* @throws {@link InternalServerException} (server fault)
* <p>The operation failed because of an error internal to Amazon Web Services. Try your operation again
* later.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The operation failed because it specified a resource that can't be found.</p>
*
* @throws {@link TooManyRequestsException} (client fault)
* <p>The operation failed because it was called too frequently and exceeded a throttle
* limit.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The operation failed because one of the input parameters was invalid.</p>
*
* @throws {@link AccountServiceException}
* <p>Base exception class for all service exceptions from Account service.</p>
*
* @public
*/
export class AcceptPrimaryEmailUpdateCommand extends $Command
.classBuilder<
AcceptPrimaryEmailUpdateCommandInput,
AcceptPrimaryEmailUpdateCommandOutput,
AccountClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep({
...commonParams,
})
.m(function (this: any, Command: any, cs: any, config: AccountClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("Account", "AcceptPrimaryEmailUpdate", {})
.n("AccountClient", "AcceptPrimaryEmailUpdateCommand")
.f(AcceptPrimaryEmailUpdateRequestFilterSensitiveLog, void 0)
.ser(se_AcceptPrimaryEmailUpdateCommand)
.de(de_AcceptPrimaryEmailUpdateCommand)
.build() {}
4 changes: 4 additions & 0 deletions clients/client-account/src/commands/DisableRegionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export interface DisableRegionCommandOutput extends __MetadataBearer {}

/**
* <p>Disables (opts-out) a particular Region for an account.</p>
* <note>
* <p>The act of disabling a Region will remove all IAM access to any resources that
* reside in that Region.</p>
* </note>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Loading

0 comments on commit 23c9d39

Please sign in to comment.