Skip to content

Commit

Permalink
[JobRouter] Regenerate from specs
Browse files Browse the repository at this point in the history
  • Loading branch information
williamzhao87 committed Nov 7, 2023
1 parent 9c67c4a commit 28a2820
Show file tree
Hide file tree
Showing 79 changed files with 1,958 additions and 3,011 deletions.
20 changes: 0 additions & 20 deletions sdk/communication/Azure.Communication.JobRouter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,6 @@
- `GetWorkers` returns `AsyncPageable<RouterWorker>` rather than `AsyncPageable<RouterJobWorker>`
- `UpdateJob(UpdateJobOptions options, CancellationToken cancellationToken)` changed to `UpdateJob(RouterJob job, CancellationToken cancellationToken)`
- `UpdateWorker(UpdateWorkerOptions options, CancellationToken cancellationToken)` changed to `UpdateWorker(RouterWorker worker, CancellationToken cancellationToken)`
- `CancelJob(CancelJobOptions options, CancellationToken cancellationToken = default)` changed to `CancelJob(string jobId, CancelJobOptions cancelJobOptions = null, CancellationToken cancellationToken = default)`
- `CompleteJob(CompleteJobOptions options, CancellationToken cancellationToken = default)` changed to `CompleteJob(string jobId, CompleteJobOptions completeJobOptions = null, CancellationToken cancellationToken = default)`
- `CloseJob(CloseJobOptions options, CancellationToken cancellationToken = default)` changed to `CloseJob(string jobId, CloseJobOptions closeJobOptions = null, CancellationToken cancellationToken = default)`
- `DeclineJobOffer(DeclineJobOfferOptions options, CancellationToken cancellationToken = default)` changed to `DeclineJobOffer(string workerId, string offerId, DeclineJobOfferOptions declineJobOfferOptions = null, CancellationToken cancellationToken = default)`
- `UnassignJob(UnassignJobOptions options, CancellationToken cancellationToken = default)` changed to `UnassignJob(string jobId, string assignmentId, UnassignJobOptions unassignJobOptions = null, CancellationToken cancellationToken = default)`

#### CancelJobOptions
- Changed constructor from `CancelJobOptions(string jobId)` to `CancelJobOptions()`

#### CompleteJobOptions
- Changed constructor from `CompleteJobOptions(string jobId, string assignmentId)` to `CompleteJobOptions(string assignmentId)`

#### CloseJobOptions
- Changed constructor from `CloseJobOptions(string jobId, string assignmentId)` to `CloseJobOptions(string assignmentId)`

#### DeclineJobOfferOptions
- Changed constructor from `DeclineJobOfferOptions(string workerId, string offerId)` to `DeclineJobOfferOptions()`

#### UnassignJobOptions
- Changed constructor from `UnassignJobOptions(string jobId, string assignmentId)` to `UnassignJobOptions()`

