# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities
from . import outputs

__all__ = [
    'GetSequencesResult',
    'AwaitableGetSequencesResult',
    'get_sequences',
    'get_sequences_output',
]

@pulumi.output_type
class GetSequencesResult:
    """
    A collection of values returned by getSequences.
    """
    def __init__(__self__, database=None, id=None, like_all_patterns=None, like_any_patterns=None, not_like_all_patterns=None, regex_pattern=None, schemas=None, sequences=None):
        if database and not isinstance(database, str):
            raise TypeError("Expected argument 'database' to be a str")
        pulumi.set(__self__, "database", database)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if like_all_patterns and not isinstance(like_all_patterns, list):
            raise TypeError("Expected argument 'like_all_patterns' to be a list")
        pulumi.set(__self__, "like_all_patterns", like_all_patterns)
        if like_any_patterns and not isinstance(like_any_patterns, list):
            raise TypeError("Expected argument 'like_any_patterns' to be a list")
        pulumi.set(__self__, "like_any_patterns", like_any_patterns)
        if not_like_all_patterns and not isinstance(not_like_all_patterns, list):
            raise TypeError("Expected argument 'not_like_all_patterns' to be a list")
        pulumi.set(__self__, "not_like_all_patterns", not_like_all_patterns)
        if regex_pattern and not isinstance(regex_pattern, str):
            raise TypeError("Expected argument 'regex_pattern' to be a str")
        pulumi.set(__self__, "regex_pattern", regex_pattern)
        if schemas and not isinstance(schemas, list):
            raise TypeError("Expected argument 'schemas' to be a list")
        pulumi.set(__self__, "schemas", schemas)
        if sequences and not isinstance(sequences, list):
            raise TypeError("Expected argument 'sequences' to be a list")
        pulumi.set(__self__, "sequences", sequences)

    @property
    @pulumi.getter
    def database(self) -> str:
        return pulumi.get(self, "database")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="likeAllPatterns")
    def like_all_patterns(self) -> Optional[Sequence[str]]:
        return pulumi.get(self, "like_all_patterns")

    @property
    @pulumi.getter(name="likeAnyPatterns")
    def like_any_patterns(self) -> Optional[Sequence[str]]:
        return pulumi.get(self, "like_any_patterns")

    @property
    @pulumi.getter(name="notLikeAllPatterns")
    def not_like_all_patterns(self) -> Optional[Sequence[str]]:
        return pulumi.get(self, "not_like_all_patterns")

    @property
    @pulumi.getter(name="regexPattern")
    def regex_pattern(self) -> Optional[str]:
        return pulumi.get(self, "regex_pattern")

    @property
    @pulumi.getter
    def schemas(self) -> Optional[Sequence[str]]:
        return pulumi.get(self, "schemas")

    @property
    @pulumi.getter
    def sequences(self) -> Sequence['outputs.GetSequencesSequenceResult']:
        """
        A list of PostgreSQL sequences retrieved by this data source. Each sequence consists of the fields documented below.
        ___
        """
        return pulumi.get(self, "sequences")


class AwaitableGetSequencesResult(GetSequencesResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetSequencesResult(
            database=self.database,
            id=self.id,
            like_all_patterns=self.like_all_patterns,
            like_any_patterns=self.like_any_patterns,
            not_like_all_patterns=self.not_like_all_patterns,
            regex_pattern=self.regex_pattern,
            schemas=self.schemas,
            sequences=self.sequences)


def get_sequences(database: Optional[str] = None,
                  like_all_patterns: Optional[Sequence[str]] = None,
                  like_any_patterns: Optional[Sequence[str]] = None,
                  not_like_all_patterns: Optional[Sequence[str]] = None,
                  regex_pattern: Optional[str] = None,
                  schemas: Optional[Sequence[str]] = None,
                  opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetSequencesResult:
    """
    The `_get_sequences_` data source retrieves a list of sequence names from a specified PostgreSQL database.

    ## Usage

    ```python
    import pulumi
    import pulumi_postgresql as postgresql

    my_sequences = postgresql.get_sequences(database="my_database")
    ```


    :param str database: The PostgreSQL database which will be queried for sequence names.
    :param Sequence[str] like_all_patterns: List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL ``LIKE ALL`` operators.
    :param Sequence[str] like_any_patterns: List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL ``LIKE ANY`` operators.
    :param Sequence[str] not_like_all_patterns: List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL ``NOT LIKE ALL`` operators.
    :param str regex_pattern: Expression which will be pattern matched against sequence names in the query using the PostgreSQL ``~`` (regular expression match) operator.
    :param Sequence[str] schemas: List of PostgreSQL schema(s) which will be queried for sequence names. Queries all schemas in the database by default.
    """
    __args__ = dict()
    __args__['database'] = database
    __args__['likeAllPatterns'] = like_all_patterns
    __args__['likeAnyPatterns'] = like_any_patterns
    __args__['notLikeAllPatterns'] = not_like_all_patterns
    __args__['regexPattern'] = regex_pattern
    __args__['schemas'] = schemas
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('postgresql:index/getSequences:getSequences', __args__, opts=opts, typ=GetSequencesResult).value

    return AwaitableGetSequencesResult(
        database=__ret__.database,
        id=__ret__.id,
        like_all_patterns=__ret__.like_all_patterns,
        like_any_patterns=__ret__.like_any_patterns,
        not_like_all_patterns=__ret__.not_like_all_patterns,
        regex_pattern=__ret__.regex_pattern,
        schemas=__ret__.schemas,
        sequences=__ret__.sequences)


@_utilities.lift_output_func(get_sequences)
def get_sequences_output(database: Optional[pulumi.Input[str]] = None,
                         like_all_patterns: Optional[pulumi.Input[Optional[Sequence[str]]]] = None,
                         like_any_patterns: Optional[pulumi.Input[Optional[Sequence[str]]]] = None,
                         not_like_all_patterns: Optional[pulumi.Input[Optional[Sequence[str]]]] = None,
                         regex_pattern: Optional[pulumi.Input[Optional[str]]] = None,
                         schemas: Optional[pulumi.Input[Optional[Sequence[str]]]] = None,
                         opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetSequencesResult]:
    """
    The `_get_sequences_` data source retrieves a list of sequence names from a specified PostgreSQL database.

    ## Usage

    ```python
    import pulumi
    import pulumi_postgresql as postgresql

    my_sequences = postgresql.get_sequences(database="my_database")
    ```


    :param str database: The PostgreSQL database which will be queried for sequence names.
    :param Sequence[str] like_all_patterns: List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL ``LIKE ALL`` operators.
    :param Sequence[str] like_any_patterns: List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL ``LIKE ANY`` operators.
    :param Sequence[str] not_like_all_patterns: List of expressions which will be pattern matched against sequence names in the query using the PostgreSQL ``NOT LIKE ALL`` operators.
    :param str regex_pattern: Expression which will be pattern matched against sequence names in the query using the PostgreSQL ``~`` (regular expression match) operator.
    :param Sequence[str] schemas: List of PostgreSQL schema(s) which will be queried for sequence names. Queries all schemas in the database by default.
    """
    ...
