# 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__ = [
    'GetDeploymentResult',
    'AwaitableGetDeploymentResult',
    'get_deployment',
    'get_deployment_output',
]

@pulumi.output_type
class GetDeploymentResult:
    """
    A collection of values returned by getDeployment.
    """
    def __init__(__self__, custom_environment_id=None, domains=None, id=None, meta=None, production=None, project_id=None, ref=None, team_id=None, url=None):
        if custom_environment_id and not isinstance(custom_environment_id, str):
            raise TypeError("Expected argument 'custom_environment_id' to be a str")
        pulumi.set(__self__, "custom_environment_id", custom_environment_id)
        if domains and not isinstance(domains, list):
            raise TypeError("Expected argument 'domains' to be a list")
        pulumi.set(__self__, "domains", domains)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if meta and not isinstance(meta, dict):
            raise TypeError("Expected argument 'meta' to be a dict")
        pulumi.set(__self__, "meta", meta)
        if production and not isinstance(production, bool):
            raise TypeError("Expected argument 'production' to be a bool")
        pulumi.set(__self__, "production", production)
        if project_id and not isinstance(project_id, str):
            raise TypeError("Expected argument 'project_id' to be a str")
        pulumi.set(__self__, "project_id", project_id)
        if ref and not isinstance(ref, str):
            raise TypeError("Expected argument 'ref' to be a str")
        pulumi.set(__self__, "ref", ref)
        if team_id and not isinstance(team_id, str):
            raise TypeError("Expected argument 'team_id' to be a str")
        pulumi.set(__self__, "team_id", team_id)
        if url and not isinstance(url, str):
            raise TypeError("Expected argument 'url' to be a str")
        pulumi.set(__self__, "url", url)

    @_builtins.property
    @pulumi.getter(name="customEnvironmentId")
    def custom_environment_id(self) -> _builtins.str:
        """
        The ID of the Custom Environment that the deployment was deployed to, if any.
        """
        return pulumi.get(self, "custom_environment_id")

    @_builtins.property
    @pulumi.getter
    def domains(self) -> Sequence[_builtins.str]:
        """
        A list of all the domains (default domains, staging domains and production domains) that were assigned upon deployment creation.
        """
        return pulumi.get(self, "domains")

    @_builtins.property
    @pulumi.getter
    def id(self) -> _builtins.str:
        """
        The ID or URL of the Deployment to read.
        """
        return pulumi.get(self, "id")

    @_builtins.property
    @pulumi.getter
    def meta(self) -> Mapping[str, _builtins.str]:
        """
        Arbitrary key/value metadata associated with the deployment.
        """
        return pulumi.get(self, "meta")

    @_builtins.property
    @pulumi.getter
    def production(self) -> _builtins.bool:
        """
        true if the deployment is a production deployment, meaning production aliases will be assigned.
        """
        return pulumi.get(self, "production")

    @_builtins.property
    @pulumi.getter(name="projectId")
    def project_id(self) -> _builtins.str:
        """
        The project ID to add the deployment to.
        """
        return pulumi.get(self, "project_id")

    @_builtins.property
    @pulumi.getter
    def ref(self) -> _builtins.str:
        """
        The branch or commit hash that has been deployed. Note this will only work if the project is configured to use a Git repository.
        """
        return pulumi.get(self, "ref")

    @_builtins.property
    @pulumi.getter(name="teamId")
    def team_id(self) -> _builtins.str:
        """
        The Team ID to the Deployment belong to. Required when reading a team resource if a default team has not been set in the provider.
        """
        return pulumi.get(self, "team_id")

    @_builtins.property
    @pulumi.getter
    def url(self) -> _builtins.str:
        """
        A unique URL that is automatically generated for a deployment.
        """
        return pulumi.get(self, "url")


class AwaitableGetDeploymentResult(GetDeploymentResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetDeploymentResult(
            custom_environment_id=self.custom_environment_id,
            domains=self.domains,
            id=self.id,
            meta=self.meta,
            production=self.production,
            project_id=self.project_id,
            ref=self.ref,
            team_id=self.team_id,
            url=self.url)


def get_deployment(id: Optional[_builtins.str] = None,
                   team_id: Optional[_builtins.str] = None,
                   opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetDeploymentResult:
    """
    Provides information about an existing Deployment.

    A Deployment is the result of building your Project and making it available through a live URL.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_vercel as vercel

    example = vercel.get_deployment(id="https://my-vercel-project.vercel.app")
    ```


    :param _builtins.str id: The ID or URL of the Deployment to read.
    :param _builtins.str team_id: The Team ID to the Deployment belong to. Required when reading a team resource if a default team has not been set in the provider.
    """
    __args__ = dict()
    __args__['id'] = id
    __args__['teamId'] = team_id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('vercel:index/getDeployment:getDeployment', __args__, opts=opts, typ=GetDeploymentResult).value

    return AwaitableGetDeploymentResult(
        custom_environment_id=pulumi.get(__ret__, 'custom_environment_id'),
        domains=pulumi.get(__ret__, 'domains'),
        id=pulumi.get(__ret__, 'id'),
        meta=pulumi.get(__ret__, 'meta'),
        production=pulumi.get(__ret__, 'production'),
        project_id=pulumi.get(__ret__, 'project_id'),
        ref=pulumi.get(__ret__, 'ref'),
        team_id=pulumi.get(__ret__, 'team_id'),
        url=pulumi.get(__ret__, 'url'))
def get_deployment_output(id: Optional[pulumi.Input[_builtins.str]] = None,
                          team_id: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                          opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetDeploymentResult]:
    """
    Provides information about an existing Deployment.

    A Deployment is the result of building your Project and making it available through a live URL.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_vercel as vercel

    example = vercel.get_deployment(id="https://my-vercel-project.vercel.app")
    ```


    :param _builtins.str id: The ID or URL of the Deployment to read.
    :param _builtins.str team_id: The Team ID to the Deployment belong to. Required when reading a team resource if a default team has not been set in the provider.
    """
    __args__ = dict()
    __args__['id'] = id
    __args__['teamId'] = team_id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('vercel:index/getDeployment:getDeployment', __args__, opts=opts, typ=GetDeploymentResult)
    return __ret__.apply(lambda __response__: GetDeploymentResult(
        custom_environment_id=pulumi.get(__response__, 'custom_environment_id'),
        domains=pulumi.get(__response__, 'domains'),
        id=pulumi.get(__response__, 'id'),
        meta=pulumi.get(__response__, 'meta'),
        production=pulumi.get(__response__, 'production'),
        project_id=pulumi.get(__response__, 'project_id'),
        ref=pulumi.get(__response__, 'ref'),
        team_id=pulumi.get(__response__, 'team_id'),
        url=pulumi.get(__response__, 'url')))