#### RouterJob && CreateJobOptions && CreateJobWithClassificationOptions
- Property `Notes` - Changed from `List<RouterJobNote>` to `IList<RouterJobNote>`
Expand Down
9 changes: 3 additions & 6 deletions sdk/communication/Azure.Communication.JobRouter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ Console.WriteLine($"Job assignment has been successful: {updatedJob.Value.Status
### Completing a job
Once the worker is done with the job, the worker has to mark the job as `completed`.
```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_CompleteJob_Async
Response completeJob = await routerClient.CompleteJobAsync(
jobId: job.Value.Id, new CompleteJobOptions(acceptJobOfferResult.Value.AssignmentId)
Response completeJob = await routerClient.CompleteJobAsync(new CompleteJobOptions(job.Value.Id, acceptJobOfferResult.Value.AssignmentId)
{
Note = $"Job has been completed by {worker.Value.Id} at {DateTimeOffset.UtcNow}"
});
Expand All @@ -214,8 +213,7 @@ Console.WriteLine($"Job has been successfully completed: {completeJob.Status ==
### Closing a job
After a job has been completed, the worker can perform wrap up actions to the job before closing the job and finally releasing its capacity to accept more incoming jobs
```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_CloseJob_Async
Response closeJob = await routerClient.CloseJobAsync(
jobId: job.Value.Id, new CloseJobOptions(acceptJobOfferResult.Value.AssignmentId)
Response closeJob = await routerClient.CloseJobAsync(new CloseJobOptions(job.Value.Id, acceptJobOfferResult.Value.AssignmentId)
{
Note = $"Job has been closed by {worker.Value.Id} at {DateTimeOffset.UtcNow}"
});
Expand All @@ -227,8 +225,7 @@ Console.WriteLine($"Updated job status: {updatedJob.Value.Status == RouterJobSta

```C# Snippet:Azure_Communication_JobRouter_Tests_Samples_CloseJobInFuture_Async
// Optionally, a job can also be set up to be marked as closed in the future.
var closeJobInFuture = await routerClient.CloseJobAsync(
jobId: job.Value.Id, new CloseJobOptions(acceptJobOfferResult.Value.AssignmentId)
var closeJobInFuture = await routerClient.CloseJobAsync(new CloseJobOptions(job.Value.Id, acceptJobOfferResult.Value.AssignmentId)
{
CloseAt = DateTimeOffset.UtcNow.AddSeconds(2), // this will mark the job as closed after 2 seconds
Note = $"Job has been marked to close in the future by {worker.Value.Id} at {DateTimeOffset.UtcNow}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ public partial class CancelExceptionAction : Azure.Communication.JobRouter.Excep
}
public partial class CancelJobOptions
{
public CancelJobOptions() { }
public CancelJobOptions(string jobId) { }
public string DispositionCode { get { throw null; } set { } }
public string JobId { get { throw null; } }
public string Note { get { throw null; } set { } }
}
public partial class ClassificationPolicy
Expand All @@ -38,16 +39,18 @@ public partial class ClassificationPolicy
}
public partial class CloseJobOptions
{
public CloseJobOptions(string assignmentId) { }
public CloseJobOptions(string jobId, string assignmentId) { }
public string AssignmentId { get { throw null; } }
public System.DateTimeOffset CloseAt { get { throw null; } set { } }
public string DispositionCode { get { throw null; } set { } }
public string JobId { get { throw null; } }
public string Note { get { throw null; } set { } }
}
public partial class CompleteJobOptions
{
public CompleteJobOptions(string assignmentId) { }
public CompleteJobOptions(string jobId, string assignmentId) { }
public string AssignmentId { get { throw null; } }
public string JobId { get { throw null; } }
public string Note { get { throw null; } set { } }
}
public partial class ConditionalQueueSelectorAttachment : Azure.Communication.JobRouter.QueueSelectorAttachment
Expand Down Expand Up @@ -145,8 +148,10 @@ public partial class CreateWorkerOptions
}
public partial class DeclineJobOfferOptions
{
public DeclineJobOfferOptions() { }
public DeclineJobOfferOptions(string workerId, string offerId) { }
public string OfferId { get { throw null; } }
public System.DateTimeOffset? RetryOfferAt { get { throw null; } set { } }
public string WorkerId { get { throw null; } }
}
public partial class DirectMapRouterRule : Azure.Communication.JobRouter.RouterRule
{
Expand Down Expand Up @@ -299,28 +304,20 @@ public partial class JobRouterClient
public virtual Azure.Response<Azure.Communication.JobRouter.AcceptJobOfferResult> AcceptJobOffer(string workerId, string offerId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> AcceptJobOfferAsync(string workerId, string offerId, Azure.RequestContext context) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.JobRouter.AcceptJobOfferResult>> AcceptJobOfferAsync(string workerId, string offerId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response CancelJob(string jobId, Azure.Communication.JobRouter.CancelJobOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response CancelJob(string jobId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> CancelJobAsync(string jobId, Azure.Communication.JobRouter.CancelJobOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> CancelJobAsync(string jobId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; }
public virtual Azure.Response CloseJob(string jobId, Azure.Communication.JobRouter.CloseJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response CloseJob(string jobId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> CloseJobAsync(string jobId, Azure.Communication.JobRouter.CloseJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> CloseJobAsync(string jobId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; }
public virtual Azure.Response CompleteJob(string jobId, Azure.Communication.JobRouter.CompleteJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response CompleteJob(string jobId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> CompleteJobAsync(string jobId, Azure.Communication.JobRouter.CompleteJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> CompleteJobAsync(string jobId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; }
public virtual Azure.Response CancelJob(Azure.Communication.JobRouter.CancelJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> CancelJobAsync(Azure.Communication.JobRouter.CancelJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response CloseJob(Azure.Communication.JobRouter.CloseJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> CloseJobAsync(Azure.Communication.JobRouter.CloseJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response CompleteJob(Azure.Communication.JobRouter.CompleteJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> CompleteJobAsync(Azure.Communication.JobRouter.CompleteJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Communication.JobRouter.RouterJob> CreateJob(Azure.Communication.JobRouter.CreateJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.JobRouter.RouterJob>> CreateJobAsync(Azure.Communication.JobRouter.CreateJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Communication.JobRouter.RouterJob> CreateJobWithClassificationPolicy(Azure.Communication.JobRouter.CreateJobWithClassificationPolicyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.JobRouter.RouterJob>> CreateJobWithClassificationPolicyAsync(Azure.Communication.JobRouter.CreateJobWithClassificationPolicyOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Communication.JobRouter.RouterWorker> CreateWorker(Azure.Communication.JobRouter.CreateWorkerOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.JobRouter.RouterWorker>> CreateWorkerAsync(Azure.Communication.JobRouter.CreateWorkerOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response DeclineJobOffer(string workerId, string offerId, Azure.Communication.JobRouter.DeclineJobOfferOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response DeclineJobOffer(string workerId, string offerId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> DeclineJobOfferAsync(string workerId, string offerId, Azure.Communication.JobRouter.DeclineJobOfferOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> DeclineJobOfferAsync(string workerId, string offerId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; }
public virtual Azure.Response DeclineJobOffer(Azure.Communication.JobRouter.DeclineJobOfferOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> DeclineJobOfferAsync(Azure.Communication.JobRouter.DeclineJobOfferOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response DeleteJob(string jobId, Azure.RequestContext context = null) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> DeleteJobAsync(string jobId, Azure.RequestContext context = null) { throw null; }
public virtual Azure.Response DeleteWorker(string workerId, Azure.RequestContext context = null) { throw null; }
Expand Down Expand Up @@ -351,10 +348,8 @@ public partial class JobRouterClient
public virtual Azure.AsyncPageable<System.BinaryData> GetWorkersAsync(int? maxpagesize, string state, string channelId, string queueId, bool? hasCapacity, Azure.RequestContext context) { throw null; }
public virtual Azure.Response ReclassifyJob(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> ReclassifyJobAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Communication.JobRouter.UnassignJobResult> UnassignJob(string jobId, string assignmentId, Azure.Communication.JobRouter.UnassignJobOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response UnassignJob(string jobId, string assignmentId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.JobRouter.UnassignJobResult>> UnassignJobAsync(string jobId, string assignmentId, Azure.Communication.JobRouter.UnassignJobOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> UnassignJobAsync(string jobId, string assignmentId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; }
public virtual Azure.Response<Azure.Communication.JobRouter.UnassignJobResult> UnassignJob(Azure.Communication.JobRouter.UnassignJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.JobRouter.UnassignJobResult>> UnassignJobAsync(Azure.Communication.JobRouter.UnassignJobOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Communication.JobRouter.RouterJob> UpdateJob(Azure.Communication.JobRouter.RouterJob job, Azure.RequestConditions requestConditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response UpdateJob(string jobId, Azure.Core.RequestContent content, Azure.RequestConditions requestConditions = null, Azure.RequestContext context = null) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Communication.JobRouter.RouterJob>> UpdateJobAsync(Azure.Communication.JobRouter.RouterJob job, Azure.RequestConditions requestConditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
Expand Down Expand Up @@ -680,7 +675,7 @@ public partial class RouterWorkerSelector
public RouterWorkerSelector(string key, Azure.Communication.JobRouter.LabelOperator labelOperator, Azure.Communication.JobRouter.RouterValue value) { }
public bool? Expedite { get { throw null; } set { } }
public System.TimeSpan? ExpiresAfter { get { throw null; } set { } }
public System.DateTimeOffset? ExpiresAt { get { throw null; } set { } }
public System.DateTimeOffset? ExpiresAt { get { throw null; } }
public string Key { get { throw null; } }
public Azure.Communication.JobRouter.LabelOperator LabelOperator { get { throw null; } }
public Azure.Communication.JobRouter.RouterWorkerSelectorStatus? Status { get { throw null; } }
Expand Down Expand Up @@ -805,7 +800,9 @@ public partial class SuspendMode : Azure.Communication.JobRouter.JobMatchingMode
}
public partial class UnassignJobOptions
{
public UnassignJobOptions() { }
public UnassignJobOptions(string jobId, string assignmentId) { }
public string AssignmentId { get { throw null; } }
public string JobId { get { throw null; } }
public bool? SuspendMatching { get { throw null; } set { } }
}
public partial class UnassignJobResult
Expand All @@ -817,7 +814,7 @@ public partial class UnassignJobResult
public partial class WaitTimeExceptionTrigger : Azure.Communication.JobRouter.ExceptionTrigger
{
public WaitTimeExceptionTrigger(System.TimeSpan threshold) { }
public System.TimeSpan Threshold { get { throw null; } set { } }
public System.TimeSpan Threshold { get { throw null; } }
}
public partial class WebhookRouterRule : Azure.Communication.JobRouter.RouterRule
{
Expand Down

0 comments on commit 28a2820

Please sign in to comment.