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

package com.azure.resourcemanager.videoanalyzer.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.videoanalyzer.fluent.models.AccessPolicyEntityInner;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** A collection of AccessPolicyEntity items. */
@Fluent
public final class AccessPolicyEntityCollection {
    /*
     * A collection of AccessPolicyEntity items.
     */
    @JsonProperty(value = "value")
    private List<AccessPolicyEntityInner> value;

    /*
     * A link to the next page of the collection (when the collection contains
     * too many results to return in one response).
     */
    @JsonProperty(value = "@nextLink")
    private String nextLink;

    /**
     * Get the value property: A collection of AccessPolicyEntity items.
     *
     * @return the value value.
     */
    public List<AccessPolicyEntityInner> value() {
        return this.value;
    }

    /**
     * Set the value property: A collection of AccessPolicyEntity items.
     *
     * @param value the value value to set.
     * @return the AccessPolicyEntityCollection object itself.
     */
    public AccessPolicyEntityCollection withValue(List<AccessPolicyEntityInner> value) {
        this.value = value;
        return this;
    }

    /**
     * Get the nextLink property: A link to the next page of the collection (when the collection contains too many
     * results to return in one response).
     *
     * @return the nextLink value.
     */
    public String nextLink() {
        return this.nextLink;
    }

    /**
     * Set the nextLink property: A link to the next page of the collection (when the collection contains too many
     * results to return in one response).
     *
     * @param nextLink the nextLink value to set.
     * @return the AccessPolicyEntityCollection object itself.
     */
    public AccessPolicyEntityCollection withNextLink(String nextLink) {
        this.nextLink = nextLink;
        return this;
    }

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