-
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 provides a way to search for exist…
…ing tags within an instance. Before tagging a resource, ensure consistency by searching for pre-existing key:value pairs.
- Loading branch information
awstools
committed
Jun 26, 2023
1 parent
cd5ca74
commit fff346b
Showing
15 changed files
with
963 additions
and
199 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
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
180 changes: 180 additions & 0 deletions
180
clients/client-connect/src/commands/SearchResourceTagsCommand.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,180 @@ | ||
// smithy-typescript generated code | ||
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; | ||
import { getSerdePlugin } from "@aws-sdk/middleware-serde"; | ||
import { Command as $Command } from "@aws-sdk/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
} from "@aws-sdk/types"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; | ||
import { SerdeContext as __SerdeContext } from "@smithy/types"; | ||
|
||
import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient"; | ||
import { SearchResourceTagsRequest, SearchResourceTagsResponse } from "../models/models_1"; | ||
import { de_SearchResourceTagsCommand, se_SearchResourceTagsCommand } from "../protocols/Aws_restJson1"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export { __MetadataBearer, $Command }; | ||
/** | ||
* @public | ||
* | ||
* The input for {@link SearchResourceTagsCommand}. | ||
*/ | ||
export interface SearchResourceTagsCommandInput extends SearchResourceTagsRequest {} | ||
/** | ||
* @public | ||
* | ||
* The output of {@link SearchResourceTagsCommand}. | ||
*/ | ||
export interface SearchResourceTagsCommandOutput extends SearchResourceTagsResponse, __MetadataBearer {} | ||
|
||
/** | ||
* @public | ||
* <p>Searches tags used in an Amazon Connect instance using optional search criteria.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { ConnectClient, SearchResourceTagsCommand } from "@aws-sdk/client-connect"; // ES Modules import | ||
* // const { ConnectClient, SearchResourceTagsCommand } = require("@aws-sdk/client-connect"); // CommonJS import | ||
* const client = new ConnectClient(config); | ||
* const input = { // SearchResourceTagsRequest | ||
* InstanceId: "STRING_VALUE", // required | ||
* ResourceTypes: [ // ResourceTypeList | ||
* "STRING_VALUE", | ||
* ], | ||
* NextToken: "STRING_VALUE", | ||
* MaxResults: Number("int"), | ||
* SearchCriteria: { // ResourceTagsSearchCriteria | ||
* TagSearchCondition: { // TagSearchCondition | ||
* tagKey: "STRING_VALUE", | ||
* tagValue: "STRING_VALUE", | ||
* tagKeyComparisonType: "STARTS_WITH" || "CONTAINS" || "EXACT", | ||
* tagValueComparisonType: "STARTS_WITH" || "CONTAINS" || "EXACT", | ||
* }, | ||
* }, | ||
* }; | ||
* const command = new SearchResourceTagsCommand(input); | ||
* const response = await client.send(command); | ||
* // { // SearchResourceTagsResponse | ||
* // Tags: [ // TagsList | ||
* // { // TagSet | ||
* // key: "STRING_VALUE", | ||
* // value: "STRING_VALUE", | ||
* // }, | ||
* // ], | ||
* // NextToken: "STRING_VALUE", | ||
* // }; | ||
* | ||
* ``` | ||
* | ||
* @param SearchResourceTagsCommandInput - {@link SearchResourceTagsCommandInput} | ||
* @returns {@link SearchResourceTagsCommandOutput} | ||
* @see {@link SearchResourceTagsCommandInput} for command's `input` shape. | ||
* @see {@link SearchResourceTagsCommandOutput} 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 MaximumResultReturnedException} (client fault) | ||
* <p>Maximum number (1000) of tags have been returned with current request. Consider | ||
* changing request parameters to get more tags.</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 SearchResourceTagsCommand extends $Command< | ||
SearchResourceTagsCommandInput, | ||
SearchResourceTagsCommandOutput, | ||
ConnectClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
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: SearchResourceTagsCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: ConnectClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<SearchResourceTagsCommandInput, SearchResourceTagsCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
this.middlewareStack.use( | ||
getEndpointPlugin(configuration, SearchResourceTagsCommand.getEndpointParameterInstructions()) | ||
); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "ConnectClient"; | ||
const commandName = "SearchResourceTagsCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: (_: any) => _, | ||
outputFilterSensitiveLog: (_: any) => _, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
private serialize(input: SearchResourceTagsCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return se_SearchResourceTagsCommand(input, context); | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<SearchResourceTagsCommandOutput> { | ||
return de_SearchResourceTagsCommand(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.