Skip to content

Commit f456886

Browse files
author
awstools
committed
feat(client-account): This release enables customers to manage the primary contact information for their AWS accounts. For more information, see https://docs.aws.amazon.com/accounts/latest/reference/API_Operations.html
1 parent b6e2600 commit f456886

File tree

11 files changed

+1068
-28
lines changed

11 files changed

+1068
-28
lines changed

clients/client-account/src/Account.ts

Lines changed: 98 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,21 @@ import {
1212
GetAlternateContactCommandInput,
1313
GetAlternateContactCommandOutput,
1414
} from "./commands/GetAlternateContactCommand";
15+
import {
16+
GetContactInformationCommand,
17+
GetContactInformationCommandInput,
18+
GetContactInformationCommandOutput,
19+
} from "./commands/GetContactInformationCommand";
1520
import {
1621
PutAlternateContactCommand,
1722
PutAlternateContactCommandInput,
1823
PutAlternateContactCommandOutput,
1924
} from "./commands/PutAlternateContactCommand";
25+
import {
26+
PutContactInformationCommand,
27+
PutContactInformationCommandInput,
28+
PutContactInformationCommandOutput,
29+
} from "./commands/PutContactInformationCommand";
2030

2131
/**
2232
* <p>Operations for Amazon Web Services Account Management</p>
@@ -26,6 +36,12 @@ export class Account extends AccountClient {
2636
* <p>Deletes the specified alternate contact from an Amazon Web Services account.</p>
2737
* <p>For complete details about how to use the alternate contact operations, see <a href="https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-update-contact.html">Access or
2838
* updating the alternate contacts</a>.</p>
39+
* <note>
40+
* <p>Before you can update the alternate contact information for an
41+
* Amazon Web Services account that is managed by Organizations, you must first enable integration between Amazon Web Services Account Management
42+
* and Organizations. For more information, see <a href="https://docs.aws.amazon.com/accounts/latest/reference/using-orgs-trusted-access.html">Enabling trusted access for
43+
* Amazon Web Services Account Management</a>.</p>
44+
* </note>
2945
*/
3046
public deleteAlternateContact(
3147
args: DeleteAlternateContactCommandInput,
@@ -59,7 +75,13 @@ export class Account extends AccountClient {
5975
/**
6076
* <p>Retrieves the specified alternate contact attached to an Amazon Web Services account.</p>
6177
* <p>For complete details about how to use the alternate contact operations, see <a href="https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-update-contact.html">Access or
62-
* updating the alternate contacts</a>.</p>
78+
* updating the alternate contacts</a>.</p>
79+
* <note>
80+
* <p>Before you can update the alternate contact information for an
81+
* Amazon Web Services account that is managed by Organizations, you must first enable integration between Amazon Web Services Account Management
82+
* and Organizations. For more information, see <a href="https://docs.aws.amazon.com/accounts/latest/reference/using-orgs-trusted-access.html">Enabling trusted access for
83+
* Amazon Web Services Account Management</a>.</p>
84+
* </note>
6385
*/
6486
public getAlternateContact(
6587
args: GetAlternateContactCommandInput,
@@ -90,10 +112,50 @@ export class Account extends AccountClient {
90112
}
91113
}
92114

115+
/**
116+
* <p>Retrieves the primary contact information of an Amazon Web Services account.</p>
117+
* <p>For complete details about how to use the primary contact operations, see <a href="https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-update-contact.html">Update
118+
* the primary and alternate contact information</a>.</p>
119+
*/
120+
public getContactInformation(
121+
args: GetContactInformationCommandInput,
122+
options?: __HttpHandlerOptions
123+
): Promise<GetContactInformationCommandOutput>;
124+
public getContactInformation(
125+
args: GetContactInformationCommandInput,
126+
cb: (err: any, data?: GetContactInformationCommandOutput) => void
127+
): void;
128+
public getContactInformation(
129+
args: GetContactInformationCommandInput,
130+
options: __HttpHandlerOptions,
131+
cb: (err: any, data?: GetContactInformationCommandOutput) => void
132+
): void;
133+
public getContactInformation(
134+
args: GetContactInformationCommandInput,
135+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetContactInformationCommandOutput) => void),
136+
cb?: (err: any, data?: GetContactInformationCommandOutput) => void
137+
): Promise<GetContactInformationCommandOutput> | void {
138+
const command = new GetContactInformationCommand(args);
139+
if (typeof optionsOrCb === "function") {
140+
this.send(command, optionsOrCb);
141+
} else if (typeof cb === "function") {
142+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
143+
this.send(command, optionsOrCb || {}, cb);
144+
} else {
145+
return this.send(command, optionsOrCb);
146+
}
147+
}
148+
93149
/**
94150
* <p>Modifies the specified alternate contact attached to an Amazon Web Services account.</p>
95151
* <p>For complete details about how to use the alternate contact operations, see <a href="https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-update-contact.html">Access or
96-
* updating the alternate contacts</a>.</p>
152+
* updating the alternate contacts</a>.</p>
153+
* <note>
154+
* <p>Before you can update the alternate contact information for an
155+
* Amazon Web Services account that is managed by Organizations, you must first enable integration between Amazon Web Services Account Management
156+
* and Organizations. For more information, see <a href="https://docs.aws.amazon.com/accounts/latest/reference/using-orgs-trusted-access.html">Enabling trusted access for
157+
* Amazon Web Services Account Management</a>.</p>
158+
* </note>
97159
*/
98160
public putAlternateContact(
99161
args: PutAlternateContactCommandInput,
@@ -123,4 +185,38 @@ export class Account extends AccountClient {
123185
return this.send(command, optionsOrCb);
124186
}
125187
}
188+
189+
/**
190+
* <p>Updates the primary contact information of an Amazon Web Services account.</p>
191+
* <p>For complete details about how to use the primary contact operations, see <a href="https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-update-contact.html">Update
192+
* the primary and alternate contact information</a>.</p>
193+
*/
194+
public putContactInformation(
195+
args: PutContactInformationCommandInput,
196+
options?: __HttpHandlerOptions
197+
): Promise<PutContactInformationCommandOutput>;
198+
public putContactInformation(
199+
args: PutContactInformationCommandInput,
200+
cb: (err: any, data?: PutContactInformationCommandOutput) => void
201+
): void;
202+
public putContactInformation(
203+
args: PutContactInformationCommandInput,
204+
options: __HttpHandlerOptions,
205+
cb: (err: any, data?: PutContactInformationCommandOutput) => void
206+
): void;
207+
public putContactInformation(
208+
args: PutContactInformationCommandInput,
209+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: PutContactInformationCommandOutput) => void),
210+
cb?: (err: any, data?: PutContactInformationCommandOutput) => void
211+
): Promise<PutContactInformationCommandOutput> | void {
212+
const command = new PutContactInformationCommand(args);
213+
if (typeof optionsOrCb === "function") {
214+
this.send(command, optionsOrCb);
215+
} else if (typeof cb === "function") {
216+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
217+
this.send(command, optionsOrCb || {}, cb);
218+
} else {
219+
return this.send(command, optionsOrCb);
220+
}
221+
}
126222
}

