-
Notifications
You must be signed in to change notification settings - Fork 584
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-connect): This release adds support for more granular bil…
…ling using tags (key:value pairs)
- Loading branch information
awstools
committed
Dec 14, 2023
1 parent
c81ff02
commit 417de03
Showing
13 changed files
with
916 additions
and
97 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
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
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
156 changes: 156 additions & 0 deletions
156
clients/client-connect/src/commands/TagContactCommand.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,156 @@ | ||
// smithy-typescript generated code | ||
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; | ||
import { getSerdePlugin } from "@smithy/middleware-serde"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; | ||
import { Command as $Command } from "@smithy/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
SerdeContext as __SerdeContext, | ||
SMITHY_CONTEXT_KEY, | ||
} from "@smithy/types"; | ||
|
||
import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient"; | ||
import { TagContactRequest, TagContactResponse } from "../models/models_2"; | ||
import { de_TagContactCommand, se_TagContactCommand } from "../protocols/Aws_restJson1"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export { __MetadataBearer, $Command }; | ||
/** | ||
* @public | ||
* | ||
* The input for {@link TagContactCommand}. | ||
*/ | ||
export interface TagContactCommandInput extends TagContactRequest {} | ||
/** | ||
* @public | ||
* | ||
* The output of {@link TagContactCommand}. | ||
*/ | ||
export interface TagContactCommandOutput extends TagContactResponse, __MetadataBearer {} | ||
|
||
/** | ||
* @public | ||
* <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 | ||
* view of your Amazon Connect usage</a>. | ||
* </p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { ConnectClient, TagContactCommand } from "@aws-sdk/client-connect"; // ES Modules import | ||
* // const { ConnectClient, TagContactCommand } = require("@aws-sdk/client-connect"); // CommonJS import | ||
* const client = new ConnectClient(config); | ||
* const input = { // TagContactRequest | ||
* ContactId: "STRING_VALUE", // required | ||
* InstanceId: "STRING_VALUE", // required | ||
* Tags: { // ContactTagMap // required | ||
* "<keys>": "STRING_VALUE", | ||
* }, | ||
* }; | ||
* const command = new TagContactCommand(input); | ||
* const response = await client.send(command); | ||
* // {}; | ||
* | ||
* ``` | ||
* | ||
* @param TagContactCommandInput - {@link TagContactCommandInput} | ||
* @returns {@link TagContactCommandOutput} | ||
* @see {@link TagContactCommandInput} for command's `input` shape. | ||
* @see {@link TagContactCommandOutput} for command's `response` shape. | ||
* @see {@link ConnectClientResolvedConfig | config} for ConnectClient's `config` shape. | ||
* | ||
* @throws {@link InternalServiceException} (server fault) | ||
* <p>Request processing failed because of an error or failure with the service.</p> | ||
* | ||
* @throws {@link InvalidParameterException} (client fault) | ||
* <p>One or more of the specified parameters are not valid.</p> | ||
* | ||
* @throws {@link InvalidRequestException} (client fault) | ||
* <p>The request is not valid.</p> | ||
* | ||
* @throws {@link ResourceNotFoundException} (client fault) | ||
* <p>The specified resource was not found.</p> | ||
* | ||
* @throws {@link ThrottlingException} (client fault) | ||
* <p>The throttling limit has been exceeded.</p> | ||
* | ||
* @throws {@link ConnectServiceException} | ||
* <p>Base exception class for all service exceptions from Connect service.</p> | ||
* | ||
*/ | ||
export class TagContactCommand extends $Command< | ||
TagContactCommandInput, | ||
TagContactCommandOutput, | ||
ConnectClientResolvedConfig | ||
> { | ||
public static getEndpointParameterInstructions(): EndpointParameterInstructions { | ||
return { | ||
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, | ||
Endpoint: { type: "builtInParams", name: "endpoint" }, | ||
Region: { type: "builtInParams", name: "region" }, | ||
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, | ||
}; | ||
} | ||
|
||
/** | ||
* @public | ||
*/ | ||
constructor(readonly input: TagContactCommandInput) { | ||
super(); | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: ConnectClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<TagContactCommandInput, TagContactCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
this.middlewareStack.use(getEndpointPlugin(configuration, TagContactCommand.getEndpointParameterInstructions())); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "ConnectClient"; | ||
const commandName = "TagContactCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: (_: any) => _, | ||
outputFilterSensitiveLog: (_: any) => _, | ||
[SMITHY_CONTEXT_KEY]: { | ||
service: "AmazonConnectService", | ||
operation: "TagContact", | ||
}, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
private serialize(input: TagContactCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return se_TagContactCommand(input, context); | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<TagContactCommandOutput> { | ||
return de_TagContactCommand(output, context); | ||
} | ||
} |
Oops, something went wrong.