Skip to content

Commit 23c9d39

Browse files
author
awstools
committed
feat(client-account): This release adds 3 new APIs (AcceptPrimaryEmailUpdate, GetPrimaryEmail, and StartPrimaryEmailUpdate) used to centrally manage the root user email address of member accounts within an AWS organization.
1 parent b381cca commit 23c9d39

12 files changed

+1158
-129
lines changed

clients/client-account/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,14 @@ see LICENSE for more information.
203203

204204
## Client Commands (Operations List)
205205

206+
<details>
207+
<summary>
208+
AcceptPrimaryEmailUpdate
209+
</summary>
210+
211+
[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/)
212+
213+
</details>
206214
<details>
207215
<summary>
208216
DeleteAlternateContact
@@ -242,6 +250,14 @@ GetContactInformation
242250

243251
[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/)
244252

253+
</details>
254+
<details>
255+
<summary>
256+
GetPrimaryEmail
257+
</summary>
258+
259+
[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/)
260+
245261
</details>
246262
<details>
247263
<summary>
@@ -275,3 +291,11 @@ PutContactInformation
275291
[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/)
276292

277293
</details>
294+
<details>
295+
<summary>
296+
StartPrimaryEmailUpdate
297+
</summary>
298+
299+
[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/)
300+
301+
</details>

clients/client-account/src/Account.ts

+66
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import { createAggregatedClient } from "@smithy/smithy-client";
33
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
44

