# 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__ = [
    'GetServiceListResult',
    'AwaitableGetServiceListResult',
    'get_service_list',
    'get_service_list_output',
]

@pulumi.output_type
class GetServiceListResult:
    """
    A collection of values returned by getServiceList.
    """
    def __init__(__self__, id=None, project=None, services=None, timeouts=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if project and not isinstance(project, str):
            raise TypeError("Expected argument 'project' to be a str")
        pulumi.set(__self__, "project", project)
        if services and not isinstance(services, list):
            raise TypeError("Expected argument 'services' to be a list")
        pulumi.set(__self__, "services", services)
        if timeouts and not isinstance(timeouts, dict):
            raise TypeError("Expected argument 'timeouts' to be a dict")
        pulumi.set(__self__, "timeouts", timeouts)

    @_builtins.property
    @pulumi.getter
    def id(self) -> _builtins.str:
        """
        Resource ID, equal to `project`.
        """
        return pulumi.get(self, "id")

    @_builtins.property
    @pulumi.getter
    def project(self) -> _builtins.str:
        """
        Project name.
        """
        return pulumi.get(self, "project")

    @_builtins.property
    @pulumi.getter
    def services(self) -> Optional[Sequence['outputs.GetServiceListServiceResult']]:
        """
        List of services under the project.
        """
        return pulumi.get(self, "services")

    @_builtins.property
    @pulumi.getter
    def timeouts(self) -> Optional['outputs.GetServiceListTimeoutsResult']:
        return pulumi.get(self, "timeouts")


class AwaitableGetServiceListResult(GetServiceListResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetServiceListResult(
            id=self.id,
            project=self.project,
            services=self.services,
            timeouts=self.timeouts)


def get_service_list(project: Optional[_builtins.str] = None,
                     services: Optional[Sequence[Union['GetServiceListServiceArgs', 'GetServiceListServiceArgsDict']]] = None,
                     timeouts: Optional[Union['GetServiceListTimeoutsArgs', 'GetServiceListTimeoutsArgsDict']] = None,
                     opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetServiceListResult:
    """
    A list of all services in a project.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_aiven as aiven

    # Use the `aiven_service_list` data source to query all services in a project.
    all_services = aiven.get_service_list(project="example-project-name")
    pulumi.export("serviceNames", [service.name for service in all_services.services])
    pulumi.export("serviceTypes", [service.service_type for service in all_services.services])
    kafka_services = [service for service in all_services.services if service.service_type == "kafka"]
    pulumi.export("kafkaServiceNames", [service.name for service in kafka_services])
    ```


    :param _builtins.str project: Project name.
    :param Sequence[Union['GetServiceListServiceArgs', 'GetServiceListServiceArgsDict']] services: List of services under the project.
    """
    __args__ = dict()
    __args__['project'] = project
    __args__['services'] = services
    __args__['timeouts'] = timeouts
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('aiven:index/getServiceList:getServiceList', __args__, opts=opts, typ=GetServiceListResult).value

    return AwaitableGetServiceListResult(
        id=pulumi.get(__ret__, 'id'),
        project=pulumi.get(__ret__, 'project'),
        services=pulumi.get(__ret__, 'services'),
        timeouts=pulumi.get(__ret__, 'timeouts'))
def get_service_list_output(project: Optional[pulumi.Input[_builtins.str]] = None,
                            services: Optional[pulumi.Input[Optional[Sequence[Union['GetServiceListServiceArgs', 'GetServiceListServiceArgsDict']]]]] = None,
                            timeouts: Optional[pulumi.Input[Optional[Union['GetServiceListTimeoutsArgs', 'GetServiceListTimeoutsArgsDict']]]] = None,
                            opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetServiceListResult]:
    """
    A list of all services in a project.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_aiven as aiven

    # Use the `aiven_service_list` data source to query all services in a project.
    all_services = aiven.get_service_list(project="example-project-name")
    pulumi.export("serviceNames", [service.name for service in all_services.services])
    pulumi.export("serviceTypes", [service.service_type for service in all_services.services])
    kafka_services = [service for service in all_services.services if service.service_type == "kafka"]
    pulumi.export("kafkaServiceNames", [service.name for service in kafka_services])
    ```


    :param _builtins.str project: Project name.
    :param Sequence[Union['GetServiceListServiceArgs', 'GetServiceListServiceArgsDict']] services: List of services under the project.
    """
    __args__ = dict()
    __args__['project'] = project
    __args__['services'] = services
    __args__['timeouts'] = timeouts
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('aiven:index/getServiceList:getServiceList', __args__, opts=opts, typ=GetServiceListResult)
    return __ret__.apply(lambda __response__: GetServiceListResult(
        id=pulumi.get(__response__, 'id'),
        project=pulumi.get(__response__, 'project'),
        services=pulumi.get(__response__, 'services'),
        timeouts=pulumi.get(__response__, 'timeouts')))
