# coding=utf-8
# *** WARNING: this file was generated by pulumigen. ***
# *** 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
from ._enums import *

__all__ = [
    'CidrBlockAndDescription',
    'ListPostgresBackupItemProperties',
    'ListPostgresItemProperties',
    'Owner',
    'Postgres',
    'ReadReplica',
    'RedisDetailpropertiesmaintenance',
]

@pulumi.output_type
class CidrBlockAndDescription(dict):
    @staticmethod
    def __key_warning(key: str):
        suggest = None
        if key == "cidrBlock":
            suggest = "cidr_block"

        if suggest:
            pulumi.log.warn(f"Key '{key}' not found in CidrBlockAndDescription. Access the value via the '{suggest}' property getter instead.")

    def __getitem__(self, key: str) -> Any:
        CidrBlockAndDescription.__key_warning(key)
        return super().__getitem__(key)

    def get(self, key: str, default = None) -> Any:
        CidrBlockAndDescription.__key_warning(key)
        return super().get(key, default)

    def __init__(__self__, *,
                 cidr_block: str,
                 description: str):
        """
        :param str description: User-provided description of the CIDR block
        """
        pulumi.set(__self__, "cidr_block", cidr_block)
        pulumi.set(__self__, "description", description)

    @property
    @pulumi.getter(name="cidrBlock")
    def cidr_block(self) -> str:
        return pulumi.get(self, "cidr_block")

    @property
    @pulumi.getter
    def description(self) -> str:
        """
        User-provided description of the CIDR block
        """
        return pulumi.get(self, "description")


@pulumi.output_type
class ListPostgresBackupItemProperties(dict):
    def __init__(__self__, *,
                 created_at: str,
                 id: str,
                 url: Optional[str] = None):
        """
        :param str url: URL to download the Postgres backup
        """
        pulumi.set(__self__, "created_at", created_at)
        pulumi.set(__self__, "id", id)
        if url is not None:
            pulumi.set(__self__, "url", url)

    @property
    @pulumi.getter(name="createdAt")
    def created_at(self) -> str:
        return pulumi.get(self, "created_at")

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

    @property
    @pulumi.getter
    def url(self) -> Optional[str]:
        """
        URL to download the Postgres backup
        """
        return pulumi.get(self, "url")


@pulumi.output_type
class ListPostgresItemProperties(dict):
    def __init__(__self__, *,
                 cursor: Optional[str] = None,
                 postgres: Optional['outputs.Postgres'] = None):
        if cursor is not None:
            pulumi.set(__self__, "cursor", cursor)
        if postgres is not None:
            pulumi.set(__self__, "postgres", postgres)

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

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


@pulumi.output_type
class Owner(dict):
    @staticmethod
    def __key_warning(key: str):
        suggest = None
        if key == "twoFactorAuthEnabled":
            suggest = "two_factor_auth_enabled"

        if suggest:
            pulumi.log.warn(f"Key '{key}' not found in Owner. Access the value via the '{suggest}' property getter instead.")

    def __getitem__(self, key: str) -> Any:
        Owner.__key_warning(key)
        return super().__getitem__(key)

    def get(self, key: str, default = None) -> Any:
        Owner.__key_warning(key)
        return super().get(key, default)

    def __init__(__self__, *,
                 email: str,
                 id: str,
                 name: str,
                 type: 'OwnerType',
                 two_factor_auth_enabled: Optional[bool] = None):
        """
        :param bool two_factor_auth_enabled: Whether two-factor authentication is enabled for the owner. Only present for user owners.
        """
        pulumi.set(__self__, "email", email)
        pulumi.set(__self__, "id", id)
        pulumi.set(__self__, "name", name)
        pulumi.set(__self__, "type", type)
        if two_factor_auth_enabled is not None:
            pulumi.set(__self__, "two_factor_auth_enabled", two_factor_auth_enabled)

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

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

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

    @property
    @pulumi.getter
    def type(self) -> 'OwnerType':
        return pulumi.get(self, "type")

    @property
    @pulumi.getter(name="twoFactorAuthEnabled")
    def two_factor_auth_enabled(self) -> Optional[bool]:
        """
        Whether two-factor authentication is enabled for the owner. Only present for user owners.
        """
        return pulumi.get(self, "two_factor_auth_enabled")


