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

package com.azure.resourcemanager.netapp.models;

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

/** Volume group properties. */
@Fluent
public final class VolumeGroupMetadata {
    /*
     * Group Description
     */
    @JsonProperty(value = "groupDescription")
    private String groupDescription;

    /*
     * Application Type
     */
    @JsonProperty(value = "applicationType")
    private ApplicationType applicationType;

    /*
     * Application specific identifier
     */
    @JsonProperty(value = "applicationIdentifier")
    private String applicationIdentifier;

    /*
     * Global volume placement rules
     *
     * Application specific placement rules for the volume group
     */
    @JsonProperty(value = "globalPlacementRules")
    private List<PlacementKeyValuePairs> globalPlacementRules;

    /*
     * Application specific identifier of deployment rules for the volume group
     */
    @JsonProperty(value = "deploymentSpecId")
    private String deploymentSpecId;

    /*
     * Number of volumes in volume group
     */
    @JsonProperty(value = "volumesCount", access = JsonProperty.Access.WRITE_ONLY)
    private Long volumesCount;

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

    /**
     * Get the groupDescription property: Group Description.
     *
     * @return the groupDescription value.
     */
    public String groupDescription() {
        return this.groupDescription;
    }

    /**
     * Set the groupDescription property: Group Description.
     *
     * @param groupDescription the groupDescription value to set.
     * @return the VolumeGroupMetadata object itself.
     */
    public VolumeGroupMetadata withGroupDescription(String groupDescription) {
        this.groupDescription = groupDescription;
        return this;
    }

    /**
     * Get the applicationType property: Application Type.
     *
     * @return the applicationType value.
     */
    public ApplicationType applicationType() {
        return this.applicationType;
    }

    /**
     * Set the applicationType property: Application Type.
     *
     * @param applicationType the applicationType value to set.
     * @return the VolumeGroupMetadata object itself.
     */
    public VolumeGroupMetadata withApplicationType(ApplicationType applicationType) {
        this.applicationType = applicationType;
        return this;
    }

    /**
     * Get the applicationIdentifier property: Application specific identifier.
     *
     * @return the applicationIdentifier value.
     */
    public String applicationIdentifier() {
        return this.applicationIdentifier;
    }

    /**
     * Set the applicationIdentifier property: Application specific identifier.
     *
     * @param applicationIdentifier the applicationIdentifier value to set.
     * @return the VolumeGroupMetadata object itself.
     */
    public VolumeGroupMetadata withApplicationIdentifier(String applicationIdentifier) {
        this.applicationIdentifier = applicationIdentifier;
        return this;
    }

    /**
     * Get the globalPlacementRules property: Global volume placement rules
     *
     * <p>Application specific placement rules for the volume group.
     *
     * @return the globalPlacementRules value.
     */
    public List<PlacementKeyValuePairs> globalPlacementRules() {
        return this.globalPlacementRules;
    }

    /**
     * Set the globalPlacementRules property: Global volume placement rules
     *
     * <p>Application specific placement rules for the volume group.
     *
     * @param globalPlacementRules the globalPlacementRules value to set.
     * @return the VolumeGroupMetadata object itself.
     */
    public VolumeGroupMetadata withGlobalPlacementRules(List<PlacementKeyValuePairs> globalPlacementRules) {
        this.globalPlacementRules = globalPlacementRules;
        return this;
    }

    /**
     * Get the deploymentSpecId property: Application specific identifier of deployment rules for the volume group.
     *
     * @return the deploymentSpecId value.
     */
    public String deploymentSpecId() {
        return this.deploymentSpecId;
    }

    /**
     * Set the deploymentSpecId property: Application specific identifier of deployment rules for the volume group.
     *
     * @param deploymentSpecId the deploymentSpecId value to set.
     * @return the VolumeGroupMetadata object itself.
     */
    public VolumeGroupMetadata withDeploymentSpecId(String deploymentSpecId) {
        this.deploymentSpecId = deploymentSpecId;
        return this;
    }

    /**
     * Get the volumesCount property: Number of volumes in volume group.
     *
     * @return the volumesCount value.
     */
    public Long volumesCount() {
        return this.volumesCount;
    }

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