|
| 1 | +import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient"; |
| 2 | +import { HttpChecksumRequiredInputOutput } from "../models/models_0"; |
| 3 | +import { |
| 4 | + deserializeAws_restJson1HttpChecksumRequiredCommand, |
| 5 | + serializeAws_restJson1HttpChecksumRequiredCommand, |
| 6 | +} from "../protocols/Aws_restJson1"; |
| 7 | +import { getApplyMd5BodyChecksumPlugin } from "@aws-sdk/middleware-apply-body-checksum"; |
| 8 | +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; |
| 9 | +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; |
| 10 | +import { Command as $Command } from "@aws-sdk/smithy-client"; |
| 11 | +import { |
| 12 | + FinalizeHandlerArguments, |
| 13 | + Handler, |
| 14 | + HandlerExecutionContext, |
| 15 | + MiddlewareStack, |
| 16 | + HttpHandlerOptions as __HttpHandlerOptions, |
| 17 | + MetadataBearer as __MetadataBearer, |
| 18 | + SerdeContext as __SerdeContext, |
| 19 | +} from "@aws-sdk/types"; |
| 20 | + |
| 21 | +export interface HttpChecksumRequiredCommandInput extends HttpChecksumRequiredInputOutput {} |
| 22 | +export interface HttpChecksumRequiredCommandOutput extends HttpChecksumRequiredInputOutput, __MetadataBearer {} |
| 23 | + |
| 24 | +/** |
| 25 | + * This example tests httpChecksumRequired trait |
| 26 | + * @example |
| 27 | + * Use a bare-bones client and the command you need to make an API call. |
| 28 | + * ```javascript |
| 29 | + * import { RestJsonProtocolClient, HttpChecksumRequiredCommand } from "@aws-sdk/aws-restjson"; // ES Modules import |
| 30 | + * // const { RestJsonProtocolClient, HttpChecksumRequiredCommand } = require("@aws-sdk/aws-restjson"); // CommonJS import |
| 31 | + * const client = new RestJsonProtocolClient(config); |
| 32 | + * const command = new HttpChecksumRequiredCommand(input); |
| 33 | + * const response = await client.send(command); |
| 34 | + * ``` |
| 35 | + * |
| 36 | + * @see {@link HttpChecksumRequiredCommandInput} for command's `input` shape. |
| 37 | + * @see {@link HttpChecksumRequiredCommandOutput} for command's `response` shape. |
| 38 | + * @see {@link RestJsonProtocolClientResolvedConfig | config} for command's `input` shape. |
| 39 | + * |
| 40 | + */ |
| 41 | +export class HttpChecksumRequiredCommand extends $Command< |
| 42 | + HttpChecksumRequiredCommandInput, |
| 43 | + HttpChecksumRequiredCommandOutput, |
| 44 | + RestJsonProtocolClientResolvedConfig |
| 45 | +> { |
| 46 | + // Start section: command_properties |
| 47 | + // End section: command_properties |
| 48 | + |
| 49 | + constructor(readonly input: HttpChecksumRequiredCommandInput) { |
| 50 | + // Start section: command_constructor |
| 51 | + super(); |
| 52 | + // End section: command_constructor |
| 53 | + } |
| 54 | + |
| 55 | + /** |
| 56 | + * @internal |
| 57 | + */ |
| 58 | + resolveMiddleware( |
| 59 | + clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, |
| 60 | + configuration: RestJsonProtocolClientResolvedConfig, |
| 61 | + options?: __HttpHandlerOptions |
| 62 | + ): Handler<HttpChecksumRequiredCommandInput, HttpChecksumRequiredCommandOutput> { |
| 63 | + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); |
| 64 | + this.middlewareStack.use(getApplyMd5BodyChecksumPlugin(configuration)); |
| 65 | + |
| 66 | + const stack = clientStack.concat(this.middlewareStack); |
| 67 | + |
| 68 | + const { logger } = configuration; |
| 69 | + const clientName = "RestJsonProtocolClient"; |
| 70 | + const commandName = "HttpChecksumRequiredCommand"; |
| 71 | + const handlerExecutionContext: HandlerExecutionContext = { |
| 72 | + logger, |
| 73 | + clientName, |
| 74 | + commandName, |
| 75 | + inputFilterSensitiveLog: HttpChecksumRequiredInputOutput.filterSensitiveLog, |
| 76 | + outputFilterSensitiveLog: HttpChecksumRequiredInputOutput.filterSensitiveLog, |
| 77 | + }; |
| 78 | + const { requestHandler } = configuration; |
| 79 | + return stack.resolve( |
| 80 | + (request: FinalizeHandlerArguments<any>) => |
| 81 | + requestHandler.handle(request.request as __HttpRequest, options || {}), |
| 82 | + handlerExecutionContext |
| 83 | + ); |
| 84 | + } |
| 85 | + |
| 86 | + private serialize(input: HttpChecksumRequiredCommandInput, context: __SerdeContext): Promise<__HttpRequest> { |
| 87 | + return serializeAws_restJson1HttpChecksumRequiredCommand(input, context); |
| 88 | + } |
| 89 | + |
| 90 | + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<HttpChecksumRequiredCommandOutput> { |
| 91 | + return deserializeAws_restJson1HttpChecksumRequiredCommand(output, context); |
| 92 | + } |
| 93 | + |
| 94 | + // Start section: command_body_extra |
| 95 | + // End section: command_body_extra |
| 96 | +} |
0 commit comments