# 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
from . import outputs

__all__ = [
    'GetGcpProjectsResult',
    'AwaitableGetGcpProjectsResult',
    'get_gcp_projects',
    'get_gcp_projects_output',
]

@pulumi.output_type
class GetGcpProjectsResult:
    """
    A collection of values returned by getGcpProjects.
    """
    def __init__(__self__, connector_id=None, id=None, org_id=None, project_id=None, projects=None):
        if connector_id and not isinstance(connector_id, str):
            raise TypeError("Expected argument 'connector_id' to be a str")
        pulumi.set(__self__, "connector_id", connector_id)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if org_id and not isinstance(org_id, str):
            raise TypeError("Expected argument 'org_id' to be a str")
        pulumi.set(__self__, "org_id", org_id)
        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 projects and not isinstance(projects, list):
            raise TypeError("Expected argument 'projects' to be a list")
        pulumi.set(__self__, "projects", projects)

    @_builtins.property
    @pulumi.getter(name="connectorId")
    def connector_id(self) -> _builtins.str:
        """
        Identifier of the GCP cloud connector or secret manager connector.
        """
        return pulumi.get(self, "connector_id")

    @_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(name="orgId")
    def org_id(self) -> Optional[_builtins.str]:
        """
        Unique identifier of the organization.
        """
        return pulumi.get(self, "org_id")

    @_builtins.property
    @pulumi.getter(name="projectId")
    def project_id(self) -> Optional[_builtins.str]:
        """
        Unique identifier of the project.
        """
        return pulumi.get(self, "project_id")

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


class AwaitableGetGcpProjectsResult(GetGcpProjectsResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetGcpProjectsResult(
            connector_id=self.connector_id,
            id=self.id,
            org_id=self.org_id,
            project_id=self.project_id,
            projects=self.projects)


def get_gcp_projects(connector_id: Optional[_builtins.str] = None,
                     org_id: Optional[_builtins.str] = None,
                     project_id: Optional[_builtins.str] = None,
                     opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetGcpProjectsResult:
    """
    Data source for listing GCP projects using a cloud connector identifier or secret manager connector identifier.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_harness as harness

    # Example: List GCP projects using a GCP cloud connector
    example = harness.platform.get_gcp_projects(connector_id="my_gcp_connector")
    # Example: List GCP projects using a GCP secret manager connector
    example_secret_manager = harness.platform.get_gcp_projects(connector_id="my_gcp_secret_manager_connector")
    # Example: List GCP projects with org and project scope
    example_scoped = harness.platform.get_gcp_projects(connector_id="my_gcp_connector",
        org_id="my_org",
        project_id="my_project")
    pulumi.export("gcpProjects", example.projects)
    ```


    :param _builtins.str connector_id: Identifier of the GCP cloud connector or secret manager connector.
    :param _builtins.str org_id: Unique identifier of the organization.
    :param _builtins.str project_id: Unique identifier of the project.
    """
    __args__ = dict()
    __args__['connectorId'] = connector_id
    __args__['orgId'] = org_id
    __args__['projectId'] = project_id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('harness:platform/getGcpProjects:getGcpProjects', __args__, opts=opts, typ=GetGcpProjectsResult).value

    return AwaitableGetGcpProjectsResult(
        connector_id=pulumi.get(__ret__, 'connector_id'),
        id=pulumi.get(__ret__, 'id'),
        org_id=pulumi.get(__ret__, 'org_id'),
        project_id=pulumi.get(__ret__, 'project_id'),
        projects=pulumi.get(__ret__, 'projects'))
def get_gcp_projects_output(connector_id: Optional[pulumi.Input[_builtins.str]] = None,
                            org_id: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                            project_id: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                            opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetGcpProjectsResult]:
    """
    Data source for listing GCP projects using a cloud connector identifier or secret manager connector identifier.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_harness as harness

    # Example: List GCP projects using a GCP cloud connector
    example = harness.platform.get_gcp_projects(connector_id="my_gcp_connector")
    # Example: List GCP projects using a GCP secret manager connector
    example_secret_manager = harness.platform.get_gcp_projects(connector_id="my_gcp_secret_manager_connector")
    # Example: List GCP projects with org and project scope
    example_scoped = harness.platform.get_gcp_projects(connector_id="my_gcp_connector",
        org_id="my_org",
        project_id="my_project")
    pulumi.export("gcpProjects", example.projects)
    ```


    :param _builtins.str connector_id: Identifier of the GCP cloud connector or secret manager connector.
    :param _builtins.str org_id: Unique identifier of the organization.
    :param _builtins.str project_id: Unique identifier of the project.
    """
    __args__ = dict()
    __args__['connectorId'] = connector_id
    __args__['orgId'] = org_id
    __args__['projectId'] = project_id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('harness:platform/getGcpProjects:getGcpProjects', __args__, opts=opts, typ=GetGcpProjectsResult)
    return __ret__.apply(lambda __response__: GetGcpProjectsResult(
        connector_id=pulumi.get(__response__, 'connector_id'),
        id=pulumi.get(__response__, 'id'),
        org_id=pulumi.get(__response__, 'org_id'),
        project_id=pulumi.get(__response__, 'project_id'),
        projects=pulumi.get(__response__, 'projects')))
