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

package com.azure.resourcemanager.azurearcdata.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.HashMap;
import java.util.Map;

/** The kubernetes resource limits and requests used to restrict or reserve resource usage. */
@Fluent
public final class K8SResourceRequirements {
    /*
     * Requests for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request must be less than or equal to
     * 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' is '4Gi', minimum is '2Gi. If sku.tier is
     * GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is '128Gi'.
     */
    @JsonProperty(value = "requests")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> requests;

    /*
     * Limits for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request must be less than or equal to
     * 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' is '4Gi', minimum is '2Gi. If sku.tier is
     * GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is '128Gi'.
     */
    @JsonProperty(value = "limits")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> limits;

    /*
     * The kubernetes resource limits and requests used to restrict or reserve resource usage.
     */
    @JsonIgnore private Map<String, Object> additionalProperties;

    /** Creates an instance of K8SResourceRequirements class. */
    public K8SResourceRequirements() {
    }

    /**
     * Get the requests property: Requests for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request must
     * be less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' is '4Gi', minimum is
     * '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is '128Gi'.
     *
     * @return the requests value.
     */
    public Map<String, String> requests() {
        return this.requests;
    }

    /**
     * Set the requests property: Requests for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request must
     * be less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' is '4Gi', minimum is
     * '2Gi. If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is '128Gi'.
     *
     * @param requests the requests value to set.
     * @return the K8SResourceRequirements object itself.
     */
    public K8SResourceRequirements withRequests(Map<String, String> requests) {
        this.requests = requests;
        return this;
    }

    /**
     * Get the limits property: Limits for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request must be
     * less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' is '4Gi', minimum is '2Gi.
     * If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is '128Gi'.
     *
     * @return the limits value.
     */
    public Map<String, String> limits() {
        return this.limits;
    }

    /**
     * Set the limits property: Limits for a kubernetes resource type (e.g 'cpu', 'memory'). The 'cpu' request must be
     * less than or equal to 'cpu' limit. Default 'cpu' is 2, minimum is 1. Default 'memory' is '4Gi', minimum is '2Gi.
     * If sku.tier is GeneralPurpose, maximum 'cpu' is 24 and maximum 'memory' is '128Gi'.
     *
     * @param limits the limits value to set.
     * @return the K8SResourceRequirements object itself.
     */
    public K8SResourceRequirements withLimits(Map<String, String> limits) {
        this.limits = limits;
        return this;
    }

    /**
     * Get the additionalProperties property: The kubernetes resource limits and requests used to restrict or reserve
     * resource usage.
     *
     * @return the additionalProperties value.
     */
    @JsonAnyGetter
    public Map<String, Object> additionalProperties() {
        return this.additionalProperties;
    }

    /**
     * Set the additionalProperties property: The kubernetes resource limits and requests used to restrict or reserve
     * resource usage.
     *
     * @param additionalProperties the additionalProperties value to set.
     * @return the K8SResourceRequirements object itself.
     */
    public K8SResourceRequirements withAdditionalProperties(Map<String, Object> additionalProperties) {
        this.additionalProperties = additionalProperties;
        return this;
    }

    @JsonAnySetter
    void withAdditionalProperties(String key, Object value) {
        if (additionalProperties == null) {
            additionalProperties = new HashMap<>();
        }
        additionalProperties.put(key, value);
    }

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