# 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__ = [
    'GetServicePrincipalFederationPoliciesResult',
    'AwaitableGetServicePrincipalFederationPoliciesResult',
    'get_service_principal_federation_policies',
    'get_service_principal_federation_policies_output',
]

@pulumi.output_type
class GetServicePrincipalFederationPoliciesResult:
    """
    A collection of values returned by getServicePrincipalFederationPolicies.
    """
    def __init__(__self__, id=None, page_size=None, policies=None, service_principal_id=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if page_size and not isinstance(page_size, int):
            raise TypeError("Expected argument 'page_size' to be a int")
        pulumi.set(__self__, "page_size", page_size)
        if policies and not isinstance(policies, list):
            raise TypeError("Expected argument 'policies' to be a list")
        pulumi.set(__self__, "policies", policies)
        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)

    @_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="pageSize")
    def page_size(self) -> Optional[_builtins.int]:
        return pulumi.get(self, "page_size")

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

    @_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")


class AwaitableGetServicePrincipalFederationPoliciesResult(GetServicePrincipalFederationPoliciesResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetServicePrincipalFederationPoliciesResult(
            id=self.id,
            page_size=self.page_size,
            policies=self.policies,
            service_principal_id=self.service_principal_id)


def get_service_principal_federation_policies(page_size: Optional[_builtins.int] = None,
                                              service_principal_id: Optional[_builtins.int] = None,
                                              opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetServicePrincipalFederationPoliciesResult:
    """
    [![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 fetch the list of federation policies for a service principal.

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

    ## Example Usage

    Getting a list of all service principal federation policies:

    ```python
    import pulumi
    import pulumi_databricks as databricks

    all = databricks.get_service_principal_federation_policies(service_principal_id=1234)
    ```


    :param _builtins.int service_principal_id: The service principal id for the federation policy
    """
    __args__ = dict()
    __args__['pageSize'] = page_size
    __args__['servicePrincipalId'] = service_principal_id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('databricks:index/getServicePrincipalFederationPolicies:getServicePrincipalFederationPolicies', __args__, opts=opts, typ=GetServicePrincipalFederationPoliciesResult).value

    return AwaitableGetServicePrincipalFederationPoliciesResult(
        id=pulumi.get(__ret__, 'id'),
        page_size=pulumi.get(__ret__, 'page_size'),
        policies=pulumi.get(__ret__, 'policies'),
        service_principal_id=pulumi.get(__ret__, 'service_principal_id'))
def get_service_principal_federation_policies_output(page_size: Optional[pulumi.Input[Optional[_builtins.int]]] = None,
                                                     service_principal_id: Optional[pulumi.Input[_builtins.int]] = None,
                                                     opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetServicePrincipalFederationPoliciesResult]:
    """
    [![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 fetch the list of federation policies for a service principal.

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

    ## Example Usage

    Getting a list of all service principal federation policies:

    ```python
    import pulumi
    import pulumi_databricks as databricks

    all = databricks.get_service_principal_federation_policies(service_principal_id=1234)
    ```


    :param _builtins.int service_principal_id: The service principal id for the federation policy
    """
    __args__ = dict()
    __args__['pageSize'] = page_size
    __args__['servicePrincipalId'] = service_principal_id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('databricks:index/getServicePrincipalFederationPolicies:getServicePrincipalFederationPolicies', __args__, opts=opts, typ=GetServicePrincipalFederationPoliciesResult)
    return __ret__.apply(lambda __response__: GetServicePrincipalFederationPoliciesResult(
        id=pulumi.get(__response__, 'id'),
        page_size=pulumi.get(__response__, 'page_size'),
        policies=pulumi.get(__response__, 'policies'),
        service_principal_id=pulumi.get(__response__, 'service_principal_id')))
