// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.webpubsub;

import com.pulumi.azure.webpubsub.inputs.HubEventHandlerArgs;
import com.pulumi.azure.webpubsub.inputs.HubEventListenerArgs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class HubArgs extends com.pulumi.resources.ResourceArgs {

    public static final HubArgs Empty = new HubArgs();

    /**
     * Is anonymous connections are allowed for this hub? Defaults to `false`.
     * Possible values are `true`, `false`.
     * 
     */
    @Import(name="anonymousConnectionsEnabled")
    private @Nullable Output<Boolean> anonymousConnectionsEnabled;

    /**
     * @return Is anonymous connections are allowed for this hub? Defaults to `false`.
     * Possible values are `true`, `false`.
     * 
     */
    public Optional<Output<Boolean>> anonymousConnectionsEnabled() {
        return Optional.ofNullable(this.anonymousConnectionsEnabled);
    }

    /**
     * An `event_handler` block as defined below.
     * 
     * &gt; **NOTE:** User can change the order of `event_handler` to change the priority accordingly.
     * 
     */
    @Import(name="eventHandlers")
    private @Nullable Output<List<HubEventHandlerArgs>> eventHandlers;

    /**
     * @return An `event_handler` block as defined below.
     * 
     * &gt; **NOTE:** User can change the order of `event_handler` to change the priority accordingly.
     * 
     */
    public Optional<Output<List<HubEventHandlerArgs>>> eventHandlers() {
        return Optional.ofNullable(this.eventHandlers);
    }

    /**
     * An `event_listener` block as defined below.
     * 
     * &gt; **NOTE:**  The managed identity of Web PubSub service must be enabled and the identity must have the &#34;Azure Event Hubs Data sender&#34; role to access the Event Hub.
     * 
     */
    @Import(name="eventListeners")
    private @Nullable Output<List<HubEventListenerArgs>> eventListeners;

    /**
     * @return An `event_listener` block as defined below.
     * 
     * &gt; **NOTE:**  The managed identity of Web PubSub service must be enabled and the identity must have the &#34;Azure Event Hubs Data sender&#34; role to access the Event Hub.
     * 
     */
    public Optional<Output<List<HubEventListenerArgs>>> eventListeners() {
        return Optional.ofNullable(this.eventListeners);
    }

    /**
     * The name of the Web Pubsub hub service. Changing this forces a new resource to be created.
     * 
     */
    @Import(name="name")
    private @Nullable Output<String> name;

    /**
     * @return The name of the Web Pubsub hub service. Changing this forces a new resource to be created.
     * 
     */
    public Optional<Output<String>> name() {
        return Optional.ofNullable(this.name);
    }

    /**
     * Specifies the id of the Web Pubsub. Changing this forces a new resource to be created.
     * 
     */
    @Import(name="webPubsubId", required=true)
    private Output<String> webPubsubId;

    /**
     * @return Specifies the id of the Web Pubsub. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> webPubsubId() {
        return this.webPubsubId;
    }

    private HubArgs() {}

    private HubArgs(HubArgs $) {
        this.anonymousConnectionsEnabled = $.anonymousConnectionsEnabled;
        this.eventHandlers = $.eventHandlers;
        this.eventListeners = $.eventListeners;
        this.name = $.name;
        this.webPubsubId = $.webPubsubId;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(HubArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private HubArgs $;

        public Builder() {
            $ = new HubArgs();
        }

        public Builder(HubArgs defaults) {
            $ = new HubArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param anonymousConnectionsEnabled Is anonymous connections are allowed for this hub? Defaults to `false`.
         * Possible values are `true`, `false`.
         * 
         * @return builder
         * 
         */
        public Builder anonymousConnectionsEnabled(@Nullable Output<Boolean> anonymousConnectionsEnabled) {
            $.anonymousConnectionsEnabled = anonymousConnectionsEnabled;
            return this;
        }

        /**
         * @param anonymousConnectionsEnabled Is anonymous connections are allowed for this hub? Defaults to `false`.
         * Possible values are `true`, `false`.
         * 
         * @return builder
         * 
         */
        public Builder anonymousConnectionsEnabled(Boolean anonymousConnectionsEnabled) {
            return anonymousConnectionsEnabled(Output.of(anonymousConnectionsEnabled));
        }

        /**
         * @param eventHandlers An `event_handler` block as defined below.
         * 
         * &gt; **NOTE:** User can change the order of `event_handler` to change the priority accordingly.
         * 
         * @return builder
         * 
         */
        public Builder eventHandlers(@Nullable Output<List<HubEventHandlerArgs>> eventHandlers) {
            $.eventHandlers = eventHandlers;
            return this;
        }

        /**
         * @param eventHandlers An `event_handler` block as defined below.
         * 
         * &gt; **NOTE:** User can change the order of `event_handler` to change the priority accordingly.
         * 
         * @return builder
         * 
         */
        public Builder eventHandlers(List<HubEventHandlerArgs> eventHandlers) {
            return eventHandlers(Output.of(eventHandlers));
        }

        /**
         * @param eventHandlers An `event_handler` block as defined below.
         * 
         * &gt; **NOTE:** User can change the order of `event_handler` to change the priority accordingly.
         * 
         * @return builder
         * 
         */
        public Builder eventHandlers(HubEventHandlerArgs... eventHandlers) {
            return eventHandlers(List.of(eventHandlers));
        }

        /**
         * @param eventListeners An `event_listener` block as defined below.
         * 
         * &gt; **NOTE:**  The managed identity of Web PubSub service must be enabled and the identity must have the &#34;Azure Event Hubs Data sender&#34; role to access the Event Hub.
         * 
         * @return builder
         * 
         */
        public Builder eventListeners(@Nullable Output<List<HubEventListenerArgs>> eventListeners) {
            $.eventListeners = eventListeners;
            return this;
        }

        /**
         * @param eventListeners An `event_listener` block as defined below.
         * 
         * &gt; **NOTE:**  The managed identity of Web PubSub service must be enabled and the identity must have the &#34;Azure Event Hubs Data sender&#34; role to access the Event Hub.
         * 
         * @return builder
         * 
         */
        public Builder eventListeners(List<HubEventListenerArgs> eventListeners) {
            return eventListeners(Output.of(eventListeners));
        }

        /**
         * @param eventListeners An `event_listener` block as defined below.
         * 
         * &gt; **NOTE:**  The managed identity of Web PubSub service must be enabled and the identity must have the &#34;Azure Event Hubs Data sender&#34; role to access the Event Hub.
         * 
         * @return builder
         * 
         */
        public Builder eventListeners(HubEventListenerArgs... eventListeners) {
            return eventListeners(List.of(eventListeners));
        }

        /**
         * @param name The name of the Web Pubsub hub service. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder name(@Nullable Output<String> name) {
            $.name = name;
            return this;
        }

        /**
         * @param name The name of the Web Pubsub hub service. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder name(String name) {
            return name(Output.of(name));
        }

        /**
         * @param webPubsubId Specifies the id of the Web Pubsub. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder webPubsubId(Output<String> webPubsubId) {
            $.webPubsubId = webPubsubId;
            return this;
        }

        /**
         * @param webPubsubId Specifies the id of the Web Pubsub. Changing this forces a new resource to be created.
         * 
         * @return builder
         * 
         */
        public Builder webPubsubId(String webPubsubId) {
            return webPubsubId(Output.of(webPubsubId));
        }

        public HubArgs build() {
            $.webPubsubId = Objects.requireNonNull($.webPubsubId, "expected parameter 'webPubsubId' to be non-null");
            return $;
        }
    }

}
