Skip to content

Commit 442a399

Browse files
author
awstools
committed
feat(client-migrationhub-config): This release introduces DeleteHomeRegionControl API that customers can use to delete the Migration Hub Home Region configuration
1 parent 1ccadc3 commit 442a399

File tree

9 files changed

+357
-9
lines changed

9 files changed

+357
-9
lines changed

clients/client-migrationhub-config/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ AWS SDK for JavaScript MigrationHubConfig Client for Node.js, Browser and React
99
<p>The AWS Migration Hub home region APIs are available specifically for working with your
1010
Migration Hub home region. You can use these APIs to determine a home region, as well as to
1111
create and work with controls that describe the home region.</p>
12-
1312
<ul>
1413
<li>
1514
<p>You must make API calls for write actions (create, notify, associate, disassociate,
@@ -29,7 +28,6 @@ is returned.</p>
2928
home region.</p>
3029
</li>
3130
</ul>
32-
3331
<p>For specific API usage, see the sections that follow in this AWS Migration Hub Home Region
3432
API reference. </p>
3533

@@ -235,6 +233,14 @@ CreateHomeRegionControl
235233

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

236+
</details>
237+
<details>
238+
<summary>
239+
DeleteHomeRegionControl
240+
</summary>
241+
242+
[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)
243+
238244
</details>
239245
<details>
240246
<summary>

clients/client-migrationhub-config/src/MigrationHubConfig.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ import {
77
CreateHomeRegionControlCommandInput,
88
CreateHomeRegionControlCommandOutput,
99
} from "./commands/CreateHomeRegionControlCommand";
10+
import {
11+
DeleteHomeRegionControlCommand,
12+
DeleteHomeRegionControlCommandInput,
13+
DeleteHomeRegionControlCommandOutput,
14+
} from "./commands/DeleteHomeRegionControlCommand";
1015
import {
1116
DescribeHomeRegionControlsCommand,
1217
DescribeHomeRegionControlsCommandInput,
@@ -21,6 +26,7 @@ import { MigrationHubConfigClient, MigrationHubConfigClientConfig } from "./Migr
2126

2227
const commands = {
2328
CreateHomeRegionControlCommand,
29+
DeleteHomeRegionControlCommand,
2430
DescribeHomeRegionControlsCommand,
2531
GetHomeRegionCommand,
2632
};
@@ -43,6 +49,23 @@ export interface MigrationHubConfig {
4349
cb: (err: any, data?: CreateHomeRegionControlCommandOutput) => void
4450
): void;
4551

52+
/**
53+
* @see {@link DeleteHomeRegionControlCommand}
54+
*/
55+
deleteHomeRegionControl(
56+
args: DeleteHomeRegionControlCommandInput,
57+
options?: __HttpHandlerOptions
58+
): Promise<DeleteHomeRegionControlCommandOutput>;
59+
deleteHomeRegionControl(
60+
args: DeleteHomeRegionControlCommandInput,
61+
cb: (err: any, data?: DeleteHomeRegionControlCommandOutput) => void
62+
): void;
63+
deleteHomeRegionControl(
64+
args: DeleteHomeRegionControlCommandInput,
65+
options: __HttpHandlerOptions,
66+
cb: (err: any, data?: DeleteHomeRegionControlCommandOutput) => void
67+
): void;
68+
4669
/**
4770
* @see {@link DescribeHomeRegionControlsCommand}
4871
*/
@@ -77,7 +100,6 @@ export interface MigrationHubConfig {
77100
* <p>The AWS Migration Hub home region APIs are available specifically for working with your
78101
* Migration Hub home region. You can use these APIs to determine a home region, as well as to
79102
* create and work with controls that describe the home region.</p>
80-
*
81103
* <ul>
82104
* <li>
83105
* <p>You must make API calls for write actions (create, notify, associate, disassociate,
@@ -97,7 +119,6 @@ export interface MigrationHubConfig {
97119
* home region.</p>
98120
* </li>
99121
* </ul>
100-
*
101122
* <p>For specific API usage, see the sections that follow in this AWS Migration Hub Home Region
102123
* API reference. </p>
103124
*/

clients/client-migrationhub-config/src/MigrationHubConfigClient.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ import {
5454
CreateHomeRegionControlCommandInput,
5555
CreateHomeRegionControlCommandOutput,
5656
} from "./commands/CreateHomeRegionControlCommand";
57+
import {
58+
DeleteHomeRegionControlCommandInput,
59+
DeleteHomeRegionControlCommandOutput,
60+
} from "./commands/DeleteHomeRegionControlCommand";
5761
import {
5862
DescribeHomeRegionControlsCommandInput,
5963
DescribeHomeRegionControlsCommandOutput,
@@ -75,6 +79,7 @@ export { __Client };
7579
*/
7680
export type ServiceInputTypes =
7781
| CreateHomeRegionControlCommandInput
82+
| DeleteHomeRegionControlCommandInput
7883
| DescribeHomeRegionControlsCommandInput
7984
| GetHomeRegionCommandInput;
8085

@@ -83,6 +88,7 @@ export type ServiceInputTypes =
8388
*/
8489
export type ServiceOutputTypes =
8590
| CreateHomeRegionControlCommandOutput
91+
| DeleteHomeRegionControlCommandOutput
8692
| DescribeHomeRegionControlsCommandOutput
8793
| GetHomeRegionCommandOutput;
8894

@@ -261,7 +267,6 @@ export interface MigrationHubConfigClientResolvedConfig extends MigrationHubConf
261267
* <p>The AWS Migration Hub home region APIs are available specifically for working with your
262268
* Migration Hub home region. You can use these APIs to determine a home region, as well as to
263269
* create and work with controls that describe the home region.</p>
264-
*
265270
* <ul>
266271
* <li>
267272
* <p>You must make API calls for write actions (create, notify, associate, disassociate,
@@ -281,7 +286,6 @@ export interface MigrationHubConfigClientResolvedConfig extends MigrationHubConf
281286
* home region.</p>
282287
* </li>
283288
* </ul>
284-
*
285289
* <p>For specific API usage, see the sections that follow in this AWS Migration Hub Home Region
286290
* API reference. </p>
287291
*/
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
5+
import { Command as $Command } from "@smithy/smithy-client";
6+
import {
7+
FinalizeHandlerArguments,
8+
Handler,
9+
HandlerExecutionContext,
10+
HttpHandlerOptions as __HttpHandlerOptions,
11+
MetadataBearer as __MetadataBearer,
12+
MiddlewareStack,
13+
SerdeContext as __SerdeContext,
14+
SMITHY_CONTEXT_KEY,
15+
} from "@smithy/types";
16+
17+
import {
18+
MigrationHubConfigClientResolvedConfig,
19+
ServiceInputTypes,
20+
ServiceOutputTypes,
21+
} from "../MigrationHubConfigClient";
22+
import { DeleteHomeRegionControlRequest, DeleteHomeRegionControlResult } from "../models/models_0";
23+
import { de_DeleteHomeRegionControlCommand, se_DeleteHomeRegionControlCommand } from "../protocols/Aws_json1_1";
24+
25+
/**
26+
* @public
27+
*/
28+
export { __MetadataBearer, $Command };
29+
/**
30+
* @public
31+
*
32+
* The input for {@link DeleteHomeRegionControlCommand}.
33+
*/
34+
export interface DeleteHomeRegionControlCommandInput extends DeleteHomeRegionControlRequest {}
35+
/**
36+
* @public
37+
*
38+
* The output of {@link DeleteHomeRegionControlCommand}.
39+
*/
40+
export interface DeleteHomeRegionControlCommandOutput extends DeleteHomeRegionControlResult, __MetadataBearer {}
41+
42+
/**
43+
* @public
44+
* <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>
45+
* @example
46+
* Use a bare-bones client and the command you need to make an API call.
47+
* ```javascript
48+
* import { MigrationHubConfigClient, DeleteHomeRegionControlCommand } from "@aws-sdk/client-migrationhub-config"; // ES Modules import
49+
* // const { MigrationHubConfigClient, DeleteHomeRegionControlCommand } = require("@aws-sdk/client-migrationhub-config"); // CommonJS import
50+
* const client = new MigrationHubConfigClient(config);
51+
* const input = { // DeleteHomeRegionControlRequest
52+
* ControlId: "STRING_VALUE", // required
53+
* };
54+
* const command = new DeleteHomeRegionControlCommand(input);
55+
* const response = await client.send(command);
56+
* // {};
57+
*
58+
* ```
59+
*
60+
* @param DeleteHomeRegionControlCommandInput - {@link DeleteHomeRegionControlCommandInput}
61+
* @returns {@link DeleteHomeRegionControlCommandOutput}
62+
* @see {@link DeleteHomeRegionControlCommandInput} for command's `input` shape.
63+
* @see {@link DeleteHomeRegionControlCommandOutput} for command's `response` shape.
64+
* @see {@link MigrationHubConfigClientResolvedConfig | config} for MigrationHubConfigClient's `config` shape.
65+
*
66+
* @throws {@link AccessDeniedException} (client fault)
67+
* <p>You do not have sufficient access to perform this action.</p>
68+
*
69+
* @throws {@link InternalServerError} (server fault)
70+
* <p>Exception raised when an internal, configuration, or dependency error is
71+
* encountered.</p>
72+
*
73+
* @throws {@link InvalidInputException} (client fault)
74+
* <p>Exception raised when the provided input violates a policy constraint or is entered in the
75+
* wrong format or data type.</p>
76+
*
77+
* @throws {@link ServiceUnavailableException} (server fault)
78+
* <p>Exception raised when a request fails due to temporary unavailability of the
79+
* service.</p>
80+
*
81+
* @throws {@link ThrottlingException} (client fault)
82+
* <p>The request was denied due to request throttling.</p>
83+
*
84+
* @throws {@link MigrationHubConfigServiceException}
85+
* <p>Base exception class for all service exceptions from MigrationHubConfig service.</p>
86+
*
87+
*/
88+
export class DeleteHomeRegionControlCommand extends $Command<
89+
DeleteHomeRegionControlCommandInput,
90+
DeleteHomeRegionControlCommandOutput,
91+
MigrationHubConfigClientResolvedConfig
92+
> {
93+
// Start section: command_properties
94+
// End section: command_properties
95+
96+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
97+
return {
98+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
99+
Endpoint: { type: "builtInParams", name: "endpoint" },
100+
Region: { type: "builtInParams", name: "region" },
101+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
102+
};
103+
}
104+
105+
/**
106+
* @public
107+
*/
108+
constructor(readonly input: DeleteHomeRegionControlCommandInput) {
109+
// Start section: command_constructor
110+
super();
111+
// End section: command_constructor
112+
}
113+
114+
/**
115+
* @internal
116+
*/
117+
resolveMiddleware(
118+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
119+
configuration: MigrationHubConfigClientResolvedConfig,
120+
options?: __HttpHandlerOptions
121+
): Handler<DeleteHomeRegionControlCommandInput, DeleteHomeRegionControlCommandOutput> {
122+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
123+
this.middlewareStack.use(
124+
getEndpointPlugin(configuration, DeleteHomeRegionControlCommand.getEndpointParameterInstructions())
125+
);
126+
127+
const stack = clientStack.concat(this.middlewareStack);
128+
129+
const { logger } = configuration;
130+
const clientName = "MigrationHubConfigClient";
131+
const commandName = "DeleteHomeRegionControlCommand";
132+
const handlerExecutionContext: HandlerExecutionContext = {
133+
logger,
134+
clientName,
135+
commandName,
136+
inputFilterSensitiveLog: (_: any) => _,
137+
outputFilterSensitiveLog: (_: any) => _,
138+
[SMITHY_CONTEXT_KEY]: {
139+
service: "AWSMigrationHubMultiAccountService",
140+
operation: "DeleteHomeRegionControl",
141+
},
142+
};
143+
const { requestHandler } = configuration;
144+
return stack.resolve(
145+
(request: FinalizeHandlerArguments<any>) =>
146+
requestHandler.handle(request.request as __HttpRequest, options || {}),
147+
handlerExecutionContext
148+
);
149+
}
150+
151+
/**
152+
* @internal
153+
*/
154+
private serialize(input: DeleteHomeRegionControlCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
155+
return se_DeleteHomeRegionControlCommand(input, context);
156+
}
157+
158+
/**
159+
* @internal
160+
*/
161+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<DeleteHomeRegionControlCommandOutput> {
162+
return de_DeleteHomeRegionControlCommand(output, context);
163+
}
164+
165+
// Start section: command_body_extra
166+
// End section: command_body_extra
167+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
22
export * from "./CreateHomeRegionControlCommand";
3+
export * from "./DeleteHomeRegionControlCommand";
34
export * from "./DescribeHomeRegionControlsCommand";
45
export * from "./GetHomeRegionCommand";

clients/client-migrationhub-config/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* <p>The AWS Migration Hub home region APIs are available specifically for working with your
55
* Migration Hub home region. You can use these APIs to determine a home region, as well as to
66
* create and work with controls that describe the home region.</p>
7-
*
87
* <ul>
98
* <li>
109
* <p>You must make API calls for write actions (create, notify, associate, disassociate,
@@ -24,7 +23,6 @@
2423
* home region.</p>
2524
* </li>
2625
* </ul>
27-
*
2826
* <p>For specific API usage, see the sections that follow in this AWS Migration Hub Home Region
2927
* API reference. </p>
3028
*

clients/client-migrationhub-config/src/models/models_0.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,23 @@ export class ThrottlingException extends __BaseException {
253253
}
254254
}
255255

256+
/**
257+
* @public
258+
*/
259+
export interface DeleteHomeRegionControlRequest {
260+
/**
261+
* @public
262+
* <p>A unique identifier that's generated for each home region control. It's always a string
263+
* that begins with "hrc-" followed by 12 lowercase letters and numbers.</p>
264+
*/
265+
ControlId: string | undefined;
266+
}
267+
268+
/**
269+
* @public
270+
*/
271+
export interface DeleteHomeRegionControlResult {}
272+
256273
/**
257274
* @public
258275
*/

0 commit comments

Comments
 (0)