# 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__ = ['DbaasPgUserArgs', 'DbaasPgUser']

@pulumi.input_type
class DbaasPgUserArgs:
    def __init__(__self__, *,
                 service: pulumi.Input[_builtins.str],
                 username: pulumi.Input[_builtins.str],
                 zone: pulumi.Input[_builtins.str],
                 allow_replication: Optional[pulumi.Input[_builtins.bool]] = None,
                 timeouts: Optional[pulumi.Input['DbaasPgUserTimeoutsArgs']] = None):
        """
        The set of arguments for constructing a DbaasPgUser resource.
        :param pulumi.Input[_builtins.str] service: ❗ The name of the database service.
        :param pulumi.Input[_builtins.str] username: ❗ The name of the user for this service.
        :param pulumi.Input[_builtins.str] zone: ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.
        :param pulumi.Input[_builtins.bool] allow_replication: Allows replication
        """
        pulumi.set(__self__, "service", service)
        pulumi.set(__self__, "username", username)
        pulumi.set(__self__, "zone", zone)
        if allow_replication is not None:
            pulumi.set(__self__, "allow_replication", allow_replication)
        if timeouts is not None:
            pulumi.set(__self__, "timeouts", timeouts)

    @_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 username(self) -> pulumi.Input[_builtins.str]:
        """
        ❗ The name of the user for this service.
        """
        return pulumi.get(self, "username")

    @username.setter
    def username(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "username", 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="allowReplication")
    def allow_replication(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Allows replication
        """
        return pulumi.get(self, "allow_replication")

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

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

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


@pulumi.input_type
class _DbaasPgUserState:
    def __init__(__self__, *,
                 allow_replication: Optional[pulumi.Input[_builtins.bool]] = None,
                 password: Optional[pulumi.Input[_builtins.str]] = None,
                 service: Optional[pulumi.Input[_builtins.str]] = None,
                 timeouts: Optional[pulumi.Input['DbaasPgUserTimeoutsArgs']] = None,
                 type: Optional[pulumi.Input[_builtins.str]] = None,
                 username: Optional[pulumi.Input[_builtins.str]] = None,
                 zone: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering DbaasPgUser resources.
        :param pulumi.Input[_builtins.bool] allow_replication: Allows replication
        :param pulumi.Input[_builtins.str] password: The password of the service user.
        :param pulumi.Input[_builtins.str] service: ❗ The name of the database service.
        :param pulumi.Input[_builtins.str] type: The type of the service user.
        :param pulumi.Input[_builtins.str] username: ❗ The name of the user for this service.
        :param pulumi.Input[_builtins.str] zone: ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.
        """
        if allow_replication is not None:
            pulumi.set(__self__, "allow_replication", allow_replication)
        if password is not None:
            pulumi.set(__self__, "password", password)
        if service is not None:
            pulumi.set(__self__, "service", service)
        if timeouts is not None:
            pulumi.set(__self__, "timeouts", timeouts)
        if type is not None:
            pulumi.set(__self__, "type", type)
        if username is not None:
            pulumi.set(__self__, "username", username)
        if zone is not None:
            pulumi.set(__self__, "zone", zone)

    @_builtins.property
    @pulumi.getter(name="allowReplication")
    def allow_replication(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Allows replication
        """
        return pulumi.get(self, "allow_replication")

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

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

    @password.setter
    def password(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "password", 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['DbaasPgUserTimeoutsArgs']]:
        return pulumi.get(self, "timeouts")

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

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

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

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

    @username.setter
    def username(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "username", 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/dbaasPgUser:DbaasPgUser")
class DbaasPgUser(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 allow_replication: Optional[pulumi.Input[_builtins.bool]] = None,
                 service: Optional[pulumi.Input[_builtins.str]] = None,
                 timeouts: Optional[pulumi.Input[Union['DbaasPgUserTimeoutsArgs', 'DbaasPgUserTimeoutsArgsDict']]] = None,
                 username: Optional[pulumi.Input[_builtins.str]] = None,
                 zone: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        ❗ Manage service users 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.bool] allow_replication: Allows replication
        :param pulumi.Input[_builtins.str] service: ❗ The name of the database service.
        :param pulumi.Input[_builtins.str] username: ❗ The name of the user for this service.
        :param pulumi.Input[_builtins.str] zone: ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: DbaasPgUserArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        ❗ Manage service users for a PostgreSQL Exoscale [Database Services (DBaaS)](https://community.exoscale.com/documentation/dbaas/).

        :param str resource_name: The name of the resource.
        :param DbaasPgUserArgs 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(DbaasPgUserArgs, 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,
                 allow_replication: Optional[pulumi.Input[_builtins.bool]] = None,
                 service: Optional[pulumi.Input[_builtins.str]] = None,
                 timeouts: Optional[pulumi.Input[Union['DbaasPgUserTimeoutsArgs', 'DbaasPgUserTimeoutsArgsDict']]] = None,
                 username: Optional[pulumi.Input[_builtins.str]] = 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__ = DbaasPgUserArgs.__new__(DbaasPgUserArgs)

            __props__.__dict__["allow_replication"] = allow_replication
            if service is None and not opts.urn:
                raise TypeError("Missing required property 'service'")
            __props__.__dict__["service"] = service
            __props__.__dict__["timeouts"] = timeouts
            if username is None and not opts.urn:
                raise TypeError("Missing required property 'username'")
            __props__.__dict__["username"] = username
            if zone is None and not opts.urn:
                raise TypeError("Missing required property 'zone'")
            __props__.__dict__["zone"] = zone
            __props__.__dict__["password"] = None
            __props__.__dict__["type"] = None
        secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["password"])
        opts = pulumi.ResourceOptions.merge(opts, secret_opts)
        super(DbaasPgUser, __self__).__init__(
            'exoscale:index/dbaasPgUser:DbaasPgUser',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            allow_replication: Optional[pulumi.Input[_builtins.bool]] = None,
            password: Optional[pulumi.Input[_builtins.str]] = None,
            service: Optional[pulumi.Input[_builtins.str]] = None,
            timeouts: Optional[pulumi.Input[Union['DbaasPgUserTimeoutsArgs', 'DbaasPgUserTimeoutsArgsDict']]] = None,
            type: Optional[pulumi.Input[_builtins.str]] = None,
            username: Optional[pulumi.Input[_builtins.str]] = None,
            zone: Optional[pulumi.Input[_builtins.str]] = None) -> 'DbaasPgUser':
        """
        Get an existing DbaasPgUser 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.bool] allow_replication: Allows replication
        :param pulumi.Input[_builtins.str] password: The password of the service user.
        :param pulumi.Input[_builtins.str] service: ❗ The name of the database service.
        :param pulumi.Input[_builtins.str] type: The type of the service user.
        :param pulumi.Input[_builtins.str] username: ❗ The name of the user for this 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__ = _DbaasPgUserState.__new__(_DbaasPgUserState)

        __props__.__dict__["allow_replication"] = allow_replication
        __props__.__dict__["password"] = password
        __props__.__dict__["service"] = service
        __props__.__dict__["timeouts"] = timeouts
        __props__.__dict__["type"] = type
        __props__.__dict__["username"] = username
        __props__.__dict__["zone"] = zone
        return DbaasPgUser(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="allowReplication")
    def allow_replication(self) -> pulumi.Output[_builtins.bool]:
        """
        Allows replication
        """
        return pulumi.get(self, "allow_replication")

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

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

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

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

    @_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")

