# 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__ = ['DbaasPgDatabaseArgs', 'DbaasPgDatabase']

@pulumi.input_type
class DbaasPgDatabaseArgs:
    def __init__(__self__, *,
                 database_name: pulumi.Input[_builtins.str],
                 service: pulumi.Input[_builtins.str],
                 zone: pulumi.Input[_builtins.str],
                 lc_collate: Optional[pulumi.Input[_builtins.str]] = None,
                 lc_ctype: Optional[pulumi.Input[_builtins.str]] = None,
                 timeouts: Optional[pulumi.Input['DbaasPgDatabaseTimeoutsArgs']] = None):
        """
        The set of arguments for constructing a DbaasPgDatabase resource.
        :param pulumi.Input[_builtins.str] database_name: ❗ The name of the database for this service.
        :param pulumi.Input[_builtins.str] service: ❗ The name of the database service.
        :param pulumi.Input[_builtins.str] zone: ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.
        :param pulumi.Input[_builtins.str] lc_collate: Default string sort order (LC_COLLATE) for PostgreSQL database
        :param pulumi.Input[_builtins.str] lc_ctype: Default character classification (LC_CTYPE) for PostgreSQL database
        """
        pulumi.set(__self__, "database_name", database_name)
        pulumi.set(__self__, "service", service)
        pulumi.set(__self__, "zone", zone)
        if lc_collate is not None:
            pulumi.set(__self__, "lc_collate", lc_collate)
        if lc_ctype is not None:
            pulumi.set(__self__, "lc_ctype", lc_ctype)
        if timeouts is not None:
            pulumi.set(__self__, "timeouts", timeouts)

    @_builtins.property
    @pulumi.getter(name="databaseName")
    def database_name(self) -> pulumi.Input[_builtins.str]:
        """
        ❗ The name of the database for this service.
        """
        return pulumi.get(self, "database_name")

    @database_name.setter
    def database_name(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "database_name", value)

    @_builtins.property
    @pulumi.getter
    def service(self) -> pulumi.Input[_builtins.str]:
        """
        ❗ The name of the database service.
        """
        return pulumi.get(self, "service")

    @service.setter
    def service(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "service", value)

    @_builtins.property
    @pulumi.getter
    def zone(self) -> pulumi.Input[_builtins.str]:
        """
        ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.
        """
        return pulumi.get(self, "zone")

    @zone.setter
    def zone(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "zone", value)

    @_builtins.property
    @pulumi.getter(name="lcCollate")
    def lc_collate(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Default string sort order (LC_COLLATE) for PostgreSQL database
        """
        return pulumi.get(self, "lc_collate")

    @lc_collate.setter
    def lc_collate(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "lc_collate", value)

    @_builtins.property
    @pulumi.getter(name="lcCtype")
    def lc_ctype(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Default character classification (LC_CTYPE) for PostgreSQL database
        """
        return pulumi.get(self, "lc_ctype")

    @lc_ctype.setter
    def lc_ctype(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "lc_ctype", value)

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

    @timeouts.setter
    def timeouts(self, value: Optional[pulumi.Input['DbaasPgDatabaseTimeoutsArgs']]):
        pulumi.set(self, "timeouts", value)


@pulumi.input_type
class _DbaasPgDatabaseState:
    def __init__(__self__, *,
                 database_name: Optional[pulumi.Input[_builtins.str]] = None,
                 lc_collate: Optional[pulumi.Input[_builtins.str]] = None,
                 lc_ctype: Optional[pulumi.Input[_builtins.str]] = None,
                 service: Optional[pulumi.Input[_builtins.str]] = None,
                 timeouts: Optional[pulumi.Input['DbaasPgDatabaseTimeoutsArgs']] = None,
                 zone: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering DbaasPgDatabase resources.
        :param pulumi.Input[_builtins.str] database_name: ❗ The name of the database for this service.
        :param pulumi.Input[_builtins.str] lc_collate: Default string sort order (LC_COLLATE) for PostgreSQL database
        :param pulumi.Input[_builtins.str] lc_ctype: Default character classification (LC_CTYPE) for PostgreSQL database
        :param pulumi.Input[_builtins.str] service: ❗ The name of the database service.
        :param pulumi.Input[_builtins.str] zone: ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.
        """
        if database_name is not None:
            pulumi.set(__self__, "database_name", database_name)
        if lc_collate is not None:
            pulumi.set(__self__, "lc_collate", lc_collate)
        if lc_ctype is not None:
            pulumi.set(__self__, "lc_ctype", lc_ctype)
        if service is not None:
            pulumi.set(__self__, "service", service)
        if timeouts is not None:
            pulumi.set(__self__, "timeouts", timeouts)
        if zone is not None:
            pulumi.set(__self__, "zone", zone)

    @_builtins.property
    @pulumi.getter(name="databaseName")
    def database_name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        ❗ The name of the database for this service.
        """
        return pulumi.get(self, "database_name")

    @database_name.setter
    def database_name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "database_name", value)

    @_builtins.property
    @pulumi.getter(name="lcCollate")
    def lc_collate(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Default string sort order (LC_COLLATE) for PostgreSQL database
        """
        return pulumi.get(self, "lc_collate")

    @lc_collate.setter
    def lc_collate(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "lc_collate", value)

    @_builtins.property
    @pulumi.getter(name="lcCtype")
    def lc_ctype(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Default character classification (LC_CTYPE) for PostgreSQL database
        """
        return pulumi.get(self, "lc_ctype")

    @lc_ctype.setter
    def lc_ctype(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "lc_ctype", value)

    @_builtins.property
    @pulumi.getter
    def service(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        ❗ The name of the database service.
        """
        return pulumi.get(self, "service")

    @service.setter
    def service(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "service", value)

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

    @timeouts.setter
    def timeouts(self, value: Optional[pulumi.Input['DbaasPgDatabaseTimeoutsArgs']]):
        pulumi.set(self, "timeouts", value)

    @_builtins.property
    @pulumi.getter
    def zone(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.
        """
        return pulumi.get(self, "zone")

    @zone.setter
    def zone(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "zone", value)


@pulumi.type_token("exoscale:index/dbaasPgDatabase:DbaasPgDatabase")
class DbaasPgDatabase(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 database_name: Optional[pulumi.Input[_builtins.str]] = None,
                 lc_collate: Optional[pulumi.Input[_builtins.str]] = None,
                 lc_ctype: Optional[pulumi.Input[_builtins.str]] = None,
                 service: Optional[pulumi.Input[_builtins.str]] = None,
                 timeouts: Optional[pulumi.Input[Union['DbaasPgDatabaseTimeoutsArgs', 'DbaasPgDatabaseTimeoutsArgsDict']]] = None,
                 zone: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        ❗ Manage service database for a PostgreSQL Exoscale [Database Services (DBaaS)](https://community.exoscale.com/documentation/dbaas/).

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] database_name: ❗ The name of the database for this service.
        :param pulumi.Input[_builtins.str] lc_collate: Default string sort order (LC_COLLATE) for PostgreSQL database
        :param pulumi.Input[_builtins.str] lc_ctype: Default character classification (LC_CTYPE) for PostgreSQL database
        :param pulumi.Input[_builtins.str] service: ❗ The name of the database service.
        :param pulumi.Input[_builtins.str] zone: ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: DbaasPgDatabaseArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        ❗ Manage service database for a PostgreSQL Exoscale [Database Services (DBaaS)](https://community.exoscale.com/documentation/dbaas/).

        :param str resource_name: The name of the resource.
        :param DbaasPgDatabaseArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(DbaasPgDatabaseArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 database_name: Optional[pulumi.Input[_builtins.str]] = None,
                 lc_collate: Optional[pulumi.Input[_builtins.str]] = None,
                 lc_ctype: Optional[pulumi.Input[_builtins.str]] = None,
                 service: Optional[pulumi.Input[_builtins.str]] = None,
                 timeouts: Optional[pulumi.Input[Union['DbaasPgDatabaseTimeoutsArgs', 'DbaasPgDatabaseTimeoutsArgsDict']]] = None,
                 zone: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = DbaasPgDatabaseArgs.__new__(DbaasPgDatabaseArgs)

            if database_name is None and not opts.urn:
                raise TypeError("Missing required property 'database_name'")
            __props__.__dict__["database_name"] = database_name
            __props__.__dict__["lc_collate"] = lc_collate
            __props__.__dict__["lc_ctype"] = lc_ctype
            if service is None and not opts.urn:
                raise TypeError("Missing required property 'service'")
            __props__.__dict__["service"] = service
            __props__.__dict__["timeouts"] = timeouts
            if zone is None and not opts.urn:
                raise TypeError("Missing required property 'zone'")
            __props__.__dict__["zone"] = zone
        super(DbaasPgDatabase, __self__).__init__(
            'exoscale:index/dbaasPgDatabase:DbaasPgDatabase',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            database_name: Optional[pulumi.Input[_builtins.str]] = None,
            lc_collate: Optional[pulumi.Input[_builtins.str]] = None,
            lc_ctype: Optional[pulumi.Input[_builtins.str]] = None,
            service: Optional[pulumi.Input[_builtins.str]] = None,
            timeouts: Optional[pulumi.Input[Union['DbaasPgDatabaseTimeoutsArgs', 'DbaasPgDatabaseTimeoutsArgsDict']]] = None,
            zone: Optional[pulumi.Input[_builtins.str]] = None) -> 'DbaasPgDatabase':
        """
        Get an existing DbaasPgDatabase resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] database_name: ❗ The name of the database for this service.
        :param pulumi.Input[_builtins.str] lc_collate: Default string sort order (LC_COLLATE) for PostgreSQL database
        :param pulumi.Input[_builtins.str] lc_ctype: Default character classification (LC_CTYPE) for PostgreSQL database
        :param pulumi.Input[_builtins.str] service: ❗ The name of the database service.
        :param pulumi.Input[_builtins.str] zone: ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _DbaasPgDatabaseState.__new__(_DbaasPgDatabaseState)

        __props__.__dict__["database_name"] = database_name
        __props__.__dict__["lc_collate"] = lc_collate
        __props__.__dict__["lc_ctype"] = lc_ctype
        __props__.__dict__["service"] = service
        __props__.__dict__["timeouts"] = timeouts
        __props__.__dict__["zone"] = zone
        return DbaasPgDatabase(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="databaseName")
    def database_name(self) -> pulumi.Output[_builtins.str]:
        """
        ❗ The name of the database for this service.
        """
        return pulumi.get(self, "database_name")

    @_builtins.property
    @pulumi.getter(name="lcCollate")
    def lc_collate(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        Default string sort order (LC_COLLATE) for PostgreSQL database
        """
        return pulumi.get(self, "lc_collate")

    @_builtins.property
    @pulumi.getter(name="lcCtype")
    def lc_ctype(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        Default character classification (LC_CTYPE) for PostgreSQL database
        """
        return pulumi.get(self, "lc_ctype")

    @_builtins.property
    @pulumi.getter
    def service(self) -> pulumi.Output[_builtins.str]:
        """
        ❗ The name of the database service.
        """
        return pulumi.get(self, "service")

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

    @_builtins.property
    @pulumi.getter
    def zone(self) -> pulumi.Output[_builtins.str]:
        """
        ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.
        """
        return pulumi.get(self, "zone")

