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

package com.azure.resourcemanager.postgresqlflexibleserver.models;

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

/** A list of server backups. */
@Fluent
public final class ServerBackupListResult {
    /*
     * The list of backups of a server.
     */
    @JsonProperty(value = "value")
    private List<ServerBackupInner> value;

    /*
     * The link used to get the next page of operations.
     */
    @JsonProperty(value = "nextLink")
    private String nextLink;

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

    /**
     * Get the value property: The list of backups of a server.
     *
     * @return the value value.
     */
    public List<ServerBackupInner> value() {
        return this.value;
    }

    /**
     * Set the value property: The list of backups of a server.
     *
     * @param value the value value to set.
     * @return the ServerBackupListResult object itself.
     */
    public ServerBackupListResult withValue(List<ServerBackupInner> value) {
        this.value = value;
        return this;
    }

    /**
     * Get the nextLink property: The link used to get the next page of operations.
     *
     * @return the nextLink value.
     */
    public String nextLink() {
        return this.nextLink;
    }

    /**
     * Set the nextLink property: The link used to get the next page of operations.
     *
     * @param nextLink the nextLink value to set.
     * @return the ServerBackupListResult object itself.
     */
    public ServerBackupListResult 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());
        }
    }
}
