From 06220e0c3562bb0a87412c091696b0200278bad0 Mon Sep 17 00:00:00 2001 From: williamzhao87 Date: Mon, 29 May 2023 13:14:34 -0400 Subject: [PATCH] [JobRouter] Minor fix to readme (#26031) ### Packages impacted by this PR ### Issues associated with this PR ### Describe the problem that is addressed by this PR ### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen? ### Are there test cases added in this PR? _(If not, why?)_ ### Provide a list of related PRs _(if any)_ ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ ### Checklists - [ ] Added impacted package name to the issue description - [ ] Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_ - [ ] Added a changelog (if necessary) --- .../review/communication-job-router.api.md | 12 ++++++++++-- .../communication-job-router/src/models/models.ts | 2 ++ .../communication-job-router/src/routerClient.ts | 5 +++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/sdk/communication/communication-job-router/review/communication-job-router.api.md b/sdk/communication/communication-job-router/review/communication-job-router.api.md index 68804fc231a0..67e68df7f6dd 100644 --- a/sdk/communication/communication-job-router/review/communication-job-router.api.md +++ b/sdk/communication/communication-job-router/review/communication-job-router.api.md @@ -169,13 +169,16 @@ export interface CreateWorkerOptions extends JobRouterUpsertWorkerOptionalParams totalCapacity?: number; } -// Warning: (ae-forgotten-export) The symbol "JobRouterDeclineJobActionOptionalParams" needs to be exported by the entry point index.d.ts -// // @public export interface DeclineJobOfferOptions extends JobRouterDeclineJobActionOptionalParams { reofferTimeUtc?: Date; } +// @public +export interface DeclineJobOfferRequest { + reofferTimeUtc?: Date; +} + // @public export interface DirectMapRule extends RouterRule { kind: "direct-map-rule"; @@ -377,6 +380,11 @@ export type JobRouterCompleteJobActionResponse = { body: any; }; +// @public +export interface JobRouterDeclineJobActionOptionalParams extends coreClient.OperationOptions { + declineJobOfferRequest?: DeclineJobOfferRequest; +} + // @public export type JobRouterDeclineJobActionResponse = { body: any; diff --git a/sdk/communication/communication-job-router/src/models/models.ts b/sdk/communication/communication-job-router/src/models/models.ts index 0c1315ff9757..d18b286ec146 100644 --- a/sdk/communication/communication-job-router/src/models/models.ts +++ b/sdk/communication/communication-job-router/src/models/models.ts @@ -65,6 +65,8 @@ export { JobRouterUpsertJobOptionalParams, JobRouterUpsertWorkerOptionalParams, JobRouterReclassifyJobActionOptionalParams, + JobRouterDeclineJobActionOptionalParams, + DeclineJobOfferRequest, ClassificationPolicyItem, DistributionPolicyItem, ExceptionPolicyItem, diff --git a/sdk/communication/communication-job-router/src/routerClient.ts b/sdk/communication/communication-job-router/src/routerClient.ts index 4d733a415c81..fb9c1695b205 100644 --- a/sdk/communication/communication-job-router/src/routerClient.ts +++ b/sdk/communication/communication-job-router/src/routerClient.ts @@ -310,6 +310,11 @@ export class RouterClient { offerId: string, options: DeclineJobOfferOptions = {} ): Promise { + if (options.reofferTimeUtc) { + options.declineJobOfferRequest = { + reofferTimeUtc: options.reofferTimeUtc, + }; + } return this.client.jobRouter.declineJobAction(workerId, offerId, options); }