@pulumi.output_type
class Postgres(dict):
    def __init__(__self__, *,
                 created_at: str,
                 dashboard_url: str,
                 database_name: str,
                 database_user: str,
                 high_availability_enabled: bool,
                 id: str,
                 ip_allow_list: Sequence['outputs.CidrBlockAndDescription'],
                 name: str,
                 owner: 'outputs.Owner',
                 plan: 'PostgresPlan',
                 read_replicas: Sequence['outputs.ReadReplica'],
                 region: Optional['PostgresRegion'] = None,
                 role: 'PostgresRole',
                 status: 'PostgresStatus',
                 suspended: 'PostgresSuspended',
                 suspenders: Sequence['PostgresSuspendersItem'],
                 updated_at: str,
                 version: 'PostgresVersion',
                 disk_size_gb: Optional[int] = None,
                 environment_id: Optional[str] = None,
                 expires_at: Optional[str] = None,
                 primary_postgres_id: Optional[str] = None):
        """
        :param str dashboard_url: The URL to view the PostgreSQL instance in the Render Dashboard
        :param 'PostgresRegion' region: Defaults to "oregon"
        :param 'PostgresVersion' version: The PostgreSQL version
        :param str expires_at: The time at which the database will be expire. Applies to free tier databases only.
        """
        pulumi.set(__self__, "created_at", created_at)
        pulumi.set(__self__, "dashboard_url", dashboard_url)
        pulumi.set(__self__, "database_name", database_name)
        pulumi.set(__self__, "database_user", database_user)
        pulumi.set(__self__, "high_availability_enabled", high_availability_enabled)
        pulumi.set(__self__, "id", id)
        pulumi.set(__self__, "ip_allow_list", ip_allow_list)
        pulumi.set(__self__, "name", name)
        pulumi.set(__self__, "owner", owner)
        pulumi.set(__self__, "plan", plan)
        pulumi.set(__self__, "read_replicas", read_replicas)
        if region is None:
            region = 'oregon'
        pulumi.set(__self__, "region", region)
        pulumi.set(__self__, "role", role)
        pulumi.set(__self__, "status", status)
        pulumi.set(__self__, "suspended", suspended)
        pulumi.set(__self__, "suspenders", suspenders)
        pulumi.set(__self__, "updated_at", updated_at)
        pulumi.set(__self__, "version", version)
        if disk_size_gb is not None:
            pulumi.set(__self__, "disk_size_gb", disk_size_gb)
        if environment_id is not None:
            pulumi.set(__self__, "environment_id", environment_id)
        if expires_at is not None:
            pulumi.set(__self__, "expires_at", expires_at)
        if primary_postgres_id is not None:
            pulumi.set(__self__, "primary_postgres_id", primary_postgres_id)

    @property
    @pulumi.getter(name="createdAt")
    def created_at(self) -> str:
        return pulumi.get(self, "created_at")

    @property
    @pulumi.getter(name="dashboardUrl")
    def dashboard_url(self) -> str:
        """
        The URL to view the PostgreSQL instance in the Render Dashboard
        """
        return pulumi.get(self, "dashboard_url")

    @property
    @pulumi.getter(name="databaseName")
    def database_name(self) -> str:
        return pulumi.get(self, "database_name")

    @property
    @pulumi.getter(name="databaseUser")
    def database_user(self) -> str:
        return pulumi.get(self, "database_user")

    @property
    @pulumi.getter(name="highAvailabilityEnabled")
    def high_availability_enabled(self) -> bool:
        return pulumi.get(self, "high_availability_enabled")

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

    @property
    @pulumi.getter(name="ipAllowList")
    def ip_allow_list(self) -> Sequence['outputs.CidrBlockAndDescription']:
        return pulumi.get(self, "ip_allow_list")

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

    @property
    @pulumi.getter
    def owner(self) -> 'outputs.Owner':
        return pulumi.get(self, "owner")

    @property
    @pulumi.getter
    def plan(self) -> 'PostgresPlan':
        return pulumi.get(self, "plan")

    @property
    @pulumi.getter(name="readReplicas")
    def read_replicas(self) -> Sequence['outputs.ReadReplica']:
        return pulumi.get(self, "read_replicas")

    @property
    @pulumi.getter
    def region(self) -> 'PostgresRegion':
        """
        Defaults to "oregon"
        """
        return pulumi.get(self, "region")

    @property
    @pulumi.getter
    def role(self) -> 'PostgresRole':
        return pulumi.get(self, "role")

    @property
    @pulumi.getter
    def status(self) -> 'PostgresStatus':
        return pulumi.get(self, "status")

    @property
    @pulumi.getter
    def suspended(self) -> 'PostgresSuspended':
        return pulumi.get(self, "suspended")

    @property
    @pulumi.getter
    def suspenders(self) -> Sequence['PostgresSuspendersItem']:
        return pulumi.get(self, "suspenders")

    @property
    @pulumi.getter(name="updatedAt")
    def updated_at(self) -> str:
        return pulumi.get(self, "updated_at")

    @property
    @pulumi.getter
    def version(self) -> 'PostgresVersion':
        """
        The PostgreSQL version
        """
        return pulumi.get(self, "version")

    @property
    @pulumi.getter(name="diskSizeGB")
    def disk_size_gb(self) -> Optional[int]:
        return pulumi.get(self, "disk_size_gb")

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

    @property
    @pulumi.getter(name="expiresAt")
    def expires_at(self) -> Optional[str]:
        """
        The time at which the database will be expire. Applies to free tier databases only.
        """
        return pulumi.get(self, "expires_at")

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


