Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JobRouter] Use internal setters #37570

Merged
merged 1 commit into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -746,10 +746,10 @@ internal CancelJobResult() { }
public partial class ClassificationPolicy
{
internal ClassificationPolicy() { }
public string FallbackQueueId { get { throw null; } set { } }
public string FallbackQueueId { get { throw null; } }
public string Id { get { throw null; } }
public string Name { get { throw null; } set { } }
public Azure.Communication.JobRouter.RouterRule PrioritizationRule { get { throw null; } set { } }
public string Name { get { throw null; } }
public Azure.Communication.JobRouter.RouterRule PrioritizationRule { get { throw null; } }
public System.Collections.Generic.List<Azure.Communication.JobRouter.QueueSelectorAttachment> QueueSelectors { get { throw null; } }
public System.Collections.Generic.List<Azure.Communication.JobRouter.WorkerSelectorAttachment> WorkerSelectors { get { throw null; } }
}
Expand Down Expand Up @@ -785,8 +785,8 @@ public partial class DistributionPolicy
{
internal DistributionPolicy() { }
public string Id { get { throw null; } }
public Azure.Communication.JobRouter.DistributionMode Mode { get { throw null; } set { } }
public string Name { get { throw null; } set { } }
public Azure.Communication.JobRouter.DistributionMode Mode { get { throw null; } }
public string Name { get { throw null; } }
public System.TimeSpan? OfferExpiresAfter { get { throw null; } set { } }
}
public partial class DistributionPolicyItem
Expand All @@ -800,7 +800,7 @@ public partial class ExceptionPolicy
internal ExceptionPolicy() { }
public System.Collections.Generic.IDictionary<string, Azure.Communication.JobRouter.ExceptionRule> ExceptionRules { get { throw null; } }
public string Id { get { throw null; } }
public string Name { get { throw null; } set { } }
public string Name { get { throw null; } }
}
public partial class ExceptionPolicyItem
{
Expand All @@ -817,17 +817,17 @@ public partial class RouterJob
internal RouterJob() { }
public System.Collections.Generic.IReadOnlyDictionary<string, Azure.Communication.JobRouter.Models.RouterJobAssignment> Assignments { get { throw null; } }
public System.Collections.Generic.IReadOnlyList<Azure.Communication.JobRouter.RouterWorkerSelector> AttachedWorkerSelectors { get { throw null; } }
public string ChannelId { get { throw null; } set { } }
public string ChannelReference { get { throw null; } set { } }
public string ClassificationPolicyId { get { throw null; } set { } }
public string DispositionCode { get { throw null; } set { } }
public string ChannelId { get { throw null; } }
public string ChannelReference { get { throw null; } }
public string ClassificationPolicyId { get { throw null; } }
public string DispositionCode { get { throw null; } }
public System.DateTimeOffset? EnqueuedAt { get { throw null; } }
public string Id { get { throw null; } }
public System.Collections.Generic.Dictionary<string, Azure.Communication.JobRouter.LabelValue> Labels { get { throw null; } }
public Azure.Communication.JobRouter.JobMatchingMode MatchingMode { get { throw null; } set { } }
public Azure.Communication.JobRouter.JobMatchingMode MatchingMode { get { throw null; } }
public System.Collections.Generic.List<Azure.Communication.JobRouter.Models.RouterJobNote> Notes { get { throw null; } }
public int? Priority { get { throw null; } set { } }
public string QueueId { get { throw null; } set { } }
public int? Priority { get { throw null; } }
public string QueueId { get { throw null; } }
public System.Collections.Generic.List<Azure.Communication.JobRouter.RouterWorkerSelector> RequestedWorkerSelectors { get { throw null; } }
public System.DateTimeOffset? ScheduledAt { get { throw null; } }
public Azure.Communication.JobRouter.Models.RouterJobStatus? Status { get { throw null; } }
Expand Down Expand Up @@ -903,11 +903,11 @@ internal RouterJobPositionDetails() { }
public partial class RouterQueue
{
internal RouterQueue() { }
public string DistributionPolicyId { get { throw null; } set { } }
public string ExceptionPolicyId { get { throw null; } set { } }
public string DistributionPolicyId { get { throw null; } }
public string ExceptionPolicyId { get { throw null; } }
public string Id { get { throw null; } }
public System.Collections.Generic.IDictionary<string, Azure.Communication.JobRouter.LabelValue> Labels { get { throw null; } }
public string Name { get { throw null; } set { } }
public string Name { get { throw null; } }
}
public partial class RouterQueueItem
{
Expand All @@ -927,7 +927,7 @@ public partial class RouterWorker
{
public RouterWorker() { }
public System.Collections.Generic.IReadOnlyList<Azure.Communication.JobRouter.Models.RouterWorkerAssignment> AssignedJobs { get { throw null; } }
public bool? AvailableForOffers { get { throw null; } set { } }
public bool? AvailableForOffers { get { throw null; } }
public System.Collections.Generic.IDictionary<string, Azure.Communication.JobRouter.ChannelConfiguration> ChannelConfigurations { get { throw null; } }
public string Id { get { throw null; } }
public System.Collections.Generic.IDictionary<string, Azure.Communication.JobRouter.LabelValue> Labels { get { throw null; } }
Expand All @@ -936,7 +936,7 @@ public RouterWorker() { }
public System.Collections.Generic.IDictionary<string, Azure.Communication.JobRouter.RouterQueueAssignment> QueueAssignments { get { throw null; } }
public Azure.Communication.JobRouter.RouterWorkerState? State { get { throw null; } }
public System.Collections.Generic.IDictionary<string, Azure.Communication.JobRouter.LabelValue> Tags { get { throw null; } }
public int? TotalCapacity { get { throw null; } set { } }
public int? TotalCapacity { get { throw null; } }
}
public partial class RouterWorkerAssignment
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ public virtual async Task<Response<RouterJob>> UpdateJobAsync(
scope.Start();
try
{
var request = new RouterJob {
var request = new RouterJob
{
ChannelId = options.ChannelId,
ClassificationPolicyId = options.ClassificationPolicyId,
ChannelReference = options.ChannelReference,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,23 @@ internal IList<WorkerSelectorAttachment> _workerSelectors

/// <summary> The worker label selectors to attach to a given job. </summary>
public List<WorkerSelectorAttachment> WorkerSelectors { get; } = new List<WorkerSelectorAttachment>();

/// <summary> (Optional) The name of the classification policy. </summary>
public string Name { get; internal set; }

/// <summary> The fallback queue to select if the queue selector doesn't find a match. </summary>
public string FallbackQueueId { get; internal set; }
/// <summary>
/// A rule of one of the following types:
///
/// StaticRule: A rule providing static rules that always return the same result, regardless of input.
/// DirectMapRule: A rule that return the same labels as the input labels.
/// ExpressionRule: A rule providing inline expression rules.
/// AzureFunctionRule: A rule providing a binding to an HTTP Triggered Azure Function.
/// WebhookRule: A rule providing a binding to a webserver following OAuth2.0 authentication protocol.
/// Please note <see cref="RouterRule"/> is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
/// The available derived classes include <see cref="FunctionRouterRule"/>, <see cref="DirectMapRouterRule"/>, <see cref="ExpressionRouterRule"/>, <see cref="StaticRouterRule"/> and <see cref="WebhookRouterRule"/>.
/// </summary>
public RouterRule PrioritizationRule { get; internal set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,15 @@ internal double? _offerExpiresAfterSeconds
OfferExpiresAfter = value != null ? TimeSpan.FromSeconds(value.Value) : null;
}
}

/// <summary> (Optional) The name of the distribution policy. </summary>
public string Name { get; internal set; }

/// <summary>
/// Abstract base class for defining a distribution mode
/// Please note <see cref="DistributionMode"/> is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
/// The available derived classes include <see cref="BestWorkerMode"/>, <see cref="LongestIdleMode"/> and <see cref="RoundRobinMode"/>.
/// </summary>
public DistributionMode Mode { get; internal set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,8 @@ internal IDictionary<string, ExceptionRule> _exceptionRules

/// <summary> (Optional) A dictionary collection of exception rules on the exception policy. Key is the Id of each exception rule. </summary>
public IDictionary<string, ExceptionRule> ExceptionRules { get; } = new Dictionary<string, ExceptionRule>();

/// <summary> (Optional) The name of the exception policy. </summary>
public string Name { get; internal set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,27 @@ internal RouterJob()
/// <summary> A collection of notes attached to a job. </summary>
public List<RouterJobNote> Notes { get; } = new List<RouterJobNote>();

/// <summary> Reference to an external parent context, eg. call ID. </summary>
public string ChannelReference { get; internal set; }

/// <summary> The channel identifier. eg. voice, chat, etc. </summary>
public string ChannelId { get; internal set; }

/// <summary> The Id of the Classification policy used for classifying a job. </summary>
public string ClassificationPolicyId { get; internal set; }

/// <summary> The Id of the Queue that this job is queued to. </summary>
public string QueueId { get; internal set; }

/// <summary> The priority of this job. </summary>
public int? Priority { get; internal set; }

/// <summary> Reason code for cancelled or closed jobs. </summary>
public string DispositionCode { get; internal set; }

/// <summary> Gets or sets the matching mode. </summary>
public JobMatchingMode MatchingMode { get; internal set; }

[CodeGenMember("Labels")]
internal IDictionary<string, object> _labels
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ internal IDictionary<string, object> _labels
/// </summary>
public IDictionary<string, LabelValue> Labels { get; } = new Dictionary<string, LabelValue>();

/// <summary> The name of this queue. </summary>
public string Name { get; internal set; }

/// <summary> The ID of the distribution policy that will determine how a job is distributed to workers. </summary>
public string DistributionPolicyId { get; internal set; }

/// <summary> (Optional) The ID of the exception policy that determines various job escalation rules. </summary>
public string ExceptionPolicyId { get; internal set; }

/// <summary> Initializes a new instance of JobQueue. </summary>
internal RouterQueue()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ public partial class RouterWorker
/// <summary> The queue(s) that this worker can receive work from. </summary>
public IDictionary<string, RouterQueueAssignment> QueueAssignments { get; } = new Dictionary<string, RouterQueueAssignment>();

/// <summary> The total capacity score this worker has to manage multiple concurrent jobs. </summary>
public int? TotalCapacity { get; internal set; }

/// <summary> A flag indicating this worker is open to receive offers or not. </summary>
public bool? AvailableForOffers { get; internal set; }

[CodeGenMember("Labels")]
internal IDictionary<string, object> _labels
{
Expand Down