// 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;

/** The estimated price info for using a VM of a particular OS type, tier, etc. */
@Fluent
public final class EstimatedVMPrice {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(EstimatedVMPrice.class);

    /*
     * The price charged for using the VM.
     */
    @JsonProperty(value = "retailPrice", required = true)
    private double retailPrice;

    /*
     * Operating system type used by the VM.
     */
    @JsonProperty(value = "osType", required = true)
    private VMPriceOSType osType;

    /*
     * The type of the VM.
     */
    @JsonProperty(value = "vmTier", required = true)
    private VMTier vmTier;

    /**
     * Get the retailPrice property: The price charged for using the VM.
     *
     * @return the retailPrice value.
     */
    public double retailPrice() {
        return this.retailPrice;
    }

    /**
     * Set the retailPrice property: The price charged for using the VM.
     *
     * @param retailPrice the retailPrice value to set.
     * @return the EstimatedVMPrice object itself.
     */
    public EstimatedVMPrice withRetailPrice(double retailPrice) {
        this.retailPrice = retailPrice;
        return this;
    }

    /**
     * Get the osType property: Operating system type used by the VM.
     *
     * @return the osType value.
     */
    public VMPriceOSType osType() {
        return this.osType;
    }

    /**
     * Set the osType property: Operating system type used by the VM.
     *
     * @param osType the osType value to set.
     * @return the EstimatedVMPrice object itself.
     */
    public EstimatedVMPrice withOsType(VMPriceOSType osType) {
        this.osType = osType;
        return this;
    }

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

    /**
     * Set the vmTier property: The type of the VM.
     *
     * @param vmTier the vmTier value to set.
     * @return the EstimatedVMPrice object itself.
     */
    public EstimatedVMPrice withVmTier(VMTier vmTier) {
        this.vmTier = vmTier;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (osType() == null) {
            throw logger
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property osType in model EstimatedVMPrice"));
        }
        if (vmTier() == null) {
            throw logger
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property vmTier in model EstimatedVMPrice"));
        }
    }
}
