-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-iot-events-data): Introducing new API for deleting detect…
…ors: BatchDeleteDetector.
- Loading branch information
awstools
committed
May 18, 2022
1 parent
0f427f3
commit 4320da0
Showing
7 changed files
with
493 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
clients/client-iot-events-data/src/commands/BatchDeleteDetectorCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
// smithy-typescript generated code | ||
import { getSerdePlugin } from "@aws-sdk/middleware-serde"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { Command as $Command } from "@aws-sdk/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
SerdeContext as __SerdeContext, | ||
} from "@aws-sdk/types"; | ||
|
||
import { IoTEventsDataClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../IoTEventsDataClient"; | ||
import { BatchDeleteDetectorRequest, BatchDeleteDetectorResponse } from "../models/models_0"; | ||
import { | ||
deserializeAws_restJson1BatchDeleteDetectorCommand, | ||
serializeAws_restJson1BatchDeleteDetectorCommand, | ||
} from "../protocols/Aws_restJson1"; | ||
|
||
export interface BatchDeleteDetectorCommandInput extends BatchDeleteDetectorRequest {} | ||
export interface BatchDeleteDetectorCommandOutput extends BatchDeleteDetectorResponse, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Deletes one or more detectors that were created. When a detector is deleted, its state will be cleared and the detector will be removed from the list of detectors. The deleted detector will no longer appear if referenced in the <a href="https://docs.aws.amazon.com/iotevents/latest/apireference/API_iotevents-data_ListDetectors.html">ListDetectors</a> API call.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { IoTEventsDataClient, BatchDeleteDetectorCommand } from "@aws-sdk/client-iot-events-data"; // ES Modules import | ||
* // const { IoTEventsDataClient, BatchDeleteDetectorCommand } = require("@aws-sdk/client-iot-events-data"); // CommonJS import | ||
* const client = new IoTEventsDataClient(config); | ||
* const command = new BatchDeleteDetectorCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link BatchDeleteDetectorCommandInput} for command's `input` shape. | ||
* @see {@link BatchDeleteDetectorCommandOutput} for command's `response` shape. | ||
* @see {@link IoTEventsDataClientResolvedConfig | config} for IoTEventsDataClient's `config` shape. | ||
* | ||
*/ | ||
export class BatchDeleteDetectorCommand extends $Command< | ||
BatchDeleteDetectorCommandInput, | ||
BatchDeleteDetectorCommandOutput, | ||
IoTEventsDataClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
constructor(readonly input: BatchDeleteDetectorCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: IoTEventsDataClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<BatchDeleteDetectorCommandInput, BatchDeleteDetectorCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "IoTEventsDataClient"; | ||
const commandName = "BatchDeleteDetectorCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: BatchDeleteDetectorRequest.filterSensitiveLog, | ||
outputFilterSensitiveLog: BatchDeleteDetectorResponse.filterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize(input: BatchDeleteDetectorCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return serializeAws_restJson1BatchDeleteDetectorCommand(input, context); | ||
} | ||
|
||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<BatchDeleteDetectorCommandOutput> { | ||
return deserializeAws_restJson1BatchDeleteDetectorCommand(output, context); | ||
} | ||
|
||
// Start section: command_body_extra | ||
// End section: command_body_extra | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.