Skip to content

Commit

Permalink
feat(client-connect): Added a new API UpdateRoutingProfileAgentAvaila…
Browse files Browse the repository at this point in the history
…bilityTimer to update agent availability timer of a routing profile.
  • Loading branch information
awstools committed Aug 4, 2023
1 parent 126b1c6 commit a2d8d18
Show file tree
Hide file tree
Showing 14 changed files with 733 additions and 295 deletions.
8 changes: 8 additions & 0 deletions clients/client-connect/README.md
Expand Up @@ -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)

</details>
<details>
<summary>
UpdateRoutingProfileAgentAvailabilityTimer
</summary>

[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)

</details>
<details>
<summary>
Expand Down
23 changes: 23 additions & 0 deletions clients/client-connect/src/Connect.ts
Expand Up @@ -847,6 +847,11 @@ import {
UpdateQuickConnectNameCommandInput,
UpdateQuickConnectNameCommandOutput,
} from "./commands/UpdateQuickConnectNameCommand";
import {
UpdateRoutingProfileAgentAvailabilityTimerCommand,
UpdateRoutingProfileAgentAvailabilityTimerCommandInput,
UpdateRoutingProfileAgentAvailabilityTimerCommandOutput,
} from "./commands/UpdateRoutingProfileAgentAvailabilityTimerCommand";
import {
UpdateRoutingProfileConcurrencyCommand,
UpdateRoutingProfileConcurrencyCommandInput,
Expand Down Expand Up @@ -1102,6 +1107,7 @@ const commands = {
UpdateQueueStatusCommand,
UpdateQuickConnectConfigCommand,
UpdateQuickConnectNameCommand,
UpdateRoutingProfileAgentAvailabilityTimerCommand,
UpdateRoutingProfileConcurrencyCommand,
UpdateRoutingProfileDefaultOutboundQueueCommand,
UpdateRoutingProfileNameCommand,
Expand Down Expand Up @@ -3966,6 +3972,23 @@ export interface Connect {
cb: (err: any, data?: UpdateQuickConnectNameCommandOutput) => void
): void;

/**
* @see {@link UpdateRoutingProfileAgentAvailabilityTimerCommand}
*/
updateRoutingProfileAgentAvailabilityTimer(
args: UpdateRoutingProfileAgentAvailabilityTimerCommandInput,
options?: __HttpHandlerOptions
): Promise<UpdateRoutingProfileAgentAvailabilityTimerCommandOutput>;
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}
*/
Expand Down
6 changes: 6 additions & 0 deletions clients/client-connect/src/ConnectClient.ts
Expand Up @@ -542,6 +542,10 @@ import {
UpdateQuickConnectNameCommandInput,
UpdateQuickConnectNameCommandOutput,
} from "./commands/UpdateQuickConnectNameCommand";
import {
UpdateRoutingProfileAgentAvailabilityTimerCommandInput,
UpdateRoutingProfileAgentAvailabilityTimerCommandOutput,
} from "./commands/UpdateRoutingProfileAgentAvailabilityTimerCommand";
import {
UpdateRoutingProfileConcurrencyCommandInput,
UpdateRoutingProfileConcurrencyCommandOutput,
Expand Down Expand Up @@ -791,6 +795,7 @@ export type ServiceInputTypes =
| UpdateQueueStatusCommandInput
| UpdateQuickConnectConfigCommandInput
| UpdateQuickConnectNameCommandInput
| UpdateRoutingProfileAgentAvailabilityTimerCommandInput
| UpdateRoutingProfileConcurrencyCommandInput
| UpdateRoutingProfileDefaultOutboundQueueCommandInput
| UpdateRoutingProfileNameCommandInput
Expand Down Expand Up @@ -992,6 +997,7 @@ export type ServiceOutputTypes =
| UpdateQueueStatusCommandOutput
| UpdateQuickConnectConfigCommandOutput
| UpdateQuickConnectNameCommandOutput
| UpdateRoutingProfileAgentAvailabilityTimerCommandOutput
| UpdateRoutingProfileConcurrencyCommandOutput
| UpdateRoutingProfileDefaultOutboundQueueCommandOutput
| UpdateRoutingProfileNameCommandOutput
Expand Down
Expand Up @@ -70,6 +70,7 @@ export interface CreateRoutingProfileCommandOutput extends CreateRoutingProfileR
* Tags: { // TagMap
* "<keys>": "STRING_VALUE",
* },
* AgentAvailabilityTimer: "TIME_SINCE_LAST_ACTIVITY" || "TIME_SINCE_LAST_INBOUND",
* };
* const command = new CreateRoutingProfileCommand(input);
* const response = await client.send(command);
Expand Down
Expand Up @@ -71,6 +71,7 @@ export interface DescribeRoutingProfileCommandOutput extends DescribeRoutingProf
* // },
* // NumberOfAssociatedQueues: Number("long"),
* // NumberOfAssociatedUsers: Number("long"),
* // AgentAvailabilityTimer: "TIME_SINCE_LAST_ACTIVITY" || "TIME_SINCE_LAST_INBOUND",
* // },
* // };
*
Expand Down
Expand Up @@ -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",
Expand Down
@@ -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
* <p>Whether agents with this routing profile
* will have their routing order calculated based on
* <i>time since their last inbound
* contact</i> or <i>longest idle
* time</i>. </p>
* @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)
* <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 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<ServiceInputTypes, ServiceOutputTypes>,
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<any>) =>
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<UpdateRoutingProfileAgentAvailabilityTimerCommandOutput> {
return de_UpdateRoutingProfileAgentAvailabilityTimerCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
1 change: 1 addition & 0 deletions clients/client-connect/src/commands/index.ts
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion clients/client-connect/src/endpoint/ruleset.ts
Expand Up @@ -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;
48 changes: 34 additions & 14 deletions clients/client-connect/src/models/models_0.ts
Expand Up @@ -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
Expand Down Expand Up @@ -2812,6 +2826,16 @@ export interface CreateRoutingProfileRequest {
* <p>The tags used to organize, track, or control access for this resource. For example, \{ "tags": \{"key1":"value1", "key2":"value2"\} \}.</p>
*/
Tags?: Record<string, string>;

/**
* @public
* <p>Whether agents with this routing profile
* will have their routing order calculated based on
* <i>time since their last inbound
* contact</i> or <i>longest idle
* time</i>. </p>
*/
AgentAvailabilityTimer?: AgentAvailabilityTimer | string;
}

/**
Expand Down Expand Up @@ -6260,6 +6284,16 @@ export interface RoutingProfile {
* <p>The number of associated users in routing profile.</p>
*/
NumberOfAssociatedUsers?: number;

/**
* @public
* <p>Whether agents with this routing profile
* will have their routing order calculated based on
* <i>time since their last inbound
* contact</i> or <i>longest idle
* time</i>. </p>
*/
AgentAvailabilityTimer?: AgentAvailabilityTimer | string;
}

/**
Expand Down Expand Up @@ -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
*/
Expand Down

0 comments on commit a2d8d18

Please sign in to comment.