Skip to content

Commit

Permalink
feat(client-account): This release enables customers to manage the pr…
Browse files Browse the repository at this point in the history
…imary contact information for their AWS accounts. For more information, see https://docs.aws.amazon.com/accounts/latest/reference/API_Operations.html
  • Loading branch information
awstools committed Jul 22, 2022
1 parent b6e2600 commit f456886
Show file tree
Hide file tree
Showing 11 changed files with 1,068 additions and 28 deletions.
100 changes: 98 additions & 2 deletions clients/client-account/src/Account.ts
Expand Up @@ -12,11 +12,21 @@ import {
GetAlternateContactCommandInput,
GetAlternateContactCommandOutput,
} from "./commands/GetAlternateContactCommand";
import {
GetContactInformationCommand,
GetContactInformationCommandInput,
GetContactInformationCommandOutput,
} from "./commands/GetContactInformationCommand";
import {
PutAlternateContactCommand,
PutAlternateContactCommandInput,
PutAlternateContactCommandOutput,
} from "./commands/PutAlternateContactCommand";
import {
PutContactInformationCommand,
PutContactInformationCommandInput,
PutContactInformationCommandOutput,
} from "./commands/PutContactInformationCommand";

/**
* <p>Operations for Amazon Web Services Account Management</p>
Expand All @@ -26,6 +36,12 @@ export class Account extends AccountClient {
* <p>Deletes the specified alternate contact from an Amazon Web Services account.</p>
* <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
* updating the alternate contacts</a>.</p>
* <note>
* <p>Before you can update the alternate contact information for an
* Amazon Web Services account that is managed by Organizations, you must first enable integration between Amazon Web Services Account Management
* 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
* Amazon Web Services Account Management</a>.</p>
* </note>
*/
public deleteAlternateContact(
args: DeleteAlternateContactCommandInput,
Expand Down Expand Up @@ -59,7 +75,13 @@ export class Account extends AccountClient {
/**
* <p>Retrieves the specified alternate contact attached to an Amazon Web Services account.</p>
* <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
* updating the alternate contacts</a>.</p>
* updating the alternate contacts</a>.</p>
* <note>
* <p>Before you can update the alternate contact information for an
* Amazon Web Services account that is managed by Organizations, you must first enable integration between Amazon Web Services Account Management
* 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
* Amazon Web Services Account Management</a>.</p>
* </note>
*/
public getAlternateContact(
args: GetAlternateContactCommandInput,
Expand Down Expand Up @@ -90,10 +112,50 @@ export class Account extends AccountClient {
}
}

/**
* <p>Retrieves the primary contact information of an Amazon Web Services account.</p>
* <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
* the primary and alternate contact information</a>.</p>
*/
public getContactInformation(
args: GetContactInformationCommandInput,
options?: __HttpHandlerOptions
): Promise<GetContactInformationCommandOutput>;
public getContactInformation(
args: GetContactInformationCommandInput,
cb: (err: any, data?: GetContactInformationCommandOutput) => void
): void;
public getContactInformation(
args: GetContactInformationCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetContactInformationCommandOutput) => void
): void;
public getContactInformation(
args: GetContactInformationCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetContactInformationCommandOutput) => void),
cb?: (err: any, data?: GetContactInformationCommandOutput) => void
): Promise<GetContactInformationCommandOutput> | void {
const command = new GetContactInformationCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Modifies the specified alternate contact attached to an Amazon Web Services account.</p>
* <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
* updating the alternate contacts</a>.</p>
* updating the alternate contacts</a>.</p>
* <note>
* <p>Before you can update the alternate contact information for an
* Amazon Web Services account that is managed by Organizations, you must first enable integration between Amazon Web Services Account Management
* 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
* Amazon Web Services Account Management</a>.</p>
* </note>
*/
public putAlternateContact(
args: PutAlternateContactCommandInput,
Expand Down Expand Up @@ -123,4 +185,38 @@ export class Account extends AccountClient {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Updates the primary contact information of an Amazon Web Services account.</p>
* <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
* the primary and alternate contact information</a>.</p>
*/
public putContactInformation(
args: PutContactInformationCommandInput,
options?: __HttpHandlerOptions
): Promise<PutContactInformationCommandOutput>;
public putContactInformation(
args: PutContactInformationCommandInput,
cb: (err: any, data?: PutContactInformationCommandOutput) => void
): void;
public putContactInformation(
args: PutContactInformationCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: PutContactInformationCommandOutput) => void
): void;
public putContactInformation(
args: PutContactInformationCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: PutContactInformationCommandOutput) => void),
cb?: (err: any, data?: PutContactInformationCommandOutput) => void
): Promise<PutContactInformationCommandOutput> | void {
const command = new PutContactInformationCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}
}
16 changes: 14 additions & 2 deletions clients/client-account/src/AccountClient.ts
Expand Up @@ -61,21 +61,33 @@ import {
GetAlternateContactCommandInput,
GetAlternateContactCommandOutput,
} from "./commands/GetAlternateContactCommand";
import {
GetContactInformationCommandInput,
GetContactInformationCommandOutput,
} from "./commands/GetContactInformationCommand";
import {
PutAlternateContactCommandInput,
PutAlternateContactCommandOutput,
} from "./commands/PutAlternateContactCommand";
import {
PutContactInformationCommandInput,
PutContactInformationCommandOutput,
} from "./commands/PutContactInformationCommand";
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";

