// 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.util.List;

/** Contains the weight percentage and worker selectors to be applied if selected for weighted distributions. */
@Fluent
public final class WorkerWeightedAllocation {
    /*
     * The percentage of this weight, expressed as a fraction of 1.
     */
    @JsonProperty(value = "weight", required = true)
    private double weight;

    /*
     * A collection of worker selectors that will be applied if this allocation
     * is selected.
     */
    @JsonProperty(value = "workerSelectors", required = true)
    private List<RouterWorkerSelector> workerSelectors;

    /**
     * Get the weight property: The percentage of this weight, expressed as a fraction of 1.
     *
     * @return the weight value.
     */
    public double getWeight() {
        return this.weight;
    }

    /**
     * Set the weight property: The percentage of this weight, expressed as a fraction of 1.
     *
     * @param weight the weight value to set.
     * @return the WorkerWeightedAllocation object itself.
     */
    public WorkerWeightedAllocation setWeight(double weight) {
        this.weight = weight;
        return this;
    }

    /**
     * Get the workerSelectors property: A collection of worker selectors that will be applied if this allocation is
     * selected.
     *
     * @return the workerSelectors value.
     */
    public List<RouterWorkerSelector> getWorkerSelectors() {
        return this.workerSelectors;
    }

    /**
     * Set the workerSelectors property: A collection of worker selectors that will be applied if this allocation is
     * selected.
     *
     * @param workerSelectors the workerSelectors value to set.
     * @return the WorkerWeightedAllocation object itself.
     */
    public WorkerWeightedAllocation setWorkerSelectors(List<RouterWorkerSelector> workerSelectors) {
        this.workerSelectors = workerSelectors;
        return this;
    }
}
