From a2d8d1833e92e36e27b232f5c04a0c6bc2d0e673 Mon Sep 17 00:00:00 2001 From: awstools Date: Fri, 4 Aug 2023 18:24:43 +0000 Subject: [PATCH] feat(client-connect): Added a new API UpdateRoutingProfileAgentAvailabilityTimer to update agent availability timer of a routing profile. --- clients/client-connect/README.md | 8 + clients/client-connect/src/Connect.ts | 23 + clients/client-connect/src/ConnectClient.ts | 6 + .../commands/CreateRoutingProfileCommand.ts | 1 + .../commands/DescribeRoutingProfileCommand.ts | 1 + .../commands/SearchRoutingProfilesCommand.ts | 1 + ...ingProfileAgentAvailabilityTimerCommand.ts | 177 +++++++ clients/client-connect/src/commands/index.ts | 1 + .../client-connect/src/endpoint/ruleset.ts | 2 +- clients/client-connect/src/models/models_0.ts | 48 +- clients/client-connect/src/models/models_1.ts | 119 ++--- clients/client-connect/src/models/models_2.ts | 78 ++- .../src/protocols/Aws_restJson1.ts | 104 +++- codegen/sdk-codegen/aws-models/connect.json | 459 ++++++++++-------- 14 files changed, 733 insertions(+), 295 deletions(-) create mode 100644 clients/client-connect/src/commands/UpdateRoutingProfileAgentAvailabilityTimerCommand.ts diff --git a/clients/client-connect/README.md b/clients/client-connect/README.md index fdfff01a94c7..cc080a3b7b31 100644 --- a/clients/client-connect/README.md +++ b/clients/client-connect/README.md @@ -1660,6 +1660,14 @@ UpdateQuickConnectName [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/classes/updatequickconnectnamecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/interfaces/updatequickconnectnamecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/interfaces/updatequickconnectnamecommandoutput.html) + +
+ +UpdateRoutingProfileAgentAvailabilityTimer + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/classes/updateroutingprofileagentavailabilitytimercommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/interfaces/updateroutingprofileagentavailabilitytimercommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/interfaces/updateroutingprofileagentavailabilitytimercommandoutput.html) +
diff --git a/clients/client-connect/src/Connect.ts b/clients/client-connect/src/Connect.ts index 9716eb0cf8cd..1bd0149ea0b9 100644 --- a/clients/client-connect/src/Connect.ts +++ b/clients/client-connect/src/Connect.ts @@ -847,6 +847,11 @@ import { UpdateQuickConnectNameCommandInput, UpdateQuickConnectNameCommandOutput, } from "./commands/UpdateQuickConnectNameCommand"; +import { + UpdateRoutingProfileAgentAvailabilityTimerCommand, + UpdateRoutingProfileAgentAvailabilityTimerCommandInput, + UpdateRoutingProfileAgentAvailabilityTimerCommandOutput, +} from "./commands/UpdateRoutingProfileAgentAvailabilityTimerCommand"; import { UpdateRoutingProfileConcurrencyCommand, UpdateRoutingProfileConcurrencyCommandInput, @@ -1102,6 +1107,7 @@ const commands = { UpdateQueueStatusCommand, UpdateQuickConnectConfigCommand, UpdateQuickConnectNameCommand, + UpdateRoutingProfileAgentAvailabilityTimerCommand, UpdateRoutingProfileConcurrencyCommand, UpdateRoutingProfileDefaultOutboundQueueCommand, UpdateRoutingProfileNameCommand, @@ -3966,6 +3972,23 @@ export interface Connect { cb: (err: any, data?: UpdateQuickConnectNameCommandOutput) => void ): void; + /** + * @see {@link UpdateRoutingProfileAgentAvailabilityTimerCommand} + */ + updateRoutingProfileAgentAvailabilityTimer( + args: UpdateRoutingProfileAgentAvailabilityTimerCommandInput, + options?: __HttpHandlerOptions + ): Promise; + updateRoutingProfileAgentAvailabilityTimer( + args: UpdateRoutingProfileAgentAvailabilityTimerCommandInput, + cb: (err: any, data?: UpdateRoutingProfileAgentAvailabilityTimerCommandOutput) => void + ): void; + updateRoutingProfileAgentAvailabilityTimer( + args: UpdateRoutingProfileAgentAvailabilityTimerCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateRoutingProfileAgentAvailabilityTimerCommandOutput) => void + ): void; + /** * @see {@link UpdateRoutingProfileConcurrencyCommand} */ diff --git a/clients/client-connect/src/ConnectClient.ts b/clients/client-connect/src/ConnectClient.ts index 449f66fc890f..09ad683ff487 100644 --- a/clients/client-connect/src/ConnectClient.ts +++ b/clients/client-connect/src/ConnectClient.ts @@ -542,6 +542,10 @@ import { UpdateQuickConnectNameCommandInput, UpdateQuickConnectNameCommandOutput, } from "./commands/UpdateQuickConnectNameCommand"; +import { + UpdateRoutingProfileAgentAvailabilityTimerCommandInput, + UpdateRoutingProfileAgentAvailabilityTimerCommandOutput, +} from "./commands/UpdateRoutingProfileAgentAvailabilityTimerCommand"; import { UpdateRoutingProfileConcurrencyCommandInput, UpdateRoutingProfileConcurrencyCommandOutput, @@ -791,6 +795,7 @@ export type ServiceInputTypes = | UpdateQueueStatusCommandInput | UpdateQuickConnectConfigCommandInput | UpdateQuickConnectNameCommandInput + | UpdateRoutingProfileAgentAvailabilityTimerCommandInput | UpdateRoutingProfileConcurrencyCommandInput | UpdateRoutingProfileDefaultOutboundQueueCommandInput | UpdateRoutingProfileNameCommandInput @@ -992,6 +997,7 @@ export type ServiceOutputTypes = | UpdateQueueStatusCommandOutput | UpdateQuickConnectConfigCommandOutput | UpdateQuickConnectNameCommandOutput + | UpdateRoutingProfileAgentAvailabilityTimerCommandOutput | UpdateRoutingProfileConcurrencyCommandOutput | UpdateRoutingProfileDefaultOutboundQueueCommandOutput | UpdateRoutingProfileNameCommandOutput diff --git a/clients/client-connect/src/commands/CreateRoutingProfileCommand.ts b/clients/client-connect/src/commands/CreateRoutingProfileCommand.ts index 4f814afcc90a..ac8fd8fc6ca3 100644 --- a/clients/client-connect/src/commands/CreateRoutingProfileCommand.ts +++ b/clients/client-connect/src/commands/CreateRoutingProfileCommand.ts @@ -70,6 +70,7 @@ export interface CreateRoutingProfileCommandOutput extends CreateRoutingProfileR * Tags: { // TagMap * "": "STRING_VALUE", * }, + * AgentAvailabilityTimer: "TIME_SINCE_LAST_ACTIVITY" || "TIME_SINCE_LAST_INBOUND", * }; * const command = new CreateRoutingProfileCommand(input); * const response = await client.send(command); diff --git a/clients/client-connect/src/commands/DescribeRoutingProfileCommand.ts b/clients/client-connect/src/commands/DescribeRoutingProfileCommand.ts index 6fbf39c8a275..0d4bc76fbef4 100644 --- a/clients/client-connect/src/commands/DescribeRoutingProfileCommand.ts +++ b/clients/client-connect/src/commands/DescribeRoutingProfileCommand.ts @@ -71,6 +71,7 @@ export interface DescribeRoutingProfileCommandOutput extends DescribeRoutingProf * // }, * // NumberOfAssociatedQueues: Number("long"), * // NumberOfAssociatedUsers: Number("long"), + * // AgentAvailabilityTimer: "TIME_SINCE_LAST_ACTIVITY" || "TIME_SINCE_LAST_INBOUND", * // }, * // }; * diff --git a/clients/client-connect/src/commands/SearchRoutingProfilesCommand.ts b/clients/client-connect/src/commands/SearchRoutingProfilesCommand.ts index b511c5fea2e3..57cfac75d46b 100644 --- a/clients/client-connect/src/commands/SearchRoutingProfilesCommand.ts +++ b/clients/client-connect/src/commands/SearchRoutingProfilesCommand.ts @@ -118,6 +118,7 @@ export interface SearchRoutingProfilesCommandOutput extends SearchRoutingProfile * // }, * // NumberOfAssociatedQueues: Number("long"), * // NumberOfAssociatedUsers: Number("long"), + * // AgentAvailabilityTimer: "TIME_SINCE_LAST_ACTIVITY" || "TIME_SINCE_LAST_INBOUND", * // }, * // ], * // NextToken: "STRING_VALUE", diff --git a/clients/client-connect/src/commands/UpdateRoutingProfileAgentAvailabilityTimerCommand.ts b/clients/client-connect/src/commands/UpdateRoutingProfileAgentAvailabilityTimerCommand.ts new file mode 100644 index 000000000000..cb5a08c64696 --- /dev/null +++ b/clients/client-connect/src/commands/UpdateRoutingProfileAgentAvailabilityTimerCommand.ts @@ -0,0 +1,177 @@ +// 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, +} from "@smithy/types"; + +import { ConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ConnectClient"; +import { UpdateRoutingProfileAgentAvailabilityTimerRequest } from "../models/models_1"; +import { + de_UpdateRoutingProfileAgentAvailabilityTimerCommand, + se_UpdateRoutingProfileAgentAvailabilityTimerCommand, +} from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link UpdateRoutingProfileAgentAvailabilityTimerCommand}. + */ +export interface UpdateRoutingProfileAgentAvailabilityTimerCommandInput + extends UpdateRoutingProfileAgentAvailabilityTimerRequest {} +/** + * @public + * + * The output of {@link UpdateRoutingProfileAgentAvailabilityTimerCommand}. + */ +export interface UpdateRoutingProfileAgentAvailabilityTimerCommandOutput extends __MetadataBearer {} + +/** + * @public + *

Whether agents with this routing profile + * will have their routing order calculated based on + * time since their last inbound + * contact or longest idle + * time.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ConnectClient, UpdateRoutingProfileAgentAvailabilityTimerCommand } from "@aws-sdk/client-connect"; // ES Modules import + * // const { ConnectClient, UpdateRoutingProfileAgentAvailabilityTimerCommand } = require("@aws-sdk/client-connect"); // CommonJS import + * const client = new ConnectClient(config); + * const input = { // UpdateRoutingProfileAgentAvailabilityTimerRequest + * InstanceId: "STRING_VALUE", // required + * RoutingProfileId: "STRING_VALUE", // required + * AgentAvailabilityTimer: "TIME_SINCE_LAST_ACTIVITY" || "TIME_SINCE_LAST_INBOUND", // required + * }; + * const command = new UpdateRoutingProfileAgentAvailabilityTimerCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param UpdateRoutingProfileAgentAvailabilityTimerCommandInput - {@link UpdateRoutingProfileAgentAvailabilityTimerCommandInput} + * @returns {@link UpdateRoutingProfileAgentAvailabilityTimerCommandOutput} + * @see {@link UpdateRoutingProfileAgentAvailabilityTimerCommandInput} for command's `input` shape. + * @see {@link UpdateRoutingProfileAgentAvailabilityTimerCommandOutput} for command's `response` shape. + * @see {@link ConnectClientResolvedConfig | config} for ConnectClient's `config` shape. + * + * @throws {@link InternalServiceException} (server fault) + *

Request processing failed because of an error or failure with the service.

+ * + * @throws {@link InvalidParameterException} (client fault) + *

One or more of the specified parameters are not valid.

+ * + * @throws {@link InvalidRequestException} (client fault) + *

The request is not valid.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The specified resource was not found.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The throttling limit has been exceeded.

+ * + * @throws {@link ConnectServiceException} + *

Base exception class for all service exceptions from Connect service.

+ * + */ +export class UpdateRoutingProfileAgentAvailabilityTimerCommand extends $Command< + UpdateRoutingProfileAgentAvailabilityTimerCommandInput, + UpdateRoutingProfileAgentAvailabilityTimerCommandOutput, + 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: UpdateRoutingProfileAgentAvailabilityTimerCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ConnectClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + UpdateRoutingProfileAgentAvailabilityTimerCommandInput, + UpdateRoutingProfileAgentAvailabilityTimerCommandOutput + > { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin( + configuration, + UpdateRoutingProfileAgentAvailabilityTimerCommand.getEndpointParameterInstructions() + ) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "ConnectClient"; + const commandName = "UpdateRoutingProfileAgentAvailabilityTimerCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize( + input: UpdateRoutingProfileAgentAvailabilityTimerCommandInput, + context: __SerdeContext + ): Promise<__HttpRequest> { + return se_UpdateRoutingProfileAgentAvailabilityTimerCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_UpdateRoutingProfileAgentAvailabilityTimerCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-connect/src/commands/index.ts b/clients/client-connect/src/commands/index.ts index 5796f607eed5..d0a3214a84ee 100644 --- a/clients/client-connect/src/commands/index.ts +++ b/clients/client-connect/src/commands/index.ts @@ -180,6 +180,7 @@ export * from "./UpdateQueueOutboundCallerConfigCommand"; export * from "./UpdateQueueStatusCommand"; export * from "./UpdateQuickConnectConfigCommand"; export * from "./UpdateQuickConnectNameCommand"; +export * from "./UpdateRoutingProfileAgentAvailabilityTimerCommand"; export * from "./UpdateRoutingProfileConcurrencyCommand"; export * from "./UpdateRoutingProfileDefaultOutboundQueueCommand"; export * from "./UpdateRoutingProfileNameCommand"; diff --git a/clients/client-connect/src/endpoint/ruleset.ts b/clients/client-connect/src/endpoint/ruleset.ts index 1806cc66a874..066c8e905dae 100644 --- a/clients/client-connect/src/endpoint/ruleset.ts +++ b/clients/client-connect/src/endpoint/ruleset.ts @@ -28,5 +28,5 @@ o={[t]:"booleanEquals",[u]:[true,{[t]:f,[u]:[n,"supportsDualStack"]}]}, p=[j], q=[k], r=[{[v]:"Region"}]; -const _data={version:"1.0",parameters:{Region:g,UseDualStack:h,UseFIPS:h,Endpoint:g},rules:[{conditions:[{[t]:a,[u]:[i]}],type:b,rules:[{conditions:p,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:q,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:i,properties:l,headers:l},type:d}]}]},{type:b,rules:[{conditions:[{[t]:a,[u]:r}],type:b,rules:[{conditions:[{[t]:"aws.partition",[u]:r,assign:e}],type:b,rules:[{conditions:[j,k],type:b,rules:[{conditions:[m,o],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://connect-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:p,type:b,rules:[{conditions:[m],type:b,rules:[{type:b,rules:[{conditions:[{[t]:"stringEquals",[u]:["aws-us-gov",{[t]:f,[u]:[n,"name"]}]}],endpoint:{url:"https://connect.{Region}.amazonaws.com",properties:l,headers:l},type:d},{endpoint:{url:"https://connect-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:q,type:b,rules:[{conditions:[o],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://connect.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{type:b,rules:[{endpoint:{url:"https://connect.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]}]}]},{error:"Invalid Configuration: Missing Region",type:c}]}]}; +const _data={version:"1.0",parameters:{Region:g,UseDualStack:h,UseFIPS:h,Endpoint:g},rules:[{conditions:[{[t]:a,[u]:[i]}],type:b,rules:[{conditions:p,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{conditions:q,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:i,properties:l,headers:l},type:d}]},{conditions:[{[t]:a,[u]:r}],type:b,rules:[{conditions:[{[t]:"aws.partition",[u]:r,assign:e}],type:b,rules:[{conditions:[j,k],type:b,rules:[{conditions:[m,o],type:b,rules:[{endpoint:{url:"https://connect-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:p,type:b,rules:[{conditions:[m],type:b,rules:[{conditions:[{[t]:"stringEquals",[u]:["aws-us-gov",{[t]:f,[u]:[n,"name"]}]}],endpoint:{url:"https://connect.{Region}.amazonaws.com",properties:l,headers:l},type:d},{endpoint:{url:"https://connect-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:q,type:b,rules:[{conditions:[o],type:b,rules:[{endpoint:{url:"https://connect.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:d}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{endpoint:{url:"https://connect.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:d}]}]},{error:"Invalid Configuration: Missing Region",type:c}]}; export const ruleSet: RuleSetObject = _data; diff --git a/clients/client-connect/src/models/models_0.ts b/clients/client-connect/src/models/models_0.ts index 0721cfce8707..d4bfc2871084 100644 --- a/clients/client-connect/src/models/models_0.ts +++ b/clients/client-connect/src/models/models_0.ts @@ -222,6 +222,20 @@ export class ThrottlingException extends __BaseException { } } +/** + * @public + * @enum + */ +export const AgentAvailabilityTimer = { + TIME_SINCE_LAST_ACTIVITY: "TIME_SINCE_LAST_ACTIVITY", + TIME_SINCE_LAST_INBOUND: "TIME_SINCE_LAST_INBOUND", +} as const; + +/** + * @public + */ +export type AgentAvailabilityTimer = (typeof AgentAvailabilityTimer)[keyof typeof AgentAvailabilityTimer]; + /** * @public * @enum @@ -2812,6 +2826,16 @@ export interface CreateRoutingProfileRequest { *

The tags used to organize, track, or control access for this resource. For example, \{ "tags": \{"key1":"value1", "key2":"value2"\} \}.

*/ Tags?: Record; + + /** + * @public + *

Whether agents with this routing profile + * will have their routing order calculated based on + * time since their last inbound + * contact or longest idle + * time.

+ */ + AgentAvailabilityTimer?: AgentAvailabilityTimer | string; } /** @@ -6260,6 +6284,16 @@ export interface RoutingProfile { *

The number of associated users in routing profile.

*/ NumberOfAssociatedUsers?: number; + + /** + * @public + *

Whether agents with this routing profile + * will have their routing order calculated based on + * time since their last inbound + * contact or longest idle + * time.

+ */ + AgentAvailabilityTimer?: AgentAvailabilityTimer | string; } /** @@ -7320,20 +7354,6 @@ export const Grouping = { */ export type Grouping = (typeof Grouping)[keyof typeof Grouping]; -/** - * @public - * @enum - */ -export const SortOrder = { - ASCENDING: "ASCENDING", - DESCENDING: "DESCENDING", -} as const; - -/** - * @public - */ -export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]; - /** * @internal */ diff --git a/clients/client-connect/src/models/models_1.ts b/clients/client-connect/src/models/models_1.ts index 58073858cd28..d5eaa5104149 100644 --- a/clients/client-connect/src/models/models_1.ts +++ b/clients/client-connect/src/models/models_1.ts @@ -4,6 +4,7 @@ import { ExceptionOptionType as __ExceptionOptionType, SENSITIVE_STRING } from " import { ConnectServiceException as __BaseException } from "./ConnectServiceException"; import { ActionSummary, + AgentAvailabilityTimer, AgentContactReference, AgentStatusReference, AgentStatusState, @@ -56,7 +57,6 @@ import { RoutingProfileQueueConfig, RuleAction, RulePublishStatus, - SortOrder, SourceType, TaskTemplateConstraints, TaskTemplateDefaults, @@ -71,6 +71,20 @@ import { VocabularyState, } from "./models_0"; +/** + * @public + * @enum + */ +export const SortOrder = { + ASCENDING: "ASCENDING", + DESCENDING: "DESCENDING", +} as const; + +/** + * @public + */ +export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder]; + /** * @public *

