| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- # 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/struct.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, Message
- from protobuf._codegen import file_desc
- from protobuf.wkt._mixin import ListValueMixin, StructMixin, ValueMixin
- if TYPE_CHECKING:
- from protobuf import DescFile, Oneof
- _StructFields: TypeAlias = Literal["fields"]
- class Struct(Message[_StructFields], StructMixin):
- """
- Represents a JSON object.
- An unordered key-value map, intending to perfectly capture the semantics of a
- JSON object. This enables parsing any arbitrary JSON payload as a message
- field in ProtoJSON format.
- This follows RFC 8259 guidelines for interoperable JSON: notably this type
- cannot represent large Int64 values or `NaN`/`Infinity` numbers,
- since the JSON format generally does not support those values in its number
- type.
- If you do not intend to parse arbitrary JSON into your message, a custom
- typed message should be preferred instead of using this type.
- ```proto
- message google.protobuf.Struct
- ```
- Attributes:
- fields:
- Unordered map of dynamically typed values.
- ```proto
- map<string, google.protobuf.Value> fields = 1;
- ```
- """
- __slots__ = ("fields",)
- if TYPE_CHECKING:
- def __init__(self, *, fields: dict[str, Value] | None = None) -> None:
- pass
- fields: dict[str, Value]
- _ValueFields: TypeAlias = Literal[
- "null_value",
- "number_value",
- "string_value",
- "bool_value",
- "struct_value",
- "list_value",
- ]
- class Value(Message[_ValueFields], ValueMixin):
- """
- Represents a JSON value.
- `Value` represents a dynamically typed value which can be either
- null, a number, a string, a boolean, a recursive struct value, or a
- list of values. A producer of value is expected to set one of these
- variants. Absence of any variant is an invalid state.
- ```proto
- message google.protobuf.Value
- ```
- Attributes:
- kind:
- The kind of value.
- ```proto
- oneof kind
- ```
- """
- __slots__ = ("kind",)
- if TYPE_CHECKING:
- def __init__(
- self,
- *,
- kind: Oneof[Literal["null_value"], NullValue]
- | Oneof[Literal["number_value"], float]
- | Oneof[Literal["string_value"], str]
- | Oneof[Literal["bool_value"], bool]
- | Oneof[Literal["struct_value"], Struct]
- | Oneof[Literal["list_value"], ListValue]
- | None = None,
- ) -> None:
- pass
- kind: (
- Oneof[Literal["null_value"], NullValue]
- | Oneof[Literal["number_value"], float]
- | Oneof[Literal["string_value"], str]
- | Oneof[Literal["bool_value"], bool]
- | Oneof[Literal["struct_value"], Struct]
- | Oneof[Literal["list_value"], ListValue]
- | None
- )
- _ListValueFields: TypeAlias = Literal["values"]
- class ListValue(Message[_ListValueFields], ListValueMixin):
- """
- Represents a JSON array.
- ```proto
- message google.protobuf.ListValue
- ```
- Attributes:
- values:
- Repeated field of dynamically typed values.
- ```proto
- repeated google.protobuf.Value values = 1;
- ```
- """
- __slots__ = ("values",)
- if TYPE_CHECKING:
- def __init__(self, *, values: list[Value] | None = None) -> None:
- pass
- values: list[Value]
- class NullValue(Enum):
- """
- Represents a JSON `null`.
- `NullValue` is a sentinel, using an enum with only one value to represent
- the null value for the `Value` type union.
- A field of type `NullValue` with any value other than `0` is considered
- invalid. Most ProtoJSON serializers will emit a Value with a `null_value` set
- as a JSON `null` regardless of the integer value, and so will round trip to
- a `0` value.
- ```proto
- enum google.protobuf.NullValue
- ```
- Attributes:
- NULL_VALUE:
- Null value.
- ```proto
- NULL_VALUE = 0
- ```
- """
- NULL_VALUE = 0
- _DESC = file_desc(
- b'\n\x1cgoogle/protobuf/struct.proto\x12\x0fgoogle.protobuf"\x98\x01\n\x06Struct\x12;\n\x06fields\x18\x01 \x03(\x0b2#.google.protobuf.Struct.FieldsEntryR\x06fields\x1aQ\n\x0bFieldsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12,\n\x05value\x18\x02 \x01(\x0b2\x16.google.protobuf.ValueR\x05value:\x028\x01"\xb2\x02\n\x05Value\x12;\n\nnull_value\x18\x01 \x01(\x0e2\x1a.google.protobuf.NullValueH\x00R\tnullValue\x12#\n\x0cnumber_value\x18\x02 \x01(\x01H\x00R\x0bnumberValue\x12#\n\x0cstring_value\x18\x03 \x01(\tH\x00R\x0bstringValue\x12\x1f\n\nbool_value\x18\x04 \x01(\x08H\x00R\tboolValue\x12<\n\x0cstruct_value\x18\x05 \x01(\x0b2\x17.google.protobuf.StructH\x00R\x0bstructValue\x12;\n\nlist_value\x18\x06 \x01(\x0b2\x1a.google.protobuf.ListValueH\x00R\tlistValueB\x06\n\x04kind";\n\tListValue\x12.\n\x06values\x18\x01 \x03(\x0b2\x16.google.protobuf.ValueR\x06values*\x1b\n\tNullValue\x12\x0e\n\nNULL_VALUE\x10\x00B\x7f\n\x13com.google.protobufB\x0bStructProtoP\x01Z/google.golang.org/protobuf/types/known/structpb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3',
- [],
- {"Struct": Struct, "Value": Value, "ListValue": ListValue, "NullValue": NullValue},
- )
- def desc() -> DescFile:
- """Returns the descriptor for the file `google/protobuf/struct.proto`."""
- return _DESC
|