Skip to content

Commit e5ad270

Browse files
author
awstools
committed
feat(client-qbusiness): This release supports deleting attachments from conversations.
1 parent 6ee1cf4 commit e5ad270

File tree

9 files changed

+358
-47
lines changed

9 files changed

+358
-47
lines changed

clients/client-qbusiness/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,14 @@ DeleteApplication
368368

369369
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/qbusiness/command/DeleteApplicationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qbusiness/Interface/DeleteApplicationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qbusiness/Interface/DeleteApplicationCommandOutput/)
370370

371+
</details>
372+
<details>
373+
<summary>
374+
DeleteAttachment
375+
</summary>
376+
377+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/qbusiness/command/DeleteAttachmentCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qbusiness/Interface/DeleteAttachmentCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qbusiness/Interface/DeleteAttachmentCommandOutput/)
378+
371379
</details>
372380
<details>
373381
<summary>

clients/client-qbusiness/src/QBusiness.ts

+23
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ import {
6666
DeleteApplicationCommandInput,
6767
DeleteApplicationCommandOutput,
6868
} from "./commands/DeleteApplicationCommand";
69+
import {
70+
DeleteAttachmentCommand,
71+
DeleteAttachmentCommandInput,
72+
DeleteAttachmentCommandOutput,
73+
} from "./commands/DeleteAttachmentCommand";
6974
import {
7075
DeleteChatControlsConfigurationCommand,
7176
DeleteChatControlsConfigurationCommandInput,
@@ -307,6 +312,7 @@ const commands = {
307312
CreateUserCommand,
308313
CreateWebExperienceCommand,
309314
DeleteApplicationCommand,
315+
DeleteAttachmentCommand,
310316
DeleteChatControlsConfigurationCommand,
311317
DeleteConversationCommand,
312318
DeleteDataAccessorCommand,
@@ -603,6 +609,23 @@ export interface QBusiness {
603609
cb: (err: any, data?: DeleteApplicationCommandOutput) => void
604610
): void;
605611

612+
/**
613+
* @see {@link DeleteAttachmentCommand}
614+
*/
615+
deleteAttachment(
616+
args: DeleteAttachmentCommandInput,
617+
options?: __HttpHandlerOptions
618+
): Promise<DeleteAttachmentCommandOutput>;
619+
deleteAttachment(
620+
args: DeleteAttachmentCommandInput,
621+
cb: (err: any, data?: DeleteAttachmentCommandOutput) => void
622+
): void;
623+
deleteAttachment(
624+
args: DeleteAttachmentCommandInput,
625+
options: __HttpHandlerOptions,
626+
cb: (err: any, data?: DeleteAttachmentCommandOutput) => void
627+
): void;
628+
606629
/**
607630
* @see {@link DeleteChatControlsConfigurationCommand}
608631
*/

clients/client-qbusiness/src/QBusinessClient.ts

+3
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ import {
9090
CreateWebExperienceCommandOutput,
9191
} from "./commands/CreateWebExperienceCommand";
9292
import { DeleteApplicationCommandInput, DeleteApplicationCommandOutput } from "./commands/DeleteApplicationCommand";
93+
import { DeleteAttachmentCommandInput, DeleteAttachmentCommandOutput } from "./commands/DeleteAttachmentCommand";
9394
import {
9495
DeleteChatControlsConfigurationCommandInput,
9596
DeleteChatControlsConfigurationCommandOutput,
@@ -218,6 +219,7 @@ export type ServiceInputTypes =
218219
| CreateUserCommandInput
219220
| CreateWebExperienceCommandInput
220221
| DeleteApplicationCommandInput
222+
| DeleteAttachmentCommandInput
221223
| DeleteChatControlsConfigurationCommandInput
222224
| DeleteConversationCommandInput
223225
| DeleteDataAccessorCommandInput
@@ -297,6 +299,7 @@ export type ServiceOutputTypes =
297299
| CreateUserCommandOutput
298300
| CreateWebExperienceCommandOutput
299301
| DeleteApplicationCommandOutput
302+
| DeleteAttachmentCommandOutput
300303
| DeleteChatControlsConfigurationCommandOutput
301304
| DeleteConversationCommandOutput
302305
| DeleteDataAccessorCommandOutput
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
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 { DeleteAttachmentRequest, DeleteAttachmentResponse } from "../models/models_0";
9+
import { de_DeleteAttachmentCommand, se_DeleteAttachmentCommand } from "../protocols/Aws_restJson1";
10+
import { QBusinessClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QBusinessClient";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link DeleteAttachmentCommand}.
21+
*/
22+
export interface DeleteAttachmentCommandInput extends DeleteAttachmentRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link DeleteAttachmentCommand}.
27+
*/
28+
export interface DeleteAttachmentCommandOutput extends DeleteAttachmentResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Deletes an attachment associated with a specific Amazon Q Business conversation.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { QBusinessClient, DeleteAttachmentCommand } from "@aws-sdk/client-qbusiness"; // ES Modules import
36+
* // const { QBusinessClient, DeleteAttachmentCommand } = require("@aws-sdk/client-qbusiness"); // CommonJS import
37+
* const client = new QBusinessClient(config);
38+
* const input = { // DeleteAttachmentRequest
39+
* applicationId: "STRING_VALUE", // required
40+
* conversationId: "STRING_VALUE", // required
41+
* attachmentId: "STRING_VALUE", // required
42+
* userId: "STRING_VALUE",
43+
* };
44+
* const command = new DeleteAttachmentCommand(input);
45+
* const response = await client.send(command);
46+
* // {};
47+
*
48+
* ```
49+
*
50+
* @param DeleteAttachmentCommandInput - {@link DeleteAttachmentCommandInput}
51+
* @returns {@link DeleteAttachmentCommandOutput}
52+
* @see {@link DeleteAttachmentCommandInput} for command's `input` shape.
53+
* @see {@link DeleteAttachmentCommandOutput} for command's `response` shape.
54+
* @see {@link QBusinessClientResolvedConfig | config} for QBusinessClient's `config` shape.
55+
*
56+
* @throws {@link AccessDeniedException} (client fault)
57+
* <p> You don't have access to perform this action. Make sure you have the required
58+
* permission policies and user accounts and try again.</p>
59+
*
60+
* @throws {@link InternalServerException} (server fault)
61+
* <p>An issue occurred with the internal server used for your Amazon Q Business service. Wait
62+
* some minutes and try again, or contact <a href="http://aws.amazon.com/contact-us/">Support</a> for help.</p>
63+
*
64+
* @throws {@link LicenseNotFoundException} (client fault)
65+
* <p>You don't have permissions to perform the action because your license is inactive. Ask
66+
* your admin to activate your license and try again after your licence is active.</p>
67+
*
68+
* @throws {@link ResourceNotFoundException} (client fault)
69+
* <p>The application or plugin resource you want to use doesn’t exist. Make sure you have
70+
* provided the correct resource and try again.</p>
71+
*
72+
* @throws {@link ThrottlingException} (client fault)
73+
* <p>The request was denied due to throttling. Reduce the number of requests and try
74+
* again.</p>
75+
*
76+
* @throws {@link ValidationException} (client fault)
77+
* <p>The input doesn't meet the constraints set by the Amazon Q Business service. Provide the
78+
* correct input and try again.</p>
79+
*
80+
* @throws {@link QBusinessServiceException}
81+
* <p>Base exception class for all service exceptions from QBusiness service.</p>
82+
*
83+
* @public
84+
*/
85+
export class DeleteAttachmentCommand extends $Command
86+
.classBuilder<
87+
DeleteAttachmentCommandInput,
88+
DeleteAttachmentCommandOutput,
89+
QBusinessClientResolvedConfig,
90+
ServiceInputTypes,
91+
ServiceOutputTypes
92+
>()
93+
.ep(commonParams)
94+
.m(function (this: any, Command: any, cs: any, config: QBusinessClientResolvedConfig, o: any) {
95+
return [
96+
getSerdePlugin(config, this.serialize, this.deserialize),
97+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
98+
];
99+
})
100+
.s("ExpertQ", "DeleteAttachment", {})
101+
.n("QBusinessClient", "DeleteAttachmentCommand")
102+
.f(void 0, void 0)
103+
.ser(se_DeleteAttachmentCommand)
104+
.de(de_DeleteAttachmentCommand)
105+
.build() {
106+
/** @internal type navigation helper, not in runtime. */
107+
protected declare static __types: {
108+
api: {
109+
input: DeleteAttachmentRequest;
110+
output: {};
111+
};
112+
sdk: {
113+
input: DeleteAttachmentCommandInput;
114+
output: DeleteAttachmentCommandOutput;
115+
};
116+
};
117+
}

clients/client-qbusiness/src/commands/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export * from "./CreateSubscriptionCommand";
1515
export * from "./CreateUserCommand";
1616
export * from "./CreateWebExperienceCommand";
1717
export * from "./DeleteApplicationCommand";
18+
export * from "./DeleteAttachmentCommand";
1819
export * from "./DeleteChatControlsConfigurationCommand";
1920
export * from "./DeleteConversationCommand";
2021
export * from "./DeleteDataAccessorCommand";

clients/client-qbusiness/src/models/models_0.ts

+34-45
Original file line numberDiff line numberDiff line change
@@ -6817,6 +6817,40 @@ export interface DataSourceSyncJob {
68176817
metrics?: DataSourceSyncJobMetrics | undefined;
68186818
}
68196819

6820+
/**
6821+
* @public
6822+
*/
6823+
export interface DeleteAttachmentRequest {
6824+
/**
6825+
* <p>The unique identifier for the Amazon Q Business application environment.</p>
6826+
* @public
6827+
*/
6828+
applicationId: string | undefined;
6829+
6830+
/**
6831+
* <p>The unique identifier of the conversation.</p>
6832+
* @public
6833+
*/
6834+
conversationId: string | undefined;
6835+
6836+
/**
6837+
* <p>The unique identifier for the attachment.</p>
6838+
* @public
6839+
*/
6840+
attachmentId: string | undefined;
6841+
6842+
/**
6843+
* <p>The unique identifier of the user involved in the conversation.</p>
6844+
* @public
6845+
*/
6846+
userId?: string | undefined;
6847+
}
6848+
6849+
/**
6850+
* @public
6851+
*/
6852+
export interface DeleteAttachmentResponse {}
6853+
68206854
/**
68216855
* @public
68226856
*/
@@ -8191,51 +8225,6 @@ export const MessageUsefulnessReason = {
81918225
*/
81928226
export type MessageUsefulnessReason = (typeof MessageUsefulnessReason)[keyof typeof MessageUsefulnessReason];
81938227

8194-
/**
8195-
* @public
8196-
* @enum
8197-
*/
8198-
export const MessageUsefulness = {
8199-
NOT_USEFUL: "NOT_USEFUL",
8200-
USEFUL: "USEFUL",
8201-
} as const;
8202-
8203-
/**
8204-
* @public
8205-
*/
8206-
export type MessageUsefulness = (typeof MessageUsefulness)[keyof typeof MessageUsefulness];
8207-
8208-
/**
8209-
* <p>End user feedback on an AI-generated web experience chat message usefulness.</p>
8210-
* @public
8211-
*/
8212-
export interface MessageUsefulnessFeedback {
8213-
/**
8214-
* <p>The usefulness value assigned by an end user to a message.</p>
8215-
* @public
8216-
*/
8217-
usefulness: MessageUsefulness | undefined;
8218-
8219-
/**
8220-
* <p>The reason for a usefulness rating.</p>
8221-
* @public
8222-
*/
8223-
reason?: MessageUsefulnessReason | undefined;
8224-
8225-
/**
8226-
* <p>A comment given by an end user on the usefulness of an AI-generated chat
8227-
* message.</p>
8228-
* @public
8229-
*/
8230-
comment?: string | undefined;
8231-
8232-
/**
8233-
* <p>The timestamp for when the feedback was submitted.</p>
8234-
* @public
8235-
*/
8236-
submittedAt: Date | undefined;
8237-
}
8238-
82398228
/**
82408229
* @internal
82418230
*/

clients/client-qbusiness/src/models/models_1.ts

+46-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
DocumentAttribute,
1717
EndOfInputEvent,
1818
MembershipType,
19-
MessageUsefulnessFeedback,
19+
MessageUsefulnessReason,
2020
OrchestrationControl,
2121
ResponseScope,
2222
S3,
@@ -28,6 +28,51 @@ import {
2828
UserAlias,
2929
} from "./models_0";
3030

31+
/**
32+
* @public
33+
* @enum
34+
*/
35+
export const MessageUsefulness = {
36+
NOT_USEFUL: "NOT_USEFUL",
37+
USEFUL: "USEFUL",
38+
} as const;
39+
40+
/**
41+
* @public
42+
*/
43+
export type MessageUsefulness = (typeof MessageUsefulness)[keyof typeof MessageUsefulness];
44+
45+
/**
46+
* <p>End user feedback on an AI-generated web experience chat message usefulness.</p>
47+
* @public
48+
*/
49+
export interface MessageUsefulnessFeedback {
50+
/**
51+
* <p>The usefulness value assigned by an end user to a message.</p>
52+
* @public
53+
*/
54+
usefulness: MessageUsefulness | undefined;
55+
56+
/**
57+
* <p>The reason for a usefulness rating.</p>
58+
* @public
59+
*/
60+
reason?: MessageUsefulnessReason | undefined;
61+
62+
/**
63+
* <p>A comment given by an end user on the usefulness of an AI-generated chat
64+
* message.</p>
65+
* @public
66+
*/
67+
comment?: string | undefined;
68+
69+
/**
70+
* <p>The timestamp for when the feedback was submitted.</p>
71+
* @public
72+
*/
73+
submittedAt: Date | undefined;
74+
}
75+
3176
/**
3277
* @public
3378
*/

0 commit comments

Comments
 (0)