Skip to content

Commit 417de03

Browse files
author
awstools
committed
feat(client-connect): This release adds support for more granular billing using tags (key:value pairs)
1 parent c81ff02 commit 417de03

File tree

13 files changed

+916
-97
lines changed

13 files changed

+916
-97
lines changed

clients/client-connect/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,6 +1660,14 @@ SuspendContactRecording
16601660

16611661
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connect/command/SuspendContactRecordingCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/SuspendContactRecordingCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/SuspendContactRecordingCommandOutput/)
16621662

1663+
</details>
1664+
<details>
1665+
<summary>
1666+
TagContact
1667+
</summary>
1668+
1669+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connect/command/TagContactCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/TagContactCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/TagContactCommandOutput/)
1670+
16631671
</details>
16641672
<details>
16651673
<summary>
@@ -1676,6 +1684,14 @@ TransferContact
16761684

16771685
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connect/command/TransferContactCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/TransferContactCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/TransferContactCommandOutput/)
16781686

1687+
</details>
1688+
<details>
1689+
<summary>
1690+
UntagContact
1691+
</summary>
1692+
1693+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/connect/command/UntagContactCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/UntagContactCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-connect/Interface/UntagContactCommandOutput/)
1694+
16791695
</details>
16801696
<details>
16811697
<summary>