The way to sort the resulting response based on metrics. By default resources are sorted @@ -7746,6 +7760,33 @@ export interface UpdateQuickConnectNameRequest { Description?: string; } +/** + * @public + */ +export interface UpdateRoutingProfileAgentAvailabilityTimerRequest { + /** + * @public + *

The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

+ */ + InstanceId: string | undefined; + + /** + * @public + *

The identifier of the routing profile.

+ */ + RoutingProfileId: string | undefined; + + /** + * @public + *

Whether agents with this routing profile + * will have their routing order calculated based on + * time since their last inbound + * contact or longest idle + * time.

+ */ + AgentAvailabilityTimer: AgentAvailabilityTimer | string | undefined; +} + /** * @public */ @@ -8529,82 +8570,6 @@ export interface EvaluationForm { Tags?: Record; } -/** - * @public - *

Information about an evaluation form used in a contact evaluation.

- */ -export interface EvaluationFormContent { - /** - * @public - *

A version of the evaluation form.

- */ - EvaluationFormVersion: number | undefined; - - /** - * @public - *

The unique identifier for the evaluation form.

- */ - EvaluationFormId: string | undefined; - - /** - * @public - *

The Amazon Resource Name (ARN) for the evaluation form resource.

- */ - EvaluationFormArn: string | undefined; - - /** - * @public - *

A title of the evaluation form.

- */ - Title: string | undefined; - - /** - * @public - *

The description of the evaluation form.

- */ - Description?: string; - - /** - * @public - *

Items that are part of the evaluation form. The total number of sections and questions must not exceed 100 each. Questions must be contained in a section.

- */ - Items: EvaluationFormItem[] | undefined; - - /** - * @public - *

A scoring strategy of the evaluation form.

- */ - ScoringStrategy?: EvaluationFormScoringStrategy; -} - -/** - * @public - *

The search criteria to be used to return hours of operations.

- */ -export interface HoursOfOperationSearchCriteria { - /** - * @public - *

A list of conditions which would be applied together with an OR condition.

- */ - OrConditions?: HoursOfOperationSearchCriteria[]; - - /** - * @public - *

A list of conditions which would be applied together with an AND condition.

- */ - AndConditions?: HoursOfOperationSearchCriteria[]; - - /** - * @public - *

A leaf node condition which can be used to specify a string condition.

- * - *

The currently supported values for FieldName are name, - * description, timezone, and resourceID.

- *
- */ - StringCondition?: StringCondition; -} - /** * @internal */ diff --git a/clients/client-connect/src/models/models_2.ts b/clients/client-connect/src/models/models_2.ts index 578cab9b6088..9f96daf0be0b 100644 --- a/clients/client-connect/src/models/models_2.ts +++ b/clients/client-connect/src/models/models_2.ts @@ -2,10 +2,8 @@ import { Evaluation, EvaluationFormScoringStrategy } from "./models_0"; import { EvaluationForm, - EvaluationFormContent, EvaluationFormItem, HierarchyGroupCondition, - HoursOfOperationSearchCriteria, HoursOfOperationSearchFilter, PromptSearchFilter, QueueSearchFilter, @@ -17,6 +15,82 @@ import { UserSearchFilter, } from "./models_1"; +/** + * @public + *

Information about an evaluation form used in a contact evaluation.

+ */ +export interface EvaluationFormContent { + /** + * @public + *

A version of the evaluation form.

+ */ + EvaluationFormVersion: number | undefined; + + /** + * @public + *

The unique identifier for the evaluation form.

+ */ + EvaluationFormId: string | undefined; + + /** + * @public + *

The Amazon Resource Name (ARN) for the evaluation form resource.

+ */ + EvaluationFormArn: string | undefined; + + /** + * @public + *

A title of the evaluation form.

+ */ + Title: string | undefined; + + /** + * @public + *

The description of the evaluation form.

+ */ + Description?: string; + + /** + * @public + *

Items that are part of the evaluation form. The total number of sections and questions must not exceed 100 each. Questions must be contained in a section.

+ */ + Items: EvaluationFormItem[] | undefined; + + /** + * @public + *

A scoring strategy of the evaluation form.

+ */ + ScoringStrategy?: EvaluationFormScoringStrategy; +} + +/** + * @public + *

The search criteria to be used to return hours of operations.

+ */ +export interface HoursOfOperationSearchCriteria { + /** + * @public + *

A list of conditions which would be applied together with an OR condition.

+ */ + OrConditions?: HoursOfOperationSearchCriteria[]; + + /** + * @public + *

A list of conditions which would be applied together with an AND condition.

+ */ + AndConditions?: HoursOfOperationSearchCriteria[]; + + /** + * @public + *

A leaf node condition which can be used to specify a string condition.

+ * + *

The currently supported values for FieldName are name, + * description, timezone, and resourceID.

+ *
+ */ + StringCondition?: StringCondition; +} + /** * @public *

The search criteria to be used to return prompts.

diff --git a/clients/client-connect/src/protocols/Aws_restJson1.ts b/clients/client-connect/src/protocols/Aws_restJson1.ts index d0deaff36fd7..0fff84735fce 100644 --- a/clients/client-connect/src/protocols/Aws_restJson1.ts +++ b/clients/client-connect/src/protocols/Aws_restJson1.ts @@ -521,6 +521,10 @@ import { UpdateQuickConnectNameCommandInput, UpdateQuickConnectNameCommandOutput, } from "../commands/UpdateQuickConnectNameCommand"; +import { + UpdateRoutingProfileAgentAvailabilityTimerCommandInput, + UpdateRoutingProfileAgentAvailabilityTimerCommandOutput, +} from "../commands/UpdateRoutingProfileAgentAvailabilityTimerCommand"; import { UpdateRoutingProfileConcurrencyCommandInput, UpdateRoutingProfileConcurrencyCommandOutput, @@ -683,7 +687,6 @@ import { Distribution, EvaluationAnswerInput, EvaluationForm, - EvaluationFormContent, EvaluationFormItem, EvaluationFormSection, EvaluationFormSummary, @@ -696,7 +699,6 @@ import { HistoricalMetric, HistoricalMetricData, HistoricalMetricResult, - HoursOfOperationSearchCriteria, HoursOfOperationSearchFilter, InstanceSummary, MaximumResultReturnedException, @@ -733,6 +735,8 @@ import { VoiceRecordingConfiguration, } from "../models/models_1"; import { + EvaluationFormContent, + HoursOfOperationSearchCriteria, PromptSearchCriteria, QueueSearchCriteria, QuickConnectSearchCriteria, @@ -1554,6 +1558,7 @@ export const se_CreateRoutingProfileCommand = async ( let body: any; body = JSON.stringify( take(input, { + AgentAvailabilityTimer: [], DefaultOutboundQueueId: [], Description: [], MediaConcurrencies: (_) => _json(_), @@ -6754,6 +6759,46 @@ export const se_UpdateQuickConnectNameCommand = async ( }); }; +/** + * serializeAws_restJson1UpdateRoutingProfileAgentAvailabilityTimerCommand + */ +export const se_UpdateRoutingProfileAgentAvailabilityTimerCommand = async ( + input: UpdateRoutingProfileAgentAvailabilityTimerCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/routing-profiles/{InstanceId}/{RoutingProfileId}/agent-availability-timer"; + resolvedPath = __resolvedPath(resolvedPath, input, "InstanceId", () => input.InstanceId!, "{InstanceId}", false); + resolvedPath = __resolvedPath( + resolvedPath, + input, + "RoutingProfileId", + () => input.RoutingProfileId!, + "{RoutingProfileId}", + false + ); + let body: any; + body = JSON.stringify( + take(input, { + AgentAvailabilityTimer: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + /** * serializeAws_restJson1UpdateRoutingProfileConcurrencyCommand */ @@ -18007,6 +18052,61 @@ const de_UpdateQuickConnectNameCommandError = async ( } }; +/** + * deserializeAws_restJson1UpdateRoutingProfileAgentAvailabilityTimerCommand + */ +export const de_UpdateRoutingProfileAgentAvailabilityTimerCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_UpdateRoutingProfileAgentAvailabilityTimerCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateRoutingProfileAgentAvailabilityTimerCommandError + */ +const de_UpdateRoutingProfileAgentAvailabilityTimerCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalServiceException": + case "com.amazonaws.connect#InternalServiceException": + throw await de_InternalServiceExceptionRes(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.connect#InvalidParameterException": + throw await de_InvalidParameterExceptionRes(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.connect#InvalidRequestException": + throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.connect#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.connect#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_restJson1UpdateRoutingProfileConcurrencyCommand */ diff --git a/codegen/sdk-codegen/aws-models/connect.json b/codegen/sdk-codegen/aws-models/connect.json index 27f62c4705e8..5245b693a5a0 100644 --- a/codegen/sdk-codegen/aws-models/connect.json +++ b/codegen/sdk-codegen/aws-models/connect.json @@ -202,6 +202,23 @@ } } }, + "com.amazonaws.connect#AgentAvailabilityTimer": { + "type": "enum", + "members": { + "TIME_SINCE_LAST_ACTIVITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TIME_SINCE_LAST_ACTIVITY" + } + }, + "TIME_SINCE_LAST_INBOUND": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TIME_SINCE_LAST_INBOUND" + } + } + } + }, "com.amazonaws.connect#AgentContactReference": { "type": "structure", "members": { @@ -1108,6 +1125,9 @@ { "target": "com.amazonaws.connect#UpdateQuickConnectName" }, + { + "target": "com.amazonaws.connect#UpdateRoutingProfileAgentAvailabilityTimer" + }, { "target": "com.amazonaws.connect#UpdateRoutingProfileConcurrency" }, @@ -1228,52 +1248,56 @@ "type": "error" }, { - "conditions": [], - "type": "tree", - "rules": [ + "conditions": [ { - "conditions": [ + "fn": "booleanEquals", + "argv": [ { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseDualStack" - }, - true - ] - } - ], - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error" - }, - { - "conditions": [], - "endpoint": { - "url": { - "ref": "Endpoint" + "ref": "UseDualStack" }, - "properties": {}, - "headers": {} - }, - "type": "endpoint" + true + ] } - ] + ], + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], + "endpoint": { + "url": { + "ref": "Endpoint" + }, + "properties": {}, + "headers": {} + }, + "type": "endpoint" } ] }, { - "conditions": [], + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Region" + } + ] + } + ], "type": "tree", "rules": [ { "conditions": [ { - "fn": "isSet", + "fn": "aws.partition", "argv": [ { "ref": "Region" } - ] + ], + "assign": "PartitionResult" } ], "type": "tree", @@ -1281,13 +1305,22 @@ { "conditions": [ { - "fn": "aws.partition", + "fn": "booleanEquals", "argv": [ { - "ref": "Region" - } - ], - "assign": "PartitionResult" + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] } ], "type": "tree", @@ -1297,92 +1330,83 @@ { "fn": "booleanEquals", "argv": [ + true, { - "ref": "UseFIPS" - }, - true + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + } ] }, { "fn": "booleanEquals", "argv": [ + true, { - "ref": "UseDualStack" - }, - true - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", + "fn": "getAttr", "argv": [ - true, - { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsFIPS" - ] - } - ] - }, - { - "fn": "booleanEquals", - "argv": [ - true, - { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsDualStack" - ] - } - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [], - "type": "tree", - "rules": [ { - "conditions": [], - "endpoint": { - "url": "https://connect-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } + "ref": "PartitionResult" + }, + "supportsDualStack" ] } ] - }, + } + ], + "type": "tree", + "rules": [ { "conditions": [], - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error" + "endpoint": { + "url": "https://connect-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" } ] }, + { + "conditions": [], + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error" + } + ] + }, + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "type": "tree", + "rules": [ { "conditions": [ { "fn": "booleanEquals", "argv": [ + true, { - "ref": "UseFIPS" - }, - true + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + } ] } ], @@ -1391,155 +1415,115 @@ { "conditions": [ { - "fn": "booleanEquals", + "fn": "stringEquals", "argv": [ - true, + "aws-us-gov", { "fn": "getAttr", "argv": [ { "ref": "PartitionResult" }, - "supportsFIPS" + "name" ] } ] } ], - "type": "tree", - "rules": [ - { - "conditions": [], - "type": "tree", - "rules": [ - { - "conditions": [ - { - "fn": "stringEquals", - "argv": [ - "aws-us-gov", - { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "name" - ] - } - ] - } - ], - "endpoint": { - "url": "https://connect.{Region}.amazonaws.com", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - }, - { - "conditions": [], - "endpoint": { - "url": "https://connect-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ] - } - ] + "endpoint": { + "url": "https://connect.{Region}.amazonaws.com", + "properties": {}, + "headers": {} + }, + "type": "endpoint" }, { "conditions": [], - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error" + "endpoint": { + "url": "https://connect-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" } ] }, + { + "conditions": [], + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error" + } + ] + }, + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "type": "tree", + "rules": [ { "conditions": [ { "fn": "booleanEquals", "argv": [ + true, { - "ref": "UseDualStack" - }, - true - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", + "fn": "getAttr", "argv": [ - true, - { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsDualStack" - ] - } - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [], - "type": "tree", - "rules": [ { - "conditions": [], - "endpoint": { - "url": "https://connect.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } + "ref": "PartitionResult" + }, + "supportsDualStack" ] } ] - }, - { - "conditions": [], - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error" } - ] - }, - { - "conditions": [], + ], "type": "tree", "rules": [ { "conditions": [], "endpoint": { - "url": "https://connect.{Region}.{PartitionResult#dnsSuffix}", + "url": "https://connect.{Region}.{PartitionResult#dualStackDnsSuffix}", "properties": {}, "headers": {} }, "type": "endpoint" } ] + }, + { + "conditions": [], + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error" } ] + }, + { + "conditions": [], + "endpoint": { + "url": "https://connect.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" } ] - }, - { - "conditions": [], - "error": "Invalid Configuration: Missing Region", - "type": "error" } ] + }, + { + "conditions": [], + "error": "Invalid Configuration: Missing Region", + "type": "error" } ] }, @@ -5212,6 +5196,12 @@ "traits": { "smithy.api#documentation": "

The tags used to organize, track, or control access for this resource. For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.

" } + }, + "AgentAvailabilityTimer": { + "target": "com.amazonaws.connect#AgentAvailabilityTimer", + "traits": { + "smithy.api#documentation": "

Whether agents with this routing profile\n will have their routing order calculated based on\n time since their last inbound\n contact or longest idle\n time.

" + } } }, "traits": { @@ -21714,6 +21704,12 @@ "traits": { "smithy.api#documentation": "

The number of associated users in routing profile.

" } + }, + "AgentAvailabilityTimer": { + "target": "com.amazonaws.connect#AgentAvailabilityTimer", + "traits": { + "smithy.api#documentation": "

Whether agents with this routing profile\n will have their routing order calculated based on\n time since their last inbound\n contact or longest idle\n time.

" + } } }, "traits": { @@ -27989,6 +27985,71 @@ "smithy.api#input": {} } }, + "com.amazonaws.connect#UpdateRoutingProfileAgentAvailabilityTimer": { + "type": "operation", + "input": { + "target": "com.amazonaws.connect#UpdateRoutingProfileAgentAvailabilityTimerRequest" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.amazonaws.connect#InternalServiceException" + }, + { + "target": "com.amazonaws.connect#InvalidParameterException" + }, + { + "target": "com.amazonaws.connect#InvalidRequestException" + }, + { + "target": "com.amazonaws.connect#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.connect#ThrottlingException" + } + ], + "traits": { + "smithy.api#documentation": "

Whether agents with this routing profile\n will have their routing order calculated based on\n time since their last inbound\n contact or longest idle\n time.

", + "smithy.api#http": { + "method": "POST", + "uri": "/routing-profiles/{InstanceId}/{RoutingProfileId}/agent-availability-timer", + "code": 200 + } + } + }, + "com.amazonaws.connect#UpdateRoutingProfileAgentAvailabilityTimerRequest": { + "type": "structure", + "members": { + "InstanceId": { + "target": "com.amazonaws.connect#InstanceId", + "traits": { + "smithy.api#documentation": "

The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "RoutingProfileId": { + "target": "com.amazonaws.connect#RoutingProfileId", + "traits": { + "smithy.api#documentation": "

The identifier of the routing profile.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "AgentAvailabilityTimer": { + "target": "com.amazonaws.connect#AgentAvailabilityTimer", + "traits": { + "smithy.api#documentation": "

Whether agents with this routing profile\n will have their routing order calculated based on\n time since their last inbound\n contact or longest idle\n time.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, "com.amazonaws.connect#UpdateRoutingProfileConcurrency": { "type": "operation", "input": {