clients/client-account/src/AccountClient.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,33 @@ import {
6161
GetAlternateContactCommandInput,
6262
GetAlternateContactCommandOutput,
6363
} from "./commands/GetAlternateContactCommand";
64+
import {
65+
GetContactInformationCommandInput,
66+
GetContactInformationCommandOutput,
67+
} from "./commands/GetContactInformationCommand";
6468
import {
6569
PutAlternateContactCommandInput,
6670
PutAlternateContactCommandOutput,
6771
} from "./commands/PutAlternateContactCommand";
72+
import {
73+
PutContactInformationCommandInput,
74+
PutContactInformationCommandOutput,
75+
} from "./commands/PutContactInformationCommand";
6876
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
6977

7078
export type ServiceInputTypes =
7179
| DeleteAlternateContactCommandInput
7280
| GetAlternateContactCommandInput
73-
| PutAlternateContactCommandInput;
81+
| GetContactInformationCommandInput
82+
| PutAlternateContactCommandInput
83+
| PutContactInformationCommandInput;
7484

7585
export type ServiceOutputTypes =
7686
| DeleteAlternateContactCommandOutput
7787
| GetAlternateContactCommandOutput
78-
| PutAlternateContactCommandOutput;
88+
| GetContactInformationCommandOutput
89+
| PutAlternateContactCommandOutput
90+
| PutContactInformationCommandOutput;
7991