@pulumi.output_type
class ReadReplica(dict):
    def __init__(__self__, *,
                 id: str,
                 name: str):
        """
        :param str id: The replica instance identifier.
        :param str name: The display name of the replica instance.
        """
        pulumi.set(__self__, "id", id)
        pulumi.set(__self__, "name", name)

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The replica instance identifier.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        The display name of the replica instance.
        """
        return pulumi.get(self, "name")


@pulumi.output_type
class RedisDetailpropertiesmaintenance(dict):
    @staticmethod
    def __key_warning(key: str):
        suggest = None
        if key == "scheduledAt":
            suggest = "scheduled_at"
        elif key == "pendingMaintenanceBy":
            suggest = "pending_maintenance_by"

        if suggest:
            pulumi.log.warn(f"Key '{key}' not found in RedisDetailpropertiesmaintenance. Access the value via the '{suggest}' property getter instead.")

    def __getitem__(self, key: str) -> Any:
        RedisDetailpropertiesmaintenance.__key_warning(key)
        return super().__getitem__(key)

    def get(self, key: str, default = None) -> Any:
        RedisDetailpropertiesmaintenance.__key_warning(key)
        return super().get(key, default)

    def __init__(__self__, *,
                 id: str,
                 scheduled_at: str,
                 state: 'RedisDetailpropertiesmaintenanceState',
                 type: str,
                 pending_maintenance_by: Optional[str] = None):
        """
        :param str pending_maintenance_by: If present, the maintenance run cannot be scheduled for later than this date-time.
        """
        pulumi.set(__self__, "id", id)
        pulumi.set(__self__, "scheduled_at", scheduled_at)
        pulumi.set(__self__, "state", state)
        pulumi.set(__self__, "type", type)
        if pending_maintenance_by is not None:
            pulumi.set(__self__, "pending_maintenance_by", pending_maintenance_by)

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

    @property
    @pulumi.getter(name="scheduledAt")
    def scheduled_at(self) -> str:
        return pulumi.get(self, "scheduled_at")

    @property
    @pulumi.getter
    def state(self) -> 'RedisDetailpropertiesmaintenanceState':
        return pulumi.get(self, "state")

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

    @property
    @pulumi.getter(name="pendingMaintenanceBy")
    def pending_maintenance_by(self) -> Optional[str]:
        """
        If present, the maintenance run cannot be scheduled for later than this date-time.
        """
        return pulumi.get(self, "pending_maintenance_by")


