# 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__ = [
    'GetIdpEnvironmentResult',
    'AwaitableGetIdpEnvironmentResult',
    'get_idp_environment',
    'get_idp_environment_output',
]

@pulumi.output_type
class GetIdpEnvironmentResult:
    """
    A collection of values returned by getIdpEnvironment.
    """
    def __init__(__self__, based_on=None, blueprint_identifier=None, blueprint_version=None, id=None, identifier=None, inputs=None, name=None, org_id=None, overrides=None, owner=None, project_id=None, target_state=None):
        if based_on and not isinstance(based_on, str):
            raise TypeError("Expected argument 'based_on' to be a str")
        pulumi.set(__self__, "based_on", based_on)
        if blueprint_identifier and not isinstance(blueprint_identifier, str):
            raise TypeError("Expected argument 'blueprint_identifier' to be a str")
        pulumi.set(__self__, "blueprint_identifier", blueprint_identifier)
        if blueprint_version and not isinstance(blueprint_version, str):
            raise TypeError("Expected argument 'blueprint_version' to be a str")
        pulumi.set(__self__, "blueprint_version", blueprint_version)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if identifier and not isinstance(identifier, str):
            raise TypeError("Expected argument 'identifier' to be a str")
        pulumi.set(__self__, "identifier", identifier)
        if inputs and not isinstance(inputs, str):
            raise TypeError("Expected argument 'inputs' to be a str")
        pulumi.set(__self__, "inputs", inputs)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        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 overrides and not isinstance(overrides, str):
            raise TypeError("Expected argument 'overrides' to be a str")
        pulumi.set(__self__, "overrides", overrides)
        if owner and not isinstance(owner, str):
            raise TypeError("Expected argument 'owner' to be a str")
        pulumi.set(__self__, "owner", owner)
        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 target_state and not isinstance(target_state, str):
            raise TypeError("Expected argument 'target_state' to be a str")
        pulumi.set(__self__, "target_state", target_state)

    @_builtins.property
    @pulumi.getter(name="basedOn")
    def based_on(self) -> _builtins.str:
        """
        Based on environment reference. This should be passed as \\n\\n.\\n\\n/\\n\\n
        """
        return pulumi.get(self, "based_on")

    @_builtins.property
    @pulumi.getter(name="blueprintIdentifier")
    def blueprint_identifier(self) -> _builtins.str:
        """
        Blueprint to base the environment on
        """
        return pulumi.get(self, "blueprint_identifier")

    @_builtins.property
    @pulumi.getter(name="blueprintVersion")
    def blueprint_version(self) -> _builtins.str:
        """
        Version of the blueprint to base the environment on
        """
        return pulumi.get(self, "blueprint_version")

    @_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 identifier(self) -> _builtins.str:
        """
        Unique identifier of the resource.
        """
        return pulumi.get(self, "identifier")

    @_builtins.property
    @pulumi.getter
    def inputs(self) -> _builtins.str:
        """
        Additional inputs for controlling the environment. This should be passed as a map of key-value pairs in YAML format
        """
        return pulumi.get(self, "inputs")

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[_builtins.str]:
        """
        Name of the resource.
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter(name="orgId")
    def org_id(self) -> _builtins.str:
        """
        Unique identifier of the organization.
        """
        return pulumi.get(self, "org_id")

    @_builtins.property
    @pulumi.getter
    def overrides(self) -> _builtins.str:
        """
        Overrides for environment blueprint inputs in YAML format
        """
        return pulumi.get(self, "overrides")

    @_builtins.property
    @pulumi.getter
    def owner(self) -> _builtins.str:
        """
        Owner of the environment
        """
        return pulumi.get(self, "owner")

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

    @_builtins.property
    @pulumi.getter(name="targetState")
    def target_state(self) -> _builtins.str:
        """
        target state of the environment. If different from the current, a pipeline will be triggered to update the environment
        """
        return pulumi.get(self, "target_state")


class AwaitableGetIdpEnvironmentResult(GetIdpEnvironmentResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetIdpEnvironmentResult(
            based_on=self.based_on,
            blueprint_identifier=self.blueprint_identifier,
            blueprint_version=self.blueprint_version,
            id=self.id,
            identifier=self.identifier,
            inputs=self.inputs,
            name=self.name,
            org_id=self.org_id,
            overrides=self.overrides,
            owner=self.owner,
            project_id=self.project_id,
            target_state=self.target_state)


def get_idp_environment(identifier: Optional[_builtins.str] = None,
                        name: Optional[_builtins.str] = None,
                        org_id: Optional[_builtins.str] = None,
                        project_id: Optional[_builtins.str] = None,
                        opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetIdpEnvironmentResult:
    """
    Data source for retrieving IDP environments.


    :param _builtins.str identifier: Unique identifier of the resource.
    :param _builtins.str name: Name of the resource.
    :param _builtins.str org_id: Unique identifier of the organization.
    :param _builtins.str project_id: Unique identifier of the project.
    """
    __args__ = dict()
    __args__['identifier'] = identifier
    __args__['name'] = name
    __args__['orgId'] = org_id
    __args__['projectId'] = project_id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('harness:platform/getIdpEnvironment:getIdpEnvironment', __args__, opts=opts, typ=GetIdpEnvironmentResult).value

    return AwaitableGetIdpEnvironmentResult(
        based_on=pulumi.get(__ret__, 'based_on'),
        blueprint_identifier=pulumi.get(__ret__, 'blueprint_identifier'),
        blueprint_version=pulumi.get(__ret__, 'blueprint_version'),
        id=pulumi.get(__ret__, 'id'),
        identifier=pulumi.get(__ret__, 'identifier'),
        inputs=pulumi.get(__ret__, 'inputs'),
        name=pulumi.get(__ret__, 'name'),
        org_id=pulumi.get(__ret__, 'org_id'),
        overrides=pulumi.get(__ret__, 'overrides'),
        owner=pulumi.get(__ret__, 'owner'),
        project_id=pulumi.get(__ret__, 'project_id'),
        target_state=pulumi.get(__ret__, 'target_state'))
def get_idp_environment_output(identifier: Optional[pulumi.Input[_builtins.str]] = None,
                               name: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                               org_id: Optional[pulumi.Input[_builtins.str]] = None,
                               project_id: Optional[pulumi.Input[_builtins.str]] = None,
                               opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetIdpEnvironmentResult]:
    """
    Data source for retrieving IDP environments.


    :param _builtins.str identifier: Unique identifier of the resource.
    :param _builtins.str name: Name of the resource.
    :param _builtins.str org_id: Unique identifier of the organization.
    :param _builtins.str project_id: Unique identifier of the project.
    """
    __args__ = dict()
    __args__['identifier'] = identifier
    __args__['name'] = name
    __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/getIdpEnvironment:getIdpEnvironment', __args__, opts=opts, typ=GetIdpEnvironmentResult)
    return __ret__.apply(lambda __response__: GetIdpEnvironmentResult(
        based_on=pulumi.get(__response__, 'based_on'),
        blueprint_identifier=pulumi.get(__response__, 'blueprint_identifier'),
        blueprint_version=pulumi.get(__response__, 'blueprint_version'),
        id=pulumi.get(__response__, 'id'),
        identifier=pulumi.get(__response__, 'identifier'),
        inputs=pulumi.get(__response__, 'inputs'),
        name=pulumi.get(__response__, 'name'),
        org_id=pulumi.get(__response__, 'org_id'),
        overrides=pulumi.get(__response__, 'overrides'),
        owner=pulumi.get(__response__, 'owner'),
        project_id=pulumi.get(__response__, 'project_id'),
        target_state=pulumi.get(__response__, 'target_state')))
