Skip to content

Commit

Permalink
feat(client-migrationhub-config): This release introduces DeleteHomeR…
Browse files Browse the repository at this point in the history
…egionControl API that customers can use to delete the Migration Hub Home Region configuration
  • Loading branch information
awstools committed Oct 24, 2023
1 parent 1ccadc3 commit 442a399
Show file tree
Hide file tree
Showing 9 changed files with 357 additions and 9 deletions.
10 changes: 8 additions & 2 deletions clients/client-migrationhub-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ AWS SDK for JavaScript MigrationHubConfig Client for Node.js, Browser and React
<p>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.</p>

<ul>
<li>
<p>You must make API calls for write actions (create, notify, associate, disassociate,
Expand All @@ -29,7 +28,6 @@ is returned.</p>
home region.</p>
</li>
</ul>

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

Expand Down Expand Up @@ -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)

</details>
<details>
<summary>
DeleteHomeRegionControl
</summary>

[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)

</details>
<details>
<summary>
Expand Down
25 changes: 23 additions & 2 deletions clients/client-migrationhub-config/src/MigrationHubConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import {
CreateHomeRegionControlCommandInput,
CreateHomeRegionControlCommandOutput,
} from "./commands/CreateHomeRegionControlCommand";
import {
DeleteHomeRegionControlCommand,
DeleteHomeRegionControlCommandInput,
DeleteHomeRegionControlCommandOutput,
} from "./commands/DeleteHomeRegionControlCommand";
import {
DescribeHomeRegionControlsCommand,
DescribeHomeRegionControlsCommandInput,
Expand All @@ -21,6 +26,7 @@ import { MigrationHubConfigClient, MigrationHubConfigClientConfig } from "./Migr

const commands = {
CreateHomeRegionControlCommand,
DeleteHomeRegionControlCommand,
DescribeHomeRegionControlsCommand,
GetHomeRegionCommand,
};
Expand All @@ -43,6 +49,23 @@ export interface MigrationHubConfig {
cb: (err: any, data?: CreateHomeRegionControlCommandOutput) => void
): void;

/**
* @see {@link DeleteHomeRegionControlCommand}
*/
deleteHomeRegionControl(
args: DeleteHomeRegionControlCommandInput,
options?: __HttpHandlerOptions
): Promise<DeleteHomeRegionControlCommandOutput>;
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}
*/
Expand Down Expand Up @@ -77,7 +100,6 @@ export interface MigrationHubConfig {
* <p>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.</p>
*
* <ul>
* <li>
* <p>You must make API calls for write actions (create, notify, associate, disassociate,
Expand All @@ -97,7 +119,6 @@ export interface MigrationHubConfig {
* home region.</p>
* </li>
* </ul>
*
* <p>For specific API usage, see the sections that follow in this AWS Migration Hub Home Region
* API reference. </p>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ import {
CreateHomeRegionControlCommandInput,
CreateHomeRegionControlCommandOutput,
} from "./commands/CreateHomeRegionControlCommand";
import {
DeleteHomeRegionControlCommandInput,
DeleteHomeRegionControlCommandOutput,
} from "./commands/DeleteHomeRegionControlCommand";
import {
DescribeHomeRegionControlsCommandInput,
DescribeHomeRegionControlsCommandOutput,
Expand All @@ -75,6 +79,7 @@ export { __Client };
*/
export type ServiceInputTypes =
| CreateHomeRegionControlCommandInput
| DeleteHomeRegionControlCommandInput
| DescribeHomeRegionControlsCommandInput
| GetHomeRegionCommandInput;

Expand All @@ -83,6 +88,7 @@ export type ServiceInputTypes =
*/
export type ServiceOutputTypes =
| CreateHomeRegionControlCommandOutput
| DeleteHomeRegionControlCommandOutput
| DescribeHomeRegionControlsCommandOutput
| GetHomeRegionCommandOutput;

Expand Down Expand Up @@ -261,7 +267,6 @@ export interface MigrationHubConfigClientResolvedConfig extends MigrationHubConf
* <p>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.</p>
*
* <ul>
* <li>
* <p>You must make API calls for write actions (create, notify, associate, disassociate,
Expand All @@ -281,7 +286,6 @@ export interface MigrationHubConfigClientResolvedConfig extends MigrationHubConf
* home region.</p>
* </li>
* </ul>
*
* <p>For specific API usage, see the sections that follow in this AWS Migration Hub Home Region
* API reference. </p>
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -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
* <p>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.</p>
* @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)
* <p>You do not have sufficient access to perform this action.</p>
*
* @throws {@link InternalServerError} (server fault)
* <p>Exception raised when an internal, configuration, or dependency error is
* encountered.</p>
*
* @throws {@link InvalidInputException} (client fault)
* <p>Exception raised when the provided input violates a policy constraint or is entered in the
* wrong format or data type.</p>
*
* @throws {@link ServiceUnavailableException} (server fault)
* <p>Exception raised when a request fails due to temporary unavailability of the
* service.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>The request was denied due to request throttling.</p>
*
* @throws {@link MigrationHubConfigServiceException}
* <p>Base exception class for all service exceptions from MigrationHubConfig service.</p>
*
*/
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<ServiceInputTypes, ServiceOutputTypes>,
configuration: MigrationHubConfigClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<DeleteHomeRegionControlCommandInput, DeleteHomeRegionControlCommandOutput> {
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<any>) =>
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<DeleteHomeRegionControlCommandOutput> {
return de_DeleteHomeRegionControlCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
1 change: 1 addition & 0 deletions clients/client-migrationhub-config/src/commands/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// smithy-typescript generated code
export * from "./CreateHomeRegionControlCommand";
export * from "./DeleteHomeRegionControlCommand";
export * from "./DescribeHomeRegionControlsCommand";
export * from "./GetHomeRegionCommand";
2 changes: 0 additions & 2 deletions clients/client-migrationhub-config/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* <p>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.</p>
*
* <ul>
* <li>
* <p>You must make API calls for write actions (create, notify, associate, disassociate,
Expand All @@ -24,7 +23,6 @@
* home region.</p>
* </li>
* </ul>
*
* <p>For specific API usage, see the sections that follow in this AWS Migration Hub Home Region
* API reference. </p>
*
Expand Down
17 changes: 17 additions & 0 deletions clients/client-migrationhub-config/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,23 @@ export class ThrottlingException extends __BaseException {
}
}

/**
* @public
*/
export interface DeleteHomeRegionControlRequest {
/**
* @public
* <p>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.</p>
*/
ControlId: string | undefined;
}

/**
* @public
*/
export interface DeleteHomeRegionControlResult {}

/**
* @public
*/
Expand Down
Loading

0 comments on commit 442a399

Please sign in to comment.