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

package com.azure.resourcemanager.providerhub.models;

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

/** The ResourceProviderManifestProperties model. */
@Fluent
public class ResourceProviderManifestProperties {
    /*
     * The providerAuthentication property.
     */
    @JsonProperty(value = "providerAuthentication")
    private ResourceProviderManifestPropertiesProviderAuthentication providerAuthentication;

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

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

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

    /*
     * The providerType property.
     */
    @JsonProperty(value = "providerType")
    private ResourceProviderType providerType;

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

    /*
     * The featuresRule property.
     */
    @JsonProperty(value = "featuresRule")
    private ResourceProviderManifestPropertiesFeaturesRule featuresRule;

    /*
     * The requestHeaderOptions property.
     */
    @JsonProperty(value = "requestHeaderOptions")
    private ResourceProviderManifestPropertiesRequestHeaderOptions requestHeaderOptions;

    /*
     * The management property.
     */
    @JsonProperty(value = "management")
    private ResourceProviderManifestPropertiesManagement management;

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

    /*
     * Anything
     */
    @JsonProperty(value = "metadata")
    private Object metadata;

    /*
     * The templateDeploymentOptions property.
     */
    @JsonProperty(value = "templateDeploymentOptions")
    private ResourceProviderManifestPropertiesTemplateDeploymentOptions templateDeploymentOptions;

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

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

    /**
     * Set the providerAuthentication property: The providerAuthentication property.
     *
     * @param providerAuthentication the providerAuthentication value to set.
     * @return the ResourceProviderManifestProperties object itself.
     */
    public ResourceProviderManifestProperties withProviderAuthentication(
        ResourceProviderManifestPropertiesProviderAuthentication providerAuthentication) {
        this.providerAuthentication = providerAuthentication;
        return this;
    }

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

    /**
     * Set the providerAuthorizations property: The providerAuthorizations property.
     *
     * @param providerAuthorizations the providerAuthorizations value to set.
     * @return the ResourceProviderManifestProperties object itself.
     */
    public ResourceProviderManifestProperties withProviderAuthorizations(
        List<ResourceProviderAuthorization> providerAuthorizations) {
        this.providerAuthorizations = providerAuthorizations;
        return this;
    }

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

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

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

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

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

    /**
     * Set the providerType property: The providerType property.
     *
     * @param providerType the providerType value to set.
     * @return the ResourceProviderManifestProperties object itself.
     */
    public ResourceProviderManifestProperties withProviderType(ResourceProviderType providerType) {
        this.providerType = providerType;
        return this;
    }

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

    /**
     * Set the requiredFeatures property: The requiredFeatures property.
     *
     * @param requiredFeatures the requiredFeatures value to set.
     * @return the ResourceProviderManifestProperties object itself.
     */
    public ResourceProviderManifestProperties withRequiredFeatures(List<String> requiredFeatures) {
        this.requiredFeatures = requiredFeatures;
        return this;
    }

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

    /**
     * Set the featuresRule property: The featuresRule property.
     *
     * @param featuresRule the featuresRule value to set.
     * @return the ResourceProviderManifestProperties object itself.
     */
    public ResourceProviderManifestProperties withFeaturesRule(
        ResourceProviderManifestPropertiesFeaturesRule featuresRule) {
        this.featuresRule = featuresRule;
        return this;
    }

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

    /**
     * Set the requestHeaderOptions property: The requestHeaderOptions property.
     *
     * @param requestHeaderOptions the requestHeaderOptions value to set.
     * @return the ResourceProviderManifestProperties object itself.
     */
    public ResourceProviderManifestProperties withRequestHeaderOptions(
        ResourceProviderManifestPropertiesRequestHeaderOptions requestHeaderOptions) {
        this.requestHeaderOptions = requestHeaderOptions;
        return this;
    }

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

    /**
     * Set the management property: The management property.
     *
     * @param management the management value to set.
     * @return the ResourceProviderManifestProperties object itself.
     */
    public ResourceProviderManifestProperties withManagement(ResourceProviderManifestPropertiesManagement management) {
        this.management = management;
        return this;
    }

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

    /**
     * Set the capabilities property: The capabilities property.
     *
     * @param capabilities the capabilities value to set.
     * @return the ResourceProviderManifestProperties object itself.
     */
    public ResourceProviderManifestProperties withCapabilities(List<ResourceProviderCapabilities> capabilities) {
        this.capabilities = capabilities;
        return this;
    }

    /**
     * Get the metadata property: Anything.
     *
     * @return the metadata value.
     */
    public Object metadata() {
        return this.metadata;
    }

    /**
     * Set the metadata property: Anything.
     *
     * @param metadata the metadata value to set.
     * @return the ResourceProviderManifestProperties object itself.
     */
    public ResourceProviderManifestProperties withMetadata(Object metadata) {
        this.metadata = metadata;
        return this;
    }

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

    /**
     * Set the templateDeploymentOptions property: The templateDeploymentOptions property.
     *
     * @param templateDeploymentOptions the templateDeploymentOptions value to set.
     * @return the ResourceProviderManifestProperties object itself.
     */
    public ResourceProviderManifestProperties withTemplateDeploymentOptions(
        ResourceProviderManifestPropertiesTemplateDeploymentOptions templateDeploymentOptions) {
        this.templateDeploymentOptions = templateDeploymentOptions;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (providerAuthentication() != null) {
            providerAuthentication().validate();
        }
        if (providerAuthorizations() != null) {
            providerAuthorizations().forEach(e -> e.validate());
        }
        if (featuresRule() != null) {
            featuresRule().validate();
        }
        if (requestHeaderOptions() != null) {
            requestHeaderOptions().validate();
        }
        if (management() != null) {
            management().validate();
        }
        if (capabilities() != null) {
            capabilities().forEach(e -> e.validate());
        }
        if (templateDeploymentOptions() != null) {
            templateDeploymentOptions().validate();
        }
    }
}
