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

package com.azure.resourcemanager.webpubsub.models;

import com.azure.core.http.rest.Response;
import com.azure.core.management.Region;
import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.webpubsub.fluent.models.WebPubSubResourceInner;
import java.util.List;
import java.util.Map;

/** An immutable client-side representation of WebPubSubResource. */
public interface WebPubSubResource {
    /**
     * Gets the id property: Fully qualified resource Id for the resource.
     *
     * @return the id value.
     */
    String id();

    /**
     * Gets the name property: The name of the resource.
     *
     * @return the name value.
     */
    String name();

    /**
     * Gets the type property: The type of the resource.
     *
     * @return the type value.
     */
    String type();

    /**
     * Gets the location property: The geo-location where the resource lives.
     *
     * @return the location value.
     */
    String location();

    /**
     * Gets the tags property: Resource tags.
     *
     * @return the tags value.
     */
    Map<String, String> tags();

    /**
     * Gets the sku property: The billing information of the resource.
     *
     * @return the sku value.
     */
    ResourceSku sku();

    /**
     * Gets the identity property: A class represent managed identities used for request and response.
     *
     * @return the identity value.
     */
    ManagedIdentity identity();

    /**
     * Gets the systemData property: Metadata pertaining to creation and last modification of the resource.
     *
     * @return the systemData value.
     */
    SystemData systemData();

    /**
     * Gets the provisioningState property: Provisioning state of the resource.
     *
     * @return the provisioningState value.
     */
    ProvisioningState provisioningState();

    /**
     * Gets the externalIp property: The publicly accessible IP of the resource.
     *
     * @return the externalIp value.
     */
    String externalIp();

    /**
     * Gets the hostname property: FQDN of the service instance.
     *
     * @return the hostname value.
     */
    String hostname();

    /**
     * Gets the publicPort property: The publicly accessible port of the resource which is designed for browser/client
     * side usage.
     *
     * @return the publicPort value.
     */
    Integer publicPort();

    /**
     * Gets the serverPort property: The publicly accessible port of the resource which is designed for customer server
     * side usage.
     *
     * @return the serverPort value.
     */
    Integer serverPort();

    /**
     * Gets the version property: Version of the resource. Probably you need the same or higher version of client SDKs.
     *
     * @return the version value.
     */
    String version();

    /**
     * Gets the privateEndpointConnections property: Private endpoint connections to the resource.
     *
     * @return the privateEndpointConnections value.
     */
    List<PrivateEndpointConnection> privateEndpointConnections();

    /**
     * Gets the sharedPrivateLinkResources property: The list of shared private link resources.
     *
     * @return the sharedPrivateLinkResources value.
     */
    List<SharedPrivateLinkResource> sharedPrivateLinkResources();

    /**
     * Gets the tls property: TLS settings for the resource.
     *
     * @return the tls value.
     */
    WebPubSubTlsSettings tls();

    /**
     * Gets the hostnamePrefix property: Deprecated.
     *
     * @return the hostnamePrefix value.
     */
    String hostnamePrefix();

    /**
     * Gets the liveTraceConfiguration property: Live trace configuration of a Microsoft.SignalRService resource.
     *
     * @return the liveTraceConfiguration value.
     */
    LiveTraceConfiguration liveTraceConfiguration();

    /**
     * Gets the resourceLogConfiguration property: Resource log configuration of a Microsoft.SignalRService resource.
     *
     * @return the resourceLogConfiguration value.
     */
    ResourceLogConfiguration resourceLogConfiguration();

    /**
     * Gets the networkACLs property: Network ACLs for the resource.
     *
     * @return the networkACLs value.
     */
    WebPubSubNetworkACLs networkACLs();

    /**
     * Gets the publicNetworkAccess property: Enable or disable public network access. Default to "Enabled". When it's
     * Enabled, network ACLs still apply. When it's Disabled, public network access is always disabled no matter what
     * you set in network ACLs.
     *
     * @return the publicNetworkAccess value.
     */
    String publicNetworkAccess();

    /**
     * Gets the disableLocalAuth property: DisableLocalAuth Enable or disable local auth with AccessKey When set as
     * true, connection with AccessKey=xxx won't work.
     *
     * @return the disableLocalAuth value.
     */
    Boolean disableLocalAuth();

    /**
     * Gets the disableAadAuth property: DisableLocalAuth Enable or disable aad auth When set as true, connection with
     * AuthType=aad won't work.
     *
     * @return the disableAadAuth value.
     */
    Boolean disableAadAuth();

    /**
     * Gets the region of the resource.
     *
     * @return the region of the resource.
     */
    Region region();

