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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.hdinsight.models.QuotaCapability;
import com.azure.resourcemanager.hdinsight.models.RegionsCapability;
import com.azure.resourcemanager.hdinsight.models.VersionsCapability;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** The Get Capabilities operation response. */
@Fluent
public final class CapabilitiesResultInner {
    /*
     * The version capability.
     */
    @JsonProperty(value = "versions")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, VersionsCapability> versions;

    /*
     * The virtual machine size compatibility features.
     */
    @JsonProperty(value = "regions")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, RegionsCapability> regions;

    /*
     * The capability features.
     */
    @JsonProperty(value = "features")
    private List<String> features;

    /*
     * The quota capability.
     */
    @JsonProperty(value = "quota", access = JsonProperty.Access.WRITE_ONLY)
    private QuotaCapability quota;

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

    /**
     * Get the versions property: The version capability.
     *
     * @return the versions value.
     */
    public Map<String, VersionsCapability> versions() {
        return this.versions;
    }

    /**
     * Set the versions property: The version capability.
     *
     * @param versions the versions value to set.
     * @return the CapabilitiesResultInner object itself.
     */
    public CapabilitiesResultInner withVersions(Map<String, VersionsCapability> versions) {
        this.versions = versions;
        return this;
    }

    /**
     * Get the regions property: The virtual machine size compatibility features.
     *
     * @return the regions value.
     */
    public Map<String, RegionsCapability> regions() {
        return this.regions;
    }

    /**
     * Set the regions property: The virtual machine size compatibility features.
     *
     * @param regions the regions value to set.
     * @return the CapabilitiesResultInner object itself.
     */
    public CapabilitiesResultInner withRegions(Map<String, RegionsCapability> regions) {
        this.regions = regions;
        return this;
    }

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

    /**
     * Set the features property: The capability features.
     *
     * @param features the features value to set.
     * @return the CapabilitiesResultInner object itself.
     */
    public CapabilitiesResultInner withFeatures(List<String> features) {
        this.features = features;
        return this;
    }

    /**
     * Get the quota property: The quota capability.
     *
     * @return the quota value.
     */
    public QuotaCapability quota() {
        return this.quota;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (versions() != null) {
            versions()
                .values()
                .forEach(
                    e -> {
                        if (e != null) {
                            e.validate();
                        }
                    });
        }
        if (regions() != null) {
            regions()
                .values()
                .forEach(
                    e -> {
                        if (e != null) {
                            e.validate();
                        }
                    });
        }
        if (quota() != null) {
            quota().validate();
        }
    }
}
