|
| 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 | +} from "@smithy/types"; |
| 15 | + |
| 16 | +import { BackupClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BackupClient"; |
| 17 | +import { |
| 18 | + CreateLogicallyAirGappedBackupVaultInput, |
| 19 | + CreateLogicallyAirGappedBackupVaultInputFilterSensitiveLog, |
| 20 | + CreateLogicallyAirGappedBackupVaultOutput, |
| 21 | +} from "../models/models_0"; |
| 22 | +import { |
| 23 | + de_CreateLogicallyAirGappedBackupVaultCommand, |
| 24 | + se_CreateLogicallyAirGappedBackupVaultCommand, |
| 25 | +} from "../protocols/Aws_restJson1"; |
| 26 | + |
| 27 | +/** |
| 28 | + * @public |
| 29 | + */ |
| 30 | +export { __MetadataBearer, $Command }; |
| 31 | +/** |
| 32 | + * @public |
| 33 | + * |
| 34 | + * The input for {@link CreateLogicallyAirGappedBackupVaultCommand}. |
| 35 | + */ |
| 36 | +export interface CreateLogicallyAirGappedBackupVaultCommandInput extends CreateLogicallyAirGappedBackupVaultInput {} |
| 37 | +/** |
| 38 | + * @public |
| 39 | + * |
| 40 | + * The output of {@link CreateLogicallyAirGappedBackupVaultCommand}. |
| 41 | + */ |
| 42 | +export interface CreateLogicallyAirGappedBackupVaultCommandOutput |
| 43 | + extends CreateLogicallyAirGappedBackupVaultOutput, |
| 44 | + __MetadataBearer {} |
| 45 | + |
| 46 | +/** |
| 47 | + * @public |
| 48 | + * <p>This request creates a logical container where backups are stored.</p> |
| 49 | + * <p>This request includes a name, optionally one or more resource tags, an encryption key, |
| 50 | + * and a request ID.</p> |
| 51 | + * <note> |
| 52 | + * <p>Do not include sensitive data, such as passport numbers, in the name of a backup |
| 53 | + * vault.</p> |
| 54 | + * </note> |
| 55 | + * @example |
| 56 | + * Use a bare-bones client and the command you need to make an API call. |
| 57 | + * ```javascript |
| 58 | + * import { BackupClient, CreateLogicallyAirGappedBackupVaultCommand } from "@aws-sdk/client-backup"; // ES Modules import |
| 59 | + * // const { BackupClient, CreateLogicallyAirGappedBackupVaultCommand } = require("@aws-sdk/client-backup"); // CommonJS import |
| 60 | + * const client = new BackupClient(config); |
| 61 | + * const input = { // CreateLogicallyAirGappedBackupVaultInput |
| 62 | + * BackupVaultName: "STRING_VALUE", // required |
| 63 | + * BackupVaultTags: { // Tags |
| 64 | + * "<keys>": "STRING_VALUE", |
| 65 | + * }, |
| 66 | + * CreatorRequestId: "STRING_VALUE", |
| 67 | + * MinRetentionDays: Number("long"), // required |
| 68 | + * MaxRetentionDays: Number("long"), // required |
| 69 | + * }; |
| 70 | + * const command = new CreateLogicallyAirGappedBackupVaultCommand(input); |
| 71 | + * const response = await client.send(command); |
| 72 | + * // { // CreateLogicallyAirGappedBackupVaultOutput |
| 73 | + * // BackupVaultName: "STRING_VALUE", |
| 74 | + * // BackupVaultArn: "STRING_VALUE", |
| 75 | + * // CreationDate: new Date("TIMESTAMP"), |
| 76 | + * // VaultState: "CREATING" || "AVAILABLE" || "FAILED", |
| 77 | + * // }; |
| 78 | + * |
| 79 | + * ``` |
| 80 | + * |
| 81 | + * @param CreateLogicallyAirGappedBackupVaultCommandInput - {@link CreateLogicallyAirGappedBackupVaultCommandInput} |
| 82 | + * @returns {@link CreateLogicallyAirGappedBackupVaultCommandOutput} |
| 83 | + * @see {@link CreateLogicallyAirGappedBackupVaultCommandInput} for command's `input` shape. |
| 84 | + * @see {@link CreateLogicallyAirGappedBackupVaultCommandOutput} for command's `response` shape. |
| 85 | + * @see {@link BackupClientResolvedConfig | config} for BackupClient's `config` shape. |
| 86 | + * |
| 87 | + * @throws {@link AlreadyExistsException} (client fault) |
| 88 | + * <p>The required resource already exists.</p> |
| 89 | + * |
| 90 | + * @throws {@link InvalidParameterValueException} (client fault) |
| 91 | + * <p>Indicates that something is wrong with a parameter's value. For example, the value is |
| 92 | + * out of range.</p> |
| 93 | + * |
| 94 | + * @throws {@link InvalidRequestException} (client fault) |
| 95 | + * <p>Indicates that something is wrong with the input to the request. For example, a |
| 96 | + * parameter is of the wrong type.</p> |
| 97 | + * |
| 98 | + * @throws {@link LimitExceededException} (client fault) |
| 99 | + * <p>A limit in the request has been exceeded; for example, a maximum number of items allowed |
| 100 | + * in a request.</p> |
| 101 | + * |
| 102 | + * @throws {@link MissingParameterValueException} (client fault) |
| 103 | + * <p>Indicates that a required parameter is missing.</p> |
| 104 | + * |
| 105 | + * @throws {@link ServiceUnavailableException} (server fault) |
| 106 | + * <p>The request failed due to a temporary failure of the server.</p> |
| 107 | + * |
| 108 | + * @throws {@link BackupServiceException} |
| 109 | + * <p>Base exception class for all service exceptions from Backup service.</p> |
| 110 | + * |
| 111 | + */ |
| 112 | +export class CreateLogicallyAirGappedBackupVaultCommand extends $Command< |
| 113 | + CreateLogicallyAirGappedBackupVaultCommandInput, |
| 114 | + CreateLogicallyAirGappedBackupVaultCommandOutput, |
| 115 | + BackupClientResolvedConfig |
| 116 | +> { |
| 117 | + // Start section: command_properties |
| 118 | + // End section: command_properties |
| 119 | + |
| 120 | + public static getEndpointParameterInstructions(): EndpointParameterInstructions { |
| 121 | + return { |
| 122 | + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, |
| 123 | + Endpoint: { type: "builtInParams", name: "endpoint" }, |
| 124 | + Region: { type: "builtInParams", name: "region" }, |
| 125 | + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, |
| 126 | + }; |
| 127 | + } |
| 128 | + |
| 129 | + /** |
| 130 | + * @public |
| 131 | + */ |
| 132 | + constructor(readonly input: CreateLogicallyAirGappedBackupVaultCommandInput) { |
| 133 | + // Start section: command_constructor |
| 134 | + super(); |
| 135 | + // End section: command_constructor |
| 136 | + } |
| 137 | + |
| 138 | + /** |
| 139 | + * @internal |
| 140 | + */ |
| 141 | + resolveMiddleware( |
| 142 | + clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, |
| 143 | + configuration: BackupClientResolvedConfig, |
| 144 | + options?: __HttpHandlerOptions |
| 145 | + ): Handler<CreateLogicallyAirGappedBackupVaultCommandInput, CreateLogicallyAirGappedBackupVaultCommandOutput> { |
| 146 | + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); |
| 147 | + this.middlewareStack.use( |
| 148 | + getEndpointPlugin(configuration, CreateLogicallyAirGappedBackupVaultCommand.getEndpointParameterInstructions()) |
| 149 | + ); |
| 150 | + |
| 151 | + const stack = clientStack.concat(this.middlewareStack); |
| 152 | + |
| 153 | + const { logger } = configuration; |
| 154 | + const clientName = "BackupClient"; |
| 155 | + const commandName = "CreateLogicallyAirGappedBackupVaultCommand"; |
| 156 | + const handlerExecutionContext: HandlerExecutionContext = { |
| 157 | + logger, |
| 158 | + clientName, |
| 159 | + commandName, |
| 160 | + inputFilterSensitiveLog: CreateLogicallyAirGappedBackupVaultInputFilterSensitiveLog, |
| 161 | + outputFilterSensitiveLog: (_: any) => _, |
| 162 | + }; |
| 163 | + const { requestHandler } = configuration; |
| 164 | + return stack.resolve( |
| 165 | + (request: FinalizeHandlerArguments<any>) => |
| 166 | + requestHandler.handle(request.request as __HttpRequest, options || {}), |
| 167 | + handlerExecutionContext |
| 168 | + ); |
| 169 | + } |
| 170 | + |
| 171 | + /** |
| 172 | + * @internal |
| 173 | + */ |
| 174 | + private serialize( |
| 175 | + input: CreateLogicallyAirGappedBackupVaultCommandInput, |
| 176 | + context: __SerdeContext |
| 177 | + ): Promise<__HttpRequest> { |
| 178 | + return se_CreateLogicallyAirGappedBackupVaultCommand(input, context); |
| 179 | + } |
| 180 | + |
| 181 | + /** |
| 182 | + * @internal |
| 183 | + */ |
| 184 | + private deserialize( |
| 185 | + output: __HttpResponse, |
| 186 | + context: __SerdeContext |
| 187 | + ): Promise<CreateLogicallyAirGappedBackupVaultCommandOutput> { |
| 188 | + return de_CreateLogicallyAirGappedBackupVaultCommand(output, context); |
| 189 | + } |
| 190 | + |
| 191 | + // Start section: command_body_extra |
| 192 | + // End section: command_body_extra |
| 193 | +} |
0 commit comments