go_features_pb.py 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. # Copyright (c) 2025-2026 Buf Technologies, Inc.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. # Generated from google/protobuf/go_features.proto. DO NOT EDIT.
  15. # Generated by protoc-gen-py v0.1.1 with parameter "no_fmt_off".
  16. # ruff: noqa: PGH004
  17. # ruff: noqa
  18. from __future__ import annotations
  19. from typing import Final, Literal, NoReturn, TYPE_CHECKING, TypeAlias
  20. from protobuf import Enum, Extension, Message
  21. from protobuf._codegen import file_desc
  22. from . import descriptor_pb
  23. from .descriptor_pb import FeatureSet
  24. if TYPE_CHECKING:
  25. from protobuf import DescFile
  26. _GoFeaturesFields: TypeAlias = Literal[
  27. "legacy_unmarshal_json_enum", "api_level", "strip_enum_prefix", "optimize_mode"
  28. ]
  29. class GoFeatures(Message[_GoFeaturesFields]):
  30. """
  31. ```proto
  32. message pb.GoFeatures
  33. ```
  34. Attributes:
  35. legacy_unmarshal_json_enum:
  36. Whether or not to generate the deprecated UnmarshalJSON method for enums.
  37. Can only be true for proto using the Open Struct api.
  38. ```proto
  39. optional bool legacy_unmarshal_json_enum = 1;
  40. ```
  41. api_level:
  42. One of OPEN, HYBRID or OPAQUE.
  43. ```proto
  44. optional pb.GoFeatures.APILevel api_level = 2;
  45. ```
  46. strip_enum_prefix:
  47. ```proto
  48. optional pb.GoFeatures.StripEnumPrefix strip_enum_prefix = 3;
  49. ```
  50. optimize_mode:
  51. ```proto
  52. optional pb.GoFeatures.OptimizeModeFeature.OptimizeMode optimize_mode = 4;
  53. ```
  54. """
  55. __slots__ = (
  56. "legacy_unmarshal_json_enum",
  57. "api_level",
  58. "strip_enum_prefix",
  59. "optimize_mode",
  60. )
  61. if TYPE_CHECKING:
  62. def __init__(
  63. self,
  64. *,
  65. legacy_unmarshal_json_enum: bool | None = None,
  66. api_level: GoFeatures.APILevel | None = None,
  67. strip_enum_prefix: GoFeatures.StripEnumPrefix | None = None,
  68. optimize_mode: GoFeatures.OptimizeModeFeature.OptimizeMode | None = None,
  69. ) -> None:
  70. pass
  71. legacy_unmarshal_json_enum: bool
  72. api_level: GoFeatures.APILevel
  73. strip_enum_prefix: GoFeatures.StripEnumPrefix
  74. optimize_mode: GoFeatures.OptimizeModeFeature.OptimizeMode
  75. _OptimizeModeFeatureFields: TypeAlias = NoReturn
  76. class OptimizeModeFeature(Message[_OptimizeModeFeatureFields]):
  77. """
  78. Wrap the OptimizeMode enum in a message for scoping:
  79. This way, users can type shorter names (SPEED, CODE_SIZE).
  80. ```proto
  81. message pb.GoFeatures.OptimizeModeFeature
  82. ```
  83. """
  84. __slots__ = ()
  85. if TYPE_CHECKING:
  86. def __init__(self) -> None:
  87. pass
  88. class OptimizeMode(Enum):
  89. """
  90. The name of this enum matches OptimizeMode in descriptor.proto.
  91. ```proto
  92. enum pb.GoFeatures.OptimizeModeFeature.OptimizeMode
  93. ```
  94. Attributes:
  95. UNSPECIFIED:
  96. OPTIMIZE_MODE_UNSPECIFIED results in falling back to the default
  97. (optimize for code size), but needs to be a separate value to distinguish
  98. between an explicitly set optimize mode or a missing optimize mode.
  99. ```proto
  100. OPTIMIZE_MODE_UNSPECIFIED = 0
  101. ```
  102. SPEED:
  103. ```proto
  104. SPEED = 1
  105. ```
  106. CODE_SIZE:
  107. There is no enum entry for LITE_RUNTIME (descriptor.proto),
  108. because Go Protobuf does not have the concept of a lite runtime.
  109. ```proto
  110. CODE_SIZE = 2
  111. ```
  112. """
  113. UNSPECIFIED = 0
  114. SPEED = 1
  115. CODE_SIZE = 2
  116. class APILevel(Enum):
  117. """
  118. ```proto
  119. enum pb.GoFeatures.APILevel
  120. ```
  121. Attributes:
  122. UNSPECIFIED:
  123. API_LEVEL_UNSPECIFIED results in selecting the OPEN API,
  124. but needs to be a separate value to distinguish between
  125. an explicitly set api level or a missing api level.
  126. ```proto
  127. API_LEVEL_UNSPECIFIED = 0
  128. ```
  129. API_OPEN:
  130. ```proto
  131. API_OPEN = 1
  132. ```
  133. API_HYBRID:
  134. ```proto
  135. API_HYBRID = 2
  136. ```
  137. API_OPAQUE:
  138. ```proto
  139. API_OPAQUE = 3
  140. ```
  141. """
  142. UNSPECIFIED = 0
  143. API_OPEN = 1
  144. API_HYBRID = 2
  145. API_OPAQUE = 3
  146. class StripEnumPrefix(Enum):
  147. """
  148. ```proto
  149. enum pb.GoFeatures.StripEnumPrefix
  150. ```
  151. Attributes:
  152. UNSPECIFIED:
  153. ```proto
  154. STRIP_ENUM_PREFIX_UNSPECIFIED = 0
  155. ```
  156. KEEP:
  157. ```proto
  158. STRIP_ENUM_PREFIX_KEEP = 1
  159. ```
  160. GENERATE_BOTH:
  161. ```proto
  162. STRIP_ENUM_PREFIX_GENERATE_BOTH = 2
  163. ```
  164. STRIP:
  165. ```proto
  166. STRIP_ENUM_PREFIX_STRIP = 3
  167. ```
  168. """
  169. UNSPECIFIED = 0
  170. KEEP = 1
  171. GENERATE_BOTH = 2
  172. STRIP = 3
  173. ext_go: Final[Extension[FeatureSet, GoFeatures]] = Extension()
  174. """
  175. ```proto
  176. extend google.protobuf.FeatureSet { optional pb.GoFeatures go = 1002 [json_name = "[pb.go]"] }
  177. ```
  178. """
  179. _DESC = file_desc(
  180. b'\n!google/protobuf/go_features.proto\x12\x02pb\x1a google/protobuf/descriptor.proto"\x94\x07\n\nGoFeatures\x12\xbe\x01\n\x1alegacy_unmarshal_json_enum\x18\x01 \x01(\x08R\x17legacyUnmarshalJsonEnumB\x80\x01\x88\x01\x01\x98\x01\x06\x98\x01\x01\xa2\x01\t\x18\x84\x07\x12\x04true\xa2\x01\n\x18\xe7\x07\x12\x05false\xb2\x01[\x08\xe8\x07\x10\xe8\x07\x1aSThe legacy UnmarshalJSON API is deprecated and will be removed in a future edition.\x12t\n\tapi_level\x18\x02 \x01(\x0e2\x17.pb.GoFeatures.APILevelR\x08apiLevelB>\x88\x01\x01\x98\x01\x03\x98\x01\x01\xa2\x01\x1a\x18\x84\x07\x12\x15API_LEVEL_UNSPECIFIED\xa2\x01\x0f\x18\xe9\x07\x12\nAPI_OPAQUE\xb2\x01\x03\x08\xe8\x07\x12|\n\x11strip_enum_prefix\x18\x03 \x01(\x0e2\x1e.pb.GoFeatures.StripEnumPrefixR\x0fstripEnumPrefixB0\x88\x01\x01\x98\x01\x06\x98\x01\x07\x98\x01\x01\xa2\x01\x1b\x18\x84\x07\x12\x16STRIP_ENUM_PREFIX_KEEP\xb2\x01\x03\x08\xe9\x07\x12\x86\x01\n\roptimize_mode\x18\x04 \x01(\x0e2/.pb.GoFeatures.OptimizeModeFeature.OptimizeModeR\x0coptimizeModeB0\x88\x01\x01\x98\x01\x03\x98\x01\x01\xa2\x01\x1e\x18\x84\x07\x12\x19OPTIMIZE_MODE_UNSPECIFIED\xb2\x01\x03\x08\xe9\x07\x1a^\n\x13OptimizeModeFeature"G\n\x0cOptimizeMode\x12\x1d\n\x19OPTIMIZE_MODE_UNSPECIFIED\x10\x00\x12\t\n\x05SPEED\x10\x01\x12\r\n\tCODE_SIZE\x10\x02"S\n\x08APILevel\x12\x19\n\x15API_LEVEL_UNSPECIFIED\x10\x00\x12\x0c\n\x08API_OPEN\x10\x01\x12\x0e\n\nAPI_HYBRID\x10\x02\x12\x0e\n\nAPI_OPAQUE\x10\x03"\x92\x01\n\x0fStripEnumPrefix\x12!\n\x1dSTRIP_ENUM_PREFIX_UNSPECIFIED\x10\x00\x12\x1a\n\x16STRIP_ENUM_PREFIX_KEEP\x10\x01\x12#\n\x1fSTRIP_ENUM_PREFIX_GENERATE_BOTH\x10\x02\x12\x1b\n\x17STRIP_ENUM_PREFIX_STRIP\x10\x03:<\n\x02go\x18\xea\x07 \x01(\x0b2\x0e.pb.GoFeatures\x12\x1b.google.protobuf.FeatureSetR\x02goB/Z-google.golang.org/protobuf/types/gofeaturespb',
  181. [descriptor_pb.desc()],
  182. {
  183. "GoFeatures": GoFeatures,
  184. "GoFeatures.OptimizeModeFeature": GoFeatures.OptimizeModeFeature,
  185. "GoFeatures.OptimizeModeFeature.OptimizeMode": GoFeatures.OptimizeModeFeature.OptimizeMode,
  186. "GoFeatures.APILevel": GoFeatures.APILevel,
  187. "GoFeatures.StripEnumPrefix": GoFeatures.StripEnumPrefix,
  188. "go": ext_go,
  189. },
  190. )
  191. def desc() -> DescFile:
  192. """Returns the descriptor for the file `google/protobuf/go_features.proto`."""
  193. return _DESC