// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.communication.jobrouter.models;

import com.azure.core.annotation.Fluent;
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 RouterWorkerSelector {
    /*
     * The label key to query against
     */
    @JsonProperty(value = "key", required = true)
    private String key;

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

    /*
     * The value to compare against the actual label value with the given
     * operator
     */
    @JsonProperty(value = "value")
    private LabelValue value;

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

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

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

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

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

    /**
     * Set the key property: The label key to query against.
     *
     * @param key the key value to set.
     * @return the RouterWorkerSelector object itself.
     */
    public RouterWorkerSelector setKey(String key) {
        this.key = key;
        return this;
    }

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

    /**
     * Set the labelOperator property: Describes how the value of the label is compared to the value defined on the
     * label selector.
     *
     * @param labelOperator the labelOperator value to set.
     * @return the RouterWorkerSelector object itself.
     */
    public RouterWorkerSelector setLabelOperator(LabelOperator labelOperator) {
        this.labelOperator = labelOperator;
        return this;
    }

    /**
     * Get the value property: The value to compare against the actual label value with the given operator.
     *
     * @return the LabelValue value.
     */
    public LabelValue getValue() {
        return this.value;
    }

    /**
     * Set the value property: The value to compare against the actual label value with the given operator.
     *
     * @param value the LabelValue value to set.
     * @return the RouterWorkerSelector object itself.
     */
    public RouterWorkerSelector setValue(LabelValue value) {
        this.value = value;
        return this;
    }

    /**
     * Get the expiresAfterSeconds property: Describes how long this label selector is valid in seconds.
     *
     * @return the expiresAfterSeconds value.
     */
    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 RouterWorkerSelector object itself.
     */
    public RouterWorkerSelector setExpiresAfterSeconds(Double expiresAfterSeconds) {
        this.expiresAfterSeconds = expiresAfterSeconds;
        return this;
    }

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

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

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

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