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

package com.azure.resourcemanager.storagecache.models;

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

/** Cache security settings. */
@Fluent
public final class CacheSecuritySettings {
    /*
     * NFS access policies defined for this cache.
     */
    @JsonProperty(value = "accessPolicies")
    private List<NfsAccessPolicy> accessPolicies;

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

    /**
     * Get the accessPolicies property: NFS access policies defined for this cache.
     *
     * @return the accessPolicies value.
     */
    public List<NfsAccessPolicy> accessPolicies() {
        return this.accessPolicies;
    }

    /**
     * Set the accessPolicies property: NFS access policies defined for this cache.
     *
     * @param accessPolicies the accessPolicies value to set.
     * @return the CacheSecuritySettings object itself.
     */
    public CacheSecuritySettings withAccessPolicies(List<NfsAccessPolicy> accessPolicies) {
        this.accessPolicies = accessPolicies;
        return this;
    }

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