# 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__ = ['PostgresBranchArgs', 'PostgresBranch']

@pulumi.input_type
class PostgresBranchArgs:
    def __init__(__self__, *,
                 branch_id: pulumi.Input[_builtins.str],
                 parent: pulumi.Input[_builtins.str],
                 provider_config: Optional[pulumi.Input['PostgresBranchProviderConfigArgs']] = None,
                 spec: Optional[pulumi.Input['PostgresBranchSpecArgs']] = None):
        """
        The set of arguments for constructing a PostgresBranch resource.
        :param pulumi.Input[_builtins.str] branch_id: The ID to use for the Branch. This becomes the final component of the branch's resource name.
               The ID is required and must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens.
               For example, `development` becomes `projects/my-app/branches/development`
        :param pulumi.Input[_builtins.str] parent: The project containing this branch (API resource hierarchy).
               Format: projects/{project_id}
               
               Note: This field indicates where the branch exists in the resource hierarchy.
               For point-in-time branching from another branch, see `status.source_branch`
        :param pulumi.Input['PostgresBranchProviderConfigArgs'] provider_config: Configure the provider for management through account provider.
        :param pulumi.Input['PostgresBranchSpecArgs'] spec: The spec contains the branch configuration
        """
        pulumi.set(__self__, "branch_id", branch_id)
        pulumi.set(__self__, "parent", parent)
        if provider_config is not None:
            pulumi.set(__self__, "provider_config", provider_config)
        if spec is not None:
            pulumi.set(__self__, "spec", spec)

    @_builtins.property
    @pulumi.getter(name="branchId")
    def branch_id(self) -> pulumi.Input[_builtins.str]:
        """
        The ID to use for the Branch. This becomes the final component of the branch's resource name.
        The ID is required and must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens.
        For example, `development` becomes `projects/my-app/branches/development`
        """
        return pulumi.get(self, "branch_id")

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

    @_builtins.property
    @pulumi.getter
    def parent(self) -> pulumi.Input[_builtins.str]:
        """
        The project containing this branch (API resource hierarchy).
        Format: projects/{project_id}

        Note: This field indicates where the branch exists in the resource hierarchy.
        For point-in-time branching from another branch, see `status.source_branch`
        """
        return pulumi.get(self, "parent")

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

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> Optional[pulumi.Input['PostgresBranchProviderConfigArgs']]:
        """
        Configure the provider for management through account provider.
        """
        return pulumi.get(self, "provider_config")

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

    @_builtins.property
    @pulumi.getter
    def spec(self) -> Optional[pulumi.Input['PostgresBranchSpecArgs']]:
        """
        The spec contains the branch configuration
        """
        return pulumi.get(self, "spec")

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


