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

package com.azure.resourcemanager.cognitiveservices.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.cognitiveservices.models.CommitmentCost;
import com.azure.resourcemanager.cognitiveservices.models.CommitmentQuota;
import com.azure.resourcemanager.cognitiveservices.models.HostingModel;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Cognitive Services account commitment tier. */
@Fluent
public final class CommitmentTierInner {
    /*
     * The Kind of the resource.
     */
    @JsonProperty(value = "kind")
    private String kind;

    /*
     * The name of the SKU. Ex - P3. It is typically a letter+number code
     */
    @JsonProperty(value = "skuName")
    private String skuName;

    /*
     * Account hosting model.
     */
    @JsonProperty(value = "hostingModel")
    private HostingModel hostingModel;

    /*
     * Commitment plan type.
     */
    @JsonProperty(value = "planType")
    private String planType;

    /*
     * Commitment period commitment tier.
     */
    @JsonProperty(value = "tier")
    private String tier;

    /*
     * Commitment period commitment max count.
     */
    @JsonProperty(value = "maxCount")
    private Integer maxCount;

    /*
     * Cognitive Services account commitment quota.
     */
    @JsonProperty(value = "quota")
    private CommitmentQuota quota;

    /*
     * Cognitive Services account commitment cost.
     */
    @JsonProperty(value = "cost")
    private CommitmentCost cost;

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

    /**
     * Get the kind property: The Kind of the resource.
     *
     * @return the kind value.
     */
    public String kind() {
        return this.kind;
    }

    /**
     * Set the kind property: The Kind of the resource.
     *
     * @param kind the kind value to set.
     * @return the CommitmentTierInner object itself.
     */
    public CommitmentTierInner withKind(String kind) {
        this.kind = kind;
        return this;
    }

    /**
     * Get the skuName property: The name of the SKU. Ex - P3. It is typically a letter+number code.
     *
     * @return the skuName value.
     */
    public String skuName() {
        return this.skuName;
    }

    /**
     * Set the skuName property: The name of the SKU. Ex - P3. It is typically a letter+number code.
     *
     * @param skuName the skuName value to set.
     * @return the CommitmentTierInner object itself.
     */
    public CommitmentTierInner withSkuName(String skuName) {
        this.skuName = skuName;
        return this;
    }

    /**
     * Get the hostingModel property: Account hosting model.
     *
     * @return the hostingModel value.
     */
    public HostingModel hostingModel() {
        return this.hostingModel;
    }

    /**
     * Set the hostingModel property: Account hosting model.
     *
     * @param hostingModel the hostingModel value to set.
     * @return the CommitmentTierInner object itself.
     */
    public CommitmentTierInner withHostingModel(HostingModel hostingModel) {
        this.hostingModel = hostingModel;
        return this;
    }

    /**
     * Get the planType property: Commitment plan type.
     *
     * @return the planType value.
     */
    public String planType() {
        return this.planType;
    }

    /**
     * Set the planType property: Commitment plan type.
     *
     * @param planType the planType value to set.
     * @return the CommitmentTierInner object itself.
     */
    public CommitmentTierInner withPlanType(String planType) {
        this.planType = planType;
        return this;
    }

    /**
     * Get the tier property: Commitment period commitment tier.
     *
     * @return the tier value.
     */
    public String tier() {
        return this.tier;
    }

    /**
     * Set the tier property: Commitment period commitment tier.
     *
     * @param tier the tier value to set.
     * @return the CommitmentTierInner object itself.
     */
    public CommitmentTierInner withTier(String tier) {
        this.tier = tier;
        return this;
    }

    /**
     * Get the maxCount property: Commitment period commitment max count.
     *
     * @return the maxCount value.
     */
    public Integer maxCount() {
        return this.maxCount;
    }

    /**
     * Set the maxCount property: Commitment period commitment max count.
     *
     * @param maxCount the maxCount value to set.
     * @return the CommitmentTierInner object itself.
     */
    public CommitmentTierInner withMaxCount(Integer maxCount) {
        this.maxCount = maxCount;
        return this;
    }

    /**
     * Get the quota property: Cognitive Services account commitment quota.
     *
     * @return the quota value.
     */
    public CommitmentQuota quota() {
        return this.quota;
    }

    /**
     * Set the quota property: Cognitive Services account commitment quota.
     *
     * @param quota the quota value to set.
     * @return the CommitmentTierInner object itself.
     */
    public CommitmentTierInner withQuota(CommitmentQuota quota) {
        this.quota = quota;
        return this;
    }

    /**
     * Get the cost property: Cognitive Services account commitment cost.
     *
     * @return the cost value.
     */
    public CommitmentCost cost() {
        return this.cost;
    }

    /**
     * Set the cost property: Cognitive Services account commitment cost.
     *
     * @param cost the cost value to set.
     * @return the CommitmentTierInner object itself.
     */
    public CommitmentTierInner withCost(CommitmentCost cost) {
        this.cost = cost;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (quota() != null) {
            quota().validate();
        }
        if (cost() != null) {
            cost().validate();
        }
    }
}
