Skip to content

Commit

Permalink
feat(client-connect): This release provides a way to search for exist…
Browse files Browse the repository at this point in the history
…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
Show file tree
Hide file tree
Showing 15 changed files with 963 additions and 199 deletions.
8 changes: 8 additions & 0 deletions clients/client-connect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,14 @@ SearchQuickConnects

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/classes/searchquickconnectscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/interfaces/searchquickconnectscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/interfaces/searchquickconnectscommandoutput.html)

</details>
<details>
<summary>
SearchResourceTags
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/classes/searchresourcetagscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/interfaces/searchresourcetagscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/interfaces/searchresourcetagscommandoutput.html)

</details>
<details>
<summary>
Expand Down
23 changes: 23 additions & 0 deletions clients/client-connect/src/Connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,11 @@ import {
SearchQuickConnectsCommandInput,
SearchQuickConnectsCommandOutput,
} from "./commands/SearchQuickConnectsCommand";
import {
SearchResourceTagsCommand,
SearchResourceTagsCommandInput,
SearchResourceTagsCommandOutput,
} from "./commands/SearchResourceTagsCommand";
import {
SearchRoutingProfilesCommand,
SearchRoutingProfilesCommandInput,
Expand Down Expand Up @@ -1046,6 +1051,7 @@ const commands = {
SearchPromptsCommand,
SearchQueuesCommand,
SearchQuickConnectsCommand,
SearchResourceTagsCommand,
SearchRoutingProfilesCommand,
SearchSecurityProfilesCommand,
SearchUsersCommand,
Expand Down Expand Up @@ -3235,6 +3241,23 @@ export interface Connect {
cb: (err: any, data?: SearchQuickConnectsCommandOutput) => void
): void;

/**
* @see {@link SearchResourceTagsCommand}
*/
searchResourceTags(
args: SearchResourceTagsCommandInput,
options?: __HttpHandlerOptions
): Promise<SearchResourceTagsCommandOutput>;
searchResourceTags(
args: SearchResourceTagsCommandInput,
cb: (err: any, data?: SearchResourceTagsCommandOutput) => void
): void;
searchResourceTags(
args: SearchResourceTagsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: SearchResourceTagsCommandOutput) => void
): void;

/**
* @see {@link SearchRoutingProfilesCommand}
*/
Expand Down
3 changes: 3 additions & 0 deletions clients/client-connect/src/ConnectClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ import {
SearchQuickConnectsCommandInput,
SearchQuickConnectsCommandOutput,
} from "./commands/SearchQuickConnectsCommand";
import { SearchResourceTagsCommandInput, SearchResourceTagsCommandOutput } from "./commands/SearchResourceTagsCommand";
import {
SearchRoutingProfilesCommandInput,
SearchRoutingProfilesCommandOutput,
Expand Down Expand Up @@ -742,6 +743,7 @@ export type ServiceInputTypes =
| SearchPromptsCommandInput
| SearchQueuesCommandInput
| SearchQuickConnectsCommandInput
| SearchResourceTagsCommandInput
| SearchRoutingProfilesCommandInput
| SearchSecurityProfilesCommandInput
| SearchUsersCommandInput
Expand Down Expand Up @@ -940,6 +942,7 @@ export type ServiceOutputTypes =
| SearchPromptsCommandOutput
| SearchQueuesCommandOutput
| SearchQuickConnectsCommandOutput
| SearchResourceTagsCommandOutput
| SearchRoutingProfilesCommandOutput
| SearchSecurityProfilesCommandOutput
| SearchUsersCommandOutput
Expand Down
13 changes: 13 additions & 0 deletions clients/client-connect/src/commands/ClaimPhoneNumberCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@ export interface ClaimPhoneNumberCommandOutput extends ClaimPhoneNumberResponse,
* the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribePhoneNumber.html">DescribePhoneNumber</a> API to verify the status of a previous <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_ClaimPhoneNumber.html">ClaimPhoneNumber</a>
* operation.</p>
* </important>
* <p>If you plan to claim and release numbers frequently during a 30 day period,
* contact us for a service quota exception. Otherwise, it is possible you will be blocked from
* claiming and releasing any more numbers until 30 days past the oldest number
* released has expired.</p>
* <p>By default you can claim and release up to 200% of your maximum number of active
* phone numbers during any 30 day period. If you claim and release phone numbers using
* the UI or API during a rolling 30 day cycle that exceeds 200% of your phone number
* service level quota, you will be blocked from claiming any more numbers until 30
* days past the oldest number released has expired. </p>
* <p>For example, if you already have 99 claimed numbers and a service level quota of 99 phone numbers, and in any 30
* day period you release 99, claim 99, and then release 99, you will have exceeded the
* 200% limit. At that point you are blocked from claiming any more numbers until you
* open an Amazon Web Services support ticket.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { SerdeContext as __SerdeContext } from "@smithy/types";

import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
import { DescribeContactEvaluationRequest } from "../models/models_0";
import { DescribeContactEvaluationResponse } from "../models/models_1";
import { DescribeContactEvaluationResponse } from "../models/models_2";
import { de_DescribeContactEvaluationCommand, se_DescribeContactEvaluationCommand } from "../protocols/Aws_restJson1";

/**
Expand Down
13 changes: 13 additions & 0 deletions clients/client-connect/src/commands/ReleasePhoneNumberCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ export interface ReleasePhoneNumberCommandOutput extends __MetadataBearer {}
* It cannot be searched for or claimed again until the period has ended. If you accidentally
* release a phone number, contact Amazon Web Services Support.</p>
* </important>
* <p>If you plan to claim and release numbers frequently during a 30 day period,
* contact us for a service quota exception. Otherwise, it is possible you will be blocked from
* claiming and releasing any more numbers until 30 days past the oldest number
* released has expired.</p>
* <p>By default you can claim and release up to 200% of your maximum number of active
* phone numbers during any 30 day period. If you claim and release phone numbers using
* the UI or API during a rolling 30 day cycle that exceeds 200% of your phone number
* service level quota, you will be blocked from claiming any more numbers until 30
* days past the oldest number released has expired. </p>
* <p>For example, if you already have 99 claimed numbers and a service level quota of 99 phone numbers, and in any 30
* day period you release 99, claim 99, and then release 99, you will have exceeded the
* 200% limit. At that point you are blocked from claiming any more numbers until you
* open an Amazon Web Services support ticket.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
180 changes: 180 additions & 0 deletions clients/client-connect/src/commands/SearchResourceTagsCommand.ts
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
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@s
import { SerdeContext as __SerdeContext } from "@smithy/types";

import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient";
import { UpdateEvaluationFormRequest, UpdateEvaluationFormResponse } from "../models/models_1";
import { UpdateEvaluationFormResponse } from "../models/models_1";
import { UpdateEvaluationFormRequest } from "../models/models_2";
import { de_UpdateEvaluationFormCommand, se_UpdateEvaluationFormCommand } from "../protocols/Aws_restJson1";

/**
Expand Down
1 change: 1 addition & 0 deletions clients/client-connect/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export * from "./SearchHoursOfOperationsCommand";
export * from "./SearchPromptsCommand";
export * from "./SearchQueuesCommand";
export * from "./SearchQuickConnectsCommand";
export * from "./SearchResourceTagsCommand";
export * from "./SearchRoutingProfilesCommand";
export * from "./SearchSecurityProfilesCommand";
export * from "./SearchUsersCommand";
Expand Down
Loading

0 comments on commit fff346b

Please sign in to comment.