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

package com.azure.resourcemanager.redisenterprise.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Information about location (for example: features that it supports). */
@Fluent
public final class LocationInfo {
    /*
     * Location name
     */
    @JsonProperty(value = "location")
    private String location;

    /*
     * List of capabilities
     */
    @JsonProperty(value = "capabilities")
    private List<Capability> capabilities;

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

    /**
     * Get the location property: Location name.
     *
     * @return the location value.
     */
    public String location() {
        return this.location;
    }

    /**
     * Set the location property: Location name.
     *
     * @param location the location value to set.
     * @return the LocationInfo object itself.
     */
    public LocationInfo withLocation(String location) {
        this.location = location;
        return this;
    }

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

    /**
     * Set the capabilities property: List of capabilities.
     *
     * @param capabilities the capabilities value to set.
     * @return the LocationInfo object itself.
     */
    public LocationInfo withCapabilities(List<Capability> capabilities) {
        this.capabilities = capabilities;
        return this;
    }

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