# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities
from . import outputs
from ._inputs import *

__all__ = [
    'GetBlockStorageVolumeResult',
    'AwaitableGetBlockStorageVolumeResult',
    'get_block_storage_volume',
    'get_block_storage_volume_output',
]

@pulumi.output_type
class GetBlockStorageVolumeResult:
    """
    A collection of values returned by getBlockStorageVolume.
    """
    def __init__(__self__, blocksize=None, created_at=None, id=None, instance=None, labels=None, name=None, size=None, snapshots=None, state=None, timeouts=None, zone=None):
        if blocksize and not isinstance(blocksize, int):
            raise TypeError("Expected argument 'blocksize' to be a int")
        pulumi.set(__self__, "blocksize", blocksize)
        if created_at and not isinstance(created_at, str):
            raise TypeError("Expected argument 'created_at' to be a str")
        pulumi.set(__self__, "created_at", created_at)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if instance and not isinstance(instance, dict):
            raise TypeError("Expected argument 'instance' to be a dict")
        pulumi.set(__self__, "instance", instance)
        if labels and not isinstance(labels, dict):
            raise TypeError("Expected argument 'labels' to be a dict")
        pulumi.set(__self__, "labels", labels)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if size and not isinstance(size, int):
            raise TypeError("Expected argument 'size' to be a int")
        pulumi.set(__self__, "size", size)
        if snapshots and not isinstance(snapshots, list):
            raise TypeError("Expected argument 'snapshots' to be a list")
        pulumi.set(__self__, "snapshots", snapshots)
        if state and not isinstance(state, str):
            raise TypeError("Expected argument 'state' to be a str")
        pulumi.set(__self__, "state", state)
        if timeouts and not isinstance(timeouts, dict):
            raise TypeError("Expected argument 'timeouts' to be a dict")
        pulumi.set(__self__, "timeouts", timeouts)
        if zone and not isinstance(zone, str):
            raise TypeError("Expected argument 'zone' to be a str")
        pulumi.set(__self__, "zone", zone)

    @property
    @pulumi.getter
    def blocksize(self) -> int:
        """
        Volume block size.
        """
        return pulumi.get(self, "blocksize")

    @property
    @pulumi.getter(name="createdAt")
    def created_at(self) -> str:
        """
        Volume creation date.
        """
        return pulumi.get(self, "created_at")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        Volume ID to match.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def instance(self) -> 'outputs.GetBlockStorageVolumeInstanceResult':
        """
        Volume attached instance.
        """
        return pulumi.get(self, "instance")

    @property
    @pulumi.getter
    def labels(self) -> Mapping[str, str]:
        """
        Resource labels.
        """
        return pulumi.get(self, "labels")

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        Volume name.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter
    def size(self) -> int:
        """
        Volume size in GB.
        """
        return pulumi.get(self, "size")

    @property
    @pulumi.getter
    def snapshots(self) -> Sequence['outputs.GetBlockStorageVolumeSnapshotResult']:
        """
        Volume snapshots.
        """
        return pulumi.get(self, "snapshots")

    @property
    @pulumi.getter
    def state(self) -> str:
        """
        Volume state.
        """
        return pulumi.get(self, "state")

    @property
    @pulumi.getter
    def timeouts(self) -> Optional['outputs.GetBlockStorageVolumeTimeoutsResult']:
        return pulumi.get(self, "timeouts")

    @property
    @pulumi.getter
    def zone(self) -> str:
        """
        The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.
        """
        return pulumi.get(self, "zone")


class AwaitableGetBlockStorageVolumeResult(GetBlockStorageVolumeResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetBlockStorageVolumeResult(
            blocksize=self.blocksize,
            created_at=self.created_at,
            id=self.id,
            instance=self.instance,
            labels=self.labels,
            name=self.name,
            size=self.size,
            snapshots=self.snapshots,
            state=self.state,
            timeouts=self.timeouts,
            zone=self.zone)


def get_block_storage_volume(id: Optional[str] = None,
                             timeouts: Optional[Union['GetBlockStorageVolumeTimeoutsArgs', 'GetBlockStorageVolumeTimeoutsArgsDict']] = None,
                             zone: Optional[str] = None,
                             opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetBlockStorageVolumeResult:
    """
    Fetch [Exoscale Block Storage](https://community.exoscale.com/documentation/block-storage/) Volume.

    Block Storage offers persistent externally attached volumes for your workloads.

    Corresponding resource: exoscale_block_storage_volume.


    :param str id: Volume ID to match.
    :param str zone: The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.
    """
    __args__ = dict()
    __args__['id'] = id
    __args__['timeouts'] = timeouts
    __args__['zone'] = zone
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('exoscale:index/getBlockStorageVolume:getBlockStorageVolume', __args__, opts=opts, typ=GetBlockStorageVolumeResult).value

    return AwaitableGetBlockStorageVolumeResult(
        blocksize=pulumi.get(__ret__, 'blocksize'),
        created_at=pulumi.get(__ret__, 'created_at'),
        id=pulumi.get(__ret__, 'id'),
        instance=pulumi.get(__ret__, 'instance'),
        labels=pulumi.get(__ret__, 'labels'),
        name=pulumi.get(__ret__, 'name'),
        size=pulumi.get(__ret__, 'size'),
        snapshots=pulumi.get(__ret__, 'snapshots'),
        state=pulumi.get(__ret__, 'state'),
        timeouts=pulumi.get(__ret__, 'timeouts'),
        zone=pulumi.get(__ret__, 'zone'))


@_utilities.lift_output_func(get_block_storage_volume)
def get_block_storage_volume_output(id: Optional[pulumi.Input[str]] = None,
                                    timeouts: Optional[pulumi.Input[Optional[Union['GetBlockStorageVolumeTimeoutsArgs', 'GetBlockStorageVolumeTimeoutsArgsDict']]]] = None,
                                    zone: Optional[pulumi.Input[str]] = None,
                                    opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetBlockStorageVolumeResult]:
    """
    Fetch [Exoscale Block Storage](https://community.exoscale.com/documentation/block-storage/) Volume.

    Block Storage offers persistent externally attached volumes for your workloads.

    Corresponding resource: exoscale_block_storage_volume.


    :param str id: Volume ID to match.
    :param str zone: The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.
    """
    ...
