# Copyright (c) 2025-2026 Buf Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Generated from google/protobuf/type.proto. DO NOT EDIT.
# Generated by protoc-gen-py v0.1.1 with parameter "no_fmt_off".
# ruff: noqa: PGH004
# ruff: noqa

from __future__ import annotations

from typing import Literal, TYPE_CHECKING, TypeAlias

from protobuf import Enum as Enum_, Message
from protobuf._codegen import file_desc

from . import any_pb, source_context_pb

if TYPE_CHECKING:
    from protobuf import DescFile

    from .any_pb import Any
    from .source_context_pb import SourceContext


_TypeFields: TypeAlias = Literal[
    "name", "fields", "oneofs", "options", "source_context", "syntax", "edition"
]


class Type(Message[_TypeFields]):
    """
    A protocol buffer message type.

    New usages of this message as an alternative to DescriptorProto are strongly
    discouraged. This message does not reliability preserve all information
    necessary to model the schema and preserve semantics. Instead make use of
    FileDescriptorSet which preserves the necessary information.

    ```proto
    message google.protobuf.Type
    ```

    Attributes:
        name:
            The fully qualified message name.

            ```proto
            string name = 1;
            ```
        fields:
            The list of fields.

            ```proto
            repeated google.protobuf.Field fields = 2;
            ```
        oneofs:
            The list of types appearing in `oneof` definitions in this type.

            ```proto
            repeated string oneofs = 3;
            ```
        options:
            The protocol buffer options.

            ```proto
            repeated google.protobuf.Option options = 4;
            ```
        source_context:
            The source context.

            ```proto
            optional google.protobuf.SourceContext source_context = 5;
            ```
        syntax:
            The source syntax.

            ```proto
            google.protobuf.Syntax syntax = 6;
            ```
        edition:
            The source edition string, only valid when syntax is SYNTAX_EDITIONS.

            ```proto
            string edition = 7;
            ```
    """

    __slots__ = (
        "name",
        "fields",
        "oneofs",
        "options",
        "source_context",
        "syntax",
        "edition",
    )

    if TYPE_CHECKING:

        def __init__(
            self,
            *,
            name: str = "",
            fields: list[Field] | None = None,
            oneofs: list[str] | None = None,
            options: list[Option] | None = None,
            source_context: SourceContext | None = None,
            syntax: Syntax | None = None,
            edition: str = "",
        ) -> None:
            pass

        name: str
        fields: list[Field]
        oneofs: list[str]
        options: list[Option]
        source_context: SourceContext | None
        syntax: Syntax
        edition: str


_FieldFields: TypeAlias = Literal[
    "kind",
    "cardinality",
    "number",
    "name",
    "type_url",
    "oneof_index",
    "packed",
    "options",
    "json_name",
    "default_value",
]


class Field(Message[_FieldFields]):
    """
    A single field of a message type.

    New usages of this message as an alternative to FieldDescriptorProto are
    strongly discouraged. This message does not reliability preserve all
    information necessary to model the schema and preserve semantics. Instead
    make use of FileDescriptorSet which preserves the necessary information.

    ```proto
    message google.protobuf.Field
    ```

    Attributes:
        kind:
            The field type.

            ```proto
            google.protobuf.Field.Kind kind = 1;
            ```
        cardinality:
            The field cardinality.

            ```proto
            google.protobuf.Field.Cardinality cardinality = 2;
            ```
        number:
            The field number.

            ```proto
            int32 number = 3;
            ```
        name:
            The field name.

            ```proto
            string name = 4;
            ```
        type_url:
            The field type URL, without the scheme, for message or enumeration
            types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.

            ```proto
            string type_url = 6;
            ```
        oneof_index:
            The index of the field type in `Type.oneofs`, for message or enumeration
            types. The first type has index 1; zero means the type is not in the list.

            ```proto
            int32 oneof_index = 7;
            ```
        packed:
            Whether to use alternative packed wire representation.

            ```proto
            bool packed = 8;
            ```
        options:
            The protocol buffer options.

            ```proto
            repeated google.protobuf.Option options = 9;
            ```
        json_name:
            The field JSON name.

            ```proto
            string json_name = 10;
            ```
        default_value:
            The string value of the default value of this field. Proto2 syntax only.

            ```proto
            string default_value = 11;
            ```
    """

    __slots__ = (
        "kind",
        "cardinality",
        "number",
        "name",
        "type_url",
        "oneof_index",
        "packed",
        "options",
        "json_name",
        "default_value",
    )

    if TYPE_CHECKING:

        def __init__(
            self,
            *,
            kind: Field.Kind | None = None,
            cardinality: Field.Cardinality | None = None,
            number: int = 0,
            name: str = "",
            type_url: str = "",
            oneof_index: int = 0,
            packed: bool = False,
            options: list[Option] | None = None,
            json_name: str = "",
            default_value: str = "",
        ) -> None:
            pass

        kind: Field.Kind
        cardinality: Field.Cardinality
        number: int
        name: str
        type_url: str
        oneof_index: int
        packed: bool
        options: list[Option]
        json_name: str
        default_value: str

    class Kind(Enum_):
        """
        Basic field types.

        ```proto
        enum google.protobuf.Field.Kind
        ```

        Attributes:
            TYPE_UNKNOWN:
                Field type unknown.

                ```proto
                TYPE_UNKNOWN = 0
                ```
            TYPE_DOUBLE:
                Field type double.

                ```proto
                TYPE_DOUBLE = 1
                ```
            TYPE_FLOAT:
                Field type float.

                ```proto
                TYPE_FLOAT = 2
                ```
            TYPE_INT64:
                Field type int64.

                ```proto
                TYPE_INT64 = 3
                ```
            TYPE_UINT64:
                Field type uint64.

                ```proto
                TYPE_UINT64 = 4
                ```
            TYPE_INT32:
                Field type int32.

                ```proto
                TYPE_INT32 = 5
                ```
            TYPE_FIXED64:
                Field type fixed64.

                ```proto
                TYPE_FIXED64 = 6
                ```
            TYPE_FIXED32:
                Field type fixed32.

                ```proto
                TYPE_FIXED32 = 7
                ```
            TYPE_BOOL:
                Field type bool.

                ```proto
                TYPE_BOOL = 8
                ```
            TYPE_STRING:
                Field type string.

                ```proto
                TYPE_STRING = 9
                ```
            TYPE_GROUP:
                Field type group. Proto2 syntax only, and deprecated.

                ```proto
                TYPE_GROUP = 10
                ```
            TYPE_MESSAGE:
                Field type message.

                ```proto
                TYPE_MESSAGE = 11
                ```
            TYPE_BYTES:
                Field type bytes.

                ```proto
                TYPE_BYTES = 12
                ```
            TYPE_UINT32:
                Field type uint32.

                ```proto
                TYPE_UINT32 = 13
                ```
            TYPE_ENUM:
                Field type enum.

                ```proto
                TYPE_ENUM = 14
                ```
            TYPE_SFIXED32:
                Field type sfixed32.

                ```proto
                TYPE_SFIXED32 = 15
                ```
            TYPE_SFIXED64:
                Field type sfixed64.

                ```proto
                TYPE_SFIXED64 = 16
                ```
            TYPE_SINT32:
                Field type sint32.

                ```proto
                TYPE_SINT32 = 17
                ```
            TYPE_SINT64:
                Field type sint64.

                ```proto
                TYPE_SINT64 = 18
                ```
        """

        TYPE_UNKNOWN = 0
        TYPE_DOUBLE = 1
        TYPE_FLOAT = 2
        TYPE_INT64 = 3
        TYPE_UINT64 = 4
        TYPE_INT32 = 5
        TYPE_FIXED64 = 6
        TYPE_FIXED32 = 7
        TYPE_BOOL = 8
        TYPE_STRING = 9
        TYPE_GROUP = 10
        TYPE_MESSAGE = 11
        TYPE_BYTES = 12
        TYPE_UINT32 = 13
        TYPE_ENUM = 14
        TYPE_SFIXED32 = 15
        TYPE_SFIXED64 = 16
        TYPE_SINT32 = 17
        TYPE_SINT64 = 18

    class Cardinality(Enum_):
        """
        Whether a field is optional, required, or repeated.

        ```proto
        enum google.protobuf.Field.Cardinality
        ```

        Attributes:
            UNKNOWN:
                For fields with unknown cardinality.

                ```proto
                CARDINALITY_UNKNOWN = 0
                ```
            OPTIONAL:
                For optional fields.

                ```proto
                CARDINALITY_OPTIONAL = 1
                ```
            REQUIRED:
                For required fields. Proto2 syntax only.

                ```proto
                CARDINALITY_REQUIRED = 2
                ```
            REPEATED:
                For repeated fields.

                ```proto
                CARDINALITY_REPEATED = 3
                ```
        """

        UNKNOWN = 0
        OPTIONAL = 1
        REQUIRED = 2
        REPEATED = 3


_EnumFields: TypeAlias = Literal[
    "name", "enumvalue", "options", "source_context", "syntax", "edition"
]


class Enum(Message[_EnumFields]):
    """
    Enum type definition.

    New usages of this message as an alternative to EnumDescriptorProto are
    strongly discouraged. This message does not reliability preserve all
    information necessary to model the schema and preserve semantics. Instead
    make use of FileDescriptorSet which preserves the necessary information.

    ```proto
    message google.protobuf.Enum
    ```

    Attributes:
        name:
            Enum type name.

            ```proto
            string name = 1;
            ```
        enumvalue:
            Enum value definitions.

            ```proto
            repeated google.protobuf.EnumValue enumvalue = 2;
            ```
        options:
            Protocol buffer options.

            ```proto
            repeated google.protobuf.Option options = 3;
            ```
        source_context:
            The source context.

            ```proto
            optional google.protobuf.SourceContext source_context = 4;
            ```
        syntax:
            The source syntax.

            ```proto
            google.protobuf.Syntax syntax = 5;
            ```
        edition:
            The source edition string, only valid when syntax is SYNTAX_EDITIONS.

            ```proto
            string edition = 6;
            ```
    """

    __slots__ = ("name", "enumvalue", "options", "source_context", "syntax", "edition")

    if TYPE_CHECKING:

        def __init__(
            self,
            *,
            name: str = "",
            enumvalue: list[EnumValue] | None = None,
            options: list[Option] | None = None,
            source_context: SourceContext | None = None,
            syntax: Syntax | None = None,
            edition: str = "",
        ) -> None:
            pass

        name: str
        enumvalue: list[EnumValue]
        options: list[Option]
        source_context: SourceContext | None
        syntax: Syntax
        edition: str


_EnumValueFields: TypeAlias = Literal["name", "number", "options"]


class EnumValue(Message[_EnumValueFields]):
    """
    Enum value definition.

    New usages of this message as an alternative to EnumValueDescriptorProto are
    strongly discouraged. This message does not reliability preserve all
    information necessary to model the schema and preserve semantics. Instead
    make use of FileDescriptorSet which preserves the necessary information.

    ```proto
    message google.protobuf.EnumValue
    ```

    Attributes:
        name:
            Enum value name.

            ```proto
            string name = 1;
            ```
        number:
            Enum value number.

            ```proto
            int32 number = 2;
            ```
        options:
            Protocol buffer options.

            ```proto
            repeated google.protobuf.Option options = 3;
            ```
    """

    __slots__ = ("name", "number", "options")

    if TYPE_CHECKING:

        def __init__(
            self,
            *,
            name: str = "",
            number: int = 0,
            options: list[Option] | None = None,
        ) -> None:
            pass

        name: str
        number: int
        options: list[Option]


_OptionFields: TypeAlias = Literal["name", "value"]


class Option(Message[_OptionFields]):
    """
    A protocol buffer option, which can be attached to a message, field,
    enumeration, etc.

    New usages of this message as an alternative to FileOptions, MessageOptions,
    FieldOptions, EnumOptions, EnumValueOptions, ServiceOptions, or MethodOptions
    are strongly discouraged.

    ```proto
    message google.protobuf.Option
    ```

    Attributes:
        name:
            The option's name. For protobuf built-in options (options defined in
            descriptor.proto), this is the short name. For example, `"map_entry"`.
            For custom options, it should be the fully-qualified name. For example,
            `"google.api.http"`.

            ```proto
            string name = 1;
            ```
        value:
            The option's value packed in an Any message. If the value is a primitive,
            the corresponding wrapper type defined in google/protobuf/wrappers.proto
            should be used. If the value is an enum, it should be stored as an int32
            value using the google.protobuf.Int32Value type.

            ```proto
            optional google.protobuf.Any value = 2;
            ```
    """

    __slots__ = ("name", "value")

    if TYPE_CHECKING:

        def __init__(self, *, name: str = "", value: Any | None = None) -> None:
            pass

        name: str
        value: Any | None


class Syntax(Enum_):
    """
    The syntax in which a protocol buffer element is defined.

    ```proto
    enum google.protobuf.Syntax
    ```

    Attributes:
        PROTO2:
            Syntax `proto2`.

            ```proto
            SYNTAX_PROTO2 = 0
            ```
        PROTO3:
            Syntax `proto3`.

            ```proto
            SYNTAX_PROTO3 = 1
            ```
        EDITIONS:
            Syntax `editions`.

            ```proto
            SYNTAX_EDITIONS = 2
            ```
    """

    PROTO2 = 0
    PROTO3 = 1
    EDITIONS = 2


_DESC = file_desc(
    b'\n\x1agoogle/protobuf/type.proto\x12\x0fgoogle.protobuf\x1a\x19google/protobuf/any.proto\x1a$google/protobuf/source_context.proto"\xa7\x02\n\x04Type\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12.\n\x06fields\x18\x02 \x03(\x0b2\x16.google.protobuf.FieldR\x06fields\x12\x16\n\x06oneofs\x18\x03 \x03(\tR\x06oneofs\x121\n\x07options\x18\x04 \x03(\x0b2\x17.google.protobuf.OptionR\x07options\x12E\n\x0esource_context\x18\x05 \x01(\x0b2\x1e.google.protobuf.SourceContextR\rsourceContext\x12/\n\x06syntax\x18\x06 \x01(\x0e2\x17.google.protobuf.SyntaxR\x06syntax\x12\x18\n\x07edition\x18\x07 \x01(\tR\x07edition"\xb4\x06\n\x05Field\x12/\n\x04kind\x18\x01 \x01(\x0e2\x1b.google.protobuf.Field.KindR\x04kind\x12D\n\x0bcardinality\x18\x02 \x01(\x0e2".google.protobuf.Field.CardinalityR\x0bcardinality\x12\x16\n\x06number\x18\x03 \x01(\x05R\x06number\x12\x12\n\x04name\x18\x04 \x01(\tR\x04name\x12\x19\n\x08type_url\x18\x06 \x01(\tR\x07typeUrl\x12\x1f\n\x0boneof_index\x18\x07 \x01(\x05R\noneofIndex\x12\x16\n\x06packed\x18\x08 \x01(\x08R\x06packed\x121\n\x07options\x18\t \x03(\x0b2\x17.google.protobuf.OptionR\x07options\x12\x1b\n\tjson_name\x18\n \x01(\tR\x08jsonName\x12#\n\rdefault_value\x18\x0b \x01(\tR\x0cdefaultValue"\xc8\x02\n\x04Kind\x12\x10\n\x0cTYPE_UNKNOWN\x10\x00\x12\x0f\n\x0bTYPE_DOUBLE\x10\x01\x12\x0e\n\nTYPE_FLOAT\x10\x02\x12\x0e\n\nTYPE_INT64\x10\x03\x12\x0f\n\x0bTYPE_UINT64\x10\x04\x12\x0e\n\nTYPE_INT32\x10\x05\x12\x10\n\x0cTYPE_FIXED64\x10\x06\x12\x10\n\x0cTYPE_FIXED32\x10\x07\x12\r\n\tTYPE_BOOL\x10\x08\x12\x0f\n\x0bTYPE_STRING\x10\t\x12\x0e\n\nTYPE_GROUP\x10\n\x12\x10\n\x0cTYPE_MESSAGE\x10\x0b\x12\x0e\n\nTYPE_BYTES\x10\x0c\x12\x0f\n\x0bTYPE_UINT32\x10\r\x12\r\n\tTYPE_ENUM\x10\x0e\x12\x11\n\rTYPE_SFIXED32\x10\x0f\x12\x11\n\rTYPE_SFIXED64\x10\x10\x12\x0f\n\x0bTYPE_SINT32\x10\x11\x12\x0f\n\x0bTYPE_SINT64\x10\x12"t\n\x0bCardinality\x12\x17\n\x13CARDINALITY_UNKNOWN\x10\x00\x12\x18\n\x14CARDINALITY_OPTIONAL\x10\x01\x12\x18\n\x14CARDINALITY_REQUIRED\x10\x02\x12\x18\n\x14CARDINALITY_REPEATED\x10\x03"\x99\x02\n\x04Enum\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x128\n\tenumvalue\x18\x02 \x03(\x0b2\x1a.google.protobuf.EnumValueR\tenumvalue\x121\n\x07options\x18\x03 \x03(\x0b2\x17.google.protobuf.OptionR\x07options\x12E\n\x0esource_context\x18\x04 \x01(\x0b2\x1e.google.protobuf.SourceContextR\rsourceContext\x12/\n\x06syntax\x18\x05 \x01(\x0e2\x17.google.protobuf.SyntaxR\x06syntax\x12\x18\n\x07edition\x18\x06 \x01(\tR\x07edition"j\n\tEnumValue\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n\x06number\x18\x02 \x01(\x05R\x06number\x121\n\x07options\x18\x03 \x03(\x0b2\x17.google.protobuf.OptionR\x07options"H\n\x06Option\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12*\n\x05value\x18\x02 \x01(\x0b2\x14.google.protobuf.AnyR\x05value*C\n\x06Syntax\x12\x11\n\rSYNTAX_PROTO2\x10\x00\x12\x11\n\rSYNTAX_PROTO3\x10\x01\x12\x13\n\x0fSYNTAX_EDITIONS\x10\x02B{\n\x13com.google.protobufB\tTypeProtoP\x01Z-google.golang.org/protobuf/types/known/typepb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3',
    [any_pb.desc(), source_context_pb.desc()],
    {
        "Type": Type,
        "Field": Field,
        "Field.Kind": Field.Kind,
        "Field.Cardinality": Field.Cardinality,
        "Enum": Enum,
        "EnumValue": EnumValue,
        "Option": Option,
        "Syntax": Syntax,
    },
)


def desc() -> DescFile:
    """Returns the descriptor for the file `google/protobuf/type.proto`."""
    return _DESC
