|
| 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 | +} |
0 commit comments