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

package com.azure.resourcemanager.devtestlabs.models;

import com.azure.core.management.Region;
import com.azure.core.util.Context;
import com.azure.resourcemanager.devtestlabs.fluent.models.DiskInner;
import java.time.OffsetDateTime;
import java.util.Map;

/** An immutable client-side representation of Disk. */
public interface Disk {
    /**
     * 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 diskType property: The storage type for the disk (i.e. Standard, Premium).
     *
     * @return the diskType value.
     */
    StorageType diskType();

    /**
     * Gets the diskSizeGiB property: The size of the disk in Gibibytes.
     *
     * @return the diskSizeGiB value.
     */
    Integer diskSizeGiB();

    /**
     * Gets the leasedByLabVmId property: The resource ID of the VM to which this disk is leased.
     *
     * @return the leasedByLabVmId value.
     */
    String leasedByLabVmId();

    /**
     * Gets the diskBlobName property: When backed by a blob, the name of the VHD blob without extension.
     *
     * @return the diskBlobName value.
     */
    String diskBlobName();

    /**
     * Gets the diskUri property: When backed by a blob, the URI of underlying blob.
     *
     * @return the diskUri value.
     */
    String diskUri();

    /**
     * Gets the storageAccountId property: When backed by a blob, the storage account where the blob is.
     *
     * @return the storageAccountId value.
     */
    String storageAccountId();

    /**
     * Gets the createdDate property: The creation date of the disk.
     *
     * @return the createdDate value.
     */
    OffsetDateTime createdDate();

    /**
     * Gets the hostCaching property: The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite).
     *
     * @return the hostCaching value.
     */
    String hostCaching();

    /**
     * Gets the managedDiskId property: When backed by managed disk, this is the ID of the compute disk resource.
     *
     * @return the managedDiskId value.
     */
    String managedDiskId();

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

    /**
     * Gets the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).
     *
     * @return the uniqueIdentifier value.
     */
    String uniqueIdentifier();

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

    /** The entirety of the Disk definition. */
    interface Definition
        extends DefinitionStages.Blank,
            DefinitionStages.WithLocation,
            DefinitionStages.WithParentResource,
            DefinitionStages.WithCreate {
    }
    /** The Disk definition stages. */
    interface DefinitionStages {
        /** The first stage of the Disk definition. */
        interface Blank extends WithLocation {
        }
        /** The stage of the Disk 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 Disk definition allowing to specify parent resource. */
        interface WithParentResource {
            /**
             * Specifies resourceGroupName, labName, username.
             *
             * @param resourceGroupName The name of the resource group.
             * @param labName The name of the lab.
             * @param username The name of the user profile.
             * @return the next definition stage.
             */
            WithCreate withExistingUser(String resourceGroupName, String labName, String username);
        }
        /**
         * The stage of the Disk 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.WithDiskType,
                DefinitionStages.WithDiskSizeGiB,
                DefinitionStages.WithLeasedByLabVmId,
                DefinitionStages.WithDiskBlobName,
                DefinitionStages.WithDiskUri,
                DefinitionStages.WithStorageAccountId,
                DefinitionStages.WithHostCaching,
                DefinitionStages.WithManagedDiskId {
            /**
             * Executes the create request.
             *
             * @return the created resource.
             */
            Disk create();

