// 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 Variant properties. */
@JsonTypeInfo(
    use = JsonTypeInfo.Id.NAME,
    include = JsonTypeInfo.As.PROPERTY,
    property = "computeType",
    defaultImpl = CreateEndpointVariantRequest.class)
@JsonTypeName("Custom")
@JsonSubTypes({@JsonSubTypes.Type(name = "AKS", value = AksServiceCreateRequest.class)})
@Fluent
public class CreateEndpointVariantRequest extends CreateServiceRequest {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateEndpointVariantRequest.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 CreateEndpointVariantRequest object itself.
     */
    public CreateEndpointVariantRequest 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 CreateEndpointVariantRequest object itself.
     */
    public CreateEndpointVariantRequest 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 CreateEndpointVariantRequest object itself.
     */
    public CreateEndpointVariantRequest withType(VariantType type) {
        this.type = type;
        return this;
    }

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

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

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

    /** {@inheritDoc} */
    @Override
    public CreateEndpointVariantRequest withKeys(CreateServiceRequestKeys keys) {
        super.withKeys(keys);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public CreateEndpointVariantRequest withEnvironmentImageRequest(
        CreateServiceRequestEnvironmentImageRequest environmentImageRequest) {
        super.withEnvironmentImageRequest(environmentImageRequest);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public CreateEndpointVariantRequest withLocation(String location) {
        super.withLocation(location);
        return this;
    }

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