@pulumi.input_type
class _PostgresBranchState:
    def __init__(__self__, *,
                 branch_id: Optional[pulumi.Input[_builtins.str]] = None,
                 create_time: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 parent: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_config: Optional[pulumi.Input['PostgresBranchProviderConfigArgs']] = None,
                 spec: Optional[pulumi.Input['PostgresBranchSpecArgs']] = None,
                 status: Optional[pulumi.Input['PostgresBranchStatusArgs']] = None,
                 uid: Optional[pulumi.Input[_builtins.str]] = None,
                 update_time: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering PostgresBranch resources.
        :param pulumi.Input[_builtins.str] branch_id: The ID to use for the Branch. This becomes the final component of the branch's resource name.
               The ID is required and must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens.
               For example, `development` becomes `projects/my-app/branches/development`
        :param pulumi.Input[_builtins.str] create_time: (string) - A timestamp indicating when the branch was created
        :param pulumi.Input[_builtins.str] name: (string) - Output only. The full resource path of the branch.
               Format: projects/{project_id}/branches/{branch_id}
        :param pulumi.Input[_builtins.str] parent: The project containing this branch (API resource hierarchy).
               Format: projects/{project_id}
               
               Note: This field indicates where the branch exists in the resource hierarchy.
               For point-in-time branching from another branch, see `status.source_branch`
        :param pulumi.Input['PostgresBranchProviderConfigArgs'] provider_config: Configure the provider for management through account provider.
        :param pulumi.Input['PostgresBranchSpecArgs'] spec: The spec contains the branch configuration
        :param pulumi.Input['PostgresBranchStatusArgs'] status: (BranchStatus) - The current status of a Branch
        :param pulumi.Input[_builtins.str] uid: (string) - System-generated unique ID for the branch
        :param pulumi.Input[_builtins.str] update_time: (string) - A timestamp indicating when the branch was last updated
        """
        if branch_id is not None:
            pulumi.set(__self__, "branch_id", branch_id)
        if create_time is not None:
            pulumi.set(__self__, "create_time", create_time)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if parent is not None:
            pulumi.set(__self__, "parent", parent)
        if provider_config is not None:
            pulumi.set(__self__, "provider_config", provider_config)
        if spec is not None:
            pulumi.set(__self__, "spec", spec)
        if status is not None:
            pulumi.set(__self__, "status", status)
        if uid is not None:
            pulumi.set(__self__, "uid", uid)
        if update_time is not None:
            pulumi.set(__self__, "update_time", update_time)

    @_builtins.property
    @pulumi.getter(name="branchId")
    def branch_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID to use for the Branch. This becomes the final component of the branch's resource name.
        The ID is required and must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens.
        For example, `development` becomes `projects/my-app/branches/development`
        """
        return pulumi.get(self, "branch_id")

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

    @_builtins.property
    @pulumi.getter(name="createTime")
    def create_time(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (string) - A timestamp indicating when the branch was created
        """
        return pulumi.get(self, "create_time")

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

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (string) - Output only. The full resource path of the branch.
        Format: projects/{project_id}/branches/{branch_id}
        """
        return pulumi.get(self, "name")

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

    @_builtins.property
    @pulumi.getter
    def parent(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The project containing this branch (API resource hierarchy).
        Format: projects/{project_id}

        Note: This field indicates where the branch exists in the resource hierarchy.
        For point-in-time branching from another branch, see `status.source_branch`
        """
        return pulumi.get(self, "parent")

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

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> Optional[pulumi.Input['PostgresBranchProviderConfigArgs']]:
        """
        Configure the provider for management through account provider.
        """
        return pulumi.get(self, "provider_config")

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

    @_builtins.property
    @pulumi.getter
    def spec(self) -> Optional[pulumi.Input['PostgresBranchSpecArgs']]:
        """
        The spec contains the branch configuration
        """
        return pulumi.get(self, "spec")

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

    @_builtins.property
    @pulumi.getter
    def status(self) -> Optional[pulumi.Input['PostgresBranchStatusArgs']]:
        """
        (BranchStatus) - The current status of a Branch
        """
        return pulumi.get(self, "status")

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

    @_builtins.property
    @pulumi.getter
    def uid(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (string) - System-generated unique ID for the branch
        """
        return pulumi.get(self, "uid")

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

    @_builtins.property
    @pulumi.getter(name="updateTime")
    def update_time(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (string) - A timestamp indicating when the branch was last updated
        """
        return pulumi.get(self, "update_time")

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


@pulumi.type_token("databricks:index/postgresBranch:PostgresBranch")
class PostgresBranch(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 branch_id: Optional[pulumi.Input[_builtins.str]] = None,
                 parent: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_config: Optional[pulumi.Input[Union['PostgresBranchProviderConfigArgs', 'PostgresBranchProviderConfigArgsDict']]] = None,
                 spec: Optional[pulumi.Input[Union['PostgresBranchSpecArgs', 'PostgresBranchSpecArgsDict']]] = None,
                 __props__=None):
        """
        [![Public Beta](https://img.shields.io/badge/Release_Stage-Public_Beta-orange)](https://docs.databricks.com/aws/en/release-notes/release-types)

        ## Example Usage

        ### Basic Branch Creation

        ```python
        import pulumi
        import pulumi_databricks as databricks

        this = databricks.PostgresProject("this",
            project_id="my-project",
            spec={
                "pg_version": 17,
                "display_name": "My Project",
            })
        dev = databricks.PostgresBranch("dev",
            branch_id="dev-branch",
            parent=this.name,
            spec={
                "no_expiry": True,
            })
        ```

        ### Protected Branch

        ```python
        import pulumi
        import pulumi_databricks as databricks

        production = databricks.PostgresBranch("production",
            branch_id="production",
            parent=this["name"],
            spec={
                "is_protected": True,
                "no_expiry": True,
            })
        ```

        ### Branch with Expiration (TTL)

        ```python
        import pulumi
        import pulumi_databricks as databricks

        temporary = databricks.PostgresBranch("temporary",
            branch_id="temp-feature-test",
            parent=this["name"],
            spec={
                "ttl": "604800s",
            })
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] branch_id: The ID to use for the Branch. This becomes the final component of the branch's resource name.
               The ID is required and must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens.
               For example, `development` becomes `projects/my-app/branches/development`
        :param pulumi.Input[_builtins.str] parent: The project containing this branch (API resource hierarchy).
               Format: projects/{project_id}
               
               Note: This field indicates where the branch exists in the resource hierarchy.
               For point-in-time branching from another branch, see `status.source_branch`
        :param pulumi.Input[Union['PostgresBranchProviderConfigArgs', 'PostgresBranchProviderConfigArgsDict']] provider_config: Configure the provider for management through account provider.
        :param pulumi.Input[Union['PostgresBranchSpecArgs', 'PostgresBranchSpecArgsDict']] spec: The spec contains the branch configuration
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: PostgresBranchArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        [![Public Beta](https://img.shields.io/badge/Release_Stage-Public_Beta-orange)](https://docs.databricks.com/aws/en/release-notes/release-types)

        ## Example Usage

        ### Basic Branch Creation

        ```python
        import pulumi
        import pulumi_databricks as databricks

        this = databricks.PostgresProject("this",
            project_id="my-project",
            spec={
                "pg_version": 17,
                "display_name": "My Project",
            })
        dev = databricks.PostgresBranch("dev",
            branch_id="dev-branch",
            parent=this.name,
            spec={
                "no_expiry": True,
            })
        ```

        ### Protected Branch

        ```python
        import pulumi
        import pulumi_databricks as databricks

        production = databricks.PostgresBranch("production",
            branch_id="production",
            parent=this["name"],
            spec={
                "is_protected": True,
                "no_expiry": True,
            })
        ```

        ### Branch with Expiration (TTL)

        ```python
        import pulumi
        import pulumi_databricks as databricks

        temporary = databricks.PostgresBranch("temporary",
            branch_id="temp-feature-test",
            parent=this["name"],
            spec={
                "ttl": "604800s",
            })
        ```

        :param str resource_name: The name of the resource.
        :param PostgresBranchArgs 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(PostgresBranchArgs, 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,
                 branch_id: Optional[pulumi.Input[_builtins.str]] = None,
                 parent: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_config: Optional[pulumi.Input[Union['PostgresBranchProviderConfigArgs', 'PostgresBranchProviderConfigArgsDict']]] = None,
                 spec: Optional[pulumi.Input[Union['PostgresBranchSpecArgs', 'PostgresBranchSpecArgsDict']]] = 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__ = PostgresBranchArgs.__new__(PostgresBranchArgs)

            if branch_id is None and not opts.urn:
                raise TypeError("Missing required property 'branch_id'")
            __props__.__dict__["branch_id"] = branch_id
            if parent is None and not opts.urn:
                raise TypeError("Missing required property 'parent'")
            __props__.__dict__["parent"] = parent
            __props__.__dict__["provider_config"] = provider_config
            __props__.__dict__["spec"] = spec
            __props__.__dict__["create_time"] = None
            __props__.__dict__["name"] = None
            __props__.__dict__["status"] = None
            __props__.__dict__["uid"] = None
            __props__.__dict__["update_time"] = None
        super(PostgresBranch, __self__).__init__(
            'databricks:index/postgresBranch:PostgresBranch',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            branch_id: Optional[pulumi.Input[_builtins.str]] = None,
            create_time: Optional[pulumi.Input[_builtins.str]] = None,
            name: Optional[pulumi.Input[_builtins.str]] = None,
            parent: Optional[pulumi.Input[_builtins.str]] = None,
            provider_config: Optional[pulumi.Input[Union['PostgresBranchProviderConfigArgs', 'PostgresBranchProviderConfigArgsDict']]] = None,
            spec: Optional[pulumi.Input[Union['PostgresBranchSpecArgs', 'PostgresBranchSpecArgsDict']]] = None,
            status: Optional[pulumi.Input[Union['PostgresBranchStatusArgs', 'PostgresBranchStatusArgsDict']]] = None,
            uid: Optional[pulumi.Input[_builtins.str]] = None,
            update_time: Optional[pulumi.Input[_builtins.str]] = None) -> 'PostgresBranch':
        """
        Get an existing PostgresBranch 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] branch_id: The ID to use for the Branch. This becomes the final component of the branch's resource name.
               The ID is required and must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens.
               For example, `development` becomes `projects/my-app/branches/development`
        :param pulumi.Input[_builtins.str] create_time: (string) - A timestamp indicating when the branch was created
        :param pulumi.Input[_builtins.str] name: (string) - Output only. The full resource path of the branch.
               Format: projects/{project_id}/branches/{branch_id}
        :param pulumi.Input[_builtins.str] parent: The project containing this branch (API resource hierarchy).
               Format: projects/{project_id}
               
               Note: This field indicates where the branch exists in the resource hierarchy.
               For point-in-time branching from another branch, see `status.source_branch`
        :param pulumi.Input[Union['PostgresBranchProviderConfigArgs', 'PostgresBranchProviderConfigArgsDict']] provider_config: Configure the provider for management through account provider.
        :param pulumi.Input[Union['PostgresBranchSpecArgs', 'PostgresBranchSpecArgsDict']] spec: The spec contains the branch configuration
        :param pulumi.Input[Union['PostgresBranchStatusArgs', 'PostgresBranchStatusArgsDict']] status: (BranchStatus) - The current status of a Branch
        :param pulumi.Input[_builtins.str] uid: (string) - System-generated unique ID for the branch
        :param pulumi.Input[_builtins.str] update_time: (string) - A timestamp indicating when the branch was last updated
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _PostgresBranchState.__new__(_PostgresBranchState)

        __props__.__dict__["branch_id"] = branch_id
        __props__.__dict__["create_time"] = create_time
        __props__.__dict__["name"] = name
        __props__.__dict__["parent"] = parent
        __props__.__dict__["provider_config"] = provider_config
        __props__.__dict__["spec"] = spec
        __props__.__dict__["status"] = status
        __props__.__dict__["uid"] = uid
        __props__.__dict__["update_time"] = update_time
        return PostgresBranch(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="branchId")
    def branch_id(self) -> pulumi.Output[_builtins.str]:
        """
        The ID to use for the Branch. This becomes the final component of the branch's resource name.
        The ID is required and must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens.
        For example, `development` becomes `projects/my-app/branches/development`
        """
        return pulumi.get(self, "branch_id")

    @_builtins.property
    @pulumi.getter(name="createTime")
    def create_time(self) -> pulumi.Output[_builtins.str]:
        """
        (string) - A timestamp indicating when the branch was created
        """
        return pulumi.get(self, "create_time")

    @_builtins.property
    @pulumi.getter
    def name(self) -> pulumi.Output[_builtins.str]:
        """
        (string) - Output only. The full resource path of the branch.
        Format: projects/{project_id}/branches/{branch_id}
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter
    def parent(self) -> pulumi.Output[_builtins.str]:
        """
        The project containing this branch (API resource hierarchy).
        Format: projects/{project_id}

        Note: This field indicates where the branch exists in the resource hierarchy.
        For point-in-time branching from another branch, see `status.source_branch`
        """
        return pulumi.get(self, "parent")

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> pulumi.Output[Optional['outputs.PostgresBranchProviderConfig']]:
        """
        Configure the provider for management through account provider.
        """
        return pulumi.get(self, "provider_config")

    @_builtins.property
    @pulumi.getter
    def spec(self) -> pulumi.Output['outputs.PostgresBranchSpec']:
        """
        The spec contains the branch configuration
        """
        return pulumi.get(self, "spec")

    @_builtins.property
    @pulumi.getter
    def status(self) -> pulumi.Output['outputs.PostgresBranchStatus']:
        """
        (BranchStatus) - The current status of a Branch
        """
        return pulumi.get(self, "status")

    @_builtins.property
    @pulumi.getter
    def uid(self) -> pulumi.Output[_builtins.str]:
        """
        (string) - System-generated unique ID for the branch
        """
        return pulumi.get(self, "uid")

    @_builtins.property
    @pulumi.getter(name="updateTime")
    def update_time(self) -> pulumi.Output[_builtins.str]:
        """
        (string) - A timestamp indicating when the branch was last updated
        """
        return pulumi.get(self, "update_time")

