# 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

__all__ = [
    'GetServiceResult',
    'AwaitableGetServiceResult',
    'get_service',
    'get_service_output',
]

@pulumi.output_type
class GetServiceResult:
    """
    A collection of values returned by getService.
    """
    def __init__(__self__, autogenerate_revision_name=None, id=None, location=None, metadatas=None, name=None, project=None, statuses=None, templates=None, traffics=None):
        if autogenerate_revision_name and not isinstance(autogenerate_revision_name, bool):
            raise TypeError("Expected argument 'autogenerate_revision_name' to be a bool")
        pulumi.set(__self__, "autogenerate_revision_name", autogenerate_revision_name)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if location and not isinstance(location, str):
            raise TypeError("Expected argument 'location' to be a str")
        pulumi.set(__self__, "location", location)
        if metadatas and not isinstance(metadatas, list):
            raise TypeError("Expected argument 'metadatas' to be a list")
        pulumi.set(__self__, "metadatas", metadatas)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if project and not isinstance(project, str):
            raise TypeError("Expected argument 'project' to be a str")
        pulumi.set(__self__, "project", project)
        if statuses and not isinstance(statuses, list):
            raise TypeError("Expected argument 'statuses' to be a list")
        pulumi.set(__self__, "statuses", statuses)
        if templates and not isinstance(templates, list):
            raise TypeError("Expected argument 'templates' to be a list")
        pulumi.set(__self__, "templates", templates)
        if traffics and not isinstance(traffics, list):
            raise TypeError("Expected argument 'traffics' to be a list")
        pulumi.set(__self__, "traffics", traffics)

    @property
    @pulumi.getter(name="autogenerateRevisionName")
    def autogenerate_revision_name(self) -> bool:
        return pulumi.get(self, "autogenerate_revision_name")

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

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

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

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

    @property
    @pulumi.getter
    def project(self) -> Optional[str]:
        return pulumi.get(self, "project")

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

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

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


class AwaitableGetServiceResult(GetServiceResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetServiceResult(
            autogenerate_revision_name=self.autogenerate_revision_name,
            id=self.id,
            location=self.location,
            metadatas=self.metadatas,
            name=self.name,
            project=self.project,
            statuses=self.statuses,
            templates=self.templates,
            traffics=self.traffics)


def get_service(location: Optional[str] = None,
                name: Optional[str] = None,
                project: Optional[str] = None,
                opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetServiceResult:
    """
    Get information about a Google Cloud Run Service. For more information see
    the [official documentation](https://cloud.google.com/run/docs/)
    and [API](https://cloud.google.com/run/docs/apis).

    ## Example Usage

    ```python
    import pulumi
    import pulumi_gcp as gcp

    run_service = gcp.cloudrun.get_service(location="us-central1",
        name="my-service")
    ```


    :param str location: The location of the cloud run instance. eg us-central1
    :param str name: The name of the Cloud Run Service.
    :param str project: The project in which the resource belongs. If it
           is not provided, the provider project is used.
    """
    __args__ = dict()
    __args__['location'] = location
    __args__['name'] = name
    __args__['project'] = project
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('gcp:cloudrun/getService:getService', __args__, opts=opts, typ=GetServiceResult).value

    return AwaitableGetServiceResult(
        autogenerate_revision_name=__ret__.autogenerate_revision_name,
        id=__ret__.id,
        location=__ret__.location,
        metadatas=__ret__.metadatas,
        name=__ret__.name,
        project=__ret__.project,
        statuses=__ret__.statuses,
        templates=__ret__.templates,
        traffics=__ret__.traffics)


@_utilities.lift_output_func(get_service)
def get_service_output(location: Optional[pulumi.Input[str]] = None,
                       name: Optional[pulumi.Input[str]] = None,
                       project: Optional[pulumi.Input[Optional[str]]] = None,
                       opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetServiceResult]:
    """
    Get information about a Google Cloud Run Service. For more information see
    the [official documentation](https://cloud.google.com/run/docs/)
    and [API](https://cloud.google.com/run/docs/apis).

    ## Example Usage

    ```python
    import pulumi
    import pulumi_gcp as gcp

    run_service = gcp.cloudrun.get_service(location="us-central1",
        name="my-service")
    ```


    :param str location: The location of the cloud run instance. eg us-central1
    :param str name: The name of the Cloud Run Service.
    :param str project: The project in which the resource belongs. If it
           is not provided, the provider project is used.
    """
    ...
