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

__all__ = [
    'GetInsightsAccountsResult',
    'AwaitableGetInsightsAccountsResult',
    'get_insights_accounts',
    'get_insights_accounts_output',
]

@pulumi.output_type
class GetInsightsAccountsResult:
    def __init__(__self__, accounts=None):
        if accounts and not isinstance(accounts, list):
            raise TypeError("Expected argument 'accounts' to be a list")
        pulumi.set(__self__, "accounts", accounts)

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


class AwaitableGetInsightsAccountsResult(GetInsightsAccountsResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetInsightsAccountsResult(
            accounts=self.accounts)


def get_insights_accounts(organization_name: Optional[_builtins.str] = None,
                          opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetInsightsAccountsResult:
    """
    Get a list of all Insights accounts for an organization.
    """
    __args__ = dict()
    __args__['organizationName'] = organization_name
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('pulumiservice:index:getInsightsAccounts', __args__, opts=opts, typ=GetInsightsAccountsResult).value

    return AwaitableGetInsightsAccountsResult(
        accounts=pulumi.get(__ret__, 'accounts'))
def get_insights_accounts_output(organization_name: Optional[pulumi.Input[_builtins.str]] = None,
                                 opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetInsightsAccountsResult]:
    """
    Get a list of all Insights accounts for an organization.
    """
    __args__ = dict()
    __args__['organizationName'] = organization_name
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('pulumiservice:index:getInsightsAccounts', __args__, opts=opts, typ=GetInsightsAccountsResult)
    return __ret__.apply(lambda __response__: GetInsightsAccountsResult(
        accounts=pulumi.get(__response__, 'accounts')))