55
import { AccountClient, AccountClientConfig } from "./AccountClient";
6+
import {
7+
AcceptPrimaryEmailUpdateCommand,
8+
AcceptPrimaryEmailUpdateCommandInput,
9+
AcceptPrimaryEmailUpdateCommandOutput,
10+
} from "./commands/AcceptPrimaryEmailUpdateCommand";
611
import {
712
DeleteAlternateContactCommand,
813
DeleteAlternateContactCommandInput,
@@ -28,6 +33,11 @@ import {
2833
GetContactInformationCommandInput,
2934
GetContactInformationCommandOutput,
3035
} from "./commands/GetContactInformationCommand";
36+
import {
37+
GetPrimaryEmailCommand,
38+
GetPrimaryEmailCommandInput,
39+
GetPrimaryEmailCommandOutput,
40+
} from "./commands/GetPrimaryEmailCommand";
3141
import {
3242
GetRegionOptStatusCommand,
3343
GetRegionOptStatusCommandInput,
@@ -44,20 +54,45 @@ import {
4454
PutContactInformationCommandInput,
4555
PutContactInformationCommandOutput,
4656
} from "./commands/PutContactInformationCommand";
57+
import {
58+
StartPrimaryEmailUpdateCommand,
59+
StartPrimaryEmailUpdateCommandInput,
60+
StartPrimaryEmailUpdateCommandOutput,
61+
} from "./commands/StartPrimaryEmailUpdateCommand";
4762

4863
const commands = {
64+
AcceptPrimaryEmailUpdateCommand,
4965
DeleteAlternateContactCommand,
5066
DisableRegionCommand,
5167
EnableRegionCommand,
5268
GetAlternateContactCommand,
5369
GetContactInformationCommand,
70+
GetPrimaryEmailCommand,
5471
GetRegionOptStatusCommand,
5572
ListRegionsCommand,
5673
PutAlternateContactCommand,
5774
PutContactInformationCommand,
75+
StartPrimaryEmailUpdateCommand,
5876
};
5977

6078
export interface Account {
79+
/**
80+
* @see {@link AcceptPrimaryEmailUpdateCommand}
81+
*/
82+
acceptPrimaryEmailUpdate(
83+
args: AcceptPrimaryEmailUpdateCommandInput,
84+
options?: __HttpHandlerOptions
85+
): Promise<AcceptPrimaryEmailUpdateCommandOutput>;
86+
acceptPrimaryEmailUpdate(
87+
args: AcceptPrimaryEmailUpdateCommandInput,
88+
cb: (err: any, data?: AcceptPrimaryEmailUpdateCommandOutput) => void
89+
): void;
90+
acceptPrimaryEmailUpdate(
91+
args: AcceptPrimaryEmailUpdateCommandInput,
92+
options: __HttpHandlerOptions,
93+
cb: (err: any, data?: AcceptPrimaryEmailUpdateCommandOutput) => void
94+
): void;
95+
6196
/**
6297
* @see {@link DeleteAlternateContactCommand}
6398
*/
@@ -132,6 +167,20 @@ export interface Account {
132167
cb: (err: any, data?: GetContactInformationCommandOutput) => void
133168
): void;
134169

170+
/**
171+
* @see {@link GetPrimaryEmailCommand}
172+
*/
173+
getPrimaryEmail(
174+
args: GetPrimaryEmailCommandInput,
175+
options?: __HttpHandlerOptions
176+
): Promise<GetPrimaryEmailCommandOutput>;
177+
getPrimaryEmail(args: GetPrimaryEmailCommandInput, cb: (err: any, data?: GetPrimaryEmailCommandOutput) => void): void;
178+
getPrimaryEmail(
179+
args: GetPrimaryEmailCommandInput,
180+
options: __HttpHandlerOptions,
181+
cb: (err: any, data?: GetPrimaryEmailCommandOutput) => void
182+
): void;
183+
135184
/**
136185
* @see {@link GetRegionOptStatusCommand}
137186
*/
@@ -194,6 +243,23 @@ export interface Account {
194243
options: __HttpHandlerOptions,
195244
cb: (err: any, data?: PutContactInformationCommandOutput) => void
196245
): void;
246+
247+
/**
248+
* @see {@link StartPrimaryEmailUpdateCommand}
249+
*/
250+
startPrimaryEmailUpdate(
251+
args: StartPrimaryEmailUpdateCommandInput,
252+
options?: __HttpHandlerOptions
253+
): Promise<StartPrimaryEmailUpdateCommandOutput>;
254+
startPrimaryEmailUpdate(
255+
args: StartPrimaryEmailUpdateCommandInput,
256+
cb: (err: any, data?: StartPrimaryEmailUpdateCommandOutput) => void
257+
): void;
258+
startPrimaryEmailUpdate(
259+
args: StartPrimaryEmailUpdateCommandInput,
260+
options: __HttpHandlerOptions,
261+
cb: (err: any, data?: StartPrimaryEmailUpdateCommandOutput) => void
262+
): void;
197263
}
198264

199265
/**

clients/client-account/src/AccountClient.ts

+17-2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ import {
5353
HttpAuthSchemeResolvedConfig,
5454
resolveHttpAuthSchemeConfig,
5555
} from "./auth/httpAuthSchemeProvider";
56+
import {
57+
AcceptPrimaryEmailUpdateCommandInput,
58+
AcceptPrimaryEmailUpdateCommandOutput,
59+
} from "./commands/AcceptPrimaryEmailUpdateCommand";
5660
import {
5761
DeleteAlternateContactCommandInput,
5862
DeleteAlternateContactCommandOutput,
@@ -67,6 +71,7 @@ import {
6771
GetContactInformationCommandInput,
6872
GetContactInformationCommandOutput,
6973
} from "./commands/GetContactInformationCommand";
74+
import { GetPrimaryEmailCommandInput, GetPrimaryEmailCommandOutput } from "./commands/GetPrimaryEmailCommand";
7075
import { GetRegionOptStatusCommandInput, GetRegionOptStatusCommandOutput } from "./commands/GetRegionOptStatusCommand";
7176
import { ListRegionsCommandInput, ListRegionsCommandOutput } from "./commands/ListRegionsCommand";
7277
import {
@@ -77,6 +82,10 @@ import {
7782
PutContactInformationCommandInput,
7883
PutContactInformationCommandOutput,
7984
} from "./commands/PutContactInformationCommand";
85+
import {
86+
StartPrimaryEmailUpdateCommandInput,
87+
StartPrimaryEmailUpdateCommandOutput,
88+
} from "./commands/StartPrimaryEmailUpdateCommand";
8089
import {
8190
ClientInputEndpointParameters,
8291
ClientResolvedEndpointParameters,
@@ -92,29 +101,35 @@ export { __Client };
92101
* @public
93102
*/
94103
export type ServiceInputTypes =
104+
| AcceptPrimaryEmailUpdateCommandInput
95105
| DeleteAlternateContactCommandInput
96106
| DisableRegionCommandInput
97107
| EnableRegionCommandInput
98108
| GetAlternateContactCommandInput
99109
| GetContactInformationCommandInput
110+
| GetPrimaryEmailCommandInput
100111
| GetRegionOptStatusCommandInput
101112
| ListRegionsCommandInput
102113
| PutAlternateContactCommandInput
103-
| PutContactInformationCommandInput;
114+
| PutContactInformationCommandInput
115+
| StartPrimaryEmailUpdateCommandInput;
104116

105117
/**
106118
* @public
107119
*/
108120
export type ServiceOutputTypes =
121+
| AcceptPrimaryEmailUpdateCommandOutput
109122
| DeleteAlternateContactCommandOutput
110123
| DisableRegionCommandOutput
111124
| EnableRegionCommandOutput
112125
| GetAlternateContactCommandOutput
113126
| GetContactInformationCommandOutput
127+
| GetPrimaryEmailCommandOutput
114128
| GetRegionOptStatusCommandOutput
115129
| ListRegionsCommandOutput
116130
| PutAlternateContactCommandOutput
117-
| PutContactInformationCommandOutput;
131+
| PutContactInformationCommandOutput
132+
| StartPrimaryEmailUpdateCommandOutput;
118133

119134
/**
120135
* @public
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { AccountClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../AccountClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import {
10+
AcceptPrimaryEmailUpdateRequest,
11+
AcceptPrimaryEmailUpdateRequestFilterSensitiveLog,
12+
AcceptPrimaryEmailUpdateResponse,
13+
} from "../models/models_0";
14+
import { de_AcceptPrimaryEmailUpdateCommand, se_AcceptPrimaryEmailUpdateCommand } from "../protocols/Aws_restJson1";
15+
16+
/**
17+
* @public
18+
*/
19+
export type { __MetadataBearer };
20+
export { $Command };
21+
/**
22+
* @public
23+
*
24+
* The input for {@link AcceptPrimaryEmailUpdateCommand}.
25+
*/
26+
export interface AcceptPrimaryEmailUpdateCommandInput extends AcceptPrimaryEmailUpdateRequest {}
27+
/**
28+
* @public
29+
*
30+
* The output of {@link AcceptPrimaryEmailUpdateCommand}.
31+
*/
32+
export interface AcceptPrimaryEmailUpdateCommandOutput extends AcceptPrimaryEmailUpdateResponse, __MetadataBearer {}
33+
34+
/**
35+
* <p>Accepts the request that originated from <a>StartPrimaryEmailUpdate</a> to update the primary email address (also known
36+
* as the root user email address) for the specified account.</p>
37+
* @example
38+
* Use a bare-bones client and the command you need to make an API call.
39+
* ```javascript
40+
* import { AccountClient, AcceptPrimaryEmailUpdateCommand } from "@aws-sdk/client-account"; // ES Modules import
41+
* // const { AccountClient, AcceptPrimaryEmailUpdateCommand } = require("@aws-sdk/client-account"); // CommonJS import
42+
* const client = new AccountClient(config);
43+
* const input = { // AcceptPrimaryEmailUpdateRequest
44+
* AccountId: "STRING_VALUE", // required
45+
* PrimaryEmail: "STRING_VALUE", // required
46+
* Otp: "STRING_VALUE", // required
47+
* };
48+
* const command = new AcceptPrimaryEmailUpdateCommand(input);
49+
* const response = await client.send(command);
50+
* // { // AcceptPrimaryEmailUpdateResponse
51+
* // Status: "STRING_VALUE",
52+
* // };
53+
*
54+
* ```
55+
*
56+
* @param AcceptPrimaryEmailUpdateCommandInput - {@link AcceptPrimaryEmailUpdateCommandInput}
57+
* @returns {@link AcceptPrimaryEmailUpdateCommandOutput}
58+
* @see {@link AcceptPrimaryEmailUpdateCommandInput} for command's `input` shape.
59+
* @see {@link AcceptPrimaryEmailUpdateCommandOutput} for command's `response` shape.
60+
* @see {@link AccountClientResolvedConfig | config} for AccountClient's `config` shape.
61+
*
62+
* @throws {@link AccessDeniedException} (client fault)
63+
* <p>The operation failed because the calling identity doesn't have the minimum required
64+
* permissions.</p>
65+
*
66+
* @throws {@link ConflictException} (client fault)
67+
* <p>The request could not be processed because of a conflict in the current status of the
68+
* resource. For example, this happens if you try to enable a Region that is currently being disabled
69+
* (in a status of DISABLING).</p>
70+
*
71+
* @throws {@link InternalServerException} (server fault)
72+
* <p>The operation failed because of an error internal to Amazon Web Services. Try your operation again
73+
* later.</p>
74+
*
75+
* @throws {@link ResourceNotFoundException} (client fault)
76+
* <p>The operation failed because it specified a resource that can't be found.</p>
77+
*
78+
* @throws {@link TooManyRequestsException} (client fault)
79+
* <p>The operation failed because it was called too frequently and exceeded a throttle
80+
* limit.</p>
81+
*
82+
* @throws {@link ValidationException} (client fault)
83+
* <p>The operation failed because one of the input parameters was invalid.</p>
84+
*
85+
* @throws {@link AccountServiceException}
86+
* <p>Base exception class for all service exceptions from Account service.</p>
87+
*
88+
* @public
89+
*/
90+
export class AcceptPrimaryEmailUpdateCommand extends $Command
91+
.classBuilder<
92+
AcceptPrimaryEmailUpdateCommandInput,
93+
AcceptPrimaryEmailUpdateCommandOutput,
94+
AccountClientResolvedConfig,
95+
ServiceInputTypes,
96+
ServiceOutputTypes
97+
>()
98+
.ep({
99+
...commonParams,
100+
})
101+
.m(function (this: any, Command: any, cs: any, config: AccountClientResolvedConfig, o: any) {
102+
return [
103+
getSerdePlugin(config, this.serialize, this.deserialize),
104+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
105+
];
106+
})
107+
.s("Account", "AcceptPrimaryEmailUpdate", {})
108+
.n("AccountClient", "AcceptPrimaryEmailUpdateCommand")
109+
.f(AcceptPrimaryEmailUpdateRequestFilterSensitiveLog, void 0)
110+
.ser(se_AcceptPrimaryEmailUpdateCommand)
111+
.de(de_AcceptPrimaryEmailUpdateCommand)
112+
.build() {}

clients/client-account/src/commands/DisableRegionCommand.ts

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ export interface DisableRegionCommandOutput extends __MetadataBearer {}
2929

3030
/**
3131
* <p>Disables (opts-out) a particular Region for an account.</p>
32+
* <note>
33+
* <p>The act of disabling a Region will remove all IAM access to any resources that
34+
* reside in that Region.</p>
35+
* </note>
3236
* @example
3337
* Use a bare-bones client and the command you need to make an API call.
3438
* ```javascript

0 commit comments

Comments
 (0)