            /**
             * Executes the create request.
             *
             * @param context The context to associate with this operation.
             * @return the created resource.
             */
            Disk create(Context context);
        }
        /** The stage of the Disk 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 Disk definition allowing to specify diskType. */
        interface WithDiskType {
            /**
             * Specifies the diskType property: The storage type for the disk (i.e. Standard, Premium)..
             *
             * @param diskType The storage type for the disk (i.e. Standard, Premium).
             * @return the next definition stage.
             */
            WithCreate withDiskType(StorageType diskType);
        }
        /** The stage of the Disk definition allowing to specify diskSizeGiB. */
        interface WithDiskSizeGiB {
            /**
             * Specifies the diskSizeGiB property: The size of the disk in Gibibytes..
             *
             * @param diskSizeGiB The size of the disk in Gibibytes.
             * @return the next definition stage.
             */
            WithCreate withDiskSizeGiB(Integer diskSizeGiB);
        }
        /** The stage of the Disk definition allowing to specify leasedByLabVmId. */
        interface WithLeasedByLabVmId {
            /**
             * Specifies the leasedByLabVmId property: The resource ID of the VM to which this disk is leased..
             *
             * @param leasedByLabVmId The resource ID of the VM to which this disk is leased.
             * @return the next definition stage.
             */
            WithCreate withLeasedByLabVmId(String leasedByLabVmId);
        }
        /** The stage of the Disk definition allowing to specify diskBlobName. */
        interface WithDiskBlobName {
            /**
             * Specifies the diskBlobName property: When backed by a blob, the name of the VHD blob without extension..
             *
             * @param diskBlobName When backed by a blob, the name of the VHD blob without extension.
             * @return the next definition stage.
             */
            WithCreate withDiskBlobName(String diskBlobName);
        }
        /** The stage of the Disk definition allowing to specify diskUri. */
        interface WithDiskUri {
            /**
             * Specifies the diskUri property: When backed by a blob, the URI of underlying blob..
             *
             * @param diskUri When backed by a blob, the URI of underlying blob.
             * @return the next definition stage.
             */
            WithCreate withDiskUri(String diskUri);
        }
        /** The stage of the Disk definition allowing to specify storageAccountId. */
        interface WithStorageAccountId {
            /**
             * Specifies the storageAccountId property: When backed by a blob, the storage account where the blob is..
             *
             * @param storageAccountId When backed by a blob, the storage account where the blob is.
             * @return the next definition stage.
             */
            WithCreate withStorageAccountId(String storageAccountId);
        }
        /** The stage of the Disk definition allowing to specify hostCaching. */
        interface WithHostCaching {
            /**
             * Specifies the hostCaching property: The host caching policy of the disk (i.e. None, ReadOnly,
             * ReadWrite)..
             *
             * @param hostCaching The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite).
             * @return the next definition stage.
             */
            WithCreate withHostCaching(String hostCaching);
        }
        /** The stage of the Disk definition allowing to specify managedDiskId. */
        interface WithManagedDiskId {
            /**
             * Specifies the managedDiskId property: When backed by managed disk, this is the ID of the compute disk
             * resource..
             *
             * @param managedDiskId When backed by managed disk, this is the ID of the compute disk resource.
             * @return the next definition stage.
             */
            WithCreate withManagedDiskId(String managedDiskId);
        }
    }
    /**
     * Begins update for the Disk resource.
     *
     * @return the stage of resource update.
     */
    Disk.Update update();

    /** The template for Disk update. */
    interface Update extends UpdateStages.WithTags {
        /**
         * Executes the update request.
         *
         * @return the updated resource.
         */
        Disk apply();

        /**
         * Executes the update request.
         *
         * @param context The context to associate with this operation.
         * @return the updated resource.
         */
        Disk apply(Context context);
    }
    /** The Disk update stages. */
    interface UpdateStages {
        /** The stage of the Disk update allowing to specify tags. */
        interface WithTags {
            /**
             * Specifies the tags property: The tags of the resource..
             *
             * @param tags The tags of the resource.
             * @return the next definition stage.
             */
            Update withTags(Map<String, String> tags);
        }
    }
    /**
     * Refreshes the resource to sync with Azure.
     *
     * @return the refreshed resource.
     */
    Disk refresh();

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

    /**
     * Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete.
     *
     * @param attachDiskProperties Properties of the disk to attach.
     * @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 attach(AttachDiskProperties attachDiskProperties);

    /**
     * Attach and create the lease of the disk to the virtual machine. This operation can take a while to complete.
     *
     * @param attachDiskProperties Properties of the disk to attach.
     * @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 attach(AttachDiskProperties attachDiskProperties, Context context);

    /**
     * Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to
     * complete.
     *
     * @param detachDiskProperties Properties of the disk to detach.
     * @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 detach(DetachDiskProperties detachDiskProperties);

    /**
     * Detach and break the lease of the disk attached to the virtual machine. This operation can take a while to
     * complete.
     *
     * @param detachDiskProperties Properties of the disk to detach.
     * @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 detach(DetachDiskProperties detachDiskProperties, Context context);
}
