|
| 1 | +// smithy-typescript generated code |
| 2 | +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; |
| 3 | +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; |
| 4 | +import { Command as $Command } from "@aws-sdk/smithy-client"; |
| 5 | +import { |
| 6 | + FinalizeHandlerArguments, |
| 7 | + Handler, |
| 8 | + HandlerExecutionContext, |
| 9 | + HttpHandlerOptions as __HttpHandlerOptions, |
| 10 | + MetadataBearer as __MetadataBearer, |
| 11 | + MiddlewareStack, |
| 12 | +} from "@aws-sdk/types"; |
| 13 | +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; |
| 14 | +import { SerdeContext as __SerdeContext } from "@smithy/types"; |
| 15 | + |
| 16 | +import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient"; |
| 17 | +import { SearchResourceTagsRequest, SearchResourceTagsResponse } from "../models/models_1"; |
| 18 | +import { de_SearchResourceTagsCommand, se_SearchResourceTagsCommand } from "../protocols/Aws_restJson1"; |
| 19 | + |
| 20 | +/** |
| 21 | + * @public |
| 22 | + */ |
| 23 | +export { __MetadataBearer, $Command }; |
| 24 | +/** |
| 25 | + * @public |
| 26 | + * |
| 27 | + * The input for {@link SearchResourceTagsCommand}. |
| 28 | + */ |
| 29 | +export interface SearchResourceTagsCommandInput extends SearchResourceTagsRequest {} |
| 30 | +/** |
| 31 | + * @public |
| 32 | + * |
| 33 | + * The output of {@link SearchResourceTagsCommand}. |
| 34 | + */ |
| 35 | +export interface SearchResourceTagsCommandOutput extends SearchResourceTagsResponse, __MetadataBearer {} |
| 36 | + |
| 37 | +/** |
| 38 | + * @public |
| 39 | + * <p>Searches tags used in an Amazon Connect instance using optional search criteria.</p> |
| 40 | + * @example |
| 41 | + * Use a bare-bones client and the command you need to make an API call. |
| 42 | + * ```javascript |
| 43 | + * import { ConnectClient, SearchResourceTagsCommand } from "@aws-sdk/client-connect"; // ES Modules import |
| 44 | + * // const { ConnectClient, SearchResourceTagsCommand } = require("@aws-sdk/client-connect"); // CommonJS import |
| 45 | + * const client = new ConnectClient(config); |
| 46 | + * const input = { // SearchResourceTagsRequest |
| 47 | + * InstanceId: "STRING_VALUE", // required |
| 48 | + * ResourceTypes: [ // ResourceTypeList |
| 49 | + * "STRING_VALUE", |
| 50 | + * ], |
| 51 | + * NextToken: "STRING_VALUE", |
| 52 | + * MaxResults: Number("int"), |
| 53 | + * SearchCriteria: { // ResourceTagsSearchCriteria |
| 54 | + * TagSearchCondition: { // TagSearchCondition |
| 55 | + * tagKey: "STRING_VALUE", |
| 56 | + * tagValue: "STRING_VALUE", |
| 57 | + * tagKeyComparisonType: "STARTS_WITH" || "CONTAINS" || "EXACT", |
| 58 | + * tagValueComparisonType: "STARTS_WITH" || "CONTAINS" || "EXACT", |
| 59 | + * }, |
| 60 | + * }, |
| 61 | + * }; |
| 62 | + * const command = new SearchResourceTagsCommand(input); |
| 63 | + * const response = await client.send(command); |
| 64 | + * // { // SearchResourceTagsResponse |
| 65 | + * // Tags: [ // TagsList |
| 66 | + * // { // TagSet |
| 67 | + * // key: "STRING_VALUE", |
| 68 | + * // value: "STRING_VALUE", |
| 69 | + * // }, |
| 70 | + * // ], |
| 71 | + * // NextToken: "STRING_VALUE", |
| 72 | + * // }; |
| 73 | + * |
| 74 | + * ``` |
| 75 | + * |
| 76 | + * @param SearchResourceTagsCommandInput - {@link SearchResourceTagsCommandInput} |
| 77 | + * @returns {@link SearchResourceTagsCommandOutput} |
| 78 | + * @see {@link SearchResourceTagsCommandInput} for command's `input` shape. |
| 79 | + * @see {@link SearchResourceTagsCommandOutput} for command's `response` shape. |
| 80 | + * @see {@link ConnectClientResolvedConfig | config} for ConnectClient's `config` shape. |
| 81 | + * |
| 82 | + * @throws {@link InternalServiceException} (server fault) |
| 83 | + * <p>Request processing failed because of an error or failure with the service.</p> |
| 84 | + * |
| 85 | + * @throws {@link InvalidParameterException} (client fault) |
| 86 | + * <p>One or more of the specified parameters are not valid.</p> |
| 87 | + * |
| 88 | + * @throws {@link InvalidRequestException} (client fault) |
| 89 | + * <p>The request is not valid.</p> |
| 90 | + * |
| 91 | + * @throws {@link MaximumResultReturnedException} (client fault) |
| 92 | + * <p>Maximum number (1000) of tags have been returned with current request. Consider |
| 93 | + * changing request parameters to get more tags.</p> |
| 94 | + * |
| 95 | + * @throws {@link ResourceNotFoundException} (client fault) |
| 96 | + * <p>The specified resource was not found.</p> |
| 97 | + * |
| 98 | + * @throws {@link ThrottlingException} (client fault) |
| 99 | + * <p>The throttling limit has been exceeded.</p> |
| 100 | + * |
| 101 | + * @throws {@link ConnectServiceException} |
| 102 | + * <p>Base exception class for all service exceptions from Connect service.</p> |
| 103 | + * |
| 104 | + */ |
| 105 | +export class SearchResourceTagsCommand extends $Command< |
| 106 | + SearchResourceTagsCommandInput, |
| 107 | + SearchResourceTagsCommandOutput, |
| 108 | + ConnectClientResolvedConfig |
| 109 | +> { |
| 110 | + // Start section: command_properties |
| 111 | + // End section: command_properties |
| 112 | + |
| 113 | + public static getEndpointParameterInstructions(): EndpointParameterInstructions { |
| 114 | + return { |
| 115 | + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, |
| 116 | + Endpoint: { type: "builtInParams", name: "endpoint" }, |
| 117 | + Region: { type: "builtInParams", name: "region" }, |
| 118 | + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, |
| 119 | + }; |
| 120 | + } |
| 121 | + |
| 122 | + /** |
| 123 | + * @public |
| 124 | + */ |
| 125 | + constructor(readonly input: SearchResourceTagsCommandInput) { |
| 126 | + // Start section: command_constructor |
| 127 | + super(); |
| 128 | + // End section: command_constructor |
| 129 | + } |
| 130 | + |
| 131 | + /** |
| 132 | + * @internal |
| 133 | + */ |
| 134 | + resolveMiddleware( |
| 135 | + clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, |
| 136 | + configuration: ConnectClientResolvedConfig, |
| 137 | + options?: __HttpHandlerOptions |
| 138 | + ): Handler<SearchResourceTagsCommandInput, SearchResourceTagsCommandOutput> { |
| 139 | + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); |
| 140 | + this.middlewareStack.use( |
| 141 | + getEndpointPlugin(configuration, SearchResourceTagsCommand.getEndpointParameterInstructions()) |
| 142 | + ); |
| 143 | + |
| 144 | + const stack = clientStack.concat(this.middlewareStack); |
| 145 | + |
| 146 | + const { logger } = configuration; |
| 147 | + const clientName = "ConnectClient"; |
| 148 | + const commandName = "SearchResourceTagsCommand"; |
| 149 | + const handlerExecutionContext: HandlerExecutionContext = { |
| 150 | + logger, |
| 151 | + clientName, |
| 152 | + commandName, |
| 153 | + inputFilterSensitiveLog: (_: any) => _, |
| 154 | + outputFilterSensitiveLog: (_: any) => _, |
| 155 | + }; |
| 156 | + const { requestHandler } = configuration; |
| 157 | + return stack.resolve( |
| 158 | + (request: FinalizeHandlerArguments<any>) => |
| 159 | + requestHandler.handle(request.request as __HttpRequest, options || {}), |
| 160 | + handlerExecutionContext |
| 161 | + ); |
| 162 | + } |
| 163 | + |
| 164 | + /** |
| 165 | + * @internal |
| 166 | + */ |
| 167 | + private serialize(input: SearchResourceTagsCommandInput, context: __SerdeContext): Promise<__HttpRequest> { |
| 168 | + return se_SearchResourceTagsCommand(input, context); |
| 169 | + } |
| 170 | + |
| 171 | + /** |
| 172 | + * @internal |
| 173 | + */ |
| 174 | + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<SearchResourceTagsCommandOutput> { |
| 175 | + return de_SearchResourceTagsCommand(output, context); |
| 176 | + } |
| 177 | + |
| 178 | + // Start section: command_body_extra |
| 179 | + // End section: command_body_extra |
| 180 | +} |
0 commit comments