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

package com.azure.resourcemanager.machinelearningservices.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.Map;

/** The response for an AKS variant. */
@JsonTypeInfo(
    use = JsonTypeInfo.Id.NAME,
    include = JsonTypeInfo.As.PROPERTY,
    property = "computeType",
    defaultImpl = AksVariantResponse.class)
@JsonTypeName("Custom")
@JsonSubTypes({@JsonSubTypes.Type(name = "AKS", value = AksServiceResponse.class)})
@Fluent
public class AksVariantResponse extends ServiceResponseBase {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(AksVariantResponse.class);

    /*
     * Is this the default variant.
     */
    @JsonProperty(value = "isDefault")
    private Boolean isDefault;

    /*
     * The amount of traffic variant receives.
     */
    @JsonProperty(value = "trafficPercentile")
    private Float trafficPercentile;

    /*
     * The type of the variant.
     */
    @JsonProperty(value = "type")
    private VariantType type;

    /**
     * Get the isDefault property: Is this the default variant.
     *
     * @return the isDefault value.
     */
    public Boolean isDefault() {
        return this.isDefault;
    }

    /**
     * Set the isDefault property: Is this the default variant.
     *
     * @param isDefault the isDefault value to set.
     * @return the AksVariantResponse object itself.
     */
    public AksVariantResponse withIsDefault(Boolean isDefault) {
        this.isDefault = isDefault;
        return this;
    }

    /**
     * Get the trafficPercentile property: The amount of traffic variant receives.
     *
     * @return the trafficPercentile value.
     */
    public Float trafficPercentile() {
        return this.trafficPercentile;
    }

    /**
     * Set the trafficPercentile property: The amount of traffic variant receives.
     *
     * @param trafficPercentile the trafficPercentile value to set.
     * @return the AksVariantResponse object itself.
     */
    public AksVariantResponse withTrafficPercentile(Float trafficPercentile) {
        this.trafficPercentile = trafficPercentile;
        return this;
    }

    /**
     * Get the type property: The type of the variant.
     *
     * @return the type value.
     */
    public VariantType type() {
        return this.type;
    }

    /**
     * Set the type property: The type of the variant.
     *
     * @param type the type value to set.
     * @return the AksVariantResponse object itself.
     */
    public AksVariantResponse withType(VariantType type) {
        this.type = type;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public AksVariantResponse withDescription(String description) {
        super.withDescription(description);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public AksVariantResponse withKvTags(Map<String, String> kvTags) {
        super.withKvTags(kvTags);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public AksVariantResponse withProperties(Map<String, String> properties) {
        super.withProperties(properties);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public AksVariantResponse withDeploymentType(DeploymentType deploymentType) {
        super.withDeploymentType(deploymentType);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
    }
}
