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

package com.azure.resourcemanager.synapse.models;

import com.azure.core.http.rest.Response;
import com.azure.core.management.Region;
import com.azure.core.util.Context;
import com.azure.resourcemanager.synapse.fluent.models.SqlPoolInner;
import java.time.OffsetDateTime;
import java.util.Map;

/** An immutable client-side representation of SqlPool. */
public interface SqlPool {
    /**
     * 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: Sku
     *
     * <p>SQL pool SKU.
     *
     * @return the sku value.
     */
    Sku sku();

    /**
     * Gets the maxSizeBytes property: Maximum size in bytes.
     *
     * @return the maxSizeBytes value.
     */
    Long maxSizeBytes();

    /**
     * Gets the collation property: Collation mode.
     *
     * @return the collation value.
     */
    String collation();

    /**
     * Gets the sourceDatabaseId property: Source database to create from.
     *
     * @return the sourceDatabaseId value.
     */
    String sourceDatabaseId();

    /**
     * Gets the recoverableDatabaseId property: Backup database to restore from.
     *
     * @return the recoverableDatabaseId value.
     */
    String recoverableDatabaseId();

    /**
     * Gets the provisioningState property: Resource state.
     *
     * @return the provisioningState value.
     */
    String provisioningState();

    /**
     * Gets the status property: Resource status.
     *
     * @return the status value.
     */
    String status();

    /**
     * Gets the restorePointInTime property: Snapshot time to restore.
     *
     * @return the restorePointInTime value.
     */
    OffsetDateTime restorePointInTime();

    /**
     * Gets the createMode property: Specifies the mode of sql pool creation.
     *
     * <p>Default: regular sql pool creation.
     *
     * <p>PointInTimeRestore: Creates a sql pool by restoring a point in time backup of an existing sql pool.
     * sourceDatabaseId must be specified as the resource ID of the existing sql pool, and restorePointInTime must be
     * specified.
     *
     * <p>Recovery: Creates a sql pool by a geo-replicated backup. sourceDatabaseId must be specified as the
     * recoverableDatabaseId to restore.
     *
     * <p>Restore: Creates a sql pool by restoring a backup of a deleted sql pool. SourceDatabaseId should be the sql
     * pool's original resource ID. SourceDatabaseId and sourceDatabaseDeletionDate must be specified.
     *
     * @return the createMode value.
     */
    CreateMode createMode();

    /**
     * Gets the creationDate property: Date the SQL pool was created.
     *
     * @return the creationDate value.
     */
    OffsetDateTime creationDate();

    /**
     * Gets the storageAccountType property: The storage account type used to store backups for this sql pool.
     *
     * @return the storageAccountType value.
     */
    StorageAccountType storageAccountType();

    /**
     * Gets the sourceDatabaseDeletionDate property: Specifies the time that the sql pool was deleted.
     *
     * @return the sourceDatabaseDeletionDate value.
     */
    OffsetDateTime sourceDatabaseDeletionDate();

    /**
     * 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.synapse.fluent.models.SqlPoolInner object.
     *
     * @return the inner object.
     */
    SqlPoolInner innerModel();

    /** The entirety of the SqlPool definition. */
    interface Definition
        extends DefinitionStages.Blank,
            DefinitionStages.WithLocation,
            DefinitionStages.WithParentResource,
            DefinitionStages.WithCreate {
    }
    /** The SqlPool definition stages. */
    interface DefinitionStages {
        /** The first stage of the SqlPool definition. */
        interface Blank extends WithLocation {
        }
        /** The stage of the SqlPool 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.
             */
            WithParentResource withRegion(Region location);

