# 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

__all__ = ['SystemSchemaArgs', 'SystemSchema']

@pulumi.input_type
class SystemSchemaArgs:
    def __init__(__self__, *,
                 schema: pulumi.Input[_builtins.str]):
        """
        The set of arguments for constructing a SystemSchema resource.
        :param pulumi.Input[_builtins.str] schema: name of the system schema.
        """
        pulumi.set(__self__, "schema", schema)

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

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


@pulumi.input_type
class _SystemSchemaState:
    def __init__(__self__, *,
                 auto_enabled: Optional[pulumi.Input[_builtins.bool]] = None,
                 full_name: Optional[pulumi.Input[_builtins.str]] = None,
                 metastore_id: Optional[pulumi.Input[_builtins.str]] = None,
                 schema: Optional[pulumi.Input[_builtins.str]] = None,
                 state: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering SystemSchema resources.
        :param pulumi.Input[_builtins.str] full_name: the full name of the system schema, in form of `system.<schema>`.
        :param pulumi.Input[_builtins.str] schema: name of the system schema.
        :param pulumi.Input[_builtins.str] state: The current state of enablement for the system schema.
        """
        if auto_enabled is not None:
            pulumi.set(__self__, "auto_enabled", auto_enabled)
        if full_name is not None:
            pulumi.set(__self__, "full_name", full_name)
        if metastore_id is not None:
            pulumi.set(__self__, "metastore_id", metastore_id)
        if schema is not None:
            pulumi.set(__self__, "schema", schema)
        if state is not None:
            pulumi.set(__self__, "state", state)

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

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

    @_builtins.property
    @pulumi.getter(name="fullName")
    def full_name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        the full name of the system schema, in form of `system.<schema>`.
        """
        return pulumi.get(self, "full_name")

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

    @_builtins.property
    @pulumi.getter(name="metastoreId")
    def metastore_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        return pulumi.get(self, "metastore_id")

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

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

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

    @_builtins.property
    @pulumi.getter
    def state(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The current state of enablement for the system schema.
        """
        return pulumi.get(self, "state")

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


@pulumi.type_token("databricks:index/systemSchema:SystemSchema")
class SystemSchema(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 schema: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        Manages system tables enablement. System tables are a Databricks-hosted analytical store of your account's operational data. System tables can be used for historical observability across your account. System tables must be enabled by an account admin.

        > This resource can only be used with a workspace-level provider!

        > Certain system schemas (such as `billing`) may be auto-enabled once GA and should not be manually declared in Pulumi configurations.  Certain schemas can't also be disabled completely.

        ## Example Usage

        Enable the system schema `access`

        ```python
        import pulumi
        import pulumi_databricks as databricks

        this = databricks.SystemSchema("this", schema="access")
        ```

        ## Import

        This resource can be imported by the metastore id and schema name:

        hcl

        import {

          to = databricks_system_schema.this

          id = "<metastore_id>|<schema_name>"

        }

        Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command:

        bash

        ```sh
        $ pulumi import databricks:index/systemSchema:SystemSchema this '<metastore_id>|<schema_name>'
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] schema: name of the system schema.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: SystemSchemaArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Manages system tables enablement. System tables are a Databricks-hosted analytical store of your account's operational data. System tables can be used for historical observability across your account. System tables must be enabled by an account admin.

        > This resource can only be used with a workspace-level provider!

        > Certain system schemas (such as `billing`) may be auto-enabled once GA and should not be manually declared in Pulumi configurations.  Certain schemas can't also be disabled completely.

        ## Example Usage

        Enable the system schema `access`

        ```python
        import pulumi
        import pulumi_databricks as databricks

        this = databricks.SystemSchema("this", schema="access")
        ```

        ## Import

        This resource can be imported by the metastore id and schema name:

        hcl

        import {

          to = databricks_system_schema.this

          id = "<metastore_id>|<schema_name>"

        }

        Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command:

        bash

        ```sh
        $ pulumi import databricks:index/systemSchema:SystemSchema this '<metastore_id>|<schema_name>'
        ```

        :param str resource_name: The name of the resource.
        :param SystemSchemaArgs 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(SystemSchemaArgs, 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,
                 schema: 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__ = SystemSchemaArgs.__new__(SystemSchemaArgs)

            if schema is None and not opts.urn:
                raise TypeError("Missing required property 'schema'")
            __props__.__dict__["schema"] = schema
            __props__.__dict__["auto_enabled"] = None
            __props__.__dict__["full_name"] = None
            __props__.__dict__["metastore_id"] = None
            __props__.__dict__["state"] = None
        super(SystemSchema, __self__).__init__(
            'databricks:index/systemSchema:SystemSchema',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            auto_enabled: Optional[pulumi.Input[_builtins.bool]] = None,
            full_name: Optional[pulumi.Input[_builtins.str]] = None,
            metastore_id: Optional[pulumi.Input[_builtins.str]] = None,
            schema: Optional[pulumi.Input[_builtins.str]] = None,
            state: Optional[pulumi.Input[_builtins.str]] = None) -> 'SystemSchema':
        """
        Get an existing SystemSchema 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] full_name: the full name of the system schema, in form of `system.<schema>`.
        :param pulumi.Input[_builtins.str] schema: name of the system schema.
        :param pulumi.Input[_builtins.str] state: The current state of enablement for the system schema.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _SystemSchemaState.__new__(_SystemSchemaState)

        __props__.__dict__["auto_enabled"] = auto_enabled
        __props__.__dict__["full_name"] = full_name
        __props__.__dict__["metastore_id"] = metastore_id
        __props__.__dict__["schema"] = schema
        __props__.__dict__["state"] = state
        return SystemSchema(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="autoEnabled")
    def auto_enabled(self) -> pulumi.Output[_builtins.bool]:
        return pulumi.get(self, "auto_enabled")

    @_builtins.property
    @pulumi.getter(name="fullName")
    def full_name(self) -> pulumi.Output[_builtins.str]:
        """
        the full name of the system schema, in form of `system.<schema>`.
        """
        return pulumi.get(self, "full_name")

    @_builtins.property
    @pulumi.getter(name="metastoreId")
    def metastore_id(self) -> pulumi.Output[_builtins.str]:
        return pulumi.get(self, "metastore_id")

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

    @_builtins.property
    @pulumi.getter
    def state(self) -> pulumi.Output[_builtins.str]:
        """
        The current state of enablement for the system schema.
        """
        return pulumi.get(self, "state")

