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

package com.azure.resourcemanager.nginx.models;

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

/** The NginxConfigurationProperties model. */
@Fluent
public final class NginxConfigurationProperties {
    /*
     * The provisioningState property.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

    /*
     * The files property.
     */
    @JsonProperty(value = "files")
    private List<NginxConfigurationFile> files;

    /*
     * The protectedFiles property.
     */
    @JsonProperty(value = "protectedFiles")
    private List<NginxConfigurationFile> protectedFiles;

    /*
     * The package property.
     */
    @JsonProperty(value = "package")
    private NginxConfigurationPackage packageProperty;

    /*
     * The rootFile property.
     */
    @JsonProperty(value = "rootFile")
    private String rootFile;

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

    /**
     * Get the provisioningState property: The provisioningState property.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the files property: The files property.
     *
     * @return the files value.
     */
    public List<NginxConfigurationFile> files() {
        return this.files;
    }

    /**
     * Set the files property: The files property.
     *
     * @param files the files value to set.
     * @return the NginxConfigurationProperties object itself.
     */
    public NginxConfigurationProperties withFiles(List<NginxConfigurationFile> files) {
        this.files = files;
        return this;
    }

    /**
     * Get the protectedFiles property: The protectedFiles property.
     *
     * @return the protectedFiles value.
     */
    public List<NginxConfigurationFile> protectedFiles() {
        return this.protectedFiles;
    }

    /**
     * Set the protectedFiles property: The protectedFiles property.
     *
     * @param protectedFiles the protectedFiles value to set.
     * @return the NginxConfigurationProperties object itself.
     */
    public NginxConfigurationProperties withProtectedFiles(List<NginxConfigurationFile> protectedFiles) {
        this.protectedFiles = protectedFiles;
        return this;
    }

    /**
     * Get the packageProperty property: The package property.
     *
     * @return the packageProperty value.
     */
    public NginxConfigurationPackage packageProperty() {
        return this.packageProperty;
    }

    /**
     * Set the packageProperty property: The package property.
     *
     * @param packageProperty the packageProperty value to set.
     * @return the NginxConfigurationProperties object itself.
     */
    public NginxConfigurationProperties withPackageProperty(NginxConfigurationPackage packageProperty) {
        this.packageProperty = packageProperty;
        return this;
    }

    /**
     * Get the rootFile property: The rootFile property.
     *
     * @return the rootFile value.
     */
    public String rootFile() {
        return this.rootFile;
    }

    /**
     * Set the rootFile property: The rootFile property.
     *
     * @param rootFile the rootFile value to set.
     * @return the NginxConfigurationProperties object itself.
     */
    public NginxConfigurationProperties withRootFile(String rootFile) {
        this.rootFile = rootFile;
        return this;
    }

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