diff --git a/clients/client-migrationhub-config/README.md b/clients/client-migrationhub-config/README.md index 561a6e3ec369..0f2e8bad0bed 100644 --- a/clients/client-migrationhub-config/README.md +++ b/clients/client-migrationhub-config/README.md @@ -9,7 +9,6 @@ AWS SDK for JavaScript MigrationHubConfig Client for Node.js, Browser and React

The AWS Migration Hub home region APIs are available specifically for working with your Migration Hub home region. You can use these APIs to determine a home region, as well as to create and work with controls that describe the home region.

- -

For specific API usage, see the sections that follow in this AWS Migration Hub Home Region API reference.

@@ -235,6 +233,14 @@ CreateHomeRegionControl [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-migrationhub-config/classes/createhomeregioncontrolcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-migrationhub-config/interfaces/createhomeregioncontrolcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-migrationhub-config/interfaces/createhomeregioncontrolcommandoutput.html) + +
+ +DeleteHomeRegionControl + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-migrationhub-config/classes/deletehomeregioncontrolcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-migrationhub-config/interfaces/deletehomeregioncontrolcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-migrationhub-config/interfaces/deletehomeregioncontrolcommandoutput.html) +
diff --git a/clients/client-migrationhub-config/src/MigrationHubConfig.ts b/clients/client-migrationhub-config/src/MigrationHubConfig.ts index 5996bf80b4c4..5b719ed72e78 100644 --- a/clients/client-migrationhub-config/src/MigrationHubConfig.ts +++ b/clients/client-migrationhub-config/src/MigrationHubConfig.ts @@ -7,6 +7,11 @@ import { CreateHomeRegionControlCommandInput, CreateHomeRegionControlCommandOutput, } from "./commands/CreateHomeRegionControlCommand"; +import { + DeleteHomeRegionControlCommand, + DeleteHomeRegionControlCommandInput, + DeleteHomeRegionControlCommandOutput, +} from "./commands/DeleteHomeRegionControlCommand"; import { DescribeHomeRegionControlsCommand, DescribeHomeRegionControlsCommandInput, @@ -21,6 +26,7 @@ import { MigrationHubConfigClient, MigrationHubConfigClientConfig } from "./Migr const commands = { CreateHomeRegionControlCommand, + DeleteHomeRegionControlCommand, DescribeHomeRegionControlsCommand, GetHomeRegionCommand, }; @@ -43,6 +49,23 @@ export interface MigrationHubConfig { cb: (err: any, data?: CreateHomeRegionControlCommandOutput) => void ): void; + /** + * @see {@link DeleteHomeRegionControlCommand} + */ + deleteHomeRegionControl( + args: DeleteHomeRegionControlCommandInput, + options?: __HttpHandlerOptions + ): Promise; + deleteHomeRegionControl( + args: DeleteHomeRegionControlCommandInput, + cb: (err: any, data?: DeleteHomeRegionControlCommandOutput) => void + ): void; + deleteHomeRegionControl( + args: DeleteHomeRegionControlCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteHomeRegionControlCommandOutput) => void + ): void; + /** * @see {@link DescribeHomeRegionControlsCommand} */ @@ -77,7 +100,6 @@ export interface MigrationHubConfig { *

The AWS Migration Hub home region APIs are available specifically for working with your * Migration Hub home region. You can use these APIs to determine a home region, as well as to * create and work with controls that describe the home region.

- * *
    *
  • *

    You must make API calls for write actions (create, notify, associate, disassociate, @@ -97,7 +119,6 @@ export interface MigrationHubConfig { * home region.

    *
  • *
- * *

For specific API usage, see the sections that follow in this AWS Migration Hub Home Region * API reference.

*/ diff --git a/clients/client-migrationhub-config/src/MigrationHubConfigClient.ts b/clients/client-migrationhub-config/src/MigrationHubConfigClient.ts index 6618e9380719..6014769ba9ed 100644 --- a/clients/client-migrationhub-config/src/MigrationHubConfigClient.ts +++ b/clients/client-migrationhub-config/src/MigrationHubConfigClient.ts @@ -54,6 +54,10 @@ import { CreateHomeRegionControlCommandInput, CreateHomeRegionControlCommandOutput, } from "./commands/CreateHomeRegionControlCommand"; +import { + DeleteHomeRegionControlCommandInput, + DeleteHomeRegionControlCommandOutput, +} from "./commands/DeleteHomeRegionControlCommand"; import { DescribeHomeRegionControlsCommandInput, DescribeHomeRegionControlsCommandOutput, @@ -75,6 +79,7 @@ export { __Client }; */ export type ServiceInputTypes = | CreateHomeRegionControlCommandInput + | DeleteHomeRegionControlCommandInput | DescribeHomeRegionControlsCommandInput | GetHomeRegionCommandInput; @@ -83,6 +88,7 @@ export type ServiceInputTypes = */ export type ServiceOutputTypes = | CreateHomeRegionControlCommandOutput + | DeleteHomeRegionControlCommandOutput | DescribeHomeRegionControlsCommandOutput | GetHomeRegionCommandOutput; @@ -261,7 +267,6 @@ export interface MigrationHubConfigClientResolvedConfig extends MigrationHubConf *

The AWS Migration Hub home region APIs are available specifically for working with your * Migration Hub home region. You can use these APIs to determine a home region, as well as to * create and work with controls that describe the home region.

- * *
    *
  • *

    You must make API calls for write actions (create, notify, associate, disassociate, @@ -281,7 +286,6 @@ export interface MigrationHubConfigClientResolvedConfig extends MigrationHubConf * home region.

    *
  • *
- * *

For specific API usage, see the sections that follow in this AWS Migration Hub Home Region * API reference.

*/ diff --git a/clients/client-migrationhub-config/src/commands/DeleteHomeRegionControlCommand.ts b/clients/client-migrationhub-config/src/commands/DeleteHomeRegionControlCommand.ts new file mode 100644 index 000000000000..c2cd521e1db3 --- /dev/null +++ b/clients/client-migrationhub-config/src/commands/DeleteHomeRegionControlCommand.ts @@ -0,0 +1,167 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { + MigrationHubConfigClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes, +} from "../MigrationHubConfigClient"; +import { DeleteHomeRegionControlRequest, DeleteHomeRegionControlResult } from "../models/models_0"; +import { de_DeleteHomeRegionControlCommand, se_DeleteHomeRegionControlCommand } from "../protocols/Aws_json1_1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DeleteHomeRegionControlCommand}. + */ +export interface DeleteHomeRegionControlCommandInput extends DeleteHomeRegionControlRequest {} +/** + * @public + * + * The output of {@link DeleteHomeRegionControlCommand}. + */ +export interface DeleteHomeRegionControlCommandOutput extends DeleteHomeRegionControlResult, __MetadataBearer {} + +/** + * @public + *

This operation deletes the home region configuration for the calling account. The operation does not delete discovery or migration tracking data in the home region.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { MigrationHubConfigClient, DeleteHomeRegionControlCommand } from "@aws-sdk/client-migrationhub-config"; // ES Modules import + * // const { MigrationHubConfigClient, DeleteHomeRegionControlCommand } = require("@aws-sdk/client-migrationhub-config"); // CommonJS import + * const client = new MigrationHubConfigClient(config); + * const input = { // DeleteHomeRegionControlRequest + * ControlId: "STRING_VALUE", // required + * }; + * const command = new DeleteHomeRegionControlCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param DeleteHomeRegionControlCommandInput - {@link DeleteHomeRegionControlCommandInput} + * @returns {@link DeleteHomeRegionControlCommandOutput} + * @see {@link DeleteHomeRegionControlCommandInput} for command's `input` shape. + * @see {@link DeleteHomeRegionControlCommandOutput} for command's `response` shape. + * @see {@link MigrationHubConfigClientResolvedConfig | config} for MigrationHubConfigClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link InternalServerError} (server fault) + *

Exception raised when an internal, configuration, or dependency error is + * encountered.

+ * + * @throws {@link InvalidInputException} (client fault) + *

Exception raised when the provided input violates a policy constraint or is entered in the + * wrong format or data type.

+ * + * @throws {@link ServiceUnavailableException} (server fault) + *

Exception raised when a request fails due to temporary unavailability of the + * service.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling.

+ * + * @throws {@link MigrationHubConfigServiceException} + *

Base exception class for all service exceptions from MigrationHubConfig service.

+ * + */ +export class DeleteHomeRegionControlCommand extends $Command< + DeleteHomeRegionControlCommandInput, + DeleteHomeRegionControlCommandOutput, + MigrationHubConfigClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: DeleteHomeRegionControlCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: MigrationHubConfigClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, DeleteHomeRegionControlCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "MigrationHubConfigClient"; + const commandName = "DeleteHomeRegionControlCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "AWSMigrationHubMultiAccountService", + operation: "DeleteHomeRegionControl", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: DeleteHomeRegionControlCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_DeleteHomeRegionControlCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_DeleteHomeRegionControlCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-migrationhub-config/src/commands/index.ts b/clients/client-migrationhub-config/src/commands/index.ts index 11cce94fed78..75c8c11df16e 100644 --- a/clients/client-migrationhub-config/src/commands/index.ts +++ b/clients/client-migrationhub-config/src/commands/index.ts @@ -1,4 +1,5 @@ // smithy-typescript generated code export * from "./CreateHomeRegionControlCommand"; +export * from "./DeleteHomeRegionControlCommand"; export * from "./DescribeHomeRegionControlsCommand"; export * from "./GetHomeRegionCommand"; diff --git a/clients/client-migrationhub-config/src/index.ts b/clients/client-migrationhub-config/src/index.ts index 5b4b58228458..bcce07443efa 100644 --- a/clients/client-migrationhub-config/src/index.ts +++ b/clients/client-migrationhub-config/src/index.ts @@ -4,7 +4,6 @@ *

The AWS Migration Hub home region APIs are available specifically for working with your * Migration Hub home region. You can use these APIs to determine a home region, as well as to * create and work with controls that describe the home region.

- * *
    *
  • *

    You must make API calls for write actions (create, notify, associate, disassociate, @@ -24,7 +23,6 @@ * home region.

    *
  • *
- * *

For specific API usage, see the sections that follow in this AWS Migration Hub Home Region * API reference.

* diff --git a/clients/client-migrationhub-config/src/models/models_0.ts b/clients/client-migrationhub-config/src/models/models_0.ts index be205244d32c..0d9ad9ea4a2e 100644 --- a/clients/client-migrationhub-config/src/models/models_0.ts +++ b/clients/client-migrationhub-config/src/models/models_0.ts @@ -253,6 +253,23 @@ export class ThrottlingException extends __BaseException { } } +/** + * @public + */ +export interface DeleteHomeRegionControlRequest { + /** + * @public + *

A unique identifier that's generated for each home region control. It's always a string + * that begins with "hrc-" followed by 12 lowercase letters and numbers.

+ */ + ControlId: string | undefined; +} + +/** + * @public + */ +export interface DeleteHomeRegionControlResult {} + /** * @public */ diff --git a/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts b/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts index 4e8cf27290c3..dd5278c6fd19 100644 --- a/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts +++ b/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts @@ -22,6 +22,10 @@ import { CreateHomeRegionControlCommandInput, CreateHomeRegionControlCommandOutput, } from "../commands/CreateHomeRegionControlCommand"; +import { + DeleteHomeRegionControlCommandInput, + DeleteHomeRegionControlCommandOutput, +} from "../commands/DeleteHomeRegionControlCommand"; import { DescribeHomeRegionControlsCommandInput, DescribeHomeRegionControlsCommandOutput, @@ -32,6 +36,7 @@ import { AccessDeniedException, CreateHomeRegionControlRequest, CreateHomeRegionControlResult, + DeleteHomeRegionControlRequest, DescribeHomeRegionControlsRequest, DescribeHomeRegionControlsResult, DryRunOperation, @@ -57,6 +62,19 @@ export const se_CreateHomeRegionControlCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +/** + * serializeAws_json1_1DeleteHomeRegionControlCommand + */ +export const se_DeleteHomeRegionControlCommand = async ( + input: DeleteHomeRegionControlCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("DeleteHomeRegionControl"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + /** * serializeAws_json1_1DescribeHomeRegionControlsCommand */ @@ -144,6 +162,64 @@ const de_CreateHomeRegionControlCommandError = async ( } }; +/** + * deserializeAws_json1_1DeleteHomeRegionControlCommand + */ +export const de_DeleteHomeRegionControlCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_DeleteHomeRegionControlCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteHomeRegionControlCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1DeleteHomeRegionControlCommandError + */ +const de_DeleteHomeRegionControlCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.migrationhubconfig#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerError": + case "com.amazonaws.migrationhubconfig#InternalServerError": + throw await de_InternalServerErrorRes(parsedOutput, context); + case "InvalidInputException": + case "com.amazonaws.migrationhubconfig#InvalidInputException": + throw await de_InvalidInputExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.migrationhubconfig#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.migrationhubconfig#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_json1_1DescribeHomeRegionControlsCommand */ @@ -349,6 +425,8 @@ const de_ThrottlingExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_CreateHomeRegionControlRequest omitted. +// se_DeleteHomeRegionControlRequest omitted. + // se_DescribeHomeRegionControlsRequest omitted. // se_GetHomeRegionRequest omitted. @@ -366,6 +444,8 @@ const de_CreateHomeRegionControlResult = (output: any, context: __SerdeContext): }) as any; }; +// de_DeleteHomeRegionControlResult omitted. + /** * deserializeAws_json1_1DescribeHomeRegionControlsResult */ diff --git a/codegen/sdk-codegen/aws-models/migrationhub-config.json b/codegen/sdk-codegen/aws-models/migrationhub-config.json index ee559f1ef4a1..83e758d10391 100644 --- a/codegen/sdk-codegen/aws-models/migrationhub-config.json +++ b/codegen/sdk-codegen/aws-models/migrationhub-config.json @@ -36,6 +36,9 @@ { "target": "com.amazonaws.migrationhubconfig#CreateHomeRegionControl" }, + { + "target": "com.amazonaws.migrationhubconfig#DeleteHomeRegionControl" + }, { "target": "com.amazonaws.migrationhubconfig#DescribeHomeRegionControls" }, @@ -55,7 +58,7 @@ "name": "mgh" }, "aws.protocols#awsJson1_1": {}, - "smithy.api#documentation": "

The AWS Migration Hub home region APIs are available specifically for working with your\n Migration Hub home region. You can use these APIs to determine a home region, as well as to\n create and work with controls that describe the home region.

\n\n
    \n
  • \n

    You must make API calls for write actions (create, notify, associate, disassociate,\n import, or put) while in your home region, or a HomeRegionNotSetException\n error is returned.

    \n
  • \n
  • \n

    API calls for read actions (list, describe, stop, and delete) are permitted outside of\n your home region.

    \n
  • \n
  • \n

    If you call a write API outside the home region, an InvalidInputException\n is returned.

    \n
  • \n
  • \n

    You can call GetHomeRegion action to obtain the account's Migration Hub\n home region.

    \n
  • \n
\n\n

For specific API usage, see the sections that follow in this AWS Migration Hub Home Region\n API reference.

", + "smithy.api#documentation": "

The AWS Migration Hub home region APIs are available specifically for working with your\n Migration Hub home region. You can use these APIs to determine a home region, as well as to\n create and work with controls that describe the home region.

\n
    \n
  • \n

    You must make API calls for write actions (create, notify, associate, disassociate,\n import, or put) while in your home region, or a HomeRegionNotSetException\n error is returned.

    \n
  • \n
  • \n

    API calls for read actions (list, describe, stop, and delete) are permitted outside of\n your home region.

    \n
  • \n
  • \n

    If you call a write API outside the home region, an InvalidInputException\n is returned.

    \n
  • \n
  • \n

    You can call GetHomeRegion action to obtain the account's Migration Hub\n home region.

    \n
  • \n
\n

For specific API usage, see the sections that follow in this AWS Migration Hub Home Region\n API reference.

", "smithy.api#title": "AWS Migration Hub Config", "smithy.rules#endpointRuleSet": { "version": "1.0", @@ -784,6 +787,57 @@ "smithy.api#output": {} } }, + "com.amazonaws.migrationhubconfig#DeleteHomeRegionControl": { + "type": "operation", + "input": { + "target": "com.amazonaws.migrationhubconfig#DeleteHomeRegionControlRequest" + }, + "output": { + "target": "com.amazonaws.migrationhubconfig#DeleteHomeRegionControlResult" + }, + "errors": [ + { + "target": "com.amazonaws.migrationhubconfig#AccessDeniedException" + }, + { + "target": "com.amazonaws.migrationhubconfig#InternalServerError" + }, + { + "target": "com.amazonaws.migrationhubconfig#InvalidInputException" + }, + { + "target": "com.amazonaws.migrationhubconfig#ServiceUnavailableException" + }, + { + "target": "com.amazonaws.migrationhubconfig#ThrottlingException" + } + ], + "traits": { + "smithy.api#documentation": "

This operation deletes the home region configuration for the calling account. The operation does not delete discovery or migration tracking data in the home region.

" + } + }, + "com.amazonaws.migrationhubconfig#DeleteHomeRegionControlRequest": { + "type": "structure", + "members": { + "ControlId": { + "target": "com.amazonaws.migrationhubconfig#ControlId", + "traits": { + "smithy.api#documentation": "

A unique identifier that's generated for each home region control. It's always a string\n that begins with \"hrc-\" followed by 12 lowercase letters and numbers.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.migrationhubconfig#DeleteHomeRegionControlResult": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.migrationhubconfig#DescribeHomeRegionControls": { "type": "operation", "input": {