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

__all__ = [
    'GetBudgetPoliciesResult',
    'AwaitableGetBudgetPoliciesResult',
    'get_budget_policies',
    'get_budget_policies_output',
]

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

    @_builtins.property
    @pulumi.getter(name="filterBy")
    def filter_by(self) -> Optional['outputs.GetBudgetPoliciesFilterByResult']:
        return pulumi.get(self, "filter_by")

    @_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.GetBudgetPoliciesPolicyResult']:
        return pulumi.get(self, "policies")

    @_builtins.property
    @pulumi.getter(name="sortSpec")
    def sort_spec(self) -> Optional['outputs.GetBudgetPoliciesSortSpecResult']:
        return pulumi.get(self, "sort_spec")


class AwaitableGetBudgetPoliciesResult(GetBudgetPoliciesResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetBudgetPoliciesResult(
            filter_by=self.filter_by,
            id=self.id,
            page_size=self.page_size,
            policies=self.policies,
            sort_spec=self.sort_spec)


def get_budget_policies(filter_by: Optional[Union['GetBudgetPoliciesFilterByArgs', 'GetBudgetPoliciesFilterByArgsDict']] = None,
                        page_size: Optional[_builtins.int] = None,
                        sort_spec: Optional[Union['GetBudgetPoliciesSortSpecArgs', 'GetBudgetPoliciesSortSpecArgsDict']] = None,
                        opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetBudgetPoliciesResult:
    """
    [![Public Preview](https://img.shields.io/badge/Release_Stage-Public_Preview-yellowgreen)](https://docs.databricks.com/aws/en/release-notes/release-types)

    This data source can be used to fetch the list of budget policies.

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

    ## Example Usage

    Getting a list of all budget policies:

    ```python
    import pulumi
    import pulumi_databricks as databricks

    all = databricks.get_budget_policies()
    ```


    :param Union['GetBudgetPoliciesFilterByArgs', 'GetBudgetPoliciesFilterByArgsDict'] filter_by: A filter to apply to the list of policies
    :param _builtins.int page_size: The maximum number of budget policies to return.
           If unspecified, at most 100 budget policies will be returned.
           The maximum value is 1000; values above 1000 will be coerced to 1000
    :param Union['GetBudgetPoliciesSortSpecArgs', 'GetBudgetPoliciesSortSpecArgsDict'] sort_spec: The sort specification
    """
    __args__ = dict()
    __args__['filterBy'] = filter_by
    __args__['pageSize'] = page_size
    __args__['sortSpec'] = sort_spec
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('databricks:index/getBudgetPolicies:getBudgetPolicies', __args__, opts=opts, typ=GetBudgetPoliciesResult).value

    return AwaitableGetBudgetPoliciesResult(
        filter_by=pulumi.get(__ret__, 'filter_by'),
        id=pulumi.get(__ret__, 'id'),
        page_size=pulumi.get(__ret__, 'page_size'),
        policies=pulumi.get(__ret__, 'policies'),
        sort_spec=pulumi.get(__ret__, 'sort_spec'))
def get_budget_policies_output(filter_by: Optional[pulumi.Input[Optional[Union['GetBudgetPoliciesFilterByArgs', 'GetBudgetPoliciesFilterByArgsDict']]]] = None,
                               page_size: Optional[pulumi.Input[Optional[_builtins.int]]] = None,
                               sort_spec: Optional[pulumi.Input[Optional[Union['GetBudgetPoliciesSortSpecArgs', 'GetBudgetPoliciesSortSpecArgsDict']]]] = None,
                               opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetBudgetPoliciesResult]:
    """
    [![Public Preview](https://img.shields.io/badge/Release_Stage-Public_Preview-yellowgreen)](https://docs.databricks.com/aws/en/release-notes/release-types)

    This data source can be used to fetch the list of budget policies.

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

    ## Example Usage

    Getting a list of all budget policies:

    ```python
    import pulumi
    import pulumi_databricks as databricks

    all = databricks.get_budget_policies()
    ```


    :param Union['GetBudgetPoliciesFilterByArgs', 'GetBudgetPoliciesFilterByArgsDict'] filter_by: A filter to apply to the list of policies
    :param _builtins.int page_size: The maximum number of budget policies to return.
           If unspecified, at most 100 budget policies will be returned.
           The maximum value is 1000; values above 1000 will be coerced to 1000
    :param Union['GetBudgetPoliciesSortSpecArgs', 'GetBudgetPoliciesSortSpecArgsDict'] sort_spec: The sort specification
    """
    __args__ = dict()
    __args__['filterBy'] = filter_by
    __args__['pageSize'] = page_size
    __args__['sortSpec'] = sort_spec
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('databricks:index/getBudgetPolicies:getBudgetPolicies', __args__, opts=opts, typ=GetBudgetPoliciesResult)
    return __ret__.apply(lambda __response__: GetBudgetPoliciesResult(
        filter_by=pulumi.get(__response__, 'filter_by'),
        id=pulumi.get(__response__, 'id'),
        page_size=pulumi.get(__response__, 'page_size'),
        policies=pulumi.get(__response__, 'policies'),
        sort_spec=pulumi.get(__response__, 'sort_spec')))