    /**
     * Gets the name of the resource region.
     *
     * @return the name of the resource region.
     */
    String regionName();

    /**
     * Gets the name of the resource group.
     *
     * @return the name of the resource group.
     */
    String resourceGroupName();

    /**
     * Gets the inner com.azure.resourcemanager.webpubsub.fluent.models.WebPubSubResourceInner object.
     *
     * @return the inner object.
     */
    WebPubSubResourceInner innerModel();

    /** The entirety of the WebPubSubResource definition. */
    interface Definition
        extends DefinitionStages.Blank,
            DefinitionStages.WithLocation,
            DefinitionStages.WithResourceGroup,
            DefinitionStages.WithCreate {
    }
    /** The WebPubSubResource definition stages. */
    interface DefinitionStages {
        /** The first stage of the WebPubSubResource definition. */
        interface Blank extends WithLocation {
        }
        /** The stage of the WebPubSubResource definition allowing to specify location. */
        interface WithLocation {
            /**
             * Specifies the region for the resource.
             *
             * @param location The geo-location where the resource lives.
             * @return the next definition stage.
             */
            WithResourceGroup withRegion(Region location);

            /**
             * Specifies the region for the resource.
             *
             * @param location The geo-location where the resource lives.
             * @return the next definition stage.
             */
            WithResourceGroup withRegion(String location);
        }
        /** The stage of the WebPubSubResource definition allowing to specify parent resource. */
        interface WithResourceGroup {
            /**
             * Specifies resourceGroupName.
             *
             * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this
             *     value from the Azure Resource Manager API or the portal.
             * @return the next definition stage.
             */
            WithCreate withExistingResourceGroup(String resourceGroupName);
        }
        /**
         * The stage of the WebPubSubResource definition which contains all the minimum required properties for the
         * resource to be created, but also allows for any other optional properties to be specified.
         */
        interface WithCreate
            extends DefinitionStages.WithTags,
                DefinitionStages.WithSku,
                DefinitionStages.WithIdentity,
                DefinitionStages.WithTls,
                DefinitionStages.WithLiveTraceConfiguration,
                DefinitionStages.WithResourceLogConfiguration,
                DefinitionStages.WithNetworkACLs,
                DefinitionStages.WithPublicNetworkAccess,
                DefinitionStages.WithDisableLocalAuth,
                DefinitionStages.WithDisableAadAuth {
            /**
             * Executes the create request.
             *
             * @return the created resource.
             */
            WebPubSubResource create();

            /**
             * Executes the create request.
             *
             * @param context The context to associate with this operation.
             * @return the created resource.
             */
            WebPubSubResource create(Context context);
        }
        /** The stage of the WebPubSubResource definition allowing to specify tags. */
        interface WithTags {
            /**
             * Specifies the tags property: Resource tags..
             *
             * @param tags Resource tags.
             * @return the next definition stage.
             */
            WithCreate withTags(Map<String, String> tags);
        }
        /** The stage of the WebPubSubResource definition allowing to specify sku. */
        interface WithSku {
            /**
             * Specifies the sku property: The billing information of the resource..
             *
             * @param sku The billing information of the resource.
             * @return the next definition stage.
             */
            WithCreate withSku(ResourceSku sku);
        }
        /** The stage of the WebPubSubResource definition allowing to specify identity. */
        interface WithIdentity {
            /**
             * Specifies the identity property: A class represent managed identities used for request and response.
             *
             * @param identity A class represent managed identities used for request and response.
             * @return the next definition stage.
             */
            WithCreate withIdentity(ManagedIdentity identity);
        }
        /** The stage of the WebPubSubResource definition allowing to specify tls. */
        interface WithTls {
            /**
             * Specifies the tls property: TLS settings for the resource.
             *
             * @param tls TLS settings for the resource.
             * @return the next definition stage.
             */
            WithCreate withTls(WebPubSubTlsSettings tls);
        }
        /** The stage of the WebPubSubResource definition allowing to specify liveTraceConfiguration. */
        interface WithLiveTraceConfiguration {
            /**
             * Specifies the liveTraceConfiguration property: Live trace configuration of a Microsoft.SignalRService
             * resource..
             *
             * @param liveTraceConfiguration Live trace configuration of a Microsoft.SignalRService resource.
             * @return the next definition stage.
             */
            WithCreate withLiveTraceConfiguration(LiveTraceConfiguration liveTraceConfiguration);
        }
        /** The stage of the WebPubSubResource definition allowing to specify resourceLogConfiguration. */
        interface WithResourceLogConfiguration {
            /**
             * Specifies the resourceLogConfiguration property: Resource log configuration of a Microsoft.SignalRService
             * resource..
             *
             * @param resourceLogConfiguration Resource log configuration of a Microsoft.SignalRService resource.
             * @return the next definition stage.
             */
            WithCreate withResourceLogConfiguration(ResourceLogConfiguration resourceLogConfiguration);
        }
        /** The stage of the WebPubSubResource definition allowing to specify networkACLs. */
        interface WithNetworkACLs {
            /**
             * Specifies the networkACLs property: Network ACLs for the resource.
             *
             * @param networkACLs Network ACLs for the resource.
             * @return the next definition stage.
             */
            WithCreate withNetworkACLs(WebPubSubNetworkACLs networkACLs);
        }
        /** The stage of the WebPubSubResource definition allowing to specify publicNetworkAccess. */
        interface WithPublicNetworkAccess {
            /**
             * Specifies the publicNetworkAccess property: Enable or disable public network access. Default to
             * "Enabled". When it's Enabled, network ACLs still apply. When it's Disabled, public network access is
             * always disabled no matter what you set in network ACLs..
             *
             * @param publicNetworkAccess Enable or disable public network access. Default to "Enabled". When it's
             *     Enabled, network ACLs still apply. When it's Disabled, public network access is always disabled no
             *     matter what you set in network ACLs.
             * @return the next definition stage.
             */
            WithCreate withPublicNetworkAccess(String publicNetworkAccess);
        }
        /** The stage of the WebPubSubResource definition allowing to specify disableLocalAuth. */
        interface WithDisableLocalAuth {
            /**
             * Specifies the disableLocalAuth property: DisableLocalAuth Enable or disable local auth with AccessKey
             * When set as true, connection with AccessKey=xxx won't work..
             *
             * @param disableLocalAuth DisableLocalAuth Enable or disable local auth with AccessKey When set as true,
             *     connection with AccessKey=xxx won't work.
             * @return the next definition stage.
             */
            WithCreate withDisableLocalAuth(Boolean disableLocalAuth);
        }
        /** The stage of the WebPubSubResource definition allowing to specify disableAadAuth. */
        interface WithDisableAadAuth {
            /**
             * Specifies the disableAadAuth property: DisableLocalAuth Enable or disable aad auth When set as true,
             * connection with AuthType=aad won't work..
             *
             * @param disableAadAuth DisableLocalAuth Enable or disable aad auth When set as true, connection with
             *     AuthType=aad won't work.
             * @return the next definition stage.
             */
            WithCreate withDisableAadAuth(Boolean disableAadAuth);
        }
    }
    /**
     * Begins update for the WebPubSubResource resource.
     *
     * @return the stage of resource update.
     */
    WebPubSubResource.Update update();

