# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
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__ = ['SchemaArgs', 'Schema']

@pulumi.input_type
class SchemaArgs:
    def __init__(__self__, *,
                 format: pulumi.Input[str],
                 subject_name: pulumi.Input[str],
                 credentials: Optional[pulumi.Input['SchemaCredentialsArgs']] = None,
                 hard_delete: Optional[pulumi.Input[bool]] = None,
                 metadata: Optional[pulumi.Input['SchemaMetadataArgs']] = None,
                 recreate_on_update: Optional[pulumi.Input[bool]] = None,
                 rest_endpoint: Optional[pulumi.Input[str]] = None,
                 ruleset: Optional[pulumi.Input['SchemaRulesetArgs']] = None,
                 schema: Optional[pulumi.Input[str]] = None,
                 schema_references: Optional[pulumi.Input[Sequence[pulumi.Input['SchemaSchemaReferenceArgs']]]] = None,
                 schema_registry_cluster: Optional[pulumi.Input['SchemaSchemaRegistryClusterArgs']] = None,
                 skip_validation_during_plan: Optional[pulumi.Input[bool]] = None):
        """
        The set of arguments for constructing a Schema resource.
        :param pulumi.Input[str] format: The format of the schema. Accepted values are: `AVRO`, `PROTOBUF`, and `JSON`.
        :param pulumi.Input[str] subject_name: The name of the subject (in other words, the namespace), representing the subject under which the schema will be registered, for example, `test-subject`. Schemas evolve safely, following a compatibility mode defined, under a subject name.
        :param pulumi.Input['SchemaCredentialsArgs'] credentials: The Cluster API Credentials.
        :param pulumi.Input[bool] hard_delete: An optional flag to control whether a schema should be soft or hard deleted. Set it to `true` if you want to hard delete a schema on destroy (see [Schema Deletion Guidelines](https://docs.confluent.io/platform/current/schema-registry/schema-deletion-guidelines.html#schema-deletion-guidelines) for more details). Must be unset when importing. Defaults to `false` (soft delete).
        :param pulumi.Input['SchemaMetadataArgs'] metadata: See [here](https://docs.confluent.io/platform/7.5/schema-registry/fundamentals/data-contracts.html) for more details. Supports the following:
        :param pulumi.Input[bool] recreate_on_update: An optional flag to control whether a schema should be recreated on an update. Set it to `true` if you want to manage different schema versions using different resource instances. Must be set to the target value when importing. Defaults to `false`, which manages the latest schema version only. The resource instance always points to the latest schema version by supporting in-place updates.
        :param pulumi.Input[str] rest_endpoint: The REST endpoint of the Schema Registry cluster, for example, `https://psrc-00000.us-central1.gcp.confluent.cloud:443`).
        :param pulumi.Input['SchemaRulesetArgs'] ruleset: The list of schema rules. See [Data Contracts for Schema Registry](https://docs.confluent.io/platform/7.5/schema-registry/fundamentals/data-contracts.html#rules) for more details. For example, these rules can enforce that a field that contains sensitive information must be encrypted, or that a message containing an invalid age must be sent to a dead letter queue.
        :param pulumi.Input[str] schema: The schema string, for example, `file("./schema_version_1.avsc")`.
        :param pulumi.Input[Sequence[pulumi.Input['SchemaSchemaReferenceArgs']]] schema_references: The list of referenced schemas (see [Schema References](https://docs.confluent.io/platform/current/schema-registry/serdes-develop/index.html#schema-references) for more details):
        :param pulumi.Input[bool] skip_validation_during_plan: An optional flag to control whether a schema should be validated during `pulumi preview`. Set it to `true` if you want to skip schema validation during `pulumi preview`. Defaults to `false`. Regardless of `true` or `false` for this flag, schema validation will be performed during `pulumi up`.
        """
        pulumi.set(__self__, "format", format)
        pulumi.set(__self__, "subject_name", subject_name)
        if credentials is not None:
            pulumi.set(__self__, "credentials", credentials)
        if hard_delete is not None:
            pulumi.set(__self__, "hard_delete", hard_delete)
        if metadata is not None:
            pulumi.set(__self__, "metadata", metadata)
        if recreate_on_update is not None:
            pulumi.set(__self__, "recreate_on_update", recreate_on_update)
        if rest_endpoint is not None:
            pulumi.set(__self__, "rest_endpoint", rest_endpoint)
        if ruleset is not None:
            pulumi.set(__self__, "ruleset", ruleset)
        if schema is not None:
            pulumi.set(__self__, "schema", schema)
        if schema_references is not None:
            pulumi.set(__self__, "schema_references", schema_references)
        if schema_registry_cluster is not None:
            pulumi.set(__self__, "schema_registry_cluster", schema_registry_cluster)
        if skip_validation_during_plan is not None:
            pulumi.set(__self__, "skip_validation_during_plan", skip_validation_during_plan)

    @property
    @pulumi.getter
    def format(self) -> pulumi.Input[str]:
        """
        The format of the schema. Accepted values are: `AVRO`, `PROTOBUF`, and `JSON`.
        """
        return pulumi.get(self, "format")

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

    @property
    @pulumi.getter(name="subjectName")
    def subject_name(self) -> pulumi.Input[str]:
        """
        The name of the subject (in other words, the namespace), representing the subject under which the schema will be registered, for example, `test-subject`. Schemas evolve safely, following a compatibility mode defined, under a subject name.
        """
        return pulumi.get(self, "subject_name")

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

    @property
    @pulumi.getter
    def credentials(self) -> Optional[pulumi.Input['SchemaCredentialsArgs']]:
        """
        The Cluster API Credentials.
        """
        return pulumi.get(self, "credentials")

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

    @property
    @pulumi.getter(name="hardDelete")
    def hard_delete(self) -> Optional[pulumi.Input[bool]]:
        """
        An optional flag to control whether a schema should be soft or hard deleted. Set it to `true` if you want to hard delete a schema on destroy (see [Schema Deletion Guidelines](https://docs.confluent.io/platform/current/schema-registry/schema-deletion-guidelines.html#schema-deletion-guidelines) for more details). Must be unset when importing. Defaults to `false` (soft delete).
        """
        return pulumi.get(self, "hard_delete")

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

    @property
    @pulumi.getter
    def metadata(self) -> Optional[pulumi.Input['SchemaMetadataArgs']]:
        """
        See [here](https://docs.confluent.io/platform/7.5/schema-registry/fundamentals/data-contracts.html) for more details. Supports the following:
        """
        return pulumi.get(self, "metadata")

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

    @property
    @pulumi.getter(name="recreateOnUpdate")
    def recreate_on_update(self) -> Optional[pulumi.Input[bool]]:
        """
        An optional flag to control whether a schema should be recreated on an update. Set it to `true` if you want to manage different schema versions using different resource instances. Must be set to the target value when importing. Defaults to `false`, which manages the latest schema version only. The resource instance always points to the latest schema version by supporting in-place updates.
        """
        return pulumi.get(self, "recreate_on_update")

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

    @property
    @pulumi.getter(name="restEndpoint")
    def rest_endpoint(self) -> Optional[pulumi.Input[str]]:
        """
        The REST endpoint of the Schema Registry cluster, for example, `https://psrc-00000.us-central1.gcp.confluent.cloud:443`).
        """
        return pulumi.get(self, "rest_endpoint")

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

    @property
    @pulumi.getter
    def ruleset(self) -> Optional[pulumi.Input['SchemaRulesetArgs']]:
        """
        The list of schema rules. See [Data Contracts for Schema Registry](https://docs.confluent.io/platform/7.5/schema-registry/fundamentals/data-contracts.html#rules) for more details. For example, these rules can enforce that a field that contains sensitive information must be encrypted, or that a message containing an invalid age must be sent to a dead letter queue.
        """
        return pulumi.get(self, "ruleset")

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

    @property
    @pulumi.getter
    def schema(self) -> Optional[pulumi.Input[str]]:
        """
        The schema string, for example, `file("./schema_version_1.avsc")`.
        """
        return pulumi.get(self, "schema")

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

    @property
    @pulumi.getter(name="schemaReferences")
    def schema_references(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['SchemaSchemaReferenceArgs']]]]:
        """
        The list of referenced schemas (see [Schema References](https://docs.confluent.io/platform/current/schema-registry/serdes-develop/index.html#schema-references) for more details):
        """
        return pulumi.get(self, "schema_references")

    @schema_references.setter
    def schema_references(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['SchemaSchemaReferenceArgs']]]]):
        pulumi.set(self, "schema_references", value)

    @property
    @pulumi.getter(name="schemaRegistryCluster")
    def schema_registry_cluster(self) -> Optional[pulumi.Input['SchemaSchemaRegistryClusterArgs']]:
        return pulumi.get(self, "schema_registry_cluster")

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

    @property
    @pulumi.getter(name="skipValidationDuringPlan")
    def skip_validation_during_plan(self) -> Optional[pulumi.Input[bool]]:
        """
        An optional flag to control whether a schema should be validated during `pulumi preview`. Set it to `true` if you want to skip schema validation during `pulumi preview`. Defaults to `false`. Regardless of `true` or `false` for this flag, schema validation will be performed during `pulumi up`.
        """
        return pulumi.get(self, "skip_validation_during_plan")

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


@pulumi.input_type
class _SchemaState:
    def __init__(__self__, *,
                 credentials: Optional[pulumi.Input['SchemaCredentialsArgs']] = None,
                 format: Optional[pulumi.Input[str]] = None,
                 hard_delete: Optional[pulumi.Input[bool]] = None,
                 metadata: Optional[pulumi.Input['SchemaMetadataArgs']] = None,
                 recreate_on_update: Optional[pulumi.Input[bool]] = None,
                 rest_endpoint: Optional[pulumi.Input[str]] = None,
                 ruleset: Optional[pulumi.Input['SchemaRulesetArgs']] = None,
                 schema: Optional[pulumi.Input[str]] = None,
                 schema_identifier: Optional[pulumi.Input[int]] = None,
                 schema_references: Optional[pulumi.Input[Sequence[pulumi.Input['SchemaSchemaReferenceArgs']]]] = None,
                 schema_registry_cluster: Optional[pulumi.Input['SchemaSchemaRegistryClusterArgs']] = None,
                 skip_validation_during_plan: Optional[pulumi.Input[bool]] = None,
                 subject_name: Optional[pulumi.Input[str]] = None,
                 version: Optional[pulumi.Input[int]] = None):
        """
        Input properties used for looking up and filtering Schema resources.
        :param pulumi.Input['SchemaCredentialsArgs'] credentials: The Cluster API Credentials.
        :param pulumi.Input[str] format: The format of the schema. Accepted values are: `AVRO`, `PROTOBUF`, and `JSON`.
        :param pulumi.Input[bool] hard_delete: An optional flag to control whether a schema should be soft or hard deleted. Set it to `true` if you want to hard delete a schema on destroy (see [Schema Deletion Guidelines](https://docs.confluent.io/platform/current/schema-registry/schema-deletion-guidelines.html#schema-deletion-guidelines) for more details). Must be unset when importing. Defaults to `false` (soft delete).
        :param pulumi.Input['SchemaMetadataArgs'] metadata: See [here](https://docs.confluent.io/platform/7.5/schema-registry/fundamentals/data-contracts.html) for more details. Supports the following:
        :param pulumi.Input[bool] recreate_on_update: An optional flag to control whether a schema should be recreated on an update. Set it to `true` if you want to manage different schema versions using different resource instances. Must be set to the target value when importing. Defaults to `false`, which manages the latest schema version only. The resource instance always points to the latest schema version by supporting in-place updates.
        :param pulumi.Input[str] rest_endpoint: The REST endpoint of the Schema Registry cluster, for example, `https://psrc-00000.us-central1.gcp.confluent.cloud:443`).
        :param pulumi.Input['SchemaRulesetArgs'] ruleset: The list of schema rules. See [Data Contracts for Schema Registry](https://docs.confluent.io/platform/7.5/schema-registry/fundamentals/data-contracts.html#rules) for more details. For example, these rules can enforce that a field that contains sensitive information must be encrypted, or that a message containing an invalid age must be sent to a dead letter queue.
        :param pulumi.Input[str] schema: The schema string, for example, `file("./schema_version_1.avsc")`.
        :param pulumi.Input[int] schema_identifier: (Required Integer) The globally unique ID of the Schema, for example, `100003`. If the same schema is registered under a different subject, the same identifier will be returned. However, the `version` of the schema may be different under different subjects.
        :param pulumi.Input[Sequence[pulumi.Input['SchemaSchemaReferenceArgs']]] schema_references: The list of referenced schemas (see [Schema References](https://docs.confluent.io/platform/current/schema-registry/serdes-develop/index.html#schema-references) for more details):
        :param pulumi.Input[bool] skip_validation_during_plan: An optional flag to control whether a schema should be validated during `pulumi preview`. Set it to `true` if you want to skip schema validation during `pulumi preview`. Defaults to `false`. Regardless of `true` or `false` for this flag, schema validation will be performed during `pulumi up`.
        :param pulumi.Input[str] subject_name: The name of the subject (in other words, the namespace), representing the subject under which the schema will be registered, for example, `test-subject`. Schemas evolve safely, following a compatibility mode defined, under a subject name.
        :param pulumi.Input[int] version: (Required Integer) The version of the Schema, for example, `4`.
        """
        if credentials is not None:
            pulumi.set(__self__, "credentials", credentials)
        if format is not None:
            pulumi.set(__self__, "format", format)
        if hard_delete is not None:
            pulumi.set(__self__, "hard_delete", hard_delete)
        if metadata is not None:
            pulumi.set(__self__, "metadata", metadata)
        if recreate_on_update is not None:
            pulumi.set(__self__, "recreate_on_update", recreate_on_update)
        if rest_endpoint is not None:
            pulumi.set(__self__, "rest_endpoint", rest_endpoint)
        if ruleset is not None:
            pulumi.set(__self__, "ruleset", ruleset)
        if schema is not None:
            pulumi.set(__self__, "schema", schema)
        if schema_identifier is not None:
            pulumi.set(__self__, "schema_identifier", schema_identifier)
        if schema_references is not None:
            pulumi.set(__self__, "schema_references", schema_references)
        if schema_registry_cluster is not None:
            pulumi.set(__self__, "schema_registry_cluster", schema_registry_cluster)
        if skip_validation_during_plan is not None:
            pulumi.set(__self__, "skip_validation_during_plan", skip_validation_during_plan)
        if subject_name is not None:
            pulumi.set(__self__, "subject_name", subject_name)
        if version is not None:
            pulumi.set(__self__, "version", version)

    @property
    @pulumi.getter
    def credentials(self) -> Optional[pulumi.Input['SchemaCredentialsArgs']]:
        """
        The Cluster API Credentials.
        """
        return pulumi.get(self, "credentials")

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

    @property
    @pulumi.getter
    def format(self) -> Optional[pulumi.Input[str]]:
        """
        The format of the schema. Accepted values are: `AVRO`, `PROTOBUF`, and `JSON`.
        """
        return pulumi.get(self, "format")

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

    @property
    @pulumi.getter(name="hardDelete")
    def hard_delete(self) -> Optional[pulumi.Input[bool]]:
        """
        An optional flag to control whether a schema should be soft or hard deleted. Set it to `true` if you want to hard delete a schema on destroy (see [Schema Deletion Guidelines](https://docs.confluent.io/platform/current/schema-registry/schema-deletion-guidelines.html#schema-deletion-guidelines) for more details). Must be unset when importing. Defaults to `false` (soft delete).
        """
        return pulumi.get(self, "hard_delete")

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

    @property
    @pulumi.getter
    def metadata(self) -> Optional[pulumi.Input['SchemaMetadataArgs']]:
        """
        See [here](https://docs.confluent.io/platform/7.5/schema-registry/fundamentals/data-contracts.html) for more details. Supports the following:
        """
        return pulumi.get(self, "metadata")

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

    @property
    @pulumi.getter(name="recreateOnUpdate")
    def recreate_on_update(self) -> Optional[pulumi.Input[bool]]:
        """
        An optional flag to control whether a schema should be recreated on an update. Set it to `true` if you want to manage different schema versions using different resource instances. Must be set to the target value when importing. Defaults to `false`, which manages the latest schema version only. The resource instance always points to the latest schema version by supporting in-place updates.
        """
        return pulumi.get(self, "recreate_on_update")

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

    @property
    @pulumi.getter(name="restEndpoint")
    def rest_endpoint(self) -> Optional[pulumi.Input[str]]:
        """
        The REST endpoint of the Schema Registry cluster, for example, `https://psrc-00000.us-central1.gcp.confluent.cloud:443`).
        """
        return pulumi.get(self, "rest_endpoint")

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

    @property
    @pulumi.getter
    def ruleset(self) -> Optional[pulumi.Input['SchemaRulesetArgs']]:
        """
        The list of schema rules. See [Data Contracts for Schema Registry](https://docs.confluent.io/platform/7.5/schema-registry/fundamentals/data-contracts.html#rules) for more details. For example, these rules can enforce that a field that contains sensitive information must be encrypted, or that a message containing an invalid age must be sent to a dead letter queue.
        """
        return pulumi.get(self, "ruleset")

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

    @property
    @pulumi.getter
    def schema(self) -> Optional[pulumi.Input[str]]:
        """
        The schema string, for example, `file("./schema_version_1.avsc")`.
        """
        return pulumi.get(self, "schema")

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

    @property
    @pulumi.getter(name="schemaIdentifier")
    def schema_identifier(self) -> Optional[pulumi.Input[int]]:
        """
        (Required Integer) The globally unique ID of the Schema, for example, `100003`. If the same schema is registered under a different subject, the same identifier will be returned. However, the `version` of the schema may be different under different subjects.
        """
        return pulumi.get(self, "schema_identifier")

    @schema_identifier.setter
    def schema_identifier(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "schema_identifier", value)

    @property
    @pulumi.getter(name="schemaReferences")
    def schema_references(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['SchemaSchemaReferenceArgs']]]]:
        """
        The list of referenced schemas (see [Schema References](https://docs.confluent.io/platform/current/schema-registry/serdes-develop/index.html#schema-references) for more details):
        """
        return pulumi.get(self, "schema_references")

    @schema_references.setter
    def schema_references(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['SchemaSchemaReferenceArgs']]]]):
        pulumi.set(self, "schema_references", value)

    @property
    @pulumi.getter(name="schemaRegistryCluster")
    def schema_registry_cluster(self) -> Optional[pulumi.Input['SchemaSchemaRegistryClusterArgs']]:
        return pulumi.get(self, "schema_registry_cluster")

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

    @property
    @pulumi.getter(name="skipValidationDuringPlan")
    def skip_validation_during_plan(self) -> Optional[pulumi.Input[bool]]:
        """
        An optional flag to control whether a schema should be validated during `pulumi preview`. Set it to `true` if you want to skip schema validation during `pulumi preview`. Defaults to `false`. Regardless of `true` or `false` for this flag, schema validation will be performed during `pulumi up`.
        """
        return pulumi.get(self, "skip_validation_during_plan")

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

    @property
    @pulumi.getter(name="subjectName")
    def subject_name(self) -> Optional[pulumi.Input[str]]:
        """
        The name of the subject (in other words, the namespace), representing the subject under which the schema will be registered, for example, `test-subject`. Schemas evolve safely, following a compatibility mode defined, under a subject name.
        """
        return pulumi.get(self, "subject_name")

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

    @property
    @pulumi.getter
    def version(self) -> Optional[pulumi.Input[int]]:
        """
        (Required Integer) The version of the Schema, for example, `4`.
        """
        return pulumi.get(self, "version")

    @version.setter
    def version(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "version", value)


class Schema(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 credentials: Optional[pulumi.Input[Union['SchemaCredentialsArgs', 'SchemaCredentialsArgsDict']]] = None,
                 format: Optional[pulumi.Input[str]] = None,
                 hard_delete: Optional[pulumi.Input[bool]] = None,
                 metadata: Optional[pulumi.Input[Union['SchemaMetadataArgs', 'SchemaMetadataArgsDict']]] = None,
                 recreate_on_update: Optional[pulumi.Input[bool]] = None,
                 rest_endpoint: Optional[pulumi.Input[str]] = None,
                 ruleset: Optional[pulumi.Input[Union['SchemaRulesetArgs', 'SchemaRulesetArgsDict']]] = None,
                 schema: Optional[pulumi.Input[str]] = None,
                 schema_references: Optional[pulumi.Input[Sequence[pulumi.Input[Union['SchemaSchemaReferenceArgs', 'SchemaSchemaReferenceArgsDict']]]]] = None,
                 schema_registry_cluster: Optional[pulumi.Input[Union['SchemaSchemaRegistryClusterArgs', 'SchemaSchemaRegistryClusterArgsDict']]] = None,
                 skip_validation_during_plan: Optional[pulumi.Input[bool]] = None,
                 subject_name: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        ## Example Usage

        ## Import

        You can import a Schema by using the Schema Registry cluster ID, Subject name, and unique identifier (or `latest` when `recreate_on_update = false`) of the Schema in the format `<Schema Registry cluster ID>/<Subject name>/<Schema identifier>`, for example:

        Option A: recreate_on_update = false (by default)

        $ export IMPORT_SCHEMA_REGISTRY_API_KEY="<schema_registry_api_key>"

        $ export IMPORT_SCHEMA_REGISTRY_API_SECRET="<schema_registry_api_secret>"

        $ export IMPORT_SCHEMA_REGISTRY_REST_ENDPOINT="<schema_registry_rest_endpoint>"

        ```sh
        $ pulumi import confluentcloud:index/schema:Schema my_schema_1 lsrc-abc123/test-subject/latest
        ```

        Option B: recreate_on_update = true

        $ export IMPORT_SCHEMA_REGISTRY_API_KEY="<schema_registry_api_key>"

        $ export IMPORT_SCHEMA_REGISTRY_API_SECRET="<schema_registry_api_secret>"

        $ export IMPORT_SCHEMA_REGISTRY_REST_ENDPOINT="<schema_registry_rest_endpoint>"

        ```sh
        $ pulumi import confluentcloud:index/schema:Schema my_schema_1 lsrc-abc123/test-subject/100003
        ```

        !> **Warning:** Do not forget to delete terminal command history afterwards for security purposes.

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[Union['SchemaCredentialsArgs', 'SchemaCredentialsArgsDict']] credentials: The Cluster API Credentials.
        :param pulumi.Input[str] format: The format of the schema. Accepted values are: `AVRO`, `PROTOBUF`, and `JSON`.
        :param pulumi.Input[bool] hard_delete: An optional flag to control whether a schema should be soft or hard deleted. Set it to `true` if you want to hard delete a schema on destroy (see [Schema Deletion Guidelines](https://docs.confluent.io/platform/current/schema-registry/schema-deletion-guidelines.html#schema-deletion-guidelines) for more details). Must be unset when importing. Defaults to `false` (soft delete).
        :param pulumi.Input[Union['SchemaMetadataArgs', 'SchemaMetadataArgsDict']] metadata: See [here](https://docs.confluent.io/platform/7.5/schema-registry/fundamentals/data-contracts.html) for more details. Supports the following:
        :param pulumi.Input[bool] recreate_on_update: An optional flag to control whether a schema should be recreated on an update. Set it to `true` if you want to manage different schema versions using different resource instances. Must be set to the target value when importing. Defaults to `false`, which manages the latest schema version only. The resource instance always points to the latest schema version by supporting in-place updates.
        :param pulumi.Input[str] rest_endpoint: The REST endpoint of the Schema Registry cluster, for example, `https://psrc-00000.us-central1.gcp.confluent.cloud:443`).
        :param pulumi.Input[Union['SchemaRulesetArgs', 'SchemaRulesetArgsDict']] ruleset: The list of schema rules. See [Data Contracts for Schema Registry](https://docs.confluent.io/platform/7.5/schema-registry/fundamentals/data-contracts.html#rules) for more details. For example, these rules can enforce that a field that contains sensitive information must be encrypted, or that a message containing an invalid age must be sent to a dead letter queue.
        :param pulumi.Input[str] schema: The schema string, for example, `file("./schema_version_1.avsc")`.
        :param pulumi.Input[Sequence[pulumi.Input[Union['SchemaSchemaReferenceArgs', 'SchemaSchemaReferenceArgsDict']]]] schema_references: The list of referenced schemas (see [Schema References](https://docs.confluent.io/platform/current/schema-registry/serdes-develop/index.html#schema-references) for more details):
        :param pulumi.Input[bool] skip_validation_during_plan: An optional flag to control whether a schema should be validated during `pulumi preview`. Set it to `true` if you want to skip schema validation during `pulumi preview`. Defaults to `false`. Regardless of `true` or `false` for this flag, schema validation will be performed during `pulumi up`.
        :param pulumi.Input[str] subject_name: The name of the subject (in other words, the namespace), representing the subject under which the schema will be registered, for example, `test-subject`. Schemas evolve safely, following a compatibility mode defined, under a subject name.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: SchemaArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        ## Example Usage

        ## Import

        You can import a Schema by using the Schema Registry cluster ID, Subject name, and unique identifier (or `latest` when `recreate_on_update = false`) of the Schema in the format `<Schema Registry cluster ID>/<Subject name>/<Schema identifier>`, for example:

        Option A: recreate_on_update = false (by default)

        $ export IMPORT_SCHEMA_REGISTRY_API_KEY="<schema_registry_api_key>"

        $ export IMPORT_SCHEMA_REGISTRY_API_SECRET="<schema_registry_api_secret>"

        $ export IMPORT_SCHEMA_REGISTRY_REST_ENDPOINT="<schema_registry_rest_endpoint>"

        ```sh
        $ pulumi import confluentcloud:index/schema:Schema my_schema_1 lsrc-abc123/test-subject/latest
        ```

        Option B: recreate_on_update = true

        $ export IMPORT_SCHEMA_REGISTRY_API_KEY="<schema_registry_api_key>"

        $ export IMPORT_SCHEMA_REGISTRY_API_SECRET="<schema_registry_api_secret>"

        $ export IMPORT_SCHEMA_REGISTRY_REST_ENDPOINT="<schema_registry_rest_endpoint>"

        ```sh
        $ pulumi import confluentcloud:index/schema:Schema my_schema_1 lsrc-abc123/test-subject/100003
        ```

        !> **Warning:** Do not forget to delete terminal command history afterwards for security purposes.

        :param str resource_name: The name of the resource.
        :param SchemaArgs 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(SchemaArgs, 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,
                 credentials: Optional[pulumi.Input[Union['SchemaCredentialsArgs', 'SchemaCredentialsArgsDict']]] = None,
                 format: Optional[pulumi.Input[str]] = None,
                 hard_delete: Optional[pulumi.Input[bool]] = None,
                 metadata: Optional[pulumi.Input[Union['SchemaMetadataArgs', 'SchemaMetadataArgsDict']]] = None,
                 recreate_on_update: Optional[pulumi.Input[bool]] = None,
                 rest_endpoint: Optional[pulumi.Input[str]] = None,
                 ruleset: Optional[pulumi.Input[Union['SchemaRulesetArgs', 'SchemaRulesetArgsDict']]] = None,
                 schema: Optional[pulumi.Input[str]] = None,
                 schema_references: Optional[pulumi.Input[Sequence[pulumi.Input[Union['SchemaSchemaReferenceArgs', 'SchemaSchemaReferenceArgsDict']]]]] = None,
                 schema_registry_cluster: Optional[pulumi.Input[Union['SchemaSchemaRegistryClusterArgs', 'SchemaSchemaRegistryClusterArgsDict']]] = None,
                 skip_validation_during_plan: Optional[pulumi.Input[bool]] = None,
                 subject_name: Optional[pulumi.Input[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__ = SchemaArgs.__new__(SchemaArgs)

            __props__.__dict__["credentials"] = None if credentials is None else pulumi.Output.secret(credentials)
            if format is None and not opts.urn:
                raise TypeError("Missing required property 'format'")
            __props__.__dict__["format"] = format
            __props__.__dict__["hard_delete"] = hard_delete
            __props__.__dict__["metadata"] = metadata
            __props__.__dict__["recreate_on_update"] = recreate_on_update
            __props__.__dict__["rest_endpoint"] = rest_endpoint
            __props__.__dict__["ruleset"] = ruleset
            __props__.__dict__["schema"] = schema
            __props__.__dict__["schema_references"] = schema_references
            __props__.__dict__["schema_registry_cluster"] = schema_registry_cluster
            __props__.__dict__["skip_validation_during_plan"] = skip_validation_during_plan
            if subject_name is None and not opts.urn:
                raise TypeError("Missing required property 'subject_name'")
            __props__.__dict__["subject_name"] = subject_name
            __props__.__dict__["schema_identifier"] = None
            __props__.__dict__["version"] = None
        secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["credentials"])
        opts = pulumi.ResourceOptions.merge(opts, secret_opts)
        super(Schema, __self__).__init__(
            'confluentcloud:index/schema:Schema',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            credentials: Optional[pulumi.Input[Union['SchemaCredentialsArgs', 'SchemaCredentialsArgsDict']]] = None,
            format: Optional[pulumi.Input[str]] = None,
            hard_delete: Optional[pulumi.Input[bool]] = None,
            metadata: Optional[pulumi.Input[Union['SchemaMetadataArgs', 'SchemaMetadataArgsDict']]] = None,
            recreate_on_update: Optional[pulumi.Input[bool]] = None,
            rest_endpoint: Optional[pulumi.Input[str]] = None,
            ruleset: Optional[pulumi.Input[Union['SchemaRulesetArgs', 'SchemaRulesetArgsDict']]] = None,
            schema: Optional[pulumi.Input[str]] = None,
            schema_identifier: Optional[pulumi.Input[int]] = None,
            schema_references: Optional[pulumi.Input[Sequence[pulumi.Input[Union['SchemaSchemaReferenceArgs', 'SchemaSchemaReferenceArgsDict']]]]] = None,
            schema_registry_cluster: Optional[pulumi.Input[Union['SchemaSchemaRegistryClusterArgs', 'SchemaSchemaRegistryClusterArgsDict']]] = None,
            skip_validation_during_plan: Optional[pulumi.Input[bool]] = None,
            subject_name: Optional[pulumi.Input[str]] = None,
            version: Optional[pulumi.Input[int]] = None) -> 'Schema':
        """
        Get an existing Schema 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[Union['SchemaCredentialsArgs', 'SchemaCredentialsArgsDict']] credentials: The Cluster API Credentials.
        :param pulumi.Input[str] format: The format of the schema. Accepted values are: `AVRO`, `PROTOBUF`, and `JSON`.
        :param pulumi.Input[bool] hard_delete: An optional flag to control whether a schema should be soft or hard deleted. Set it to `true` if you want to hard delete a schema on destroy (see [Schema Deletion Guidelines](https://docs.confluent.io/platform/current/schema-registry/schema-deletion-guidelines.html#schema-deletion-guidelines) for more details). Must be unset when importing. Defaults to `false` (soft delete).
        :param pulumi.Input[Union['SchemaMetadataArgs', 'SchemaMetadataArgsDict']] metadata: See [here](https://docs.confluent.io/platform/7.5/schema-registry/fundamentals/data-contracts.html) for more details. Supports the following:
        :param pulumi.Input[bool] recreate_on_update: An optional flag to control whether a schema should be recreated on an update. Set it to `true` if you want to manage different schema versions using different resource instances. Must be set to the target value when importing. Defaults to `false`, which manages the latest schema version only. The resource instance always points to the latest schema version by supporting in-place updates.
        :param pulumi.Input[str] rest_endpoint: The REST endpoint of the Schema Registry cluster, for example, `https://psrc-00000.us-central1.gcp.confluent.cloud:443`).
        :param pulumi.Input[Union['SchemaRulesetArgs', 'SchemaRulesetArgsDict']] ruleset: The list of schema rules. See [Data Contracts for Schema Registry](https://docs.confluent.io/platform/7.5/schema-registry/fundamentals/data-contracts.html#rules) for more details. For example, these rules can enforce that a field that contains sensitive information must be encrypted, or that a message containing an invalid age must be sent to a dead letter queue.
        :param pulumi.Input[str] schema: The schema string, for example, `file("./schema_version_1.avsc")`.
        :param pulumi.Input[int] schema_identifier: (Required Integer) The globally unique ID of the Schema, for example, `100003`. If the same schema is registered under a different subject, the same identifier will be returned. However, the `version` of the schema may be different under different subjects.
        :param pulumi.Input[Sequence[pulumi.Input[Union['SchemaSchemaReferenceArgs', 'SchemaSchemaReferenceArgsDict']]]] schema_references: The list of referenced schemas (see [Schema References](https://docs.confluent.io/platform/current/schema-registry/serdes-develop/index.html#schema-references) for more details):
        :param pulumi.Input[bool] skip_validation_during_plan: An optional flag to control whether a schema should be validated during `pulumi preview`. Set it to `true` if you want to skip schema validation during `pulumi preview`. Defaults to `false`. Regardless of `true` or `false` for this flag, schema validation will be performed during `pulumi up`.
        :param pulumi.Input[str] subject_name: The name of the subject (in other words, the namespace), representing the subject under which the schema will be registered, for example, `test-subject`. Schemas evolve safely, following a compatibility mode defined, under a subject name.
        :param pulumi.Input[int] version: (Required Integer) The version of the Schema, for example, `4`.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _SchemaState.__new__(_SchemaState)

        __props__.__dict__["credentials"] = credentials
        __props__.__dict__["format"] = format
        __props__.__dict__["hard_delete"] = hard_delete
        __props__.__dict__["metadata"] = metadata
        __props__.__dict__["recreate_on_update"] = recreate_on_update
        __props__.__dict__["rest_endpoint"] = rest_endpoint
        __props__.__dict__["ruleset"] = ruleset
        __props__.__dict__["schema"] = schema
        __props__.__dict__["schema_identifier"] = schema_identifier
        __props__.__dict__["schema_references"] = schema_references
        __props__.__dict__["schema_registry_cluster"] = schema_registry_cluster
        __props__.__dict__["skip_validation_during_plan"] = skip_validation_during_plan
        __props__.__dict__["subject_name"] = subject_name
        __props__.__dict__["version"] = version
        return Schema(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def credentials(self) -> pulumi.Output[Optional['outputs.SchemaCredentials']]:
        """
        The Cluster API Credentials.
        """
        return pulumi.get(self, "credentials")

    @property
    @pulumi.getter
    def format(self) -> pulumi.Output[str]:
        """
        The format of the schema. Accepted values are: `AVRO`, `PROTOBUF`, and `JSON`.
        """
        return pulumi.get(self, "format")

    @property
    @pulumi.getter(name="hardDelete")
    def hard_delete(self) -> pulumi.Output[Optional[bool]]:
        """
        An optional flag to control whether a schema should be soft or hard deleted. Set it to `true` if you want to hard delete a schema on destroy (see [Schema Deletion Guidelines](https://docs.confluent.io/platform/current/schema-registry/schema-deletion-guidelines.html#schema-deletion-guidelines) for more details). Must be unset when importing. Defaults to `false` (soft delete).
        """
        return pulumi.get(self, "hard_delete")

    @property
    @pulumi.getter
    def metadata(self) -> pulumi.Output['outputs.SchemaMetadata']:
        """
        See [here](https://docs.confluent.io/platform/7.5/schema-registry/fundamentals/data-contracts.html) for more details. Supports the following:
        """
        return pulumi.get(self, "metadata")

    @property
    @pulumi.getter(name="recreateOnUpdate")
    def recreate_on_update(self) -> pulumi.Output[Optional[bool]]:
        """
        An optional flag to control whether a schema should be recreated on an update. Set it to `true` if you want to manage different schema versions using different resource instances. Must be set to the target value when importing. Defaults to `false`, which manages the latest schema version only. The resource instance always points to the latest schema version by supporting in-place updates.
        """
        return pulumi.get(self, "recreate_on_update")

    @property
    @pulumi.getter(name="restEndpoint")
    def rest_endpoint(self) -> pulumi.Output[Optional[str]]:
        """
        The REST endpoint of the Schema Registry cluster, for example, `https://psrc-00000.us-central1.gcp.confluent.cloud:443`).
        """
        return pulumi.get(self, "rest_endpoint")

    @property
    @pulumi.getter
    def ruleset(self) -> pulumi.Output['outputs.SchemaRuleset']:
        """
        The list of schema rules. See [Data Contracts for Schema Registry](https://docs.confluent.io/platform/7.5/schema-registry/fundamentals/data-contracts.html#rules) for more details. For example, these rules can enforce that a field that contains sensitive information must be encrypted, or that a message containing an invalid age must be sent to a dead letter queue.
        """
        return pulumi.get(self, "ruleset")

    @property
    @pulumi.getter
    def schema(self) -> pulumi.Output[str]:
        """
        The schema string, for example, `file("./schema_version_1.avsc")`.
        """
        return pulumi.get(self, "schema")

    @property
    @pulumi.getter(name="schemaIdentifier")
    def schema_identifier(self) -> pulumi.Output[int]:
        """
        (Required Integer) The globally unique ID of the Schema, for example, `100003`. If the same schema is registered under a different subject, the same identifier will be returned. However, the `version` of the schema may be different under different subjects.
        """
        return pulumi.get(self, "schema_identifier")

    @property
    @pulumi.getter(name="schemaReferences")
    def schema_references(self) -> pulumi.Output[Optional[Sequence['outputs.SchemaSchemaReference']]]:
        """
        The list of referenced schemas (see [Schema References](https://docs.confluent.io/platform/current/schema-registry/serdes-develop/index.html#schema-references) for more details):
        """
        return pulumi.get(self, "schema_references")

    @property
    @pulumi.getter(name="schemaRegistryCluster")
    def schema_registry_cluster(self) -> pulumi.Output[Optional['outputs.SchemaSchemaRegistryCluster']]:
        return pulumi.get(self, "schema_registry_cluster")

    @property
    @pulumi.getter(name="skipValidationDuringPlan")
    def skip_validation_during_plan(self) -> pulumi.Output[Optional[bool]]:
        """
        An optional flag to control whether a schema should be validated during `pulumi preview`. Set it to `true` if you want to skip schema validation during `pulumi preview`. Defaults to `false`. Regardless of `true` or `false` for this flag, schema validation will be performed during `pulumi up`.
        """
        return pulumi.get(self, "skip_validation_during_plan")

    @property
    @pulumi.getter(name="subjectName")
    def subject_name(self) -> pulumi.Output[str]:
        """
        The name of the subject (in other words, the namespace), representing the subject under which the schema will be registered, for example, `test-subject`. Schemas evolve safely, following a compatibility mode defined, under a subject name.
        """
        return pulumi.get(self, "subject_name")

    @property
    @pulumi.getter
    def version(self) -> pulumi.Output[int]:
        """
        (Required Integer) The version of the Schema, for example, `4`.
        """
        return pulumi.get(self, "version")

