Skip to content

Commit 8fd6242

Browse files
author
awstools
committed
feat(client-iot-data-plane): Adding DeleteConnection API to IoT Data Plane
1 parent c14f49d commit 8fd6242

File tree

10 files changed

+400
-49
lines changed

10 files changed

+400
-49
lines changed

clients/client-iot-data-plane/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,14 @@ see LICENSE for more information.
214214

215215
## Client Commands (Operations List)
216216

217+
<details>
218+
<summary>
219+
DeleteConnection
220+
</summary>
221+
222+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/iot-data-plane/command/DeleteConnectionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-iot-data-plane/Interface/DeleteConnectionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-iot-data-plane/Interface/DeleteConnectionCommandOutput/)
223+
224+
</details>
217225
<details>
218226
<summary>
219227
DeleteThingShadow

clients/client-iot-data-plane/src/IoTDataPlane.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
import { createAggregatedClient } from "@smithy/smithy-client";
33
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
44

5+
import {
6+
DeleteConnectionCommand,
7+
DeleteConnectionCommandInput,
8+
DeleteConnectionCommandOutput,
9+
} from "./commands/DeleteConnectionCommand";
510
import {
611
DeleteThingShadowCommand,
712
DeleteThingShadowCommandInput,
@@ -36,6 +41,7 @@ import {
3641
import { IoTDataPlaneClient, IoTDataPlaneClientConfig } from "./IoTDataPlaneClient";
3742

3843
const commands = {
44+
DeleteConnectionCommand,
3945
DeleteThingShadowCommand,
4046
GetRetainedMessageCommand,
4147
GetThingShadowCommand,
@@ -46,6 +52,23 @@ const commands = {
4652
};
4753

4854
export interface IoTDataPlane {
55+
/**
56+
* @see {@link DeleteConnectionCommand}
57+
*/
58+
deleteConnection(
59+
args: DeleteConnectionCommandInput,
60+
options?: __HttpHandlerOptions
61+
): Promise<DeleteConnectionCommandOutput>;
62+
deleteConnection(
63+
args: DeleteConnectionCommandInput,
64+
cb: (err: any, data?: DeleteConnectionCommandOutput) => void
65+
): void;
66+
deleteConnection(
67+
args: DeleteConnectionCommandInput,
68+
options: __HttpHandlerOptions,
69+
cb: (err: any, data?: DeleteConnectionCommandOutput) => void
70+
): void;
71+
4972
/**
5073
* @see {@link DeleteThingShadowCommand}
5174
*/

clients/client-iot-data-plane/src/IoTDataPlaneClient.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import {
5353
HttpAuthSchemeResolvedConfig,
5454
resolveHttpAuthSchemeConfig,
5555
} from "./auth/httpAuthSchemeProvider";
56+
import { DeleteConnectionCommandInput, DeleteConnectionCommandOutput } from "./commands/DeleteConnectionCommand";
5657
import { DeleteThingShadowCommandInput, DeleteThingShadowCommandOutput } from "./commands/DeleteThingShadowCommand";
5758
import { GetRetainedMessageCommandInput, GetRetainedMessageCommandOutput } from "./commands/GetRetainedMessageCommand";
5859
import { GetThingShadowCommandInput, GetThingShadowCommandOutput } from "./commands/GetThingShadowCommand";
@@ -81,6 +82,7 @@ export { __Client };
8182
* @public
8283
*/
8384
export type ServiceInputTypes =
85+
| DeleteConnectionCommandInput
8486
| DeleteThingShadowCommandInput
8587
| GetRetainedMessageCommandInput
8688
| GetThingShadowCommandInput
@@ -93,6 +95,7 @@ export type ServiceInputTypes =
9395
* @public
9496
*/
9597
export type ServiceOutputTypes =
98+
| DeleteConnectionCommandOutput
9699
| DeleteThingShadowCommandOutput
97100
| GetRetainedMessageCommandOutput
98101
| GetThingShadowCommandOutput
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import { IoTDataPlaneClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../IoTDataPlaneClient";
9+
import { DeleteConnectionRequest } from "../models/models_0";
10+
import { de_DeleteConnectionCommand, se_DeleteConnectionCommand } from "../protocols/Aws_restJson1";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link DeleteConnectionCommand}.
21+
*/
22+
export interface DeleteConnectionCommandInput extends DeleteConnectionRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link DeleteConnectionCommand}.
27+
*/
28+
export interface DeleteConnectionCommandOutput extends __MetadataBearer {}
29+
30+
/**
31+
* <p>Disconnects a connected MQTT client from Amazon Web Services IoT Core. When you disconnect a client, Amazon Web Services IoT Core closes the client's network connection and optionally cleans the session state.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { IoTDataPlaneClient, DeleteConnectionCommand } from "@aws-sdk/client-iot-data-plane"; // ES Modules import
36+
* // const { IoTDataPlaneClient, DeleteConnectionCommand } = require("@aws-sdk/client-iot-data-plane"); // CommonJS import
37+
* const client = new IoTDataPlaneClient(config);
38+
* const input = { // DeleteConnectionRequest
39+
* clientId: "STRING_VALUE", // required
40+
* cleanSession: true || false,
41+
* preventWillMessage: true || false,
42+
* };
43+
* const command = new DeleteConnectionCommand(input);
44+
* const response = await client.send(command);
45+
* // {};
46+
*
47+
* ```
48+
*
49+
* @param DeleteConnectionCommandInput - {@link DeleteConnectionCommandInput}
50+
* @returns {@link DeleteConnectionCommandOutput}
51+
* @see {@link DeleteConnectionCommandInput} for command's `input` shape.
52+
* @see {@link DeleteConnectionCommandOutput} for command's `response` shape.
53+
* @see {@link IoTDataPlaneClientResolvedConfig | config} for IoTDataPlaneClient's `config` shape.
54+
*
55+
* @throws {@link ForbiddenException} (client fault)
56+
* <p>The caller isn't authorized to make the request.</p>
57+
*
58+
* @throws {@link InternalFailureException} (server fault)
59+
* <p>An unexpected error has occurred.</p>
60+
*
61+
* @throws {@link InvalidRequestException} (client fault)
62+
* <p>The request is not valid.</p>
63+
*
64+
* @throws {@link ResourceNotFoundException} (client fault)
65+
* <p>The specified resource does not exist.</p>
66+
*
67+
* @throws {@link ThrottlingException} (client fault)
68+
* <p>The rate exceeds the limit.</p>
69+
*
70+
* @throws {@link IoTDataPlaneServiceException}
71+
* <p>Base exception class for all service exceptions from IoTDataPlane service.</p>
72+
*
73+
*
74+
* @public
75+
*/
76+
export class DeleteConnectionCommand extends $Command
77+
.classBuilder<
78+
DeleteConnectionCommandInput,
79+
DeleteConnectionCommandOutput,
80+
IoTDataPlaneClientResolvedConfig,
81+
ServiceInputTypes,
82+
ServiceOutputTypes
83+
>()
84+
.ep(commonParams)
85+
.m(function (this: any, Command: any, cs: any, config: IoTDataPlaneClientResolvedConfig, o: any) {
86+
return [
87+
getSerdePlugin(config, this.serialize, this.deserialize),
88+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
89+
];
90+
})
91+
.s("IotMoonrakerService", "DeleteConnection", {})
92+
.n("IoTDataPlaneClient", "DeleteConnectionCommand")
93+
.f(void 0, void 0)
94+
.ser(se_DeleteConnectionCommand)
95+
.de(de_DeleteConnectionCommand)
96+
.build() {
97+
/** @internal type navigation helper, not in runtime. */
98+
protected declare static __types: {
99+
api: {
100+
input: DeleteConnectionRequest;
101+
output: {};
102+
};
103+
sdk: {
104+
input: DeleteConnectionCommandInput;
105+
output: DeleteConnectionCommandOutput;
106+
};
107+
};
108+
}

clients/client-iot-data-plane/src/commands/GetRetainedMessageCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export interface GetRetainedMessageCommandOutput extends GetRetainedMessageRespo
3232
* <p>This action returns the message payload of the retained message, which can
3333
* incur messaging costs. To list only the topic names of the retained messages, call
3434
* <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_iotdata_ListRetainedMessages.html">ListRetainedMessages</a>.</p>
35-
* <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiotfleethubfordevicemanagement.html#awsiotfleethubfordevicemanagement-actions-as-permissions">GetRetainedMessage</a> action.</p>
35+
* <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html">GetRetainedMessage</a> action.</p>
3636
* <p>For more information about messaging costs, see <a href="http://aws.amazon.com/iot-core/pricing/#Messaging">Amazon Web Services IoT Core
3737
* pricing - Messaging</a>.</p>
3838
* @example

clients/client-iot-data-plane/src/commands/ListRetainedMessagesCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export interface ListRetainedMessagesCommandOutput extends ListRetainedMessagesR
3535
* <p>To get the message payload of a retained message, call
3636
* <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_iotdata_GetRetainedMessage.html">GetRetainedMessage</a>
3737
* with the topic name of the retained message.</p>
38-
* <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiotfleethubfordevicemanagement.html#awsiotfleethubfordevicemanagement-actions-as-permissions">ListRetainedMessages</a> action.</p>
38+
* <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html">ListRetainedMessages</a> action.</p>
3939
* <p>For more information about messaging costs, see <a href="http://aws.amazon.com/iot-core/pricing/#Messaging">Amazon Web Services IoT Core
4040
* pricing - Messaging</a>.</p>
4141
* @example

clients/client-iot-data-plane/src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// smithy-typescript generated code
2+
export * from "./DeleteConnectionCommand";
23
export * from "./DeleteThingShadowCommand";
34
export * from "./GetRetainedMessageCommand";
45
export * from "./GetThingShadowCommand";

0 commit comments

Comments
 (0)