Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -49,9 +49,9 @@ public static RouterRuleInternal getRouterRuleInternal(RouterRule routerRule) {
} else if (routerRule.getClass() == WebhookRouterRule.class) {
WebhookRouterRule webhookRouterRule = (WebhookRouterRule) routerRule;
prioritizationRuleInternal = new WebhookRouterRuleInternal()
.setAuthorizationServerUri(webhookRouterRule.getAuthorizationServerUri())
.setAuthorizationServerUri(webhookRouterRule.getAuthorizationServerUrl())
.setClientCredential(webhookRouterRule.getClientCredential())
.setWebhookUri(webhookRouterRule.getWebhookUri());
.setWebhookUri(webhookRouterRule.getWebhookUrl());
}
}

Expand All @@ -75,11 +75,11 @@ public static RouterRuleInternal convertRouterRuleToInternal(RouterRule rule) {
return new StaticRouterRuleInternal().setValue(RouterValueAdapter.getValue(((StaticRouterRule) rule).getValue()));
} else if (rule instanceof WebhookRouterRule) {
WebhookRouterRule webhookRouterRule = (WebhookRouterRule) rule;
return new WebhookRouterRuleInternal().setWebhookUri(webhookRouterRule.getWebhookUri())
return new WebhookRouterRuleInternal().setWebhookUri(webhookRouterRule.getWebhookUrl())
.setClientCredential(new OAuth2WebhookClientCredential()
.setClientId(webhookRouterRule.getClientCredential().getClientId())
.setClientSecret(webhookRouterRule.getClientCredential().getClientSecret()))
.setAuthorizationServerUri(webhookRouterRule.getAuthorizationServerUri());
.setAuthorizationServerUri(webhookRouterRule.getAuthorizationServerUrl());
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ public final class BestWorkerMode extends DistributionMode {
private ScoringRuleOptions scoringRuleOptions;

/** Creates an instance of BestWorkerMode class. */
public BestWorkerMode() {
this.kind = DistributionModeKind.BEST_WORKER;
}
public BestWorkerMode() {}

/**
* Returns kind discriminator.
* @return kind.
*/
public DistributionModeKind getKind() { return DistributionModeKind.BEST_WORKER; }

/**
* Get the scoringRule property: Define a scoring rule to use, when calculating a score to determine the best
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ public final class CancelExceptionAction extends ExceptionAction {
private String dispositionCode;

/** Creates an instance of CancelExceptionAction class. */
public CancelExceptionAction() {
this.kind = ExceptionActionKind.CANCEL;
}
public CancelExceptionAction() {}

/**
* Returns kind discriminator.
* @return kind.
*/
public ExceptionActionKind getKind() { return ExceptionActionKind.CANCEL; }

/**
* Get the note property: (Optional) A note that will be appended to the jobs' Notes collection with the current
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,14 @@ public ConditionalQueueSelectorAttachment(
@JsonProperty(value = "queueSelectors") List<RouterQueueSelector> queueSelectors) {
this.condition = condition;
this.queueSelectors = queueSelectors;
this.kind = QueueSelectorAttachmentKind.CONDITIONAL;
}

/**
* Returns kind discriminator.
* @return kind.
*/
public QueueSelectorAttachmentKind getKind() { return QueueSelectorAttachmentKind.CONDITIONAL; }

/**
* Get the condition property: A rule of one of the following types:
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,14 @@ public ConditionalWorkerSelectorAttachment(
@JsonProperty(value = "workerSelectors") List<RouterWorkerSelector> workerSelectors) {
this.condition = condition;
this.workerSelectors = workerSelectors;
this.kind = WorkerSelectorAttachmentKind.CONDITIONAL;
}

/**
* Returns kind discriminator.
* @return kind.
*/
public WorkerSelectorAttachmentKind getKind() { return WorkerSelectorAttachmentKind.CONDITIONAL; }

/**
* Get the condition property: A rule of one of the following types:
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
public final class DirectMapRouterRule extends RouterRule {

/** Creates an instance of DirectMapRouterRule class. */
public DirectMapRouterRule() {
this.kind = RouterRuleKind.DIRECT_MAP;
}
public DirectMapRouterRule() {}

/**
* Returns kind discriminator.
* @return kind.
*/
public RouterRuleKind getKind() { return RouterRuleKind.DIRECT_MAP; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public abstract class DistributionMode {
* kind discriminator.
*/
@JsonProperty(value = "kind")
protected DistributionModeKind kind;
private DistributionModeKind kind;

/*
* Governs the minimum desired number of active concurrent offers a job can have.
Expand Down Expand Up @@ -123,7 +123,5 @@ public DistributionMode setBypassSelectors(Boolean bypassSelectors) {
* Returns kind discriminator.
* @return kind.
*/
public DistributionModeKind getKind() {
return this.kind;
}
public abstract DistributionModeKind getKind();
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.communication.jobrouter.models;

import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
Expand All @@ -20,12 +21,13 @@
@JsonSubTypes.Type(name = "manualReclassify", value = ManualReclassifyExceptionAction.class),
@JsonSubTypes.Type(name = "reclassify", value = ReclassifyExceptionAction.class)
})
@Immutable
public abstract class ExceptionAction {
/**
* kind discriminator.
*/
@JsonProperty(value = "kind")
protected ExceptionActionKind kind;
private ExceptionActionKind kind;

/** Creates an instance of ExceptionAction class. */
public ExceptionAction() {}
Expand All @@ -49,7 +51,5 @@ public String getId() {
* Returns kind discriminator.
* @return kind.
*/
public ExceptionActionKind getKind() {
return this.kind;
}
public abstract ExceptionActionKind getKind();
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.communication.jobrouter.models;

import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
Expand All @@ -19,12 +20,13 @@
@JsonSubTypes.Type(name = "queueLength", value = QueueLengthExceptionTrigger.class),
@JsonSubTypes.Type(name = "waitTime", value = WaitTimeExceptionTrigger.class)
})
@Immutable
public abstract class ExceptionTrigger {
/**
* kind discriminator.
*/
@JsonProperty(value = "kind")
protected ExceptionTriggerKind kind;
private ExceptionTriggerKind kind;

/** Creates an instance of ExceptionTrigger class. */
public ExceptionTrigger() {}
Expand All @@ -33,7 +35,5 @@ public ExceptionTrigger() {}
* Returns kind discriminator.
* @return kind.
*/
public ExceptionTriggerKind getKind() {
return this.kind;
}
public abstract ExceptionTriggerKind getKind();
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@ public final class ExpressionRouterRule extends RouterRule {
@JsonCreator
public ExpressionRouterRule(@JsonProperty(value = "expression") String expression) {
this.expression = expression;
this.kind = RouterRuleKind.EXPRESSION;
}

/**
* Returns kind discriminator.
* @return kind.
*/
public RouterRuleKind getKind() { return RouterRuleKind.EXPRESSION; }

/**
* Get the language property: The expression language to compile to and execute.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@ public final class FunctionRouterRule extends RouterRule {
@JsonCreator
public FunctionRouterRule(@JsonProperty(value = "functionUri") String functionUri) {
this.functionUri = functionUri;
this.kind = RouterRuleKind.FUNCTION;
}

/**
* Returns kind discriminator.
* @return kind.
*/
public RouterRuleKind getKind() { return RouterRuleKind.FUNCTION; }

/**
* Get the functionUri property: URL for Azure Function.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@
@Fluent
public final class LongestIdleMode extends DistributionMode {
/** Creates an instance of LongestIdleMode class. */
public LongestIdleMode() {
this.kind = DistributionModeKind.LONGEST_IDLE;
}
public LongestIdleMode() {}

/**
* Returns kind discriminator.
* @return kind.
*/
public DistributionModeKind getKind() { return DistributionModeKind.LONGEST_IDLE; }

/** {@inheritDoc} */
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ public final class ManualReclassifyExceptionAction extends ExceptionAction {
private List<RouterWorkerSelector> workerSelectors;

/** Creates an instance of ManualReclassifyExceptionAction class. */
public ManualReclassifyExceptionAction() {
this.kind = ExceptionActionKind.MANUAL_RECLASSIFY;
}
public ManualReclassifyExceptionAction() {}

/**
* Returns kind discriminator.
* @return kind.
*/
public ExceptionActionKind getKind() { return ExceptionActionKind.MANUAL_RECLASSIFY; }

/**
* Get the queueId property: Updated QueueId.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ public PassThroughQueueSelectorAttachment(
@JsonProperty(value = "labelOperator") LabelOperator labelOperator) {
this.key = key;
this.labelOperator = labelOperator;
this.kind = QueueSelectorAttachmentKind.PASS_THROUGH;
}

/**
* Returns kind discriminator.
* @return kind.
*/
public QueueSelectorAttachmentKind getKind() { return QueueSelectorAttachmentKind.PASS_THROUGH; }

/**
* Get the key property: The label key to query against.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,14 @@ public PassThroughWorkerSelectorAttachment(
@JsonProperty(value = "labelOperator") LabelOperator labelOperator) {
this.key = key;
this.labelOperator = labelOperator;
this.kind = WorkerSelectorAttachmentKind.PASS_THROUGH;
}

/**
* Returns kind discriminator.
* @return kind.
*/
public WorkerSelectorAttachmentKind getKind() { return WorkerSelectorAttachmentKind.PASS_THROUGH; }

/**
* Get the key property: The label key to query against.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,14 @@ public final class QueueLengthExceptionTrigger extends ExceptionTrigger {
@JsonCreator
public QueueLengthExceptionTrigger(@JsonProperty(value = "threshold") int threshold) {
this.threshold = threshold;
this.kind = ExceptionTriggerKind.QUEUE_LENGTH;
}

/**
* Returns kind discriminator.
* @return kind.
*/
public ExceptionTriggerKind getKind() { return ExceptionTriggerKind.QUEUE_LENGTH; }

/**
* Get the threshold property: Threshold of number of jobs ahead in the queue to for this trigger to fire.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.communication.jobrouter.models;

import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
Expand All @@ -24,12 +25,13 @@
name = "weightedAllocation",
value = WeightedAllocationQueueSelectorAttachment.class)
})
@Immutable
public abstract class QueueSelectorAttachment {
/**
* kind discriminator.
*/
@JsonProperty(value = "kind")
protected QueueSelectorAttachmentKind kind;
private QueueSelectorAttachmentKind kind;

/** Creates an instance of QueueSelectorAttachment class. */
public QueueSelectorAttachment() {}
Expand All @@ -38,7 +40,5 @@ public QueueSelectorAttachment() {}
* Returns kind discriminator.
* @return kind.
*/
public QueueSelectorAttachmentKind getKind() {
return this.kind;
}
public abstract QueueSelectorAttachmentKind getKind();
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ public final class ReclassifyExceptionAction extends ExceptionAction {
private Map<String, RouterValue> labelsToUpsert;

/** Creates an instance of ReclassifyExceptionAction class. */
public ReclassifyExceptionAction() {
this.kind = ExceptionActionKind.RECLASSIFY;
}
public ReclassifyExceptionAction() {}

/**
* Returns kind discriminator.
* @return kind.
*/
public ExceptionActionKind getKind() { return ExceptionActionKind.RECLASSIFY; }

/**
* Get the classificationPolicyId property: (optional) The new classification policy that will determine queue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
public final class RoundRobinMode extends DistributionMode {

/** Creates an instance of RoundRobinMode class. */
public RoundRobinMode() {
this.kind = DistributionModeKind.ROUND_ROBIN;
}
public RoundRobinMode() {}

/**
* Returns kind discriminator.
* @return kind.
*/
public DistributionModeKind getKind() { return DistributionModeKind.ROUND_ROBIN; }

/** {@inheritDoc} */
@Override
Expand Down
Loading