# 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 builtins
import copy
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__ = [
    'GetRegionsResult',
    'AwaitableGetRegionsResult',
    'get_regions',
    'get_regions_output',
]

@pulumi.output_type
class GetRegionsResult:
    """
    A collection of values returned by getRegions.
    """
    def __init__(__self__, id=None, regions=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if regions and not isinstance(regions, list):
            raise TypeError("Expected argument 'regions' to be a list")
        pulumi.set(__self__, "regions", regions)

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

    @property
    @pulumi.getter
    def regions(self) -> Sequence[builtins.str]:
        """
        `(list of strings)` - a list of regions available in the cluster.
        """
        return pulumi.get(self, "regions")


class AwaitableGetRegionsResult(GetRegionsResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetRegionsResult(
            id=self.id,
            regions=self.regions)


def get_regions(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetRegionsResult:
    """
    Retrieve a list of regions available in Nomad.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_nomad as nomad


    def not_implemented(msg):
        raise NotImplementedError(msg)

    my_regions = nomad.get_regions()
    jobs = not_implemented("The template_file data resource is not yet supported.")
    app = []
    def create_app(range_body):
        for range in [{"value": i} for i in range(0, range_body)]:
            app.append(nomad.Job(f"app-{range['value']}", jobspec=jobs[range["value"]]["rendered"]))

    (len(my_regions.regions)).apply(create_app)
    ```
    """
    __args__ = dict()
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('nomad:index/getRegions:getRegions', __args__, opts=opts, typ=GetRegionsResult).value

    return AwaitableGetRegionsResult(
        id=pulumi.get(__ret__, 'id'),
        regions=pulumi.get(__ret__, 'regions'))
def get_regions_output(opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetRegionsResult]:
    """
    Retrieve a list of regions available in Nomad.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_nomad as nomad


    def not_implemented(msg):
        raise NotImplementedError(msg)

    my_regions = nomad.get_regions()
    jobs = not_implemented("The template_file data resource is not yet supported.")
    app = []
    def create_app(range_body):
        for range in [{"value": i} for i in range(0, range_body)]:
            app.append(nomad.Job(f"app-{range['value']}", jobspec=jobs[range["value"]]["rendered"]))

    (len(my_regions.regions)).apply(create_app)
    ```
    """
    __args__ = dict()
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('nomad:index/getRegions:getRegions', __args__, opts=opts, typ=GetRegionsResult)
    return __ret__.apply(lambda __response__: GetRegionsResult(
        id=pulumi.get(__response__, 'id'),
        regions=pulumi.get(__response__, 'regions')))
