// 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 resource requirements for the container (cpu and memory). */
@Fluent
public final class ContainerResourceRequirements {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerResourceRequirements.class);

    /*
     * The minimum amount of CPU cores to be used by the container. More info:
     * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
     */
    @JsonProperty(value = "cpu")
    private Double cpu;

    /*
     * The maximum amount of CPU cores allowed to be used by the container.
     * More info:
     * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
     */
    @JsonProperty(value = "cpuLimit")
    private Double cpuLimit;

    /*
     * The minimum amount of memory (in GB) to be used by the container. More
     * info:
     * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
     */
    @JsonProperty(value = "memoryInGB")
    private Double memoryInGB;

    /*
     * The maximum amount of memory (in GB) allowed to be used by the
     * container. More info:
     * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
     */
    @JsonProperty(value = "memoryInGBLimit")
    private Double memoryInGBLimit;

    /*
     * The number of GPU cores in the container.
     */
    @JsonProperty(value = "gpu")
    private Integer gpu;

    /*
     * The number of FPGA PCIE devices exposed to the container. Must be
     * multiple of 2.
     */
    @JsonProperty(value = "fpga")
    private Integer fpga;

    /**
     * Get the cpu property: The minimum amount of CPU cores to be used by the container. More info:
     * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/.
     *
     * @return the cpu value.
     */
    public Double cpu() {
        return this.cpu;
    }

    /**
     * Set the cpu property: The minimum amount of CPU cores to be used by the container. More info:
     * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/.
     *
     * @param cpu the cpu value to set.
     * @return the ContainerResourceRequirements object itself.
     */
    public ContainerResourceRequirements withCpu(Double cpu) {
        this.cpu = cpu;
        return this;
    }

    /**
     * Get the cpuLimit property: The maximum amount of CPU cores allowed to be used by the container. More info:
     * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/.
     *
     * @return the cpuLimit value.
     */
    public Double cpuLimit() {
        return this.cpuLimit;
    }

    /**
     * Set the cpuLimit property: The maximum amount of CPU cores allowed to be used by the container. More info:
     * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/.
     *
     * @param cpuLimit the cpuLimit value to set.
     * @return the ContainerResourceRequirements object itself.
     */
    public ContainerResourceRequirements withCpuLimit(Double cpuLimit) {
        this.cpuLimit = cpuLimit;
        return this;
    }

    /**
     * Get the memoryInGB property: The minimum amount of memory (in GB) to be used by the container. More info:
     * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/.
     *
     * @return the memoryInGB value.
     */
    public Double memoryInGB() {
        return this.memoryInGB;
    }

    /**
     * Set the memoryInGB property: The minimum amount of memory (in GB) to be used by the container. More info:
     * https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/.
     *
     * @param memoryInGB the memoryInGB value to set.
     * @return the ContainerResourceRequirements object itself.
     */
    public ContainerResourceRequirements withMemoryInGB(Double memoryInGB) {
        this.memoryInGB = memoryInGB;
        return this;
    }

    /**
     * Get the memoryInGBLimit property: The maximum amount of memory (in GB) allowed to be used by the container. More
     * info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/.
     *
     * @return the memoryInGBLimit value.
     */
    public Double memoryInGBLimit() {
        return this.memoryInGBLimit;
    }

    /**
     * Set the memoryInGBLimit property: The maximum amount of memory (in GB) allowed to be used by the container. More
     * info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/.
     *
     * @param memoryInGBLimit the memoryInGBLimit value to set.
     * @return the ContainerResourceRequirements object itself.
     */
    public ContainerResourceRequirements withMemoryInGBLimit(Double memoryInGBLimit) {
        this.memoryInGBLimit = memoryInGBLimit;
        return this;
    }

    /**
     * Get the gpu property: The number of GPU cores in the container.
     *
     * @return the gpu value.
     */
    public Integer gpu() {
        return this.gpu;
    }

    /**
     * Set the gpu property: The number of GPU cores in the container.
     *
     * @param gpu the gpu value to set.
     * @return the ContainerResourceRequirements object itself.
     */
    public ContainerResourceRequirements withGpu(Integer gpu) {
        this.gpu = gpu;
        return this;
    }

    /**
     * Get the fpga property: The number of FPGA PCIE devices exposed to the container. Must be multiple of 2.
     *
     * @return the fpga value.
     */
    public Integer fpga() {
        return this.fpga;
    }

    /**
     * Set the fpga property: The number of FPGA PCIE devices exposed to the container. Must be multiple of 2.
     *
     * @param fpga the fpga value to set.
     * @return the ContainerResourceRequirements object itself.
     */
    public ContainerResourceRequirements withFpga(Integer fpga) {
        this.fpga = fpga;
        return this;
    }

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