// 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.providerhub.models.ResourceProviderAuthorization;
import com.azure.resourcemanager.providerhub.models.ResourceProviderCapabilities;
import com.azure.resourcemanager.providerhub.models.ResourceProviderEndpoint;
import com.azure.resourcemanager.providerhub.models.ResourceProviderManifestFeaturesRule;
import com.azure.resourcemanager.providerhub.models.ResourceProviderManifestManagement;
import com.azure.resourcemanager.providerhub.models.ResourceProviderManifestProviderAuthentication;
import com.azure.resourcemanager.providerhub.models.ResourceProviderManifestReRegisterSubscriptionMetadata;
import com.azure.resourcemanager.providerhub.models.ResourceProviderManifestRequestHeaderOptions;
import com.azure.resourcemanager.providerhub.models.ResourceProviderType;
import com.azure.resourcemanager.providerhub.models.ResourceType;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The ResourceProviderManifest model. */
@Fluent
public final class ResourceProviderManifestInner {
    /*
     * The providerAuthentication property.
     */
    @JsonProperty(value = "providerAuthentication")
    private ResourceProviderManifestProviderAuthentication 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 ResourceProviderManifestFeaturesRule featuresRule;

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

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

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

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

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

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

    /*
     * The reRegisterSubscriptionMetadata property.
     */
    @JsonProperty(value = "reRegisterSubscriptionMetadata")
    private ResourceProviderManifestReRegisterSubscriptionMetadata reRegisterSubscriptionMetadata;

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

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

    /**
     * Set the providerAuthentication property: The providerAuthentication property.
     *
     * @param providerAuthentication the providerAuthentication value to set.
     * @return the ResourceProviderManifestInner object itself.
     */
    public ResourceProviderManifestInner withProviderAuthentication(
        ResourceProviderManifestProviderAuthentication 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 ResourceProviderManifestInner object itself.
     */
    public ResourceProviderManifestInner 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 ResourceProviderManifestInner object itself.
     */
    public ResourceProviderManifestInner 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 ResourceProviderManifestInner object itself.
     */
    public ResourceProviderManifestInner 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 ResourceProviderManifestInner object itself.
     */
    public ResourceProviderManifestInner 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 ResourceProviderManifestInner object itself.
     */
    public ResourceProviderManifestInner withRequiredFeatures(List<String> requiredFeatures) {
        this.requiredFeatures = requiredFeatures;
        return this;
    }

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

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

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

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

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

    /**
     * Set the resourceTypes property: The resourceTypes property.
     *
     * @param resourceTypes the resourceTypes value to set.
     * @return the ResourceProviderManifestInner object itself.
     */
    public ResourceProviderManifestInner withResourceTypes(List<ResourceType> resourceTypes) {
        this.resourceTypes = resourceTypes;
        return this;
    }

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

    /**
     * Set the management property: The management property.
     *
     * @param management the management value to set.
     * @return the ResourceProviderManifestInner object itself.
     */
    public ResourceProviderManifestInner withManagement(ResourceProviderManifestManagement 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 ResourceProviderManifestInner object itself.
     */
    public ResourceProviderManifestInner 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 ResourceProviderManifestInner object itself.
     */
    public ResourceProviderManifestInner withMetadata(Object metadata) {
        this.metadata = metadata;
        return this;
    }

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

    /**
     * Set the globalNotificationEndpoints property: The globalNotificationEndpoints property.
     *
     * @param globalNotificationEndpoints the globalNotificationEndpoints value to set.
     * @return the ResourceProviderManifestInner object itself.
     */
    public ResourceProviderManifestInner withGlobalNotificationEndpoints(
        List<ResourceProviderEndpoint> globalNotificationEndpoints) {
        this.globalNotificationEndpoints = globalNotificationEndpoints;
        return this;
    }

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

    /**
     * Set the reRegisterSubscriptionMetadata property: The reRegisterSubscriptionMetadata property.
     *
     * @param reRegisterSubscriptionMetadata the reRegisterSubscriptionMetadata value to set.
     * @return the ResourceProviderManifestInner object itself.
     */
    public ResourceProviderManifestInner withReRegisterSubscriptionMetadata(
        ResourceProviderManifestReRegisterSubscriptionMetadata reRegisterSubscriptionMetadata) {
        this.reRegisterSubscriptionMetadata = reRegisterSubscriptionMetadata;
        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 (resourceTypes() != null) {
            resourceTypes().forEach(e -> e.validate());
        }
        if (management() != null) {
            management().validate();
        }
        if (capabilities() != null) {
            capabilities().forEach(e -> e.validate());
        }
        if (globalNotificationEndpoints() != null) {
            globalNotificationEndpoints().forEach(e -> e.validate());
        }
        if (reRegisterSubscriptionMetadata() != null) {
            reRegisterSubscriptionMetadata().validate();
        }
    }
}
