# 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__ = [
    'GetServicePrincipalFederationPolicyResult',
    'AwaitableGetServicePrincipalFederationPolicyResult',
    'get_service_principal_federation_policy',
    'get_service_principal_federation_policy_output',
]

@pulumi.output_type
class GetServicePrincipalFederationPolicyResult:
    """
    A collection of values returned by getServicePrincipalFederationPolicy.
    """
    def __init__(__self__, create_time=None, description=None, id=None, name=None, oidc_policy=None, policy_id=None, service_principal_id=None, uid=None, update_time=None):
        if create_time and not isinstance(create_time, str):
            raise TypeError("Expected argument 'create_time' to be a str")
        pulumi.set(__self__, "create_time", create_time)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if oidc_policy and not isinstance(oidc_policy, dict):
            raise TypeError("Expected argument 'oidc_policy' to be a dict")
        pulumi.set(__self__, "oidc_policy", oidc_policy)
        if policy_id and not isinstance(policy_id, str):
            raise TypeError("Expected argument 'policy_id' to be a str")
        pulumi.set(__self__, "policy_id", policy_id)
        if service_principal_id and not isinstance(service_principal_id, int):
            raise TypeError("Expected argument 'service_principal_id' to be a int")
        pulumi.set(__self__, "service_principal_id", service_principal_id)
        if uid and not isinstance(uid, str):
            raise TypeError("Expected argument 'uid' to be a str")
        pulumi.set(__self__, "uid", uid)
        if update_time and not isinstance(update_time, str):
            raise TypeError("Expected argument 'update_time' to be a str")
        pulumi.set(__self__, "update_time", update_time)

    @_builtins.property
    @pulumi.getter(name="createTime")
    def create_time(self) -> _builtins.str:
        """
        (string) - Creation time of the federation policy
        """
        return pulumi.get(self, "create_time")

    @_builtins.property
    @pulumi.getter
    def description(self) -> _builtins.str:
        """
        (string) - Description of the federation policy
        """
        return pulumi.get(self, "description")

    @_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 name(self) -> _builtins.str:
        """
        (string) - Resource name for the federation policy. Example values include
        `accounts/<account-id>/federationPolicies/my-federation-policy` for Account Federation Policies, and
        `accounts/<account-id>/servicePrincipals/<service-principal-id>/federationPolicies/my-federation-policy`
        for Service Principal Federation Policies. Typically an output parameter, which does not need to be
        specified in create or update requests. If specified in a request, must match the value in the
        request URL
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter(name="oidcPolicy")
    def oidc_policy(self) -> 'outputs.GetServicePrincipalFederationPolicyOidcPolicyResult':
        """
        (OidcFederationPolicy)
        """
        return pulumi.get(self, "oidc_policy")

    @_builtins.property
    @pulumi.getter(name="policyId")
    def policy_id(self) -> _builtins.str:
        """
        (string) - The ID of the federation policy. Output only
        """
        return pulumi.get(self, "policy_id")

    @_builtins.property
    @pulumi.getter(name="servicePrincipalId")
    def service_principal_id(self) -> _builtins.int:
        """
        (integer) - The service principal ID that this federation policy applies to. Output only. Only set for service principal federation policies
        """
        return pulumi.get(self, "service_principal_id")

    @_builtins.property
    @pulumi.getter
    def uid(self) -> _builtins.str:
        """
        (string) - Unique, immutable id of the federation policy
        """
        return pulumi.get(self, "uid")

    @_builtins.property
    @pulumi.getter(name="updateTime")
    def update_time(self) -> _builtins.str:
        """
        (string) - Last update time of the federation policy
        """
        return pulumi.get(self, "update_time")


class AwaitableGetServicePrincipalFederationPolicyResult(GetServicePrincipalFederationPolicyResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetServicePrincipalFederationPolicyResult(
            create_time=self.create_time,
            description=self.description,
            id=self.id,
            name=self.name,
            oidc_policy=self.oidc_policy,
            policy_id=self.policy_id,
            service_principal_id=self.service_principal_id,
            uid=self.uid,
            update_time=self.update_time)


def get_service_principal_federation_policy(policy_id: Optional[_builtins.str] = None,
                                            service_principal_id: Optional[_builtins.int] = None,
                                            opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetServicePrincipalFederationPolicyResult:
    """
    [![GA](https://img.shields.io/badge/Release_Stage-GA-green)](https://docs.databricks.com/aws/en/release-notes/release-types)

    This data source can be used to get a single service principal federation policy.

    > **Note** This data source can only be used with an account-level provider!

    ## Example Usage

    Referring to a service principal federation policy by id:


    :param _builtins.str policy_id: The ID of the federation policy. Output only
    :param _builtins.int service_principal_id: The service principal ID that this federation policy applies to. Output only. Only set for service principal federation policies
    """
    __args__ = dict()
    __args__['policyId'] = policy_id
    __args__['servicePrincipalId'] = service_principal_id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('databricks:index/getServicePrincipalFederationPolicy:getServicePrincipalFederationPolicy', __args__, opts=opts, typ=GetServicePrincipalFederationPolicyResult).value

    return AwaitableGetServicePrincipalFederationPolicyResult(
        create_time=pulumi.get(__ret__, 'create_time'),
        description=pulumi.get(__ret__, 'description'),
        id=pulumi.get(__ret__, 'id'),
        name=pulumi.get(__ret__, 'name'),
        oidc_policy=pulumi.get(__ret__, 'oidc_policy'),
        policy_id=pulumi.get(__ret__, 'policy_id'),
        service_principal_id=pulumi.get(__ret__, 'service_principal_id'),
        uid=pulumi.get(__ret__, 'uid'),
        update_time=pulumi.get(__ret__, 'update_time'))
def get_service_principal_federation_policy_output(policy_id: Optional[pulumi.Input[_builtins.str]] = None,
                                                   service_principal_id: Optional[pulumi.Input[_builtins.int]] = None,
                                                   opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetServicePrincipalFederationPolicyResult]:
    """
    [![GA](https://img.shields.io/badge/Release_Stage-GA-green)](https://docs.databricks.com/aws/en/release-notes/release-types)

    This data source can be used to get a single service principal federation policy.

    > **Note** This data source can only be used with an account-level provider!

    ## Example Usage

    Referring to a service principal federation policy by id:


    :param _builtins.str policy_id: The ID of the federation policy. Output only
    :param _builtins.int service_principal_id: The service principal ID that this federation policy applies to. Output only. Only set for service principal federation policies
    """
    __args__ = dict()
    __args__['policyId'] = policy_id
    __args__['servicePrincipalId'] = service_principal_id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('databricks:index/getServicePrincipalFederationPolicy:getServicePrincipalFederationPolicy', __args__, opts=opts, typ=GetServicePrincipalFederationPolicyResult)
    return __ret__.apply(lambda __response__: GetServicePrincipalFederationPolicyResult(
        create_time=pulumi.get(__response__, 'create_time'),
        description=pulumi.get(__response__, 'description'),
        id=pulumi.get(__response__, 'id'),
        name=pulumi.get(__response__, 'name'),
        oidc_policy=pulumi.get(__response__, 'oidc_policy'),
        policy_id=pulumi.get(__response__, 'policy_id'),
        service_principal_id=pulumi.get(__response__, 'service_principal_id'),
        uid=pulumi.get(__response__, 'uid'),
        update_time=pulumi.get(__response__, 'update_time')))