clients/client-connect/src/Connect.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,12 +839,18 @@ import {
839839
SuspendContactRecordingCommandInput,
840840
SuspendContactRecordingCommandOutput,
841841
} from "./commands/SuspendContactRecordingCommand";
842+
import { TagContactCommand, TagContactCommandInput, TagContactCommandOutput } from "./commands/TagContactCommand";
842843
import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
843844
import {
844845
TransferContactCommand,
845846
TransferContactCommandInput,
846847
TransferContactCommandOutput,
847848
} from "./commands/TransferContactCommand";
849+
import {
850+
UntagContactCommand,
851+
UntagContactCommandInput,
852+
UntagContactCommandOutput,
853+
} from "./commands/UntagContactCommand";
848854
import {
849855
UntagResourceCommand,
850856
UntagResourceCommandInput,
@@ -1245,8 +1251,10 @@ const commands = {
12451251
StopContactStreamingCommand,
12461252
SubmitContactEvaluationCommand,
12471253
SuspendContactRecordingCommand,
1254+
TagContactCommand,
12481255
TagResourceCommand,
12491256
TransferContactCommand,
1257+
UntagContactCommand,
12501258
UntagResourceCommand,
12511259
UpdateAgentStatusCommand,
12521260
UpdateContactCommand,
@@ -4137,6 +4145,17 @@ export interface Connect {
41374145
cb: (err: any, data?: SuspendContactRecordingCommandOutput) => void
41384146
): void;
41394147

4148+
/**
4149+
* @see {@link TagContactCommand}
4150+
*/
4151+
tagContact(args: TagContactCommandInput, options?: __HttpHandlerOptions): Promise<TagContactCommandOutput>;
4152+
tagContact(args: TagContactCommandInput, cb: (err: any, data?: TagContactCommandOutput) => void): void;
4153+
tagContact(
4154+
args: TagContactCommandInput,
4155+
options: __HttpHandlerOptions,
4156+
cb: (err: any, data?: TagContactCommandOutput) => void
4157+
): void;
4158+
41404159
/**
41414160
* @see {@link TagResourceCommand}
41424161
*/
@@ -4162,6 +4181,17 @@ export interface Connect {
41624181
cb: (err: any, data?: TransferContactCommandOutput) => void
41634182
): void;
41644183

4184+
/**
4185+
* @see {@link UntagContactCommand}
4186+
*/
4187+
untagContact(args: UntagContactCommandInput, options?: __HttpHandlerOptions): Promise<UntagContactCommandOutput>;
4188+
untagContact(args: UntagContactCommandInput, cb: (err: any, data?: UntagContactCommandOutput) => void): void;
4189+
untagContact(
4190+
args: UntagContactCommandInput,
4191+
options: __HttpHandlerOptions,
4192+
cb: (err: any, data?: UntagContactCommandOutput) => void
4193+
): void;
4194+
41654195
/**
41664196
* @see {@link UntagResourceCommand}
41674197
*/

clients/client-connect/src/ConnectClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,10 @@ import {
529529
SuspendContactRecordingCommandInput,
530530
SuspendContactRecordingCommandOutput,
531531
} from "./commands/SuspendContactRecordingCommand";
532+
import { TagContactCommandInput, TagContactCommandOutput } from "./commands/TagContactCommand";
532533
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
533534
import { TransferContactCommandInput, TransferContactCommandOutput } from "./commands/TransferContactCommand";
535+
import { UntagContactCommandInput, UntagContactCommandOutput } from "./commands/UntagContactCommand";
534536
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
535537
import { UpdateAgentStatusCommandInput, UpdateAgentStatusCommandOutput } from "./commands/UpdateAgentStatusCommand";
536538
import {
@@ -870,8 +872,10 @@ export type ServiceInputTypes =
870872
| StopContactStreamingCommandInput
871873
| SubmitContactEvaluationCommandInput
872874
| SuspendContactRecordingCommandInput
875+
| TagContactCommandInput
873876
| TagResourceCommandInput
874877
| TransferContactCommandInput
878+
| UntagContactCommandInput
875879
| UntagResourceCommandInput
876880
| UpdateAgentStatusCommandInput
877881
| UpdateContactAttributesCommandInput
@@ -1102,8 +1106,10 @@ export type ServiceOutputTypes =
11021106
| StopContactStreamingCommandOutput
11031107
| SubmitContactEvaluationCommandOutput
11041108
| SuspendContactRecordingCommandOutput
1109+
| TagContactCommandOutput
11051110
| TagResourceCommandOutput
11061111
| TransferContactCommandOutput
1112+
| UntagContactCommandOutput
11071113
| UntagResourceCommandOutput
11081114
| UpdateAgentStatusCommandOutput
11091115
| UpdateContactAttributesCommandOutput

clients/client-connect/src/commands/BatchAssociateAnalyticsDataSetCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ export interface BatchAssociateAnalyticsDataSetCommandOutput
4343
/**
4444
* @public
4545
* <p>This API is in preview release for Amazon Connect and is subject to change.</p>
46-
* <p>Associates a list of analytics datasets for a given Amazon Connect instance to a target account. You can
47-
* associate multiple datasets in a single call.</p>
46+
* <p>Associates a list of analytics datasets for a given Amazon Connect instance to a target
47+
* account. You can associate multiple datasets in a single call.</p>
4848
* @example
4949
* Use a bare-bones client and the command you need to make an API call.
5050
* ```javascript

clients/client-connect/src/commands/DescribeContactCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ export interface DescribeContactCommandOutput extends DescribeContactResponse, _
8383
* // WisdomInfo: { // WisdomInfo
8484
* // SessionArn: "STRING_VALUE",
8585
* // },
86+
* // Tags: { // ContactTagMap
87+
* // "<keys>": "STRING_VALUE",
88+
* // },
8689
* // },
8790
* // };
8891
*
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
5+
import { Command as $Command } from "@smithy/smithy-client";
6+
import {
7+
FinalizeHandlerArguments,
8+
Handler,
9+
HandlerExecutionContext,
10+
HttpHandlerOptions as __HttpHandlerOptions,
11+
MetadataBearer as __MetadataBearer,
12+
MiddlewareStack,
13+
SerdeContext as __SerdeContext,
14+
SMITHY_CONTEXT_KEY,
15+
} from "@smithy/types";
16+
17+
import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
18+
import { TagContactRequest, TagContactResponse } from "../models/models_2";
19+
import { de_TagContactCommand, se_TagContactCommand } from "../protocols/Aws_restJson1";
20+
21+
/**
22+
* @public
23+
*/
24+
export { __MetadataBearer, $Command };
25+
/**
26+
* @public
27+
*
28+
* The input for {@link TagContactCommand}.
29+
*/
30+
export interface TagContactCommandInput extends TagContactRequest {}
31+
/**
32+
* @public
33+
*
34+
* The output of {@link TagContactCommand}.
35+
*/
36+
export interface TagContactCommandOutput extends TagContactResponse, __MetadataBearer {}
37+
38+
/**
39+
* @public
40+
* <p>Adds the specified tags to the contact resource. For more information about this API is used, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/granular-billing.html">Set up granular billing for a detailed
41+
* view of your Amazon Connect usage</a>.
42+
* </p>
43+
* @example
44+
* Use a bare-bones client and the command you need to make an API call.
45+
* ```javascript
46+
* import { ConnectClient, TagContactCommand } from "@aws-sdk/client-connect"; // ES Modules import
47+
* // const { ConnectClient, TagContactCommand } = require("@aws-sdk/client-connect"); // CommonJS import
48+
* const client = new ConnectClient(config);
49+
* const input = { // TagContactRequest
50+
* ContactId: "STRING_VALUE", // required
51+
* InstanceId: "STRING_VALUE", // required
52+
* Tags: { // ContactTagMap // required
53+
* "<keys>": "STRING_VALUE",
54+
* },
55+
* };
56+
* const command = new TagContactCommand(input);
57+
* const response = await client.send(command);
58+
* // {};
59+
*
60+
* ```
61+
*
62+
* @param TagContactCommandInput - {@link TagContactCommandInput}
63+
* @returns {@link TagContactCommandOutput}
64+
* @see {@link TagContactCommandInput} for command's `input` shape.
65+
* @see {@link TagContactCommandOutput} for command's `response` shape.
66+
* @see {@link ConnectClientResolvedConfig | config} for ConnectClient's `config` shape.
67+
*
68+
* @throws {@link InternalServiceException} (server fault)
69+
* <p>Request processing failed because of an error or failure with the service.</p>
70+
*
71+
* @throws {@link InvalidParameterException} (client fault)
72+
* <p>One or more of the specified parameters are not valid.</p>
73+
*
74+
* @throws {@link InvalidRequestException} (client fault)
75+
* <p>The request is not valid.</p>
76+
*
77+
* @throws {@link ResourceNotFoundException} (client fault)
78+
* <p>The specified resource was not found.</p>
79+
*
80+
* @throws {@link ThrottlingException} (client fault)
81+
* <p>The throttling limit has been exceeded.</p>
82+
*
83+
* @throws {@link ConnectServiceException}
84+
* <p>Base exception class for all service exceptions from Connect service.</p>
85+
*
86+
*/
87+
export class TagContactCommand extends $Command<
88+
TagContactCommandInput,
89+
TagContactCommandOutput,
90+
ConnectClientResolvedConfig
91+
> {
92+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
93+
return {
94+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
95+
Endpoint: { type: "builtInParams", name: "endpoint" },
96+
Region: { type: "builtInParams", name: "region" },
97+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
98+
};
99+
}
100+
101+
/**
102+
* @public
103+
*/
104+
constructor(readonly input: TagContactCommandInput) {
105+
super();
106+
}
107+
108+
/**
109+
* @internal
110+
*/
111+
resolveMiddleware(
112+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
113+
configuration: ConnectClientResolvedConfig,
114+
options?: __HttpHandlerOptions
115+
): Handler<TagContactCommandInput, TagContactCommandOutput> {
116+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
117+
this.middlewareStack.use(getEndpointPlugin(configuration, TagContactCommand.getEndpointParameterInstructions()));
118+
119+
const stack = clientStack.concat(this.middlewareStack);
120+
121+
const { logger } = configuration;
122+
const clientName = "ConnectClient";
123+
const commandName = "TagContactCommand";
124+
const handlerExecutionContext: HandlerExecutionContext = {
125+
logger,
126+
clientName,
127+
commandName,
128+
inputFilterSensitiveLog: (_: any) => _,
129+
outputFilterSensitiveLog: (_: any) => _,
130+
[SMITHY_CONTEXT_KEY]: {
131+
service: "AmazonConnectService",
132+
operation: "TagContact",
133+
},
134+
};
135+
const { requestHandler } = configuration;
136+
return stack.resolve(
137+
(request: FinalizeHandlerArguments<any>) =>
138+
requestHandler.handle(request.request as __HttpRequest, options || {}),
139+
handlerExecutionContext
140+
);
141+
}
142+
143+
/**
144+
* @internal
145+
*/
146+
private serialize(input: TagContactCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
147+
return se_TagContactCommand(input, context);
148+
}
149+
150+
/**
151+
* @internal
152+
*/
153+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<TagContactCommandOutput> {
154+
return de_TagContactCommand(output, context);
155+
}
156+
}

0 commit comments

Comments
 (0)