All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.communication.jobrouter.implementation.models.RouterWorkerSelectorInternal Maven / Gradle / Ivy

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.communication.jobrouter.implementation.models;

import com.azure.communication.jobrouter.models.LabelOperator;
import com.azure.communication.jobrouter.models.RouterWorkerSelectorStatus;
import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.Generated;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/**
 * Describes a condition that must be met against a set of labels for worker selection.
 */
@Fluent
public final class RouterWorkerSelectorInternal {

    /*
     * The label key to query against.
     */
    @Generated
    @JsonProperty(value = "key")
    private String key;

    /*
     * Describes how the value of the label is compared to the value defined on the worker selector.
     */
    @Generated
    @JsonProperty(value = "labelOperator")
    private LabelOperator labelOperator;

    /*
     * The value to compare against the actual label value with the given operator. Values must be primitive values -
     * number, string, boolean.
     */
    @Generated
    @JsonProperty(value = "value")
    private Object value;

    /*
     * Describes how long this label selector is valid in seconds.
     */
    @Generated
    @JsonProperty(value = "expiresAfterSeconds")
    private Double expiresAfterSeconds;

    /*
     * Pushes a job to the front of the queue as long as this selector is active.
     */
    @Generated
    @JsonProperty(value = "expedite")
    private Boolean expedite;

    /*
     * Status of the worker selector.
     */
    @Generated
    @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
    private RouterWorkerSelectorStatus status;

    /*
     * The time at which this worker selector expires in UTC.
     */
    @Generated
    @JsonProperty(value = "expiresAt", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime expiresAt;

    /**
     * Creates an instance of RouterWorkerSelectorInternal class.
     *
     * @param key the key value to set.
     * @param labelOperator the labelOperator value to set.
     */
    @Generated
    @JsonCreator
    public RouterWorkerSelectorInternal(@JsonProperty(value = "key") String key,
        @JsonProperty(value = "labelOperator") LabelOperator labelOperator) {
        this.key = key;
        this.labelOperator = labelOperator;
    }

    /**
     * Get the key property: The label key to query against.
     *
     * @return the key value.
     */
    @Generated
    public String getKey() {
        return this.key;
    }

    /**
     * Get the labelOperator property: Describes how the value of the label is compared to the value defined on the
     * worker selector.
     *
     * @return the labelOperator value.
     */
    @Generated
    public LabelOperator getLabelOperator() {
        return this.labelOperator;
    }

    /**
     * Get the value property: The value to compare against the actual label value with the given operator. Values must
     * be primitive values - number, string, boolean.
     *
     * @return the value value.
     */
    @Generated
    public Object getValue() {
        return this.value;
    }

    /**
     * Set the value property: The value to compare against the actual label value with the given operator. Values must
     * be primitive values - number, string, boolean.
     *
     * @param value the value value to set.
     * @return the RouterWorkerSelectorInternal object itself.
     */
    @Generated
    public RouterWorkerSelectorInternal setValue(Object value) {
        this.value = value;
        return this;
    }

    /**
     * Get the expiresAfterSeconds property: Describes how long this label selector is valid in seconds.
     *
     * @return the expiresAfterSeconds value.
     */
    @Generated
    public Double getExpiresAfterSeconds() {
        return this.expiresAfterSeconds;
    }

    /**
     * Set the expiresAfterSeconds property: Describes how long this label selector is valid in seconds.
     *
     * @param expiresAfterSeconds the expiresAfterSeconds value to set.
     * @return the RouterWorkerSelectorInternal object itself.
     */
    @Generated
    public RouterWorkerSelectorInternal setExpiresAfterSeconds(Double expiresAfterSeconds) {
        this.expiresAfterSeconds = expiresAfterSeconds;
        return this;
    }

    /**
     * Get the expedite property: Pushes a job to the front of the queue as long as this selector is active.
     *
     * @return the expedite value.
     */
    @Generated
    public Boolean isExpedite() {
        return this.expedite;
    }

    /**
     * Set the expedite property: Pushes a job to the front of the queue as long as this selector is active.
     *
     * @param expedite the expedite value to set.
     * @return the RouterWorkerSelectorInternal object itself.
     */
    @Generated
    public RouterWorkerSelectorInternal setExpedite(Boolean expedite) {
        this.expedite = expedite;
        return this;
    }

    /**
     * Get the status property: Status of the worker selector.
     *
     * @return the status value.
     */
    @Generated
    public RouterWorkerSelectorStatus getStatus() {
        return this.status;
    }

    /**
     * Set status.
     *
     * @param status status.
     * @return this.
     */
    public RouterWorkerSelectorInternal setStatus(RouterWorkerSelectorStatus status) {
        this.status = status;
        return this;
    }

    /**
     * Get the expiresAt property: The time at which this worker selector expires in UTC.
     *
     * @return the expiresAt value.
     */
    @Generated
    public OffsetDateTime getExpiresAt() {
        return this.expiresAt;
    }

    /**
     * Set expirestAt.
     *
     * @param expiresAt expiresAt.
     * @return this.
     */
    public RouterWorkerSelectorInternal setExpiresAt(OffsetDateTime expiresAt) {
        this.expiresAt = expiresAt;
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy