"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
"""
import builtins
import collections.abc
import google.protobuf.descriptor
import google.protobuf.descriptor_pb2
import google.protobuf.internal.containers
import google.protobuf.internal.extension_dict
import google.protobuf.message
import sys

if sys.version_info >= (3, 8):
    import typing as typing_extensions
else:
    import typing_extensions

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

@typing_extensions.final
class TableDescriptor(google.protobuf.message.Message):
    """TableDescriptor describes an ORM table."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    PRIMARY_KEY_FIELD_NUMBER: builtins.int
    INDEX_FIELD_NUMBER: builtins.int
    ID_FIELD_NUMBER: builtins.int
    @property
    def primary_key(self) -> global___PrimaryKeyDescriptor:
        """primary_key defines the primary key for the table."""
    @property
    def index(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___SecondaryIndexDescriptor]:
        """index defines one or more secondary indexes."""
    id: builtins.int
    """id is a non-zero integer ID that must be unique within the
    tables and singletons in this file. It may be deprecated in the future when this
    can be auto-generated.
    """
    def __init__(
        self,
        *,
        primary_key: global___PrimaryKeyDescriptor | None = ...,
        index: collections.abc.Iterable[global___SecondaryIndexDescriptor] | None = ...,
        id: builtins.int = ...,
    ) -> None: ...
    def HasField(self, field_name: typing_extensions.Literal["primary_key", b"primary_key"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing_extensions.Literal["id", b"id", "index", b"index", "primary_key", b"primary_key"]) -> None: ...

global___TableDescriptor = TableDescriptor

@typing_extensions.final
class PrimaryKeyDescriptor(google.protobuf.message.Message):
    """PrimaryKeyDescriptor describes a table primary key."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    FIELDS_FIELD_NUMBER: builtins.int
    AUTO_INCREMENT_FIELD_NUMBER: builtins.int
    fields: builtins.str
    """fields is a comma-separated list of fields in the primary key. Spaces are
    not allowed. Supported field types, their encodings, and any applicable constraints
    are described below.
      - uint32 are encoded as 2,3,4 or 5 bytes using a compact encoding that
        is suitable for sorted iteration (not varint encoding). This type is
        well-suited for small integers.
      - uint64 are encoded as 2,4,6 or 9 bytes using a compact encoding that
        is suitable for sorted iteration (not varint encoding). This type is
        well-suited for small integers such as auto-incrementing sequences.
      - fixed32, fixed64 are encoded as big-endian fixed width bytes and support
      sorted iteration. These types are well-suited for encoding fixed with
      decimals as integers.
      - string's are encoded as raw bytes in terminal key segments and null-terminated
      in non-terminal segments. Null characters are thus forbidden in strings.
      string fields support sorted iteration.
      - bytes are encoded as raw bytes in terminal segments and length-prefixed
      with a 32-bit unsigned varint in non-terminal segments.
      - int32, sint32, int64, sint64, sfixed32, sfixed64 are encoded as fixed width bytes with
      an encoding that enables sorted iteration.
      - google.protobuf.Timestamp and google.protobuf.Duration are encoded
      as 12 bytes using an encoding that enables sorted iteration.
      - enum fields are encoded using varint encoding and do not support sorted
      iteration.
      - bool fields are encoded as a single byte 0 or 1.

    All other fields types are unsupported in keys including repeated and
    oneof fields.

    Primary keys are prefixed by the varint encoded table id and the byte 0x0
    plus any additional prefix specified by the schema.
    """
    auto_increment: builtins.bool
    """auto_increment specifies that the primary key is generated by an
    auto-incrementing integer. If this is set to true fields must only
    contain one field of that is of type uint64.
    """
    def __init__(
        self,
        *,
        fields: builtins.str = ...,
        auto_increment: builtins.bool = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal["auto_increment", b"auto_increment", "fields", b"fields"]) -> None: ...

global___PrimaryKeyDescriptor = PrimaryKeyDescriptor

@typing_extensions.final
class SecondaryIndexDescriptor(google.protobuf.message.Message):
    """PrimaryKeyDescriptor describes a table secondary index."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    FIELDS_FIELD_NUMBER: builtins.int
    ID_FIELD_NUMBER: builtins.int
    UNIQUE_FIELD_NUMBER: builtins.int
    fields: builtins.str
    """fields is a comma-separated list of fields in the index. The supported
    field types are the same as those for PrimaryKeyDescriptor.fields.
    Index keys are prefixed by the varint encoded table id and the varint
    encoded index id plus any additional prefix specified by the schema.

    In addition the field segments, non-unique index keys are suffixed with
    any additional primary key fields not present in the index fields so that the
    primary key can be reconstructed. Unique indexes instead of being suffixed
    store the remaining primary key fields in the value..
    """
    id: builtins.int
    """id is a non-zero integer ID that must be unique within the indexes for this
    table and less than 32768. It may be deprecated in the future when this can
    be auto-generated.
    """
    unique: builtins.bool
    """unique specifies that this an unique index."""
    def __init__(
        self,
        *,
        fields: builtins.str = ...,
        id: builtins.int = ...,
        unique: builtins.bool = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal["fields", b"fields", "id", b"id", "unique", b"unique"]) -> None: ...

global___SecondaryIndexDescriptor = SecondaryIndexDescriptor

@typing_extensions.final
class SingletonDescriptor(google.protobuf.message.Message):
    """TableDescriptor describes an ORM singleton table which has at most one instance."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    ID_FIELD_NUMBER: builtins.int
    id: builtins.int
    """id is a non-zero integer ID that must be unique within the
    tables and singletons in this file. It may be deprecated in the future when this
    can be auto-generated.
    """
    def __init__(
        self,
        *,
        id: builtins.int = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal["id", b"id"]) -> None: ...

global___SingletonDescriptor = SingletonDescriptor

TABLE_FIELD_NUMBER: builtins.int
SINGLETON_FIELD_NUMBER: builtins.int
table: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[google.protobuf.descriptor_pb2.MessageOptions, global___TableDescriptor]
"""table specifies that this message will be used as an ORM table. It cannot
be used together with the singleton option.
"""
singleton: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[google.protobuf.descriptor_pb2.MessageOptions, global___SingletonDescriptor]
"""singleton specifies that this message will be used as an ORM singleton. It cannot
be used together with the table option.
"""