8092
export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
8193
/**

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ export interface DeleteAlternateContactCommandOutput extends __MetadataBearer {}
2626
* <p>Deletes the specified alternate contact from an Amazon Web Services account.</p>
2727
* <p>For complete details about how to use the alternate contact operations, see <a href="https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-update-contact.html">Access or
2828
* updating the alternate contacts</a>.</p>
29+
* <note>
30+
* <p>Before you can update the alternate contact information for an
31+
* Amazon Web Services account that is managed by Organizations, you must first enable integration between Amazon Web Services Account Management
32+
* and Organizations. For more information, see <a href="https://docs.aws.amazon.com/accounts/latest/reference/using-orgs-trusted-access.html">Enabling trusted access for
33+
* Amazon Web Services Account Management</a>.</p>
34+
* </note>
2935
* @example
3036
* Use a bare-bones client and the command you need to make an API call.
3137
* ```javascript

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ export interface GetAlternateContactCommandOutput extends GetAlternateContactRes
2525
/**
2626
* <p>Retrieves the specified alternate contact attached to an Amazon Web Services account.</p>
2727
* <p>For complete details about how to use the alternate contact operations, see <a href="https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-update-contact.html">Access or
28-
* updating the alternate contacts</a>.</p>
28+
* updating the alternate contacts</a>.</p>
29+
* <note>
30+
* <p>Before you can update the alternate contact information for an
31+
* Amazon Web Services account that is managed by Organizations, you must first enable integration between Amazon Web Services Account Management
32+
* and Organizations. For more information, see <a href="https://docs.aws.amazon.com/accounts/latest/reference/using-orgs-trusted-access.html">Enabling trusted access for
33+
* Amazon Web Services Account Management</a>.</p>
34+
* </note>
2935
* @example
3036
* Use a bare-bones client and the command you need to make an API call.
3137
* ```javascript
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
// smithy-typescript generated code
2+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
4+
import { Command as $Command } from "@aws-sdk/smithy-client";
5+
import {
6+
FinalizeHandlerArguments,
7+
Handler,
8+
HandlerExecutionContext,
9+
HttpHandlerOptions as __HttpHandlerOptions,
10+
MetadataBearer as __MetadataBearer,
11+
MiddlewareStack,
12+
SerdeContext as __SerdeContext,
13+
} from "@aws-sdk/types";
14+
15+
import { AccountClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../AccountClient";
16+
import { GetContactInformationRequest, GetContactInformationResponse } from "../models/models_0";
17+
import {
18+
deserializeAws_restJson1GetContactInformationCommand,
19+
serializeAws_restJson1GetContactInformationCommand,
20+
} from "../protocols/Aws_restJson1";
21+
22+
export interface GetContactInformationCommandInput extends GetContactInformationRequest {}
23+
export interface GetContactInformationCommandOutput extends GetContactInformationResponse, __MetadataBearer {}
24+
25+
/**
26+
* <p>Retrieves the primary contact information of an Amazon Web Services account.</p>
27+
* <p>For complete details about how to use the primary contact operations, see <a href="https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-update-contact.html">Update
28+
* the primary and alternate contact information</a>.</p>
29+
* @example
30+
* Use a bare-bones client and the command you need to make an API call.
31+
* ```javascript
32+
* import { AccountClient, GetContactInformationCommand } from "@aws-sdk/client-account"; // ES Modules import
33+
* // const { AccountClient, GetContactInformationCommand } = require("@aws-sdk/client-account"); // CommonJS import
34+
* const client = new AccountClient(config);
35+
* const command = new GetContactInformationCommand(input);
36+
* const response = await client.send(command);
37+
* ```
38+
*
39+
* @see {@link GetContactInformationCommandInput} for command's `input` shape.
40+
* @see {@link GetContactInformationCommandOutput} for command's `response` shape.
41+
* @see {@link AccountClientResolvedConfig | config} for AccountClient's `config` shape.
42+
*
43+
*/
44+
export class GetContactInformationCommand extends $Command<
45+
GetContactInformationCommandInput,
46+
GetContactInformationCommandOutput,
47+
AccountClientResolvedConfig
48+
> {
49+
// Start section: command_properties
50+
// End section: command_properties
51+
52+
constructor(readonly input: GetContactInformationCommandInput) {
53+
// Start section: command_constructor
54+
super();
55+
// End section: command_constructor
56+
}
57+
58+
/**
59+
* @internal
60+
*/
61+
resolveMiddleware(
62+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
63+
configuration: AccountClientResolvedConfig,
64+
options?: __HttpHandlerOptions
65+
): Handler<GetContactInformationCommandInput, GetContactInformationCommandOutput> {
66+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
67+
68+
const stack = clientStack.concat(this.middlewareStack);
69+
70+
const { logger } = configuration;
71+
const clientName = "AccountClient";
72+
const commandName = "GetContactInformationCommand";
73+
const handlerExecutionContext: HandlerExecutionContext = {
74+
logger,
75+
clientName,
76+
commandName,
77+
inputFilterSensitiveLog: GetContactInformationRequest.filterSensitiveLog,
78+
outputFilterSensitiveLog: GetContactInformationResponse.filterSensitiveLog,
79+
};
80+
const { requestHandler } = configuration;
81+
return stack.resolve(
82+
(request: FinalizeHandlerArguments<any>) =>
83+
requestHandler.handle(request.request as __HttpRequest, options || {}),
84+
handlerExecutionContext
85+
);
86+
}
87+
88+
private serialize(input: GetContactInformationCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
89+
return serializeAws_restJson1GetContactInformationCommand(input, context);
90+
}
91+
92+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<GetContactInformationCommandOutput> {
93+
return deserializeAws_restJson1GetContactInformationCommand(output, context);
94+
}
95+
96+
// Start section: command_body_extra
97+
// End section: command_body_extra
98+
}

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ export interface PutAlternateContactCommandOutput extends __MetadataBearer {}
2525
/**
2626
* <p>Modifies the specified alternate contact attached to an Amazon Web Services account.</p>
2727
* <p>For complete details about how to use the alternate contact operations, see <a href="https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-update-contact.html">Access or
28-
* updating the alternate contacts</a>.</p>
28+
* updating the alternate contacts</a>.</p>
29+
* <note>
30+
* <p>Before you can update the alternate contact information for an
31+
* Amazon Web Services account that is managed by Organizations, you must first enable integration between Amazon Web Services Account Management
32+
* and Organizations. For more information, see <a href="https://docs.aws.amazon.com/accounts/latest/reference/using-orgs-trusted-access.html">Enabling trusted access for
33+
* Amazon Web Services Account Management</a>.</p>
34+
* </note>
2935
* @example
3036
* Use a bare-bones client and the command you need to make an API call.
3137
* ```javascript

0 commit comments

Comments
 (0)