Fix template bug resulting in empty __post_init__ methods
This commit is contained in:
parent
fc90653ab1
commit
bb646fe26f
@ -172,9 +172,6 @@ class Timestamp(betterproto.Message):
|
|||||||
# count forward in time. Must be from 0 to 999,999,999 inclusive.
|
# count forward in time. Must be from 0 to 999,999,999 inclusive.
|
||||||
nanos: int = betterproto.int32_field(2)
|
nanos: int = betterproto.int32_field(2)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class FieldMask(betterproto.Message):
|
class FieldMask(betterproto.Message):
|
||||||
@ -259,9 +256,6 @@ class FieldMask(betterproto.Message):
|
|||||||
# The set of field mask paths.
|
# The set of field mask paths.
|
||||||
paths: List[str] = betterproto.string_field(1)
|
paths: List[str] = betterproto.string_field(1)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class SourceContext(betterproto.Message):
|
class SourceContext(betterproto.Message):
|
||||||
@ -274,9 +268,6 @@ class SourceContext(betterproto.Message):
|
|||||||
# protobuf element. For example: `"google/protobuf/source_context.proto"`.
|
# protobuf element. For example: `"google/protobuf/source_context.proto"`.
|
||||||
file_name: str = betterproto.string_field(1)
|
file_name: str = betterproto.string_field(1)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class Any(betterproto.Message):
|
class Any(betterproto.Message):
|
||||||
@ -335,9 +326,6 @@ class Any(betterproto.Message):
|
|||||||
# Must be a valid serialized protocol buffer of the above specified type.
|
# Must be a valid serialized protocol buffer of the above specified type.
|
||||||
value: bytes = betterproto.bytes_field(2)
|
value: bytes = betterproto.bytes_field(2)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class Type(betterproto.Message):
|
class Type(betterproto.Message):
|
||||||
@ -356,9 +344,6 @@ class Type(betterproto.Message):
|
|||||||
# The source syntax.
|
# The source syntax.
|
||||||
syntax: "Syntax" = betterproto.enum_field(6)
|
syntax: "Syntax" = betterproto.enum_field(6)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class Field(betterproto.Message):
|
class Field(betterproto.Message):
|
||||||
@ -387,9 +372,6 @@ class Field(betterproto.Message):
|
|||||||
# The string value of the default value of this field. Proto2 syntax only.
|
# The string value of the default value of this field. Proto2 syntax only.
|
||||||
default_value: str = betterproto.string_field(11)
|
default_value: str = betterproto.string_field(11)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class Enum(betterproto.Message):
|
class Enum(betterproto.Message):
|
||||||
@ -408,9 +390,6 @@ class Enum(betterproto.Message):
|
|||||||
# The source syntax.
|
# The source syntax.
|
||||||
syntax: "Syntax" = betterproto.enum_field(5)
|
syntax: "Syntax" = betterproto.enum_field(5)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class EnumValue(betterproto.Message):
|
class EnumValue(betterproto.Message):
|
||||||
@ -423,9 +402,6 @@ class EnumValue(betterproto.Message):
|
|||||||
# Protocol buffer options.
|
# Protocol buffer options.
|
||||||
options: List["Option"] = betterproto.message_field(3)
|
options: List["Option"] = betterproto.message_field(3)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class Option(betterproto.Message):
|
class Option(betterproto.Message):
|
||||||
@ -445,9 +421,6 @@ class Option(betterproto.Message):
|
|||||||
# value using the google.protobuf.Int32Value type.
|
# value using the google.protobuf.Int32Value type.
|
||||||
value: "Any" = betterproto.message_field(2)
|
value: "Any" = betterproto.message_field(2)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class Api(betterproto.Message):
|
class Api(betterproto.Message):
|
||||||
@ -491,9 +464,6 @@ class Api(betterproto.Message):
|
|||||||
# The source syntax of the service.
|
# The source syntax of the service.
|
||||||
syntax: "Syntax" = betterproto.enum_field(7)
|
syntax: "Syntax" = betterproto.enum_field(7)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class Method(betterproto.Message):
|
class Method(betterproto.Message):
|
||||||
@ -514,9 +484,6 @@ class Method(betterproto.Message):
|
|||||||
# The source syntax of this method.
|
# The source syntax of this method.
|
||||||
syntax: "Syntax" = betterproto.enum_field(7)
|
syntax: "Syntax" = betterproto.enum_field(7)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class Mixin(betterproto.Message):
|
class Mixin(betterproto.Message):
|
||||||
@ -562,9 +529,6 @@ class Mixin(betterproto.Message):
|
|||||||
# If non-empty specifies a path under which inherited HTTP paths are rooted.
|
# If non-empty specifies a path under which inherited HTTP paths are rooted.
|
||||||
root: str = betterproto.string_field(2)
|
root: str = betterproto.string_field(2)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class Duration(betterproto.Message):
|
class Duration(betterproto.Message):
|
||||||
@ -610,9 +574,6 @@ class Duration(betterproto.Message):
|
|||||||
# `seconds` field. Must be from -999,999,999 to +999,999,999 inclusive.
|
# `seconds` field. Must be from -999,999,999 to +999,999,999 inclusive.
|
||||||
nanos: int = betterproto.int32_field(2)
|
nanos: int = betterproto.int32_field(2)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class Struct(betterproto.Message):
|
class Struct(betterproto.Message):
|
||||||
@ -630,9 +591,6 @@ class Struct(betterproto.Message):
|
|||||||
1, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE
|
1, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE
|
||||||
)
|
)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class Value(betterproto.Message):
|
class Value(betterproto.Message):
|
||||||
@ -657,9 +615,6 @@ class Value(betterproto.Message):
|
|||||||
# Represents a repeated `Value`.
|
# Represents a repeated `Value`.
|
||||||
list_value: "ListValue" = betterproto.message_field(6, group="kind")
|
list_value: "ListValue" = betterproto.message_field(6, group="kind")
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class ListValue(betterproto.Message):
|
class ListValue(betterproto.Message):
|
||||||
@ -671,9 +626,6 @@ class ListValue(betterproto.Message):
|
|||||||
# Repeated field of dynamically typed values.
|
# Repeated field of dynamically typed values.
|
||||||
values: List["Value"] = betterproto.message_field(1)
|
values: List["Value"] = betterproto.message_field(1)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class DoubleValue(betterproto.Message):
|
class DoubleValue(betterproto.Message):
|
||||||
@ -685,9 +637,6 @@ class DoubleValue(betterproto.Message):
|
|||||||
# The double value.
|
# The double value.
|
||||||
value: float = betterproto.double_field(1)
|
value: float = betterproto.double_field(1)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class FloatValue(betterproto.Message):
|
class FloatValue(betterproto.Message):
|
||||||
@ -699,9 +648,6 @@ class FloatValue(betterproto.Message):
|
|||||||
# The float value.
|
# The float value.
|
||||||
value: float = betterproto.float_field(1)
|
value: float = betterproto.float_field(1)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class Int64Value(betterproto.Message):
|
class Int64Value(betterproto.Message):
|
||||||
@ -713,9 +659,6 @@ class Int64Value(betterproto.Message):
|
|||||||
# The int64 value.
|
# The int64 value.
|
||||||
value: int = betterproto.int64_field(1)
|
value: int = betterproto.int64_field(1)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class UInt64Value(betterproto.Message):
|
class UInt64Value(betterproto.Message):
|
||||||
@ -727,9 +670,6 @@ class UInt64Value(betterproto.Message):
|
|||||||
# The uint64 value.
|
# The uint64 value.
|
||||||
value: int = betterproto.uint64_field(1)
|
value: int = betterproto.uint64_field(1)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class Int32Value(betterproto.Message):
|
class Int32Value(betterproto.Message):
|
||||||
@ -741,9 +681,6 @@ class Int32Value(betterproto.Message):
|
|||||||
# The int32 value.
|
# The int32 value.
|
||||||
value: int = betterproto.int32_field(1)
|
value: int = betterproto.int32_field(1)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class UInt32Value(betterproto.Message):
|
class UInt32Value(betterproto.Message):
|
||||||
@ -755,9 +692,6 @@ class UInt32Value(betterproto.Message):
|
|||||||
# The uint32 value.
|
# The uint32 value.
|
||||||
value: int = betterproto.uint32_field(1)
|
value: int = betterproto.uint32_field(1)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class BoolValue(betterproto.Message):
|
class BoolValue(betterproto.Message):
|
||||||
@ -769,9 +703,6 @@ class BoolValue(betterproto.Message):
|
|||||||
# The bool value.
|
# The bool value.
|
||||||
value: bool = betterproto.bool_field(1)
|
value: bool = betterproto.bool_field(1)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class StringValue(betterproto.Message):
|
class StringValue(betterproto.Message):
|
||||||
@ -783,9 +714,6 @@ class StringValue(betterproto.Message):
|
|||||||
# The string value.
|
# The string value.
|
||||||
value: str = betterproto.string_field(1)
|
value: str = betterproto.string_field(1)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class BytesValue(betterproto.Message):
|
class BytesValue(betterproto.Message):
|
||||||
@ -797,9 +725,6 @@ class BytesValue(betterproto.Message):
|
|||||||
# The bytes value.
|
# The bytes value.
|
||||||
value: bytes = betterproto.bytes_field(1)
|
value: bytes = betterproto.bytes_field(1)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class Empty(betterproto.Message):
|
class Empty(betterproto.Message):
|
||||||
@ -813,9 +738,6 @@ class Empty(betterproto.Message):
|
|||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class FileDescriptorSet(betterproto.Message):
|
class FileDescriptorSet(betterproto.Message):
|
||||||
@ -826,9 +748,6 @@ class FileDescriptorSet(betterproto.Message):
|
|||||||
|
|
||||||
file: List["FileDescriptorProto"] = betterproto.message_field(1)
|
file: List["FileDescriptorProto"] = betterproto.message_field(1)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class FileDescriptorProto(betterproto.Message):
|
class FileDescriptorProto(betterproto.Message):
|
||||||
@ -858,9 +777,6 @@ class FileDescriptorProto(betterproto.Message):
|
|||||||
# "proto3".
|
# "proto3".
|
||||||
syntax: str = betterproto.string_field(12)
|
syntax: str = betterproto.string_field(12)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class DescriptorProto(betterproto.Message):
|
class DescriptorProto(betterproto.Message):
|
||||||
@ -881,9 +797,6 @@ class DescriptorProto(betterproto.Message):
|
|||||||
# A given name may only be reserved once.
|
# A given name may only be reserved once.
|
||||||
reserved_name: List[str] = betterproto.string_field(10)
|
reserved_name: List[str] = betterproto.string_field(10)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class DescriptorProtoExtensionRange(betterproto.Message):
|
class DescriptorProtoExtensionRange(betterproto.Message):
|
||||||
@ -891,9 +804,6 @@ class DescriptorProtoExtensionRange(betterproto.Message):
|
|||||||
end: int = betterproto.int32_field(2)
|
end: int = betterproto.int32_field(2)
|
||||||
options: "ExtensionRangeOptions" = betterproto.message_field(3)
|
options: "ExtensionRangeOptions" = betterproto.message_field(3)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class DescriptorProtoReservedRange(betterproto.Message):
|
class DescriptorProtoReservedRange(betterproto.Message):
|
||||||
@ -906,18 +816,12 @@ class DescriptorProtoReservedRange(betterproto.Message):
|
|||||||
start: int = betterproto.int32_field(1)
|
start: int = betterproto.int32_field(1)
|
||||||
end: int = betterproto.int32_field(2)
|
end: int = betterproto.int32_field(2)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class ExtensionRangeOptions(betterproto.Message):
|
class ExtensionRangeOptions(betterproto.Message):
|
||||||
# The parser stores options it doesn't recognize here. See above.
|
# The parser stores options it doesn't recognize here. See above.
|
||||||
uninterpreted_option: List["UninterpretedOption"] = betterproto.message_field(999)
|
uninterpreted_option: List["UninterpretedOption"] = betterproto.message_field(999)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class FieldDescriptorProto(betterproto.Message):
|
class FieldDescriptorProto(betterproto.Message):
|
||||||
@ -952,9 +856,6 @@ class FieldDescriptorProto(betterproto.Message):
|
|||||||
json_name: str = betterproto.string_field(10)
|
json_name: str = betterproto.string_field(10)
|
||||||
options: "FieldOptions" = betterproto.message_field(8)
|
options: "FieldOptions" = betterproto.message_field(8)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class OneofDescriptorProto(betterproto.Message):
|
class OneofDescriptorProto(betterproto.Message):
|
||||||
@ -963,9 +864,6 @@ class OneofDescriptorProto(betterproto.Message):
|
|||||||
name: str = betterproto.string_field(1)
|
name: str = betterproto.string_field(1)
|
||||||
options: "OneofOptions" = betterproto.message_field(2)
|
options: "OneofOptions" = betterproto.message_field(2)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class EnumDescriptorProto(betterproto.Message):
|
class EnumDescriptorProto(betterproto.Message):
|
||||||
@ -984,9 +882,6 @@ class EnumDescriptorProto(betterproto.Message):
|
|||||||
# be reserved once.
|
# be reserved once.
|
||||||
reserved_name: List[str] = betterproto.string_field(5)
|
reserved_name: List[str] = betterproto.string_field(5)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class EnumDescriptorProtoEnumReservedRange(betterproto.Message):
|
class EnumDescriptorProtoEnumReservedRange(betterproto.Message):
|
||||||
@ -1000,9 +895,6 @@ class EnumDescriptorProtoEnumReservedRange(betterproto.Message):
|
|||||||
start: int = betterproto.int32_field(1)
|
start: int = betterproto.int32_field(1)
|
||||||
end: int = betterproto.int32_field(2)
|
end: int = betterproto.int32_field(2)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class EnumValueDescriptorProto(betterproto.Message):
|
class EnumValueDescriptorProto(betterproto.Message):
|
||||||
@ -1012,9 +904,6 @@ class EnumValueDescriptorProto(betterproto.Message):
|
|||||||
number: int = betterproto.int32_field(2)
|
number: int = betterproto.int32_field(2)
|
||||||
options: "EnumValueOptions" = betterproto.message_field(3)
|
options: "EnumValueOptions" = betterproto.message_field(3)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class ServiceDescriptorProto(betterproto.Message):
|
class ServiceDescriptorProto(betterproto.Message):
|
||||||
@ -1024,9 +913,6 @@ class ServiceDescriptorProto(betterproto.Message):
|
|||||||
method: List["MethodDescriptorProto"] = betterproto.message_field(2)
|
method: List["MethodDescriptorProto"] = betterproto.message_field(2)
|
||||||
options: "ServiceOptions" = betterproto.message_field(3)
|
options: "ServiceOptions" = betterproto.message_field(3)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class MethodDescriptorProto(betterproto.Message):
|
class MethodDescriptorProto(betterproto.Message):
|
||||||
@ -1043,9 +929,6 @@ class MethodDescriptorProto(betterproto.Message):
|
|||||||
# Identifies if server streams multiple server messages
|
# Identifies if server streams multiple server messages
|
||||||
server_streaming: bool = betterproto.bool_field(6)
|
server_streaming: bool = betterproto.bool_field(6)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class FileOptions(betterproto.Message):
|
class FileOptions(betterproto.Message):
|
||||||
@ -1174,9 +1057,6 @@ class MessageOptions(betterproto.Message):
|
|||||||
# The parser stores options it doesn't recognize here. See above.
|
# The parser stores options it doesn't recognize here. See above.
|
||||||
uninterpreted_option: List["UninterpretedOption"] = betterproto.message_field(999)
|
uninterpreted_option: List["UninterpretedOption"] = betterproto.message_field(999)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class FieldOptions(betterproto.Message):
|
class FieldOptions(betterproto.Message):
|
||||||
@ -1234,18 +1114,12 @@ class FieldOptions(betterproto.Message):
|
|||||||
# The parser stores options it doesn't recognize here. See above.
|
# The parser stores options it doesn't recognize here. See above.
|
||||||
uninterpreted_option: List["UninterpretedOption"] = betterproto.message_field(999)
|
uninterpreted_option: List["UninterpretedOption"] = betterproto.message_field(999)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class OneofOptions(betterproto.Message):
|
class OneofOptions(betterproto.Message):
|
||||||
# The parser stores options it doesn't recognize here. See above.
|
# The parser stores options it doesn't recognize here. See above.
|
||||||
uninterpreted_option: List["UninterpretedOption"] = betterproto.message_field(999)
|
uninterpreted_option: List["UninterpretedOption"] = betterproto.message_field(999)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class EnumOptions(betterproto.Message):
|
class EnumOptions(betterproto.Message):
|
||||||
@ -1259,9 +1133,6 @@ class EnumOptions(betterproto.Message):
|
|||||||
# The parser stores options it doesn't recognize here. See above.
|
# The parser stores options it doesn't recognize here. See above.
|
||||||
uninterpreted_option: List["UninterpretedOption"] = betterproto.message_field(999)
|
uninterpreted_option: List["UninterpretedOption"] = betterproto.message_field(999)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class EnumValueOptions(betterproto.Message):
|
class EnumValueOptions(betterproto.Message):
|
||||||
@ -1273,9 +1144,6 @@ class EnumValueOptions(betterproto.Message):
|
|||||||
# The parser stores options it doesn't recognize here. See above.
|
# The parser stores options it doesn't recognize here. See above.
|
||||||
uninterpreted_option: List["UninterpretedOption"] = betterproto.message_field(999)
|
uninterpreted_option: List["UninterpretedOption"] = betterproto.message_field(999)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class ServiceOptions(betterproto.Message):
|
class ServiceOptions(betterproto.Message):
|
||||||
@ -1286,9 +1154,6 @@ class ServiceOptions(betterproto.Message):
|
|||||||
# The parser stores options it doesn't recognize here. See above.
|
# The parser stores options it doesn't recognize here. See above.
|
||||||
uninterpreted_option: List["UninterpretedOption"] = betterproto.message_field(999)
|
uninterpreted_option: List["UninterpretedOption"] = betterproto.message_field(999)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class MethodOptions(betterproto.Message):
|
class MethodOptions(betterproto.Message):
|
||||||
@ -1300,9 +1165,6 @@ class MethodOptions(betterproto.Message):
|
|||||||
# The parser stores options it doesn't recognize here. See above.
|
# The parser stores options it doesn't recognize here. See above.
|
||||||
uninterpreted_option: List["UninterpretedOption"] = betterproto.message_field(999)
|
uninterpreted_option: List["UninterpretedOption"] = betterproto.message_field(999)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class UninterpretedOption(betterproto.Message):
|
class UninterpretedOption(betterproto.Message):
|
||||||
@ -1325,9 +1187,6 @@ class UninterpretedOption(betterproto.Message):
|
|||||||
string_value: bytes = betterproto.bytes_field(7)
|
string_value: bytes = betterproto.bytes_field(7)
|
||||||
aggregate_value: str = betterproto.string_field(8)
|
aggregate_value: str = betterproto.string_field(8)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class UninterpretedOptionNamePart(betterproto.Message):
|
class UninterpretedOptionNamePart(betterproto.Message):
|
||||||
@ -1342,9 +1201,6 @@ class UninterpretedOptionNamePart(betterproto.Message):
|
|||||||
name_part: str = betterproto.string_field(1)
|
name_part: str = betterproto.string_field(1)
|
||||||
is_extension: bool = betterproto.bool_field(2)
|
is_extension: bool = betterproto.bool_field(2)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class SourceCodeInfo(betterproto.Message):
|
class SourceCodeInfo(betterproto.Message):
|
||||||
@ -1384,9 +1240,6 @@ class SourceCodeInfo(betterproto.Message):
|
|||||||
# as more types of locations could be recorded in the future.
|
# as more types of locations could be recorded in the future.
|
||||||
location: List["SourceCodeInfoLocation"] = betterproto.message_field(1)
|
location: List["SourceCodeInfoLocation"] = betterproto.message_field(1)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class SourceCodeInfoLocation(betterproto.Message):
|
class SourceCodeInfoLocation(betterproto.Message):
|
||||||
@ -1434,9 +1287,6 @@ class SourceCodeInfoLocation(betterproto.Message):
|
|||||||
trailing_comments: str = betterproto.string_field(4)
|
trailing_comments: str = betterproto.string_field(4)
|
||||||
leading_detached_comments: List[str] = betterproto.string_field(6)
|
leading_detached_comments: List[str] = betterproto.string_field(6)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class GeneratedCodeInfo(betterproto.Message):
|
class GeneratedCodeInfo(betterproto.Message):
|
||||||
@ -1450,9 +1300,6 @@ class GeneratedCodeInfo(betterproto.Message):
|
|||||||
# its generating .proto file.
|
# its generating .proto file.
|
||||||
annotation: List["GeneratedCodeInfoAnnotation"] = betterproto.message_field(1)
|
annotation: List["GeneratedCodeInfoAnnotation"] = betterproto.message_field(1)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class GeneratedCodeInfoAnnotation(betterproto.Message):
|
class GeneratedCodeInfoAnnotation(betterproto.Message):
|
||||||
@ -1468,6 +1315,3 @@ class GeneratedCodeInfoAnnotation(betterproto.Message):
|
|||||||
# the identified offset. The end offset should be one past the last relevant
|
# the identified offset. The end offset should be one past the last relevant
|
||||||
# byte (so the length of the text = end - begin).
|
# byte (so the length of the text = end - begin).
|
||||||
end: int = betterproto.int32_field(4)
|
end: int = betterproto.int32_field(4)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
@ -18,9 +18,6 @@ class Version(betterproto.Message):
|
|||||||
# be empty for mainline stable releases.
|
# be empty for mainline stable releases.
|
||||||
suffix: str = betterproto.string_field(4)
|
suffix: str = betterproto.string_field(4)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class CodeGeneratorRequest(betterproto.Message):
|
class CodeGeneratorRequest(betterproto.Message):
|
||||||
@ -49,9 +46,6 @@ class CodeGeneratorRequest(betterproto.Message):
|
|||||||
# The version number of protocol compiler.
|
# The version number of protocol compiler.
|
||||||
compiler_version: "Version" = betterproto.message_field(3)
|
compiler_version: "Version" = betterproto.message_field(3)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class CodeGeneratorResponse(betterproto.Message):
|
class CodeGeneratorResponse(betterproto.Message):
|
||||||
@ -67,9 +61,6 @@ class CodeGeneratorResponse(betterproto.Message):
|
|||||||
error: str = betterproto.string_field(1)
|
error: str = betterproto.string_field(1)
|
||||||
file: List["CodeGeneratorResponseFile"] = betterproto.message_field(15)
|
file: List["CodeGeneratorResponseFile"] = betterproto.message_field(15)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass(eq=False, repr=False)
|
@dataclass(eq=False, repr=False)
|
||||||
class CodeGeneratorResponseFile(betterproto.Message):
|
class CodeGeneratorResponseFile(betterproto.Message):
|
||||||
@ -118,8 +109,5 @@ class CodeGeneratorResponseFile(betterproto.Message):
|
|||||||
# The file contents.
|
# The file contents.
|
||||||
content: str = betterproto.string_field(15)
|
content: str = betterproto.string_field(15)
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
|
||||||
super().__post_init__()
|
|
||||||
|
|
||||||
|
|
||||||
import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf
|
import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf
|
||||||
|
@ -312,6 +312,10 @@ class MessageCompiler(ProtoContentBase):
|
|||||||
if f.deprecated:
|
if f.deprecated:
|
||||||
yield f.py_name
|
yield f.py_name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def has_deprecated_fields(self) -> bool:
|
||||||
|
return any(self.deprecated_fields)
|
||||||
|
|
||||||
|
|
||||||
def is_map(
|
def is_map(
|
||||||
proto_field_obj: FieldDescriptorProto, parent_message: DescriptorProto
|
proto_field_obj: FieldDescriptorProto, parent_message: DescriptorProto
|
||||||
|
@ -54,7 +54,7 @@ class {{ message.py_name }}(betterproto.Message):
|
|||||||
pass
|
pass
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if message.deprecated or message.deprecated_fields %}
|
{% if message.deprecated or message.has_deprecated_fields %}
|
||||||
def __post_init__(self) -> None:
|
def __post_init__(self) -> None:
|
||||||
{% if message.deprecated %}
|
{% if message.deprecated %}
|
||||||
warnings.warn("{{ message.py_name }} is deprecated", DeprecationWarning)
|
warnings.warn("{{ message.py_name }} is deprecated", DeprecationWarning)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user