|
| 1 | +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; |
| 2 | +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; |
| 3 | +import { Command as $Command } from "@aws-sdk/smithy-client"; |
| 4 | +import { |
| 5 | + FinalizeHandlerArguments, |
| 6 | + Handler, |
| 7 | + HandlerExecutionContext, |
| 8 | + HttpHandlerOptions as __HttpHandlerOptions, |
| 9 | + MetadataBearer as __MetadataBearer, |
| 10 | + MiddlewareStack, |
| 11 | + SerdeContext as __SerdeContext, |
| 12 | +} from "@aws-sdk/types"; |
| 13 | + |
| 14 | +import { LookoutMetricsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../LookoutMetricsClient"; |
| 15 | +import { DetectMetricSetConfigRequest, DetectMetricSetConfigResponse } from "../models/models_0"; |
| 16 | +import { |
| 17 | + deserializeAws_restJson1DetectMetricSetConfigCommand, |
| 18 | + serializeAws_restJson1DetectMetricSetConfigCommand, |
| 19 | +} from "../protocols/Aws_restJson1"; |
| 20 | + |
| 21 | +export interface DetectMetricSetConfigCommandInput extends DetectMetricSetConfigRequest {} |
| 22 | +export interface DetectMetricSetConfigCommandOutput extends DetectMetricSetConfigResponse, __MetadataBearer {} |
| 23 | + |
| 24 | +/** |
| 25 | + * <p>Detects an Amazon S3 dataset's file format, interval, and offset.</p> |
| 26 | + * @example |
| 27 | + * Use a bare-bones client and the command you need to make an API call. |
| 28 | + * ```javascript |
| 29 | + * import { LookoutMetricsClient, DetectMetricSetConfigCommand } from "@aws-sdk/client-lookoutmetrics"; // ES Modules import |
| 30 | + * // const { LookoutMetricsClient, DetectMetricSetConfigCommand } = require("@aws-sdk/client-lookoutmetrics"); // CommonJS import |
| 31 | + * const client = new LookoutMetricsClient(config); |
| 32 | + * const command = new DetectMetricSetConfigCommand(input); |
| 33 | + * const response = await client.send(command); |
| 34 | + * ``` |
| 35 | + * |
| 36 | + * @see {@link DetectMetricSetConfigCommandInput} for command's `input` shape. |
| 37 | + * @see {@link DetectMetricSetConfigCommandOutput} for command's `response` shape. |
| 38 | + * @see {@link LookoutMetricsClientResolvedConfig | config} for LookoutMetricsClient's `config` shape. |
| 39 | + * |
| 40 | + */ |
| 41 | +export class DetectMetricSetConfigCommand extends $Command< |
| 42 | + DetectMetricSetConfigCommandInput, |
| 43 | + DetectMetricSetConfigCommandOutput, |
| 44 | + LookoutMetricsClientResolvedConfig |
| 45 | +> { |
| 46 | + // Start section: command_properties |
| 47 | + // End section: command_properties |
| 48 | + |
| 49 | + constructor(readonly input: DetectMetricSetConfigCommandInput) { |
| 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: LookoutMetricsClientResolvedConfig, |
| 61 | + options?: __HttpHandlerOptions |
| 62 | + ): Handler<DetectMetricSetConfigCommandInput, DetectMetricSetConfigCommandOutput> { |
| 63 | + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); |
| 64 | + |
| 65 | + const stack = clientStack.concat(this.middlewareStack); |
| 66 | + |
| 67 | + const { logger } = configuration; |
| 68 | + const clientName = "LookoutMetricsClient"; |
| 69 | + const commandName = "DetectMetricSetConfigCommand"; |
| 70 | + const handlerExecutionContext: HandlerExecutionContext = { |
| 71 | + logger, |
| 72 | + clientName, |
| 73 | + commandName, |
| 74 | + inputFilterSensitiveLog: DetectMetricSetConfigRequest.filterSensitiveLog, |
| 75 | + outputFilterSensitiveLog: DetectMetricSetConfigResponse.filterSensitiveLog, |
| 76 | + }; |
| 77 | + const { requestHandler } = configuration; |
| 78 | + return stack.resolve( |
| 79 | + (request: FinalizeHandlerArguments<any>) => |
| 80 | + requestHandler.handle(request.request as __HttpRequest, options || {}), |
| 81 | + handlerExecutionContext |
| 82 | + ); |
| 83 | + } |
| 84 | + |
| 85 | + private serialize(input: DetectMetricSetConfigCommandInput, context: __SerdeContext): Promise<__HttpRequest> { |
| 86 | + return serializeAws_restJson1DetectMetricSetConfigCommand(input, context); |
| 87 | + } |
| 88 | + |
| 89 | + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<DetectMetricSetConfigCommandOutput> { |
| 90 | + return deserializeAws_restJson1DetectMetricSetConfigCommand(output, context); |
| 91 | + } |
| 92 | + |
| 93 | + // Start section: command_body_extra |
| 94 | + // End section: command_body_extra |
| 95 | +} |
0 commit comments