    /** The template for WebPubSubResource update. */
    interface Update
        extends UpdateStages.WithTags,
            UpdateStages.WithSku,
            UpdateStages.WithIdentity,
            UpdateStages.WithTls,
            UpdateStages.WithLiveTraceConfiguration,
            UpdateStages.WithResourceLogConfiguration,
            UpdateStages.WithNetworkACLs,
            UpdateStages.WithPublicNetworkAccess,
            UpdateStages.WithDisableLocalAuth,
            UpdateStages.WithDisableAadAuth {
        /**
         * Executes the update request.
         *
         * @return the updated resource.
         */
        WebPubSubResource apply();

        /**
         * Executes the update request.
         *
         * @param context The context to associate with this operation.
         * @return the updated resource.
         */
        WebPubSubResource apply(Context context);
    }
    /** The WebPubSubResource update stages. */
    interface UpdateStages {
        /** The stage of the WebPubSubResource update allowing to specify tags. */
        interface WithTags {
            /**
             * Specifies the tags property: Resource tags..
             *
             * @param tags Resource tags.
             * @return the next definition stage.
             */
            Update withTags(Map<String, String> tags);
        }
        /** The stage of the WebPubSubResource update allowing to specify sku. */
        interface WithSku {
            /**
             * Specifies the sku property: The billing information of the resource..
             *
             * @param sku The billing information of the resource.
             * @return the next definition stage.
             */
            Update withSku(ResourceSku sku);
        }
        /** The stage of the WebPubSubResource update allowing to specify identity. */
        interface WithIdentity {
            /**
             * Specifies the identity property: A class represent managed identities used for request and response.
             *
             * @param identity A class represent managed identities used for request and response.
             * @return the next definition stage.
             */
            Update withIdentity(ManagedIdentity identity);
        }
        /** The stage of the WebPubSubResource update allowing to specify tls. */
        interface WithTls {
            /**
             * Specifies the tls property: TLS settings for the resource.
             *
             * @param tls TLS settings for the resource.
             * @return the next definition stage.
             */
            Update withTls(WebPubSubTlsSettings tls);
        }
        /** The stage of the WebPubSubResource update allowing to specify liveTraceConfiguration. */
        interface WithLiveTraceConfiguration {
            /**
             * Specifies the liveTraceConfiguration property: Live trace configuration of a Microsoft.SignalRService
             * resource..
             *
             * @param liveTraceConfiguration Live trace configuration of a Microsoft.SignalRService resource.
             * @return the next definition stage.
             */
            Update withLiveTraceConfiguration(LiveTraceConfiguration liveTraceConfiguration);
        }
        /** The stage of the WebPubSubResource update allowing to specify resourceLogConfiguration. */
        interface WithResourceLogConfiguration {
            /**
             * Specifies the resourceLogConfiguration property: Resource log configuration of a Microsoft.SignalRService
             * resource..
             *
             * @param resourceLogConfiguration Resource log configuration of a Microsoft.SignalRService resource.
             * @return the next definition stage.
             */
            Update withResourceLogConfiguration(ResourceLogConfiguration resourceLogConfiguration);
        }
        /** The stage of the WebPubSubResource update allowing to specify networkACLs. */
        interface WithNetworkACLs {
            /**
             * Specifies the networkACLs property: Network ACLs for the resource.
             *
             * @param networkACLs Network ACLs for the resource.
             * @return the next definition stage.
             */
            Update withNetworkACLs(WebPubSubNetworkACLs networkACLs);
        }
        /** The stage of the WebPubSubResource update allowing to specify publicNetworkAccess. */
        interface WithPublicNetworkAccess {
            /**
             * Specifies the publicNetworkAccess property: Enable or disable public network access. Default to
             * "Enabled". When it's Enabled, network ACLs still apply. When it's Disabled, public network access is
             * always disabled no matter what you set in network ACLs..
             *
             * @param publicNetworkAccess Enable or disable public network access. Default to "Enabled". When it's
             *     Enabled, network ACLs still apply. When it's Disabled, public network access is always disabled no
             *     matter what you set in network ACLs.
             * @return the next definition stage.
             */
            Update withPublicNetworkAccess(String publicNetworkAccess);
        }
        /** The stage of the WebPubSubResource update allowing to specify disableLocalAuth. */
        interface WithDisableLocalAuth {
            /**
             * Specifies the disableLocalAuth property: DisableLocalAuth Enable or disable local auth with AccessKey
             * When set as true, connection with AccessKey=xxx won't work..
             *
             * @param disableLocalAuth DisableLocalAuth Enable or disable local auth with AccessKey When set as true,
             *     connection with AccessKey=xxx won't work.
             * @return the next definition stage.
             */
            Update withDisableLocalAuth(Boolean disableLocalAuth);
        }
        /** The stage of the WebPubSubResource update allowing to specify disableAadAuth. */
        interface WithDisableAadAuth {
            /**
             * Specifies the disableAadAuth property: DisableLocalAuth Enable or disable aad auth When set as true,
             * connection with AuthType=aad won't work..
             *
             * @param disableAadAuth DisableLocalAuth Enable or disable aad auth When set as true, connection with
             *     AuthType=aad won't work.
             * @return the next definition stage.
             */
            Update withDisableAadAuth(Boolean disableAadAuth);
        }
    }
    /**
     * Refreshes the resource to sync with Azure.
     *
     * @return the refreshed resource.
     */
    WebPubSubResource refresh();

    /**
     * Refreshes the resource to sync with Azure.
     *
     * @param context The context to associate with this operation.
     * @return the refreshed resource.
     */
    WebPubSubResource refresh(Context context);

    /**
     * Get the access keys of the resource.
     *
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the access keys of the resource along with {@link Response}.
     */
    Response<WebPubSubKeys> listKeysWithResponse(Context context);

    /**
     * Get the access keys of the resource.
     *
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the access keys of the resource.
     */
    WebPubSubKeys listKeys();

    /**
     * Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same time.
     *
     * @param parameters Parameter that describes the Regenerate Key Operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a class represents the access keys of the resource.
     */
    WebPubSubKeys regenerateKey(RegenerateKeyParameters parameters);

    /**
     * Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same time.
     *
     * @param parameters Parameter that describes the Regenerate Key Operation.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a class represents the access keys of the resource.
     */
    WebPubSubKeys regenerateKey(RegenerateKeyParameters parameters, Context context);

    /**
     * Operation to restart a resource.
     *
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void restart();

    /**
     * Operation to restart a resource.
     *
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void restart(Context context);
}