            /**
             * Specifies the region for the resource.
             *
             * @param location The geo-location where the resource lives.
             * @return the next definition stage.
             */
            WithParentResource withRegion(String location);
        }
        /** The stage of the SqlPool definition allowing to specify parent resource. */
        interface WithParentResource {
            /**
             * Specifies resourceGroupName, workspaceName.
             *
             * @param resourceGroupName The name of the resource group. The name is case insensitive.
             * @param workspaceName The name of the workspace.
             * @return the next definition stage.
             */
            WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName);
        }
        /**
         * The stage of the SqlPool 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.WithMaxSizeBytes,
                DefinitionStages.WithCollation,
                DefinitionStages.WithSourceDatabaseId,
                DefinitionStages.WithRecoverableDatabaseId,
                DefinitionStages.WithProvisioningState,
                DefinitionStages.WithRestorePointInTime,
                DefinitionStages.WithCreateMode,
                DefinitionStages.WithStorageAccountType,
                DefinitionStages.WithSourceDatabaseDeletionDate {
            /**
             * Executes the create request.
             *
             * @return the created resource.
             */
            SqlPool create();

            /**
             * Executes the create request.
             *
             * @param context The context to associate with this operation.
             * @return the created resource.
             */
            SqlPool create(Context context);
        }
        /** The stage of the SqlPool 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 SqlPool definition allowing to specify sku. */
        interface WithSku {
            /**
             * Specifies the sku property: Sku
             *
             * <p>SQL pool SKU.
             *
             * @param sku Sku
             *     <p>SQL pool SKU.
             * @return the next definition stage.
             */
            WithCreate withSku(Sku sku);
        }
        /** The stage of the SqlPool definition allowing to specify maxSizeBytes. */
        interface WithMaxSizeBytes {
            /**
             * Specifies the maxSizeBytes property: Maximum size in bytes.
             *
             * @param maxSizeBytes Maximum size in bytes.
             * @return the next definition stage.
             */
            WithCreate withMaxSizeBytes(Long maxSizeBytes);
        }
        /** The stage of the SqlPool definition allowing to specify collation. */
        interface WithCollation {
            /**
             * Specifies the collation property: Collation mode.
             *
             * @param collation Collation mode.
             * @return the next definition stage.
             */
            WithCreate withCollation(String collation);
        }
        /** The stage of the SqlPool definition allowing to specify sourceDatabaseId. */
        interface WithSourceDatabaseId {
            /**
             * Specifies the sourceDatabaseId property: Source database to create from.
             *
             * @param sourceDatabaseId Source database to create from.
             * @return the next definition stage.
             */
            WithCreate withSourceDatabaseId(String sourceDatabaseId);
        }
        /** The stage of the SqlPool definition allowing to specify recoverableDatabaseId. */
        interface WithRecoverableDatabaseId {
            /**
             * Specifies the recoverableDatabaseId property: Backup database to restore from.
             *
             * @param recoverableDatabaseId Backup database to restore from.
             * @return the next definition stage.
             */
            WithCreate withRecoverableDatabaseId(String recoverableDatabaseId);
        }
        /** The stage of the SqlPool definition allowing to specify provisioningState. */
        interface WithProvisioningState {
            /**
             * Specifies the provisioningState property: Resource state.
             *
             * @param provisioningState Resource state.
             * @return the next definition stage.
             */
            WithCreate withProvisioningState(String provisioningState);
        }
        /** The stage of the SqlPool definition allowing to specify restorePointInTime. */
        interface WithRestorePointInTime {
            /**
             * Specifies the restorePointInTime property: Snapshot time to restore.
             *
             * @param restorePointInTime Snapshot time to restore.
             * @return the next definition stage.
             */
            WithCreate withRestorePointInTime(OffsetDateTime restorePointInTime);
        }
        /** The stage of the SqlPool definition allowing to specify createMode. */
        interface WithCreateMode {
            /**
             * Specifies the createMode property: Specifies the mode of sql pool creation.
             *
             * <p>Default: regular sql pool creation.
             *
             * <p>PointInTimeRestore: Creates a sql pool by restoring a point in time backup of an existing sql pool.
             * sourceDatabaseId must be specified as the resource ID of the existing sql pool, and restorePointInTime
             * must be specified.
             *
             * <p>Recovery: Creates a sql pool by a geo-replicated backup. sourceDatabaseId must be specified as the
             * recoverableDatabaseId to restore.
             *
             * <p>Restore: Creates a sql pool by restoring a backup of a deleted sql pool. SourceDatabaseId should be
             * the sql pool's original resource ID. SourceDatabaseId and sourceDatabaseDeletionDate must be specified..
             *
             * @param createMode Specifies the mode of sql pool creation.
             *     <p>Default: regular sql pool creation.
             *     <p>PointInTimeRestore: Creates a sql pool by restoring a point in time backup of an existing sql
             *     pool. sourceDatabaseId must be specified as the resource ID of the existing sql pool, and
             *     restorePointInTime must be specified.
             *     <p>Recovery: Creates a sql pool by a geo-replicated backup. sourceDatabaseId must be specified as the
             *     recoverableDatabaseId to restore.
             *     <p>Restore: Creates a sql pool by restoring a backup of a deleted sql pool. SourceDatabaseId should
             *     be the sql pool's original resource ID. SourceDatabaseId and sourceDatabaseDeletionDate must be
             *     specified.
             * @return the next definition stage.
             */
            WithCreate withCreateMode(CreateMode createMode);
        }
        /** The stage of the SqlPool definition allowing to specify storageAccountType. */
        interface WithStorageAccountType {
            /**
             * Specifies the storageAccountType property: The storage account type used to store backups for this sql
             * pool..
             *
             * @param storageAccountType The storage account type used to store backups for this sql pool.
             * @return the next definition stage.
             */
            WithCreate withStorageAccountType(StorageAccountType storageAccountType);
        }
        /** The stage of the SqlPool definition allowing to specify sourceDatabaseDeletionDate. */
        interface WithSourceDatabaseDeletionDate {
            /**
             * Specifies the sourceDatabaseDeletionDate property: Specifies the time that the sql pool was deleted.
             *
             * @param sourceDatabaseDeletionDate Specifies the time that the sql pool was deleted.
             * @return the next definition stage.
             */
            WithCreate withSourceDatabaseDeletionDate(OffsetDateTime sourceDatabaseDeletionDate);
        }
    }
    /**
     * Begins update for the SqlPool resource.
     *
     * @return the stage of resource update.
     */
    SqlPool.Update update();

    /** The template for SqlPool update. */
    interface Update
        extends UpdateStages.WithTags,
            UpdateStages.WithSku,
            UpdateStages.WithMaxSizeBytes,
            UpdateStages.WithSourceDatabaseId,
            UpdateStages.WithRecoverableDatabaseId,
            UpdateStages.WithProvisioningState,
            UpdateStages.WithCreateMode,
            UpdateStages.WithStorageAccountType {
        /**
         * Executes the update request.
         *
         * @return the updated resource.
         */
        SqlPool apply();

        /**
         * Executes the update request.
         *
         * @param context The context to associate with this operation.
         * @return the updated resource.
         */
        SqlPool apply(Context context);
    }
    /** The SqlPool update stages. */
    interface UpdateStages {
        /** The stage of the SqlPool 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 SqlPool update allowing to specify sku. */
        interface WithSku {
            /**
             * Specifies the sku property: Sku
             *
             * <p>SQL pool SKU.
             *
             * @param sku Sku
             *     <p>SQL pool SKU.
             * @return the next definition stage.
             */
            Update withSku(Sku sku);
        }
        /** The stage of the SqlPool update allowing to specify maxSizeBytes. */
        interface WithMaxSizeBytes {
            /**
             * Specifies the maxSizeBytes property: Maximum size in bytes.
             *
             * @param maxSizeBytes Maximum size in bytes.
             * @return the next definition stage.
             */
            Update withMaxSizeBytes(Long maxSizeBytes);
        }
        /** The stage of the SqlPool update allowing to specify sourceDatabaseId. */
        interface WithSourceDatabaseId {
            /**
             * Specifies the sourceDatabaseId property: Source database to create from.
             *
             * @param sourceDatabaseId Source database to create from.
             * @return the next definition stage.
             */
            Update withSourceDatabaseId(String sourceDatabaseId);
        }
        /** The stage of the SqlPool update allowing to specify recoverableDatabaseId. */
        interface WithRecoverableDatabaseId {
            /**
             * Specifies the recoverableDatabaseId property: Backup database to restore from.
             *
             * @param recoverableDatabaseId Backup database to restore from.
             * @return the next definition stage.
             */
            Update withRecoverableDatabaseId(String recoverableDatabaseId);
        }
        /** The stage of the SqlPool update allowing to specify provisioningState. */
        interface WithProvisioningState {
            /**
             * Specifies the provisioningState property: Resource state.
             *
             * @param provisioningState Resource state.
             * @return the next definition stage.
             */
            Update withProvisioningState(String provisioningState);
        }
        /** The stage of the SqlPool update allowing to specify createMode. */
        interface WithCreateMode {
            /**
             * Specifies the createMode property: Specifies the mode of sql pool creation.
             *
             * <p>Default: regular sql pool creation.
             *
             * <p>PointInTimeRestore: Creates a sql pool by restoring a point in time backup of an existing sql pool.
             * sourceDatabaseId must be specified as the resource ID of the existing sql pool, and restorePointInTime
             * must be specified.
             *
             * <p>Recovery: Creates a sql pool by a geo-replicated backup. sourceDatabaseId must be specified as the
             * recoverableDatabaseId to restore.
             *
             * <p>Restore: Creates a sql pool by restoring a backup of a deleted sql pool. SourceDatabaseId should be
             * the sql pool's original resource ID. SourceDatabaseId and sourceDatabaseDeletionDate must be specified..
             *
             * @param createMode Specifies the mode of sql pool creation.
             *     <p>Default: regular sql pool creation.
             *     <p>PointInTimeRestore: Creates a sql pool by restoring a point in time backup of an existing sql
             *     pool. sourceDatabaseId must be specified as the resource ID of the existing sql pool, and
             *     restorePointInTime must be specified.
             *     <p>Recovery: Creates a sql pool by a geo-replicated backup. sourceDatabaseId must be specified as the
             *     recoverableDatabaseId to restore.
             *     <p>Restore: Creates a sql pool by restoring a backup of a deleted sql pool. SourceDatabaseId should
             *     be the sql pool's original resource ID. SourceDatabaseId and sourceDatabaseDeletionDate must be
             *     specified.
             * @return the next definition stage.
             */
            Update withCreateMode(CreateMode createMode);
        }
        /** The stage of the SqlPool update allowing to specify storageAccountType. */
        interface WithStorageAccountType {
            /**
             * Specifies the storageAccountType property: The storage account type used to store backups for this sql
             * pool..
             *
             * @param storageAccountType The storage account type used to store backups for this sql pool.
             * @return the next definition stage.
             */
            Update withStorageAccountType(StorageAccountType storageAccountType);
        }
    }
    /**
     * Refreshes the resource to sync with Azure.
     *
     * @return the refreshed resource.
     */
    SqlPool refresh();

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

    /**
     * Pause SQL pool
     *
     * <p>Pause a SQL pool.
     *
     * @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 sQL pool.
     */
    SqlPool pause();

    /**
     * Pause SQL pool
     *
     * <p>Pause a SQL pool.
     *
     * @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 sQL pool.
     */
    SqlPool pause(Context context);

    /**
     * Resume SQL pool
     *
     * <p>Resume a SQL pool.
     *
     * @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 sQL pool.
     */
    SqlPool resume();

    /**
     * Resume SQL pool
     *
     * <p>Resume a SQL pool.
     *
     * @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 sQL pool.
     */
    SqlPool resume(Context context);

    /**
     * Rename a SQL pool
     *
     * <p>Rename a SQL pool.
     *
     * @param parameters The resource move definition for renaming this Sql pool.
     * @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 {@link Response}.
     */
    Response<Void> renameWithResponse(ResourceMoveDefinition parameters, Context context);

    /**
     * Rename a SQL pool
     *
     * <p>Rename a SQL pool.
     *
     * @param parameters The resource move definition for renaming this Sql pool.
     * @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 rename(ResourceMoveDefinition parameters);
}
