# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities

__all__ = [
    'GetRegionResult',
    'AwaitableGetRegionResult',
    'get_region',
    'get_region_output',
]

@pulumi.output_type
class GetRegionResult:
    """
    A collection of values returned by getRegion.
    """
    def __init__(__self__, available=None, features=None, id=None, name=None, sizes=None, slug=None):
        if available and not isinstance(available, bool):
            raise TypeError("Expected argument 'available' to be a bool")
        pulumi.set(__self__, "available", available)
        if features and not isinstance(features, list):
            raise TypeError("Expected argument 'features' to be a list")
        pulumi.set(__self__, "features", features)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if sizes and not isinstance(sizes, list):
            raise TypeError("Expected argument 'sizes' to be a list")
        pulumi.set(__self__, "sizes", sizes)
        if slug and not isinstance(slug, str):
            raise TypeError("Expected argument 'slug' to be a str")
        pulumi.set(__self__, "slug", slug)

    @_builtins.property
    @pulumi.getter
    def available(self) -> _builtins.bool:
        """
        A boolean value that represents whether new Droplets can be created in this region.
        """
        return pulumi.get(self, "available")

    @_builtins.property
    @pulumi.getter
    def features(self) -> Sequence[_builtins.str]:
        """
        A set of features available in this region.
        """
        return pulumi.get(self, "features")

    @_builtins.property
    @pulumi.getter
    def id(self) -> _builtins.str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @_builtins.property
    @pulumi.getter
    def name(self) -> _builtins.str:
        """
        The display name of the region.
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter
    def sizes(self) -> Sequence[_builtins.str]:
        """
        A set of identifying slugs for the Droplet sizes available in this region.
        """
        return pulumi.get(self, "sizes")

    @_builtins.property
    @pulumi.getter
    def slug(self) -> _builtins.str:
        """
        A human-readable string that is used as a unique identifier for each region.
        """
        return pulumi.get(self, "slug")


class AwaitableGetRegionResult(GetRegionResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetRegionResult(
            available=self.available,
            features=self.features,
            id=self.id,
            name=self.name,
            sizes=self.sizes,
            slug=self.slug)


def get_region(slug: Optional[_builtins.str] = None,
               opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetRegionResult:
    """
    Get information on a single DigitalOcean region. This is useful to find out
    what Droplet sizes and features are supported within a region.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_digitalocean as digitalocean

    sfo2 = digitalocean.get_region(slug="sfo2")
    pulumi.export("regionName", sfo2.name)
    ```


    :param _builtins.str slug: A human-readable string that is used as a unique identifier for each region.
    """
    __args__ = dict()
    __args__['slug'] = slug
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('digitalocean:index/getRegion:getRegion', __args__, opts=opts, typ=GetRegionResult).value

    return AwaitableGetRegionResult(
        available=pulumi.get(__ret__, 'available'),
        features=pulumi.get(__ret__, 'features'),
        id=pulumi.get(__ret__, 'id'),
        name=pulumi.get(__ret__, 'name'),
        sizes=pulumi.get(__ret__, 'sizes'),
        slug=pulumi.get(__ret__, 'slug'))
def get_region_output(slug: Optional[pulumi.Input[_builtins.str]] = None,
                      opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetRegionResult]:
    """
    Get information on a single DigitalOcean region. This is useful to find out
    what Droplet sizes and features are supported within a region.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_digitalocean as digitalocean

    sfo2 = digitalocean.get_region(slug="sfo2")
    pulumi.export("regionName", sfo2.name)
    ```


    :param _builtins.str slug: A human-readable string that is used as a unique identifier for each region.
    """
    __args__ = dict()
    __args__['slug'] = slug
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('digitalocean:index/getRegion:getRegion', __args__, opts=opts, typ=GetRegionResult)
    return __ret__.apply(lambda __response__: GetRegionResult(
        available=pulumi.get(__response__, 'available'),
        features=pulumi.get(__response__, 'features'),
        id=pulumi.get(__response__, 'id'),
        name=pulumi.get(__response__, 'name'),
        sizes=pulumi.get(__response__, 'sizes'),
        slug=pulumi.get(__response__, 'slug')))
