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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.reservations.models.CatalogMsrp;
import com.azure.resourcemanager.reservations.models.ReservationBillingPlan;
import com.azure.resourcemanager.reservations.models.ReservationTerm;
import com.azure.resourcemanager.reservations.models.SkuCapability;
import com.azure.resourcemanager.reservations.models.SkuProperty;
import com.azure.resourcemanager.reservations.models.SkuRestriction;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** Product details of a type of resource. */
@Fluent
public final class CatalogInner {
    /*
     * The type of resource the sku applies to.
     */
    @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY)
    private String resourceType;

    /*
     * The name of sku
     */
    @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
    private String name;

    /*
     * The billing plan options available for this sku.
     */
    @JsonProperty(value = "billingPlans")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, List<ReservationBillingPlan>> billingPlans;

    /*
     * Available reservation terms for this resource
     */
    @JsonProperty(value = "terms", access = JsonProperty.Access.WRITE_ONLY)
    private List<ReservationTerm> terms;

    /*
     * The locations property.
     */
    @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY)
    private List<String> locations;

    /*
     * The skuProperties property.
     */
    @JsonProperty(value = "skuProperties", access = JsonProperty.Access.WRITE_ONLY)
    private List<SkuProperty> skuProperties;

    /*
     * Pricing information about the sku
     */
    @JsonProperty(value = "msrp", access = JsonProperty.Access.WRITE_ONLY)
    private CatalogMsrp msrp;

    /*
     * The restrictions property.
     */
    @JsonProperty(value = "restrictions", access = JsonProperty.Access.WRITE_ONLY)
    private List<SkuRestriction> restrictions;

    /*
     * The tier of this sku
     */
    @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY)
    private String tier;

    /*
     * The size of this sku
     */
    @JsonProperty(value = "size", access = JsonProperty.Access.WRITE_ONLY)
    private String size;

    /*
     * The capabilities property.
     */
    @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY)
    private List<SkuCapability> capabilities;

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

    /**
     * Get the resourceType property: The type of resource the sku applies to.
     *
     * @return the resourceType value.
     */
    public String resourceType() {
        return this.resourceType;
    }

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

    /**
     * Get the billingPlans property: The billing plan options available for this sku.
     *
     * @return the billingPlans value.
     */
    public Map<String, List<ReservationBillingPlan>> billingPlans() {
        return this.billingPlans;
    }

    /**
     * Set the billingPlans property: The billing plan options available for this sku.
     *
     * @param billingPlans the billingPlans value to set.
     * @return the CatalogInner object itself.
     */
    public CatalogInner withBillingPlans(Map<String, List<ReservationBillingPlan>> billingPlans) {
        this.billingPlans = billingPlans;
        return this;
    }

    /**
     * Get the terms property: Available reservation terms for this resource.
     *
     * @return the terms value.
     */
    public List<ReservationTerm> terms() {
        return this.terms;
    }

    /**
     * Get the locations property: The locations property.
     *
     * @return the locations value.
     */
    public List<String> locations() {
        return this.locations;
    }

    /**
     * Get the skuProperties property: The skuProperties property.
     *
     * @return the skuProperties value.
     */
    public List<SkuProperty> skuProperties() {
        return this.skuProperties;
    }

    /**
     * Get the msrp property: Pricing information about the sku.
     *
     * @return the msrp value.
     */
    public CatalogMsrp msrp() {
        return this.msrp;
    }

    /**
     * Get the restrictions property: The restrictions property.
     *
     * @return the restrictions value.
     */
    public List<SkuRestriction> restrictions() {
        return this.restrictions;
    }

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

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

    /**
     * Get the capabilities property: The capabilities property.
     *
     * @return the capabilities value.
     */
    public List<SkuCapability> capabilities() {
        return this.capabilities;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (skuProperties() != null) {
            skuProperties().forEach(e -> e.validate());
        }
        if (msrp() != null) {
            msrp().validate();
        }
        if (restrictions() != null) {
            restrictions().forEach(e -> e.validate());
        }
        if (capabilities() != null) {
            capabilities().forEach(e -> e.validate());
        }
    }
}