export type ServiceInputTypes =
| DeleteAlternateContactCommandInput
| GetAlternateContactCommandInput
| PutAlternateContactCommandInput;
| GetContactInformationCommandInput
| PutAlternateContactCommandInput
| PutContactInformationCommandInput;

export type ServiceOutputTypes =
| DeleteAlternateContactCommandOutput
| GetAlternateContactCommandOutput
| PutAlternateContactCommandOutput;
| GetContactInformationCommandOutput
| PutAlternateContactCommandOutput
| PutContactInformationCommandOutput;

export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
/**
Expand Down
Expand Up @@ -26,6 +26,12 @@ export interface DeleteAlternateContactCommandOutput extends __MetadataBearer {}
* <p>Deletes the specified alternate contact from an Amazon Web Services account.</p>
* <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
* updating the alternate contacts</a>.</p>
* <note>
* <p>Before you can update the alternate contact information for an
* Amazon Web Services account that is managed by Organizations, you must first enable integration between Amazon Web Services Account Management
* 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
* Amazon Web Services Account Management</a>.</p>
* </note>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Expand Up @@ -25,7 +25,13 @@ export interface GetAlternateContactCommandOutput extends GetAlternateContactRes
/**
* <p>Retrieves the specified alternate contact attached to an Amazon Web Services account.</p>
* <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
* updating the alternate contacts</a>.</p>
* updating the alternate contacts</a>.</p>
* <note>
* <p>Before you can update the alternate contact information for an
* Amazon Web Services account that is managed by Organizations, you must first enable integration between Amazon Web Services Account Management
* 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
* Amazon Web Services Account Management</a>.</p>
* </note>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
@@ -0,0 +1,98 @@
// smithy-typescript generated code
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
import { Command as $Command } from "@aws-sdk/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";

import { AccountClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../AccountClient";
import { GetContactInformationRequest, GetContactInformationResponse } from "../models/models_0";
import {
deserializeAws_restJson1GetContactInformationCommand,
serializeAws_restJson1GetContactInformationCommand,
} from "../protocols/Aws_restJson1";

export interface GetContactInformationCommandInput extends GetContactInformationRequest {}
export interface GetContactInformationCommandOutput extends GetContactInformationResponse, __MetadataBearer {}

/**
* <p>Retrieves the primary contact information of an Amazon Web Services account.</p>
* <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
* the primary and alternate contact information</a>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccountClient, GetContactInformationCommand } from "@aws-sdk/client-account"; // ES Modules import
* // const { AccountClient, GetContactInformationCommand } = require("@aws-sdk/client-account"); // CommonJS import
* const client = new AccountClient(config);
* const command = new GetContactInformationCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link GetContactInformationCommandInput} for command's `input` shape.
* @see {@link GetContactInformationCommandOutput} for command's `response` shape.
* @see {@link AccountClientResolvedConfig | config} for AccountClient's `config` shape.
*
*/
export class GetContactInformationCommand extends $Command<
GetContactInformationCommandInput,
GetContactInformationCommandOutput,
AccountClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

constructor(readonly input: GetContactInformationCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: AccountClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<GetContactInformationCommandInput, GetContactInformationCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "AccountClient";
const commandName = "GetContactInformationCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: GetContactInformationRequest.filterSensitiveLog,
outputFilterSensitiveLog: GetContactInformationResponse.filterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

private serialize(input: GetContactInformationCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_restJson1GetContactInformationCommand(input, context);
}

private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<GetContactInformationCommandOutput> {
return deserializeAws_restJson1GetContactInformationCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
Expand Up @@ -25,7 +25,13 @@ export interface PutAlternateContactCommandOutput extends __MetadataBearer {}
/**
* <p>Modifies the specified alternate contact attached to an Amazon Web Services account.</p>
* <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
* updating the alternate contacts</a>.</p>
* updating the alternate contacts</a>.</p>
* <note>
* <p>Before you can update the alternate contact information for an
* Amazon Web Services account that is managed by Organizations, you must first enable integration between Amazon Web Services Account Management
* 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
* Amazon Web Services Account Management</a>.</p>
* </note>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down

0 comments on commit f456886

Please sign in to comment.