envoy_types/generated/google.protobuf.rs
1// This file is @generated by prost-build.
2/// A Timestamp represents a point in time independent of any time zone or local
3/// calendar, encoded as a count of seconds and fractions of seconds at
4/// nanosecond resolution. The count is relative to an epoch at UTC midnight on
5/// January 1, 1970, in the proleptic Gregorian calendar which extends the
6/// Gregorian calendar backwards to year one.
7///
8/// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
9/// second table is needed for interpretation, using a [24-hour linear
10/// smear](<https://developers.google.com/time/smear>).
11///
12/// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
13/// restricting to that range, we ensure that we can convert to and from [RFC
14/// 3339](<https://www.ietf.org/rfc/rfc3339.txt>) date strings.
15///
16/// # Examples
17///
18/// Example 1: Compute Timestamp from POSIX `time()`.
19///
20/// ```text
21/// Timestamp timestamp;
22/// timestamp.set_seconds(time(NULL));
23/// timestamp.set_nanos(0);
24/// ```
25///
26/// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
27///
28/// ```text
29/// struct timeval tv;
30/// gettimeofday(&tv, NULL);
31///
32/// Timestamp timestamp;
33/// timestamp.set_seconds(tv.tv_sec);
34/// timestamp.set_nanos(tv.tv_usec * 1000);
35/// ```
36///
37/// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
38///
39/// ```text
40/// FILETIME ft;
41/// GetSystemTimeAsFileTime(&ft);
42/// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
43///
44/// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
45/// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
46/// Timestamp timestamp;
47/// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
48/// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
49/// ```
50///
51/// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
52///
53/// ```text
54/// long millis = System.currentTimeMillis();
55///
56/// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
57/// .setNanos((int) ((millis % 1000) * 1000000)).build();
58/// ```
59///
60/// Example 5: Compute Timestamp from Java `Instant.now()`.
61///
62/// ```text
63/// Instant now = Instant.now();
64///
65/// Timestamp timestamp =
66/// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
67/// .setNanos(now.getNano()).build();
68/// ```
69///
70/// Example 6: Compute Timestamp from current time in Python.
71///
72/// ```text
73/// timestamp = Timestamp()
74/// timestamp.GetCurrentTime()
75/// ```
76///
77/// # JSON Mapping
78///
79/// In JSON format, the Timestamp type is encoded as a string in the
80/// [RFC 3339](<https://www.ietf.org/rfc/rfc3339.txt>) format. That is, the
81/// format is "{year}-{month}-{day}T{hour}:{min}:{sec}\[.{frac_sec}\]Z"
82/// where {year} is always expressed using four digits while {month}, {day},
83/// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
84/// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
85/// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
86/// is required. A proto3 JSON serializer should always use UTC (as indicated by
87/// "Z") when printing the Timestamp type and a proto3 JSON parser should be
88/// able to accept both UTC and other timezones (as indicated by an offset).
89///
90/// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
91/// 01:30 UTC on January 15, 2017.
92///
93/// In JavaScript, one can convert a Date object to this format using the
94/// standard
95/// [toISOString()](<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString>)
96/// method. In Python, a standard `datetime.datetime` object can be converted
97/// to this format using
98/// [`strftime`](<https://docs.python.org/2/library/time.html#time.strftime>) with
99/// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
100/// the Joda Time's [`ISODateTimeFormat.dateTime()`](<http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime(>)) to obtain a formatter capable of generating timestamps in this format.
101#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
102pub struct Timestamp {
103 /// Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
104 /// be between -315576000000 and 315576000000 inclusive (which corresponds to
105 /// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
106 #[prost(int64, tag = "1")]
107 pub seconds: i64,
108 /// Non-negative fractions of a second at nanosecond resolution. This field is
109 /// the nanosecond portion of the duration, not an alternative to seconds.
110 /// Negative second values with fractions must still have non-negative nanos
111 /// values that count forward in time. Must be between 0 and 999,999,999
112 /// inclusive.
113 #[prost(int32, tag = "2")]
114 pub nanos: i32,
115}
116impl ::prost::Name for Timestamp {
117 const NAME: &'static str = "Timestamp";
118 const PACKAGE: &'static str = "google.protobuf";
119 fn full_name() -> ::prost::alloc::string::String {
120 "google.protobuf.Timestamp".into()
121 }
122 fn type_url() -> ::prost::alloc::string::String {
123 "type.googleapis.com/google.protobuf.Timestamp".into()
124 }
125}
126/// The protocol compiler can output a FileDescriptorSet containing the .proto
127/// files it parses.
128#[derive(Clone, PartialEq, ::prost::Message)]
129pub struct FileDescriptorSet {
130 #[prost(message, repeated, tag = "1")]
131 pub file: ::prost::alloc::vec::Vec<FileDescriptorProto>,
132}
133impl ::prost::Name for FileDescriptorSet {
134 const NAME: &'static str = "FileDescriptorSet";
135 const PACKAGE: &'static str = "google.protobuf";
136 fn full_name() -> ::prost::alloc::string::String {
137 "google.protobuf.FileDescriptorSet".into()
138 }
139 fn type_url() -> ::prost::alloc::string::String {
140 "type.googleapis.com/google.protobuf.FileDescriptorSet".into()
141 }
142}
143/// Describes a complete .proto file.
144#[derive(Clone, PartialEq, ::prost::Message)]
145pub struct FileDescriptorProto {
146 /// file name, relative to root of source tree
147 #[prost(string, optional, tag = "1")]
148 pub name: ::core::option::Option<::prost::alloc::string::String>,
149 /// e.g. "foo", "foo.bar", etc.
150 #[prost(string, optional, tag = "2")]
151 pub package: ::core::option::Option<::prost::alloc::string::String>,
152 /// Names of files imported by this file.
153 #[prost(string, repeated, tag = "3")]
154 pub dependency: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
155 /// Indexes of the public imported files in the dependency list above.
156 #[prost(int32, repeated, packed = "false", tag = "10")]
157 pub public_dependency: ::prost::alloc::vec::Vec<i32>,
158 /// Indexes of the weak imported files in the dependency list.
159 /// For Google-internal migration only. Do not use.
160 #[prost(int32, repeated, packed = "false", tag = "11")]
161 pub weak_dependency: ::prost::alloc::vec::Vec<i32>,
162 /// Names of files imported by this file purely for the purpose of providing
163 /// option extensions. These are excluded from the dependency list above.
164 #[prost(string, repeated, tag = "15")]
165 pub option_dependency: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
166 /// All top-level definitions in this file.
167 #[prost(message, repeated, tag = "4")]
168 pub message_type: ::prost::alloc::vec::Vec<DescriptorProto>,
169 #[prost(message, repeated, tag = "5")]
170 pub enum_type: ::prost::alloc::vec::Vec<EnumDescriptorProto>,
171 #[prost(message, repeated, tag = "6")]
172 pub service: ::prost::alloc::vec::Vec<ServiceDescriptorProto>,
173 #[prost(message, repeated, tag = "7")]
174 pub extension: ::prost::alloc::vec::Vec<FieldDescriptorProto>,
175 #[prost(message, optional, tag = "8")]
176 pub options: ::core::option::Option<FileOptions>,
177 /// This field contains optional information about the original source code.
178 /// You may safely remove this entire field without harming runtime
179 /// functionality of the descriptors -- the information is needed only by
180 /// development tools.
181 #[prost(message, optional, tag = "9")]
182 pub source_code_info: ::core::option::Option<SourceCodeInfo>,
183 /// The syntax of the proto file.
184 /// The supported values are "proto2", "proto3", and "editions".
185 ///
186 /// If `edition` is present, this value must be "editions".
187 /// WARNING: This field should only be used by protobuf plugins or special
188 /// cases like the proto compiler. Other uses are discouraged and
189 /// developers should rely on the protoreflect APIs for their client language.
190 #[prost(string, optional, tag = "12")]
191 pub syntax: ::core::option::Option<::prost::alloc::string::String>,
192 /// The edition of the proto file.
193 /// WARNING: This field should only be used by protobuf plugins or special
194 /// cases like the proto compiler. Other uses are discouraged and
195 /// developers should rely on the protoreflect APIs for their client language.
196 #[prost(enumeration = "Edition", optional, tag = "14")]
197 pub edition: ::core::option::Option<i32>,
198}
199impl ::prost::Name for FileDescriptorProto {
200 const NAME: &'static str = "FileDescriptorProto";
201 const PACKAGE: &'static str = "google.protobuf";
202 fn full_name() -> ::prost::alloc::string::String {
203 "google.protobuf.FileDescriptorProto".into()
204 }
205 fn type_url() -> ::prost::alloc::string::String {
206 "type.googleapis.com/google.protobuf.FileDescriptorProto".into()
207 }
208}
209/// Describes a message type.
210#[derive(Clone, PartialEq, ::prost::Message)]
211pub struct DescriptorProto {
212 #[prost(string, optional, tag = "1")]
213 pub name: ::core::option::Option<::prost::alloc::string::String>,
214 #[prost(message, repeated, tag = "2")]
215 pub field: ::prost::alloc::vec::Vec<FieldDescriptorProto>,
216 #[prost(message, repeated, tag = "6")]
217 pub extension: ::prost::alloc::vec::Vec<FieldDescriptorProto>,
218 #[prost(message, repeated, tag = "3")]
219 pub nested_type: ::prost::alloc::vec::Vec<DescriptorProto>,
220 #[prost(message, repeated, tag = "4")]
221 pub enum_type: ::prost::alloc::vec::Vec<EnumDescriptorProto>,
222 #[prost(message, repeated, tag = "5")]
223 pub extension_range: ::prost::alloc::vec::Vec<descriptor_proto::ExtensionRange>,
224 #[prost(message, repeated, tag = "8")]
225 pub oneof_decl: ::prost::alloc::vec::Vec<OneofDescriptorProto>,
226 #[prost(message, optional, tag = "7")]
227 pub options: ::core::option::Option<MessageOptions>,
228 #[prost(message, repeated, tag = "9")]
229 pub reserved_range: ::prost::alloc::vec::Vec<descriptor_proto::ReservedRange>,
230 /// Reserved field names, which may not be used by fields in the same message.
231 /// A given name may only be reserved once.
232 #[prost(string, repeated, tag = "10")]
233 pub reserved_name: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
234 /// Support for `export` and `local` keywords on enums.
235 #[prost(enumeration = "SymbolVisibility", optional, tag = "11")]
236 pub visibility: ::core::option::Option<i32>,
237}
238/// Nested message and enum types in `DescriptorProto`.
239pub mod descriptor_proto {
240 #[derive(Clone, PartialEq, ::prost::Message)]
241 pub struct ExtensionRange {
242 /// Inclusive.
243 #[prost(int32, optional, tag = "1")]
244 pub start: ::core::option::Option<i32>,
245 /// Exclusive.
246 #[prost(int32, optional, tag = "2")]
247 pub end: ::core::option::Option<i32>,
248 #[prost(message, optional, tag = "3")]
249 pub options: ::core::option::Option<super::ExtensionRangeOptions>,
250 }
251 impl ::prost::Name for ExtensionRange {
252 const NAME: &'static str = "ExtensionRange";
253 const PACKAGE: &'static str = "google.protobuf";
254 fn full_name() -> ::prost::alloc::string::String {
255 "google.protobuf.DescriptorProto.ExtensionRange".into()
256 }
257 fn type_url() -> ::prost::alloc::string::String {
258 "type.googleapis.com/google.protobuf.DescriptorProto.ExtensionRange".into()
259 }
260 }
261 /// Range of reserved tag numbers. Reserved tag numbers may not be used by
262 /// fields or extension ranges in the same message. Reserved ranges may
263 /// not overlap.
264 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
265 pub struct ReservedRange {
266 /// Inclusive.
267 #[prost(int32, optional, tag = "1")]
268 pub start: ::core::option::Option<i32>,
269 /// Exclusive.
270 #[prost(int32, optional, tag = "2")]
271 pub end: ::core::option::Option<i32>,
272 }
273 impl ::prost::Name for ReservedRange {
274 const NAME: &'static str = "ReservedRange";
275 const PACKAGE: &'static str = "google.protobuf";
276 fn full_name() -> ::prost::alloc::string::String {
277 "google.protobuf.DescriptorProto.ReservedRange".into()
278 }
279 fn type_url() -> ::prost::alloc::string::String {
280 "type.googleapis.com/google.protobuf.DescriptorProto.ReservedRange".into()
281 }
282 }
283}
284impl ::prost::Name for DescriptorProto {
285 const NAME: &'static str = "DescriptorProto";
286 const PACKAGE: &'static str = "google.protobuf";
287 fn full_name() -> ::prost::alloc::string::String {
288 "google.protobuf.DescriptorProto".into()
289 }
290 fn type_url() -> ::prost::alloc::string::String {
291 "type.googleapis.com/google.protobuf.DescriptorProto".into()
292 }
293}
294#[derive(Clone, PartialEq, ::prost::Message)]
295pub struct ExtensionRangeOptions {
296 /// The parser stores options it doesn't recognize here. See above.
297 #[prost(message, repeated, tag = "999")]
298 pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
299 /// For external users: DO NOT USE. We are in the process of open sourcing
300 /// extension declaration and executing internal cleanups before it can be
301 /// used externally.
302 #[prost(message, repeated, tag = "2")]
303 pub declaration: ::prost::alloc::vec::Vec<extension_range_options::Declaration>,
304 /// Any features defined in the specific edition.
305 #[prost(message, optional, tag = "50")]
306 pub features: ::core::option::Option<FeatureSet>,
307 /// The verification state of the range.
308 /// TODO: flip the default to DECLARATION once all empty ranges
309 /// are marked as UNVERIFIED.
310 #[prost(
311 enumeration = "extension_range_options::VerificationState",
312 optional,
313 tag = "3",
314 default = "Unverified"
315 )]
316 pub verification: ::core::option::Option<i32>,
317}
318/// Nested message and enum types in `ExtensionRangeOptions`.
319pub mod extension_range_options {
320 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
321 pub struct Declaration {
322 /// The extension number declared within the extension range.
323 #[prost(int32, optional, tag = "1")]
324 pub number: ::core::option::Option<i32>,
325 /// The fully-qualified name of the extension field. There must be a leading
326 /// dot in front of the full name.
327 #[prost(string, optional, tag = "2")]
328 pub full_name: ::core::option::Option<::prost::alloc::string::String>,
329 /// The fully-qualified type name of the extension field. Unlike
330 /// Metadata.type, Declaration.type must have a leading dot for messages
331 /// and enums.
332 #[prost(string, optional, tag = "3")]
333 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
334 /// If true, indicates that the number is reserved in the extension range,
335 /// and any extension field with the number will fail to compile. Set this
336 /// when a declared extension field is deleted.
337 #[prost(bool, optional, tag = "5")]
338 pub reserved: ::core::option::Option<bool>,
339 /// If true, indicates that the extension must be defined as repeated.
340 /// Otherwise the extension must be defined as optional.
341 #[prost(bool, optional, tag = "6")]
342 pub repeated: ::core::option::Option<bool>,
343 }
344 impl ::prost::Name for Declaration {
345 const NAME: &'static str = "Declaration";
346 const PACKAGE: &'static str = "google.protobuf";
347 fn full_name() -> ::prost::alloc::string::String {
348 "google.protobuf.ExtensionRangeOptions.Declaration".into()
349 }
350 fn type_url() -> ::prost::alloc::string::String {
351 "type.googleapis.com/google.protobuf.ExtensionRangeOptions.Declaration"
352 .into()
353 }
354 }
355 /// The verification state of the extension range.
356 #[derive(
357 Clone,
358 Copy,
359 Debug,
360 PartialEq,
361 Eq,
362 Hash,
363 PartialOrd,
364 Ord,
365 ::prost::Enumeration
366 )]
367 #[repr(i32)]
368 pub enum VerificationState {
369 /// All the extensions of the range must be declared.
370 Declaration = 0,
371 Unverified = 1,
372 }
373 impl VerificationState {
374 /// String value of the enum field names used in the ProtoBuf definition.
375 ///
376 /// The values are not transformed in any way and thus are considered stable
377 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
378 pub fn as_str_name(&self) -> &'static str {
379 match self {
380 Self::Declaration => "DECLARATION",
381 Self::Unverified => "UNVERIFIED",
382 }
383 }
384 /// Creates an enum from field names used in the ProtoBuf definition.
385 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
386 match value {
387 "DECLARATION" => Some(Self::Declaration),
388 "UNVERIFIED" => Some(Self::Unverified),
389 _ => None,
390 }
391 }
392 }
393}
394impl ::prost::Name for ExtensionRangeOptions {
395 const NAME: &'static str = "ExtensionRangeOptions";
396 const PACKAGE: &'static str = "google.protobuf";
397 fn full_name() -> ::prost::alloc::string::String {
398 "google.protobuf.ExtensionRangeOptions".into()
399 }
400 fn type_url() -> ::prost::alloc::string::String {
401 "type.googleapis.com/google.protobuf.ExtensionRangeOptions".into()
402 }
403}
404/// Describes a field within a message.
405#[derive(Clone, PartialEq, ::prost::Message)]
406pub struct FieldDescriptorProto {
407 #[prost(string, optional, tag = "1")]
408 pub name: ::core::option::Option<::prost::alloc::string::String>,
409 #[prost(int32, optional, tag = "3")]
410 pub number: ::core::option::Option<i32>,
411 #[prost(enumeration = "field_descriptor_proto::Label", optional, tag = "4")]
412 pub label: ::core::option::Option<i32>,
413 /// If type_name is set, this need not be set. If both this and type_name
414 /// are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
415 #[prost(enumeration = "field_descriptor_proto::Type", optional, tag = "5")]
416 pub r#type: ::core::option::Option<i32>,
417 /// For message and enum types, this is the name of the type. If the name
418 /// starts with a '.', it is fully-qualified. Otherwise, C++-like scoping
419 /// rules are used to find the type (i.e. first the nested types within this
420 /// message are searched, then within the parent, on up to the root
421 /// namespace).
422 #[prost(string, optional, tag = "6")]
423 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
424 /// For extensions, this is the name of the type being extended. It is
425 /// resolved in the same manner as type_name.
426 #[prost(string, optional, tag = "2")]
427 pub extendee: ::core::option::Option<::prost::alloc::string::String>,
428 /// For numeric types, contains the original text representation of the value.
429 /// For booleans, "true" or "false".
430 /// For strings, contains the default text contents (not escaped in any way).
431 /// For bytes, contains the C escaped value. All bytes >= 128 are escaped.
432 #[prost(string, optional, tag = "7")]
433 pub default_value: ::core::option::Option<::prost::alloc::string::String>,
434 /// If set, gives the index of a oneof in the containing type's oneof_decl
435 /// list. This field is a member of that oneof.
436 #[prost(int32, optional, tag = "9")]
437 pub oneof_index: ::core::option::Option<i32>,
438 /// JSON name of this field. The value is set by protocol compiler. If the
439 /// user has set a "json_name" option on this field, that option's value
440 /// will be used. Otherwise, it's deduced from the field's name by converting
441 /// it to camelCase.
442 #[prost(string, optional, tag = "10")]
443 pub json_name: ::core::option::Option<::prost::alloc::string::String>,
444 #[prost(message, optional, tag = "8")]
445 pub options: ::core::option::Option<FieldOptions>,
446 /// If true, this is a proto3 "optional". When a proto3 field is optional, it
447 /// tracks presence regardless of field type.
448 ///
449 /// When proto3_optional is true, this field must belong to a oneof to signal
450 /// to old proto3 clients that presence is tracked for this field. This oneof
451 /// is known as a "synthetic" oneof, and this field must be its sole member
452 /// (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs
453 /// exist in the descriptor only, and do not generate any API. Synthetic oneofs
454 /// must be ordered after all "real" oneofs.
455 ///
456 /// For message fields, proto3_optional doesn't create any semantic change,
457 /// since non-repeated message fields always track presence. However it still
458 /// indicates the semantic detail of whether the user wrote "optional" or not.
459 /// This can be useful for round-tripping the .proto file. For consistency we
460 /// give message fields a synthetic oneof also, even though it is not required
461 /// to track presence. This is especially important because the parser can't
462 /// tell if a field is a message or an enum, so it must always create a
463 /// synthetic oneof.
464 ///
465 /// Proto2 optional fields do not set this flag, because they already indicate
466 /// optional with `LABEL_OPTIONAL`.
467 #[prost(bool, optional, tag = "17")]
468 pub proto3_optional: ::core::option::Option<bool>,
469}
470/// Nested message and enum types in `FieldDescriptorProto`.
471pub mod field_descriptor_proto {
472 #[derive(
473 Clone,
474 Copy,
475 Debug,
476 PartialEq,
477 Eq,
478 Hash,
479 PartialOrd,
480 Ord,
481 ::prost::Enumeration
482 )]
483 #[repr(i32)]
484 pub enum Type {
485 /// 0 is reserved for errors.
486 /// Order is weird for historical reasons.
487 Double = 1,
488 Float = 2,
489 /// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
490 /// negative values are likely.
491 Int64 = 3,
492 Uint64 = 4,
493 /// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
494 /// negative values are likely.
495 Int32 = 5,
496 Fixed64 = 6,
497 Fixed32 = 7,
498 Bool = 8,
499 String = 9,
500 /// Tag-delimited aggregate.
501 /// Group type is deprecated and not supported after google.protobuf. However, Proto3
502 /// implementations should still be able to parse the group wire format and
503 /// treat group fields as unknown fields. In Editions, the group wire format
504 /// can be enabled via the `message_encoding` feature.
505 Group = 10,
506 /// Length-delimited aggregate.
507 Message = 11,
508 /// New in version 2.
509 Bytes = 12,
510 Uint32 = 13,
511 Enum = 14,
512 Sfixed32 = 15,
513 Sfixed64 = 16,
514 /// Uses ZigZag encoding.
515 Sint32 = 17,
516 /// Uses ZigZag encoding.
517 Sint64 = 18,
518 }
519 impl Type {
520 /// String value of the enum field names used in the ProtoBuf definition.
521 ///
522 /// The values are not transformed in any way and thus are considered stable
523 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
524 pub fn as_str_name(&self) -> &'static str {
525 match self {
526 Self::Double => "TYPE_DOUBLE",
527 Self::Float => "TYPE_FLOAT",
528 Self::Int64 => "TYPE_INT64",
529 Self::Uint64 => "TYPE_UINT64",
530 Self::Int32 => "TYPE_INT32",
531 Self::Fixed64 => "TYPE_FIXED64",
532 Self::Fixed32 => "TYPE_FIXED32",
533 Self::Bool => "TYPE_BOOL",
534 Self::String => "TYPE_STRING",
535 Self::Group => "TYPE_GROUP",
536 Self::Message => "TYPE_MESSAGE",
537 Self::Bytes => "TYPE_BYTES",
538 Self::Uint32 => "TYPE_UINT32",
539 Self::Enum => "TYPE_ENUM",
540 Self::Sfixed32 => "TYPE_SFIXED32",
541 Self::Sfixed64 => "TYPE_SFIXED64",
542 Self::Sint32 => "TYPE_SINT32",
543 Self::Sint64 => "TYPE_SINT64",
544 }
545 }
546 /// Creates an enum from field names used in the ProtoBuf definition.
547 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
548 match value {
549 "TYPE_DOUBLE" => Some(Self::Double),
550 "TYPE_FLOAT" => Some(Self::Float),
551 "TYPE_INT64" => Some(Self::Int64),
552 "TYPE_UINT64" => Some(Self::Uint64),
553 "TYPE_INT32" => Some(Self::Int32),
554 "TYPE_FIXED64" => Some(Self::Fixed64),
555 "TYPE_FIXED32" => Some(Self::Fixed32),
556 "TYPE_BOOL" => Some(Self::Bool),
557 "TYPE_STRING" => Some(Self::String),
558 "TYPE_GROUP" => Some(Self::Group),
559 "TYPE_MESSAGE" => Some(Self::Message),
560 "TYPE_BYTES" => Some(Self::Bytes),
561 "TYPE_UINT32" => Some(Self::Uint32),
562 "TYPE_ENUM" => Some(Self::Enum),
563 "TYPE_SFIXED32" => Some(Self::Sfixed32),
564 "TYPE_SFIXED64" => Some(Self::Sfixed64),
565 "TYPE_SINT32" => Some(Self::Sint32),
566 "TYPE_SINT64" => Some(Self::Sint64),
567 _ => None,
568 }
569 }
570 }
571 #[derive(
572 Clone,
573 Copy,
574 Debug,
575 PartialEq,
576 Eq,
577 Hash,
578 PartialOrd,
579 Ord,
580 ::prost::Enumeration
581 )]
582 #[repr(i32)]
583 pub enum Label {
584 /// 0 is reserved for errors
585 Optional = 1,
586 Repeated = 3,
587 /// The required label is only allowed in google.protobuf. In proto3 and Editions
588 /// it's explicitly prohibited. In Editions, the `field_presence` feature
589 /// can be used to get this behavior.
590 Required = 2,
591 }
592 impl Label {
593 /// String value of the enum field names used in the ProtoBuf definition.
594 ///
595 /// The values are not transformed in any way and thus are considered stable
596 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
597 pub fn as_str_name(&self) -> &'static str {
598 match self {
599 Self::Optional => "LABEL_OPTIONAL",
600 Self::Repeated => "LABEL_REPEATED",
601 Self::Required => "LABEL_REQUIRED",
602 }
603 }
604 /// Creates an enum from field names used in the ProtoBuf definition.
605 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
606 match value {
607 "LABEL_OPTIONAL" => Some(Self::Optional),
608 "LABEL_REPEATED" => Some(Self::Repeated),
609 "LABEL_REQUIRED" => Some(Self::Required),
610 _ => None,
611 }
612 }
613 }
614}
615impl ::prost::Name for FieldDescriptorProto {
616 const NAME: &'static str = "FieldDescriptorProto";
617 const PACKAGE: &'static str = "google.protobuf";
618 fn full_name() -> ::prost::alloc::string::String {
619 "google.protobuf.FieldDescriptorProto".into()
620 }
621 fn type_url() -> ::prost::alloc::string::String {
622 "type.googleapis.com/google.protobuf.FieldDescriptorProto".into()
623 }
624}
625/// Describes a oneof.
626#[derive(Clone, PartialEq, ::prost::Message)]
627pub struct OneofDescriptorProto {
628 #[prost(string, optional, tag = "1")]
629 pub name: ::core::option::Option<::prost::alloc::string::String>,
630 #[prost(message, optional, tag = "2")]
631 pub options: ::core::option::Option<OneofOptions>,
632}
633impl ::prost::Name for OneofDescriptorProto {
634 const NAME: &'static str = "OneofDescriptorProto";
635 const PACKAGE: &'static str = "google.protobuf";
636 fn full_name() -> ::prost::alloc::string::String {
637 "google.protobuf.OneofDescriptorProto".into()
638 }
639 fn type_url() -> ::prost::alloc::string::String {
640 "type.googleapis.com/google.protobuf.OneofDescriptorProto".into()
641 }
642}
643/// Describes an enum type.
644#[derive(Clone, PartialEq, ::prost::Message)]
645pub struct EnumDescriptorProto {
646 #[prost(string, optional, tag = "1")]
647 pub name: ::core::option::Option<::prost::alloc::string::String>,
648 #[prost(message, repeated, tag = "2")]
649 pub value: ::prost::alloc::vec::Vec<EnumValueDescriptorProto>,
650 #[prost(message, optional, tag = "3")]
651 pub options: ::core::option::Option<EnumOptions>,
652 /// Range of reserved numeric values. Reserved numeric values may not be used
653 /// by enum values in the same enum declaration. Reserved ranges may not
654 /// overlap.
655 #[prost(message, repeated, tag = "4")]
656 pub reserved_range: ::prost::alloc::vec::Vec<
657 enum_descriptor_proto::EnumReservedRange,
658 >,
659 /// Reserved enum value names, which may not be reused. A given name may only
660 /// be reserved once.
661 #[prost(string, repeated, tag = "5")]
662 pub reserved_name: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
663 /// Support for `export` and `local` keywords on enums.
664 #[prost(enumeration = "SymbolVisibility", optional, tag = "6")]
665 pub visibility: ::core::option::Option<i32>,
666}
667/// Nested message and enum types in `EnumDescriptorProto`.
668pub mod enum_descriptor_proto {
669 /// Range of reserved numeric values. Reserved values may not be used by
670 /// entries in the same enum. Reserved ranges may not overlap.
671 ///
672 /// Note that this is distinct from DescriptorProto.ReservedRange in that it
673 /// is inclusive such that it can appropriately represent the entire int32
674 /// domain.
675 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
676 pub struct EnumReservedRange {
677 /// Inclusive.
678 #[prost(int32, optional, tag = "1")]
679 pub start: ::core::option::Option<i32>,
680 /// Inclusive.
681 #[prost(int32, optional, tag = "2")]
682 pub end: ::core::option::Option<i32>,
683 }
684 impl ::prost::Name for EnumReservedRange {
685 const NAME: &'static str = "EnumReservedRange";
686 const PACKAGE: &'static str = "google.protobuf";
687 fn full_name() -> ::prost::alloc::string::String {
688 "google.protobuf.EnumDescriptorProto.EnumReservedRange".into()
689 }
690 fn type_url() -> ::prost::alloc::string::String {
691 "type.googleapis.com/google.protobuf.EnumDescriptorProto.EnumReservedRange"
692 .into()
693 }
694 }
695}
696impl ::prost::Name for EnumDescriptorProto {
697 const NAME: &'static str = "EnumDescriptorProto";
698 const PACKAGE: &'static str = "google.protobuf";
699 fn full_name() -> ::prost::alloc::string::String {
700 "google.protobuf.EnumDescriptorProto".into()
701 }
702 fn type_url() -> ::prost::alloc::string::String {
703 "type.googleapis.com/google.protobuf.EnumDescriptorProto".into()
704 }
705}
706/// Describes a value within an enum.
707#[derive(Clone, PartialEq, ::prost::Message)]
708pub struct EnumValueDescriptorProto {
709 #[prost(string, optional, tag = "1")]
710 pub name: ::core::option::Option<::prost::alloc::string::String>,
711 #[prost(int32, optional, tag = "2")]
712 pub number: ::core::option::Option<i32>,
713 #[prost(message, optional, tag = "3")]
714 pub options: ::core::option::Option<EnumValueOptions>,
715}
716impl ::prost::Name for EnumValueDescriptorProto {
717 const NAME: &'static str = "EnumValueDescriptorProto";
718 const PACKAGE: &'static str = "google.protobuf";
719 fn full_name() -> ::prost::alloc::string::String {
720 "google.protobuf.EnumValueDescriptorProto".into()
721 }
722 fn type_url() -> ::prost::alloc::string::String {
723 "type.googleapis.com/google.protobuf.EnumValueDescriptorProto".into()
724 }
725}
726/// Describes a service.
727#[derive(Clone, PartialEq, ::prost::Message)]
728pub struct ServiceDescriptorProto {
729 #[prost(string, optional, tag = "1")]
730 pub name: ::core::option::Option<::prost::alloc::string::String>,
731 #[prost(message, repeated, tag = "2")]
732 pub method: ::prost::alloc::vec::Vec<MethodDescriptorProto>,
733 #[prost(message, optional, tag = "3")]
734 pub options: ::core::option::Option<ServiceOptions>,
735}
736impl ::prost::Name for ServiceDescriptorProto {
737 const NAME: &'static str = "ServiceDescriptorProto";
738 const PACKAGE: &'static str = "google.protobuf";
739 fn full_name() -> ::prost::alloc::string::String {
740 "google.protobuf.ServiceDescriptorProto".into()
741 }
742 fn type_url() -> ::prost::alloc::string::String {
743 "type.googleapis.com/google.protobuf.ServiceDescriptorProto".into()
744 }
745}
746/// Describes a method of a service.
747#[derive(Clone, PartialEq, ::prost::Message)]
748pub struct MethodDescriptorProto {
749 #[prost(string, optional, tag = "1")]
750 pub name: ::core::option::Option<::prost::alloc::string::String>,
751 /// Input and output type names. These are resolved in the same way as
752 /// FieldDescriptorProto.type_name, but must refer to a message type.
753 #[prost(string, optional, tag = "2")]
754 pub input_type: ::core::option::Option<::prost::alloc::string::String>,
755 #[prost(string, optional, tag = "3")]
756 pub output_type: ::core::option::Option<::prost::alloc::string::String>,
757 #[prost(message, optional, tag = "4")]
758 pub options: ::core::option::Option<MethodOptions>,
759 /// Identifies if client streams multiple client messages
760 #[prost(bool, optional, tag = "5", default = "false")]
761 pub client_streaming: ::core::option::Option<bool>,
762 /// Identifies if server streams multiple server messages
763 #[prost(bool, optional, tag = "6", default = "false")]
764 pub server_streaming: ::core::option::Option<bool>,
765}
766impl ::prost::Name for MethodDescriptorProto {
767 const NAME: &'static str = "MethodDescriptorProto";
768 const PACKAGE: &'static str = "google.protobuf";
769 fn full_name() -> ::prost::alloc::string::String {
770 "google.protobuf.MethodDescriptorProto".into()
771 }
772 fn type_url() -> ::prost::alloc::string::String {
773 "type.googleapis.com/google.protobuf.MethodDescriptorProto".into()
774 }
775}
776#[derive(Clone, PartialEq, ::prost::Message)]
777pub struct FileOptions {
778 /// Sets the Java package where classes generated from this .proto will be
779 /// placed. By default, the proto package is used, but this is often
780 /// inappropriate because proto packages do not normally start with backwards
781 /// domain names.
782 #[prost(string, optional, tag = "1")]
783 pub java_package: ::core::option::Option<::prost::alloc::string::String>,
784 /// Controls the name of the wrapper Java class generated for the .proto file.
785 /// That class will always contain the .proto file's getDescriptor() method as
786 /// well as any top-level extensions defined in the .proto file.
787 /// If java_multiple_files is disabled, then all the other classes from the
788 /// .proto file will be nested inside the single wrapper outer class.
789 #[prost(string, optional, tag = "8")]
790 pub java_outer_classname: ::core::option::Option<::prost::alloc::string::String>,
791 /// If enabled, then the Java code generator will generate a separate .java
792 /// file for each top-level message, enum, and service defined in the .proto
793 /// file. Thus, these types will *not* be nested inside the wrapper class
794 /// named by java_outer_classname. However, the wrapper class will still be
795 /// generated to contain the file's getDescriptor() method as well as any
796 /// top-level extensions defined in the file.
797 #[prost(bool, optional, tag = "10", default = "false")]
798 pub java_multiple_files: ::core::option::Option<bool>,
799 /// This option does nothing.
800 #[deprecated]
801 #[prost(bool, optional, tag = "20")]
802 pub java_generate_equals_and_hash: ::core::option::Option<bool>,
803 /// A proto2 file can set this to true to opt in to UTF-8 checking for Java,
804 /// which will throw an exception if invalid UTF-8 is parsed from the wire or
805 /// assigned to a string field.
806 ///
807 /// TODO: clarify exactly what kinds of field types this option
808 /// applies to, and update these docs accordingly.
809 ///
810 /// Proto3 files already perform these checks. Setting the option explicitly to
811 /// false has no effect: it cannot be used to opt proto3 files out of UTF-8
812 /// checks.
813 #[prost(bool, optional, tag = "27", default = "false")]
814 pub java_string_check_utf8: ::core::option::Option<bool>,
815 #[prost(
816 enumeration = "file_options::OptimizeMode",
817 optional,
818 tag = "9",
819 default = "Speed"
820 )]
821 pub optimize_for: ::core::option::Option<i32>,
822 /// Sets the Go package where structs generated from this .proto will be
823 /// placed. If omitted, the Go package will be derived from the following:
824 ///
825 /// * The basename of the package import path, if provided.
826 /// * Otherwise, the package statement in the .proto file, if present.
827 /// * Otherwise, the basename of the .proto file, without extension.
828 #[prost(string, optional, tag = "11")]
829 pub go_package: ::core::option::Option<::prost::alloc::string::String>,
830 /// Should generic services be generated in each language? "Generic" services
831 /// are not specific to any particular RPC system. They are generated by the
832 /// main code generators in each language (without additional plugins).
833 /// Generic services were the only kind of service generation supported by
834 /// early versions of google.protobuf.
835 ///
836 /// Generic services are now considered deprecated in favor of using plugins
837 /// that generate code specific to your particular RPC system. Therefore,
838 /// these default to false. Old code which depends on generic services should
839 /// explicitly set them to true.
840 #[prost(bool, optional, tag = "16", default = "false")]
841 pub cc_generic_services: ::core::option::Option<bool>,
842 #[prost(bool, optional, tag = "17", default = "false")]
843 pub java_generic_services: ::core::option::Option<bool>,
844 #[prost(bool, optional, tag = "18", default = "false")]
845 pub py_generic_services: ::core::option::Option<bool>,
846 /// Is this file deprecated?
847 /// Depending on the target platform, this can emit Deprecated annotations
848 /// for everything in the file, or it will be completely ignored; in the very
849 /// least, this is a formalization for deprecating files.
850 #[prost(bool, optional, tag = "23", default = "false")]
851 pub deprecated: ::core::option::Option<bool>,
852 /// Enables the use of arenas for the proto messages in this file. This applies
853 /// only to generated classes for C++.
854 #[prost(bool, optional, tag = "31", default = "true")]
855 pub cc_enable_arenas: ::core::option::Option<bool>,
856 /// Sets the objective c class prefix which is prepended to all objective c
857 /// generated classes from this .proto. There is no default.
858 #[prost(string, optional, tag = "36")]
859 pub objc_class_prefix: ::core::option::Option<::prost::alloc::string::String>,
860 /// Namespace for generated classes; defaults to the package.
861 #[prost(string, optional, tag = "37")]
862 pub csharp_namespace: ::core::option::Option<::prost::alloc::string::String>,
863 /// By default Swift generators will take the proto package and CamelCase it
864 /// replacing '.' with underscore and use that to prefix the types/symbols
865 /// defined. When this options is provided, they will use this value instead
866 /// to prefix the types/symbols defined.
867 #[prost(string, optional, tag = "39")]
868 pub swift_prefix: ::core::option::Option<::prost::alloc::string::String>,
869 /// Sets the php class prefix which is prepended to all php generated classes
870 /// from this .proto. Default is empty.
871 #[prost(string, optional, tag = "40")]
872 pub php_class_prefix: ::core::option::Option<::prost::alloc::string::String>,
873 /// Use this option to change the namespace of php generated classes. Default
874 /// is empty. When this option is empty, the package name will be used for
875 /// determining the namespace.
876 #[prost(string, optional, tag = "41")]
877 pub php_namespace: ::core::option::Option<::prost::alloc::string::String>,
878 /// Use this option to change the namespace of php generated metadata classes.
879 /// Default is empty. When this option is empty, the proto file name will be
880 /// used for determining the namespace.
881 #[prost(string, optional, tag = "44")]
882 pub php_metadata_namespace: ::core::option::Option<::prost::alloc::string::String>,
883 /// Use this option to change the package of ruby generated classes. Default
884 /// is empty. When this option is not set, the package name will be used for
885 /// determining the ruby package.
886 #[prost(string, optional, tag = "45")]
887 pub ruby_package: ::core::option::Option<::prost::alloc::string::String>,
888 /// Any features defined in the specific edition.
889 /// WARNING: This field should only be used by protobuf plugins or special
890 /// cases like the proto compiler. Other uses are discouraged and
891 /// developers should rely on the protoreflect APIs for their client language.
892 #[prost(message, optional, tag = "50")]
893 pub features: ::core::option::Option<FeatureSet>,
894 /// The parser stores options it doesn't recognize here.
895 /// See the documentation for the "Options" section above.
896 #[prost(message, repeated, tag = "999")]
897 pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
898}
899/// Nested message and enum types in `FileOptions`.
900pub mod file_options {
901 /// Generated classes can be optimized for speed or code size.
902 #[derive(
903 Clone,
904 Copy,
905 Debug,
906 PartialEq,
907 Eq,
908 Hash,
909 PartialOrd,
910 Ord,
911 ::prost::Enumeration
912 )]
913 #[repr(i32)]
914 pub enum OptimizeMode {
915 /// Generate complete code for parsing, serialization,
916 Speed = 1,
917 /// etc.
918 ///
919 /// Use ReflectionOps to implement these methods.
920 CodeSize = 2,
921 /// Generate code using MessageLite and the lite runtime.
922 LiteRuntime = 3,
923 }
924 impl OptimizeMode {
925 /// String value of the enum field names used in the ProtoBuf definition.
926 ///
927 /// The values are not transformed in any way and thus are considered stable
928 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
929 pub fn as_str_name(&self) -> &'static str {
930 match self {
931 Self::Speed => "SPEED",
932 Self::CodeSize => "CODE_SIZE",
933 Self::LiteRuntime => "LITE_RUNTIME",
934 }
935 }
936 /// Creates an enum from field names used in the ProtoBuf definition.
937 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
938 match value {
939 "SPEED" => Some(Self::Speed),
940 "CODE_SIZE" => Some(Self::CodeSize),
941 "LITE_RUNTIME" => Some(Self::LiteRuntime),
942 _ => None,
943 }
944 }
945 }
946}
947impl ::prost::Name for FileOptions {
948 const NAME: &'static str = "FileOptions";
949 const PACKAGE: &'static str = "google.protobuf";
950 fn full_name() -> ::prost::alloc::string::String {
951 "google.protobuf.FileOptions".into()
952 }
953 fn type_url() -> ::prost::alloc::string::String {
954 "type.googleapis.com/google.protobuf.FileOptions".into()
955 }
956}
957#[derive(Clone, PartialEq, ::prost::Message)]
958pub struct MessageOptions {
959 /// Set true to use the old proto1 MessageSet wire format for extensions.
960 /// This is provided for backwards-compatibility with the MessageSet wire
961 /// format. You should not use this for any other reason: It's less
962 /// efficient, has fewer features, and is more complicated.
963 ///
964 /// The message must be defined exactly as follows:
965 /// message Foo {
966 /// option message_set_wire_format = true;
967 /// extensions 4 to max;
968 /// }
969 /// Note that the message cannot have any defined fields; MessageSets only
970 /// have extensions.
971 ///
972 /// All extensions of your type must be singular messages; e.g. they cannot
973 /// be int32s, enums, or repeated messages.
974 ///
975 /// Because this is an option, the above two restrictions are not enforced by
976 /// the protocol compiler.
977 #[prost(bool, optional, tag = "1", default = "false")]
978 pub message_set_wire_format: ::core::option::Option<bool>,
979 /// Disables the generation of the standard "descriptor()" accessor, which can
980 /// conflict with a field of the same name. This is meant to make migration
981 /// from proto1 easier; new code should avoid fields named "descriptor".
982 #[prost(bool, optional, tag = "2", default = "false")]
983 pub no_standard_descriptor_accessor: ::core::option::Option<bool>,
984 /// Is this message deprecated?
985 /// Depending on the target platform, this can emit Deprecated annotations
986 /// for the message, or it will be completely ignored; in the very least,
987 /// this is a formalization for deprecating messages.
988 #[prost(bool, optional, tag = "3", default = "false")]
989 pub deprecated: ::core::option::Option<bool>,
990 /// Whether the message is an automatically generated map entry type for the
991 /// maps field.
992 ///
993 /// For maps fields:
994 /// map\<KeyType, ValueType> map_field = 1;
995 /// The parsed descriptor looks like:
996 /// message MapFieldEntry {
997 /// option map_entry = true;
998 /// optional KeyType key = 1;
999 /// optional ValueType value = 2;
1000 /// }
1001 /// repeated MapFieldEntry map_field = 1;
1002 ///
1003 /// Implementations may choose not to generate the map_entry=true message, but
1004 /// use a native map in the target language to hold the keys and values.
1005 /// The reflection APIs in such implementations still need to work as
1006 /// if the field is a repeated message field.
1007 ///
1008 /// NOTE: Do not set the option in .proto files. Always use the maps syntax
1009 /// instead. The option should only be implicitly set by the proto compiler
1010 /// parser.
1011 #[prost(bool, optional, tag = "7")]
1012 pub map_entry: ::core::option::Option<bool>,
1013 /// Enable the legacy handling of JSON field name conflicts. This lowercases
1014 /// and strips underscored from the fields before comparison in proto3 only.
1015 /// The new behavior takes `json_name` into account and applies to proto2 as
1016 /// well.
1017 ///
1018 /// This should only be used as a temporary measure against broken builds due
1019 /// to the change in behavior for JSON field name conflicts.
1020 ///
1021 /// TODO This is legacy behavior we plan to remove once downstream
1022 /// teams have had time to migrate.
1023 #[deprecated]
1024 #[prost(bool, optional, tag = "11")]
1025 pub deprecated_legacy_json_field_conflicts: ::core::option::Option<bool>,
1026 /// Any features defined in the specific edition.
1027 /// WARNING: This field should only be used by protobuf plugins or special
1028 /// cases like the proto compiler. Other uses are discouraged and
1029 /// developers should rely on the protoreflect APIs for their client language.
1030 #[prost(message, optional, tag = "12")]
1031 pub features: ::core::option::Option<FeatureSet>,
1032 /// The parser stores options it doesn't recognize here. See above.
1033 #[prost(message, repeated, tag = "999")]
1034 pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
1035}
1036impl ::prost::Name for MessageOptions {
1037 const NAME: &'static str = "MessageOptions";
1038 const PACKAGE: &'static str = "google.protobuf";
1039 fn full_name() -> ::prost::alloc::string::String {
1040 "google.protobuf.MessageOptions".into()
1041 }
1042 fn type_url() -> ::prost::alloc::string::String {
1043 "type.googleapis.com/google.protobuf.MessageOptions".into()
1044 }
1045}
1046#[derive(Clone, PartialEq, ::prost::Message)]
1047pub struct FieldOptions {
1048 /// NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead.
1049 /// The ctype option instructs the C++ code generator to use a different
1050 /// representation of the field than it normally would. See the specific
1051 /// options below. This option is only implemented to support use of
1052 /// \[ctype=CORD\] and \[ctype=STRING\] (the default) on non-repeated fields of
1053 /// type "bytes" in the open source release.
1054 /// TODO: make ctype actually deprecated.
1055 #[prost(
1056 enumeration = "field_options::CType",
1057 optional,
1058 tag = "1",
1059 default = "String"
1060 )]
1061 pub ctype: ::core::option::Option<i32>,
1062 /// The packed option can be enabled for repeated primitive fields to enable
1063 /// a more efficient representation on the wire. Rather than repeatedly
1064 /// writing the tag and type for each element, the entire array is encoded as
1065 /// a single length-delimited blob. In proto3, only explicit setting it to
1066 /// false will avoid using packed encoding. This option is prohibited in
1067 /// Editions, but the `repeated_field_encoding` feature can be used to control
1068 /// the behavior.
1069 #[prost(bool, optional, tag = "2")]
1070 pub packed: ::core::option::Option<bool>,
1071 /// The jstype option determines the JavaScript type used for values of the
1072 /// field. The option is permitted only for 64 bit integral and fixed types
1073 /// (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING
1074 /// is represented as JavaScript string, which avoids loss of precision that
1075 /// can happen when a large value is converted to a floating point JavaScript.
1076 /// Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
1077 /// use the JavaScript "number" type. The behavior of the default option
1078 /// JS_NORMAL is implementation dependent.
1079 ///
1080 /// This option is an enum to permit additional types to be added, e.g.
1081 /// goog.math.Integer.
1082 #[prost(
1083 enumeration = "field_options::JsType",
1084 optional,
1085 tag = "6",
1086 default = "JsNormal"
1087 )]
1088 pub jstype: ::core::option::Option<i32>,
1089 /// Should this field be parsed lazily? Lazy applies only to message-type
1090 /// fields. It means that when the outer message is initially parsed, the
1091 /// inner message's contents will not be parsed but instead stored in encoded
1092 /// form. The inner message will actually be parsed when it is first accessed.
1093 ///
1094 /// This is only a hint. Implementations are free to choose whether to use
1095 /// eager or lazy parsing regardless of the value of this option. However,
1096 /// setting this option true suggests that the protocol author believes that
1097 /// using lazy parsing on this field is worth the additional bookkeeping
1098 /// overhead typically needed to implement it.
1099 ///
1100 /// This option does not affect the public interface of any generated code;
1101 /// all method signatures remain the same. Furthermore, thread-safety of the
1102 /// interface is not affected by this option; const methods remain safe to
1103 /// call from multiple threads concurrently, while non-const methods continue
1104 /// to require exclusive access.
1105 ///
1106 /// Note that lazy message fields are still eagerly verified to check
1107 /// ill-formed wireformat or missing required fields. Calling IsInitialized()
1108 /// on the outer message would fail if the inner message has missing required
1109 /// fields. Failed verification would result in parsing failure (except when
1110 /// uninitialized messages are acceptable).
1111 #[prost(bool, optional, tag = "5", default = "false")]
1112 pub lazy: ::core::option::Option<bool>,
1113 /// unverified_lazy does no correctness checks on the byte stream. This should
1114 /// only be used where lazy with verification is prohibitive for performance
1115 /// reasons.
1116 #[prost(bool, optional, tag = "15", default = "false")]
1117 pub unverified_lazy: ::core::option::Option<bool>,
1118 /// Is this field deprecated?
1119 /// Depending on the target platform, this can emit Deprecated annotations
1120 /// for accessors, or it will be completely ignored; in the very least, this
1121 /// is a formalization for deprecating fields.
1122 #[prost(bool, optional, tag = "3", default = "false")]
1123 pub deprecated: ::core::option::Option<bool>,
1124 /// DEPRECATED. DO NOT USE!
1125 /// For Google-internal migration only. Do not use.
1126 #[deprecated]
1127 #[prost(bool, optional, tag = "10", default = "false")]
1128 pub weak: ::core::option::Option<bool>,
1129 /// Indicate that the field value should not be printed out when using debug
1130 /// formats, e.g. when the field contains sensitive credentials.
1131 #[prost(bool, optional, tag = "16", default = "false")]
1132 pub debug_redact: ::core::option::Option<bool>,
1133 #[prost(enumeration = "field_options::OptionRetention", optional, tag = "17")]
1134 pub retention: ::core::option::Option<i32>,
1135 #[prost(
1136 enumeration = "field_options::OptionTargetType",
1137 repeated,
1138 packed = "false",
1139 tag = "19"
1140 )]
1141 pub targets: ::prost::alloc::vec::Vec<i32>,
1142 #[prost(message, repeated, tag = "20")]
1143 pub edition_defaults: ::prost::alloc::vec::Vec<field_options::EditionDefault>,
1144 /// Any features defined in the specific edition.
1145 /// WARNING: This field should only be used by protobuf plugins or special
1146 /// cases like the proto compiler. Other uses are discouraged and
1147 /// developers should rely on the protoreflect APIs for their client language.
1148 #[prost(message, optional, tag = "21")]
1149 pub features: ::core::option::Option<FeatureSet>,
1150 #[prost(message, optional, tag = "22")]
1151 pub feature_support: ::core::option::Option<field_options::FeatureSupport>,
1152 /// The parser stores options it doesn't recognize here. See above.
1153 #[prost(message, repeated, tag = "999")]
1154 pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
1155}
1156/// Nested message and enum types in `FieldOptions`.
1157pub mod field_options {
1158 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1159 pub struct EditionDefault {
1160 #[prost(enumeration = "super::Edition", optional, tag = "3")]
1161 pub edition: ::core::option::Option<i32>,
1162 /// Textproto value.
1163 #[prost(string, optional, tag = "2")]
1164 pub value: ::core::option::Option<::prost::alloc::string::String>,
1165 }
1166 impl ::prost::Name for EditionDefault {
1167 const NAME: &'static str = "EditionDefault";
1168 const PACKAGE: &'static str = "google.protobuf";
1169 fn full_name() -> ::prost::alloc::string::String {
1170 "google.protobuf.FieldOptions.EditionDefault".into()
1171 }
1172 fn type_url() -> ::prost::alloc::string::String {
1173 "type.googleapis.com/google.protobuf.FieldOptions.EditionDefault".into()
1174 }
1175 }
1176 /// Information about the support window of a feature.
1177 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1178 pub struct FeatureSupport {
1179 /// The edition that this feature was first available in. In editions
1180 /// earlier than this one, the default assigned to EDITION_LEGACY will be
1181 /// used, and proto files will not be able to override it.
1182 #[prost(enumeration = "super::Edition", optional, tag = "1")]
1183 pub edition_introduced: ::core::option::Option<i32>,
1184 /// The edition this feature becomes deprecated in. Using this after this
1185 /// edition may trigger warnings.
1186 #[prost(enumeration = "super::Edition", optional, tag = "2")]
1187 pub edition_deprecated: ::core::option::Option<i32>,
1188 /// The deprecation warning text if this feature is used after the edition it
1189 /// was marked deprecated in.
1190 #[prost(string, optional, tag = "3")]
1191 pub deprecation_warning: ::core::option::Option<::prost::alloc::string::String>,
1192 /// The edition this feature is no longer available in. In editions after
1193 /// this one, the last default assigned will be used, and proto files will
1194 /// not be able to override it.
1195 #[prost(enumeration = "super::Edition", optional, tag = "4")]
1196 pub edition_removed: ::core::option::Option<i32>,
1197 }
1198 impl ::prost::Name for FeatureSupport {
1199 const NAME: &'static str = "FeatureSupport";
1200 const PACKAGE: &'static str = "google.protobuf";
1201 fn full_name() -> ::prost::alloc::string::String {
1202 "google.protobuf.FieldOptions.FeatureSupport".into()
1203 }
1204 fn type_url() -> ::prost::alloc::string::String {
1205 "type.googleapis.com/google.protobuf.FieldOptions.FeatureSupport".into()
1206 }
1207 }
1208 #[derive(
1209 Clone,
1210 Copy,
1211 Debug,
1212 PartialEq,
1213 Eq,
1214 Hash,
1215 PartialOrd,
1216 Ord,
1217 ::prost::Enumeration
1218 )]
1219 #[repr(i32)]
1220 pub enum CType {
1221 /// Default mode.
1222 String = 0,
1223 /// The option \[ctype=CORD\] may be applied to a non-repeated field of type
1224 /// "bytes". It indicates that in C++, the data should be stored in a Cord
1225 /// instead of a string. For very large strings, this may reduce memory
1226 /// fragmentation. It may also allow better performance when parsing from a
1227 /// Cord, or when parsing with aliasing enabled, as the parsed Cord may then
1228 /// alias the original buffer.
1229 Cord = 1,
1230 StringPiece = 2,
1231 }
1232 impl CType {
1233 /// String value of the enum field names used in the ProtoBuf definition.
1234 ///
1235 /// The values are not transformed in any way and thus are considered stable
1236 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1237 pub fn as_str_name(&self) -> &'static str {
1238 match self {
1239 Self::String => "STRING",
1240 Self::Cord => "CORD",
1241 Self::StringPiece => "STRING_PIECE",
1242 }
1243 }
1244 /// Creates an enum from field names used in the ProtoBuf definition.
1245 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1246 match value {
1247 "STRING" => Some(Self::String),
1248 "CORD" => Some(Self::Cord),
1249 "STRING_PIECE" => Some(Self::StringPiece),
1250 _ => None,
1251 }
1252 }
1253 }
1254 #[derive(
1255 Clone,
1256 Copy,
1257 Debug,
1258 PartialEq,
1259 Eq,
1260 Hash,
1261 PartialOrd,
1262 Ord,
1263 ::prost::Enumeration
1264 )]
1265 #[repr(i32)]
1266 pub enum JsType {
1267 /// Use the default type.
1268 JsNormal = 0,
1269 /// Use JavaScript strings.
1270 JsString = 1,
1271 /// Use JavaScript numbers.
1272 JsNumber = 2,
1273 }
1274 impl JsType {
1275 /// String value of the enum field names used in the ProtoBuf definition.
1276 ///
1277 /// The values are not transformed in any way and thus are considered stable
1278 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1279 pub fn as_str_name(&self) -> &'static str {
1280 match self {
1281 Self::JsNormal => "JS_NORMAL",
1282 Self::JsString => "JS_STRING",
1283 Self::JsNumber => "JS_NUMBER",
1284 }
1285 }
1286 /// Creates an enum from field names used in the ProtoBuf definition.
1287 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1288 match value {
1289 "JS_NORMAL" => Some(Self::JsNormal),
1290 "JS_STRING" => Some(Self::JsString),
1291 "JS_NUMBER" => Some(Self::JsNumber),
1292 _ => None,
1293 }
1294 }
1295 }
1296 /// If set to RETENTION_SOURCE, the option will be omitted from the binary.
1297 #[derive(
1298 Clone,
1299 Copy,
1300 Debug,
1301 PartialEq,
1302 Eq,
1303 Hash,
1304 PartialOrd,
1305 Ord,
1306 ::prost::Enumeration
1307 )]
1308 #[repr(i32)]
1309 pub enum OptionRetention {
1310 RetentionUnknown = 0,
1311 RetentionRuntime = 1,
1312 RetentionSource = 2,
1313 }
1314 impl OptionRetention {
1315 /// String value of the enum field names used in the ProtoBuf definition.
1316 ///
1317 /// The values are not transformed in any way and thus are considered stable
1318 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1319 pub fn as_str_name(&self) -> &'static str {
1320 match self {
1321 Self::RetentionUnknown => "RETENTION_UNKNOWN",
1322 Self::RetentionRuntime => "RETENTION_RUNTIME",
1323 Self::RetentionSource => "RETENTION_SOURCE",
1324 }
1325 }
1326 /// Creates an enum from field names used in the ProtoBuf definition.
1327 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1328 match value {
1329 "RETENTION_UNKNOWN" => Some(Self::RetentionUnknown),
1330 "RETENTION_RUNTIME" => Some(Self::RetentionRuntime),
1331 "RETENTION_SOURCE" => Some(Self::RetentionSource),
1332 _ => None,
1333 }
1334 }
1335 }
1336 /// This indicates the types of entities that the field may apply to when used
1337 /// as an option. If it is unset, then the field may be freely used as an
1338 /// option on any kind of entity.
1339 #[derive(
1340 Clone,
1341 Copy,
1342 Debug,
1343 PartialEq,
1344 Eq,
1345 Hash,
1346 PartialOrd,
1347 Ord,
1348 ::prost::Enumeration
1349 )]
1350 #[repr(i32)]
1351 pub enum OptionTargetType {
1352 TargetTypeUnknown = 0,
1353 TargetTypeFile = 1,
1354 TargetTypeExtensionRange = 2,
1355 TargetTypeMessage = 3,
1356 TargetTypeField = 4,
1357 TargetTypeOneof = 5,
1358 TargetTypeEnum = 6,
1359 TargetTypeEnumEntry = 7,
1360 TargetTypeService = 8,
1361 TargetTypeMethod = 9,
1362 }
1363 impl OptionTargetType {
1364 /// String value of the enum field names used in the ProtoBuf definition.
1365 ///
1366 /// The values are not transformed in any way and thus are considered stable
1367 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1368 pub fn as_str_name(&self) -> &'static str {
1369 match self {
1370 Self::TargetTypeUnknown => "TARGET_TYPE_UNKNOWN",
1371 Self::TargetTypeFile => "TARGET_TYPE_FILE",
1372 Self::TargetTypeExtensionRange => "TARGET_TYPE_EXTENSION_RANGE",
1373 Self::TargetTypeMessage => "TARGET_TYPE_MESSAGE",
1374 Self::TargetTypeField => "TARGET_TYPE_FIELD",
1375 Self::TargetTypeOneof => "TARGET_TYPE_ONEOF",
1376 Self::TargetTypeEnum => "TARGET_TYPE_ENUM",
1377 Self::TargetTypeEnumEntry => "TARGET_TYPE_ENUM_ENTRY",
1378 Self::TargetTypeService => "TARGET_TYPE_SERVICE",
1379 Self::TargetTypeMethod => "TARGET_TYPE_METHOD",
1380 }
1381 }
1382 /// Creates an enum from field names used in the ProtoBuf definition.
1383 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1384 match value {
1385 "TARGET_TYPE_UNKNOWN" => Some(Self::TargetTypeUnknown),
1386 "TARGET_TYPE_FILE" => Some(Self::TargetTypeFile),
1387 "TARGET_TYPE_EXTENSION_RANGE" => Some(Self::TargetTypeExtensionRange),
1388 "TARGET_TYPE_MESSAGE" => Some(Self::TargetTypeMessage),
1389 "TARGET_TYPE_FIELD" => Some(Self::TargetTypeField),
1390 "TARGET_TYPE_ONEOF" => Some(Self::TargetTypeOneof),
1391 "TARGET_TYPE_ENUM" => Some(Self::TargetTypeEnum),
1392 "TARGET_TYPE_ENUM_ENTRY" => Some(Self::TargetTypeEnumEntry),
1393 "TARGET_TYPE_SERVICE" => Some(Self::TargetTypeService),
1394 "TARGET_TYPE_METHOD" => Some(Self::TargetTypeMethod),
1395 _ => None,
1396 }
1397 }
1398 }
1399}
1400impl ::prost::Name for FieldOptions {
1401 const NAME: &'static str = "FieldOptions";
1402 const PACKAGE: &'static str = "google.protobuf";
1403 fn full_name() -> ::prost::alloc::string::String {
1404 "google.protobuf.FieldOptions".into()
1405 }
1406 fn type_url() -> ::prost::alloc::string::String {
1407 "type.googleapis.com/google.protobuf.FieldOptions".into()
1408 }
1409}
1410#[derive(Clone, PartialEq, ::prost::Message)]
1411pub struct OneofOptions {
1412 /// Any features defined in the specific edition.
1413 /// WARNING: This field should only be used by protobuf plugins or special
1414 /// cases like the proto compiler. Other uses are discouraged and
1415 /// developers should rely on the protoreflect APIs for their client language.
1416 #[prost(message, optional, tag = "1")]
1417 pub features: ::core::option::Option<FeatureSet>,
1418 /// The parser stores options it doesn't recognize here. See above.
1419 #[prost(message, repeated, tag = "999")]
1420 pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
1421}
1422impl ::prost::Name for OneofOptions {
1423 const NAME: &'static str = "OneofOptions";
1424 const PACKAGE: &'static str = "google.protobuf";
1425 fn full_name() -> ::prost::alloc::string::String {
1426 "google.protobuf.OneofOptions".into()
1427 }
1428 fn type_url() -> ::prost::alloc::string::String {
1429 "type.googleapis.com/google.protobuf.OneofOptions".into()
1430 }
1431}
1432#[derive(Clone, PartialEq, ::prost::Message)]
1433pub struct EnumOptions {
1434 /// Set this option to true to allow mapping different tag names to the same
1435 /// value.
1436 #[prost(bool, optional, tag = "2")]
1437 pub allow_alias: ::core::option::Option<bool>,
1438 /// Is this enum deprecated?
1439 /// Depending on the target platform, this can emit Deprecated annotations
1440 /// for the enum, or it will be completely ignored; in the very least, this
1441 /// is a formalization for deprecating enums.
1442 #[prost(bool, optional, tag = "3", default = "false")]
1443 pub deprecated: ::core::option::Option<bool>,
1444 /// Enable the legacy handling of JSON field name conflicts. This lowercases
1445 /// and strips underscored from the fields before comparison in proto3 only.
1446 /// The new behavior takes `json_name` into account and applies to proto2 as
1447 /// well.
1448 /// TODO Remove this legacy behavior once downstream teams have
1449 /// had time to migrate.
1450 #[deprecated]
1451 #[prost(bool, optional, tag = "6")]
1452 pub deprecated_legacy_json_field_conflicts: ::core::option::Option<bool>,
1453 /// Any features defined in the specific edition.
1454 /// WARNING: This field should only be used by protobuf plugins or special
1455 /// cases like the proto compiler. Other uses are discouraged and
1456 /// developers should rely on the protoreflect APIs for their client language.
1457 #[prost(message, optional, tag = "7")]
1458 pub features: ::core::option::Option<FeatureSet>,
1459 /// The parser stores options it doesn't recognize here. See above.
1460 #[prost(message, repeated, tag = "999")]
1461 pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
1462}
1463impl ::prost::Name for EnumOptions {
1464 const NAME: &'static str = "EnumOptions";
1465 const PACKAGE: &'static str = "google.protobuf";
1466 fn full_name() -> ::prost::alloc::string::String {
1467 "google.protobuf.EnumOptions".into()
1468 }
1469 fn type_url() -> ::prost::alloc::string::String {
1470 "type.googleapis.com/google.protobuf.EnumOptions".into()
1471 }
1472}
1473#[derive(Clone, PartialEq, ::prost::Message)]
1474pub struct EnumValueOptions {
1475 /// Is this enum value deprecated?
1476 /// Depending on the target platform, this can emit Deprecated annotations
1477 /// for the enum value, or it will be completely ignored; in the very least,
1478 /// this is a formalization for deprecating enum values.
1479 #[prost(bool, optional, tag = "1", default = "false")]
1480 pub deprecated: ::core::option::Option<bool>,
1481 /// Any features defined in the specific edition.
1482 /// WARNING: This field should only be used by protobuf plugins or special
1483 /// cases like the proto compiler. Other uses are discouraged and
1484 /// developers should rely on the protoreflect APIs for their client language.
1485 #[prost(message, optional, tag = "2")]
1486 pub features: ::core::option::Option<FeatureSet>,
1487 /// Indicate that fields annotated with this enum value should not be printed
1488 /// out when using debug formats, e.g. when the field contains sensitive
1489 /// credentials.
1490 #[prost(bool, optional, tag = "3", default = "false")]
1491 pub debug_redact: ::core::option::Option<bool>,
1492 /// Information about the support window of a feature value.
1493 #[prost(message, optional, tag = "4")]
1494 pub feature_support: ::core::option::Option<field_options::FeatureSupport>,
1495 /// The parser stores options it doesn't recognize here. See above.
1496 #[prost(message, repeated, tag = "999")]
1497 pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
1498}
1499impl ::prost::Name for EnumValueOptions {
1500 const NAME: &'static str = "EnumValueOptions";
1501 const PACKAGE: &'static str = "google.protobuf";
1502 fn full_name() -> ::prost::alloc::string::String {
1503 "google.protobuf.EnumValueOptions".into()
1504 }
1505 fn type_url() -> ::prost::alloc::string::String {
1506 "type.googleapis.com/google.protobuf.EnumValueOptions".into()
1507 }
1508}
1509#[derive(Clone, PartialEq, ::prost::Message)]
1510pub struct ServiceOptions {
1511 /// Any features defined in the specific edition.
1512 /// WARNING: This field should only be used by protobuf plugins or special
1513 /// cases like the proto compiler. Other uses are discouraged and
1514 /// developers should rely on the protoreflect APIs for their client language.
1515 #[prost(message, optional, tag = "34")]
1516 pub features: ::core::option::Option<FeatureSet>,
1517 /// Is this service deprecated?
1518 /// Depending on the target platform, this can emit Deprecated annotations
1519 /// for the service, or it will be completely ignored; in the very least,
1520 /// this is a formalization for deprecating services.
1521 #[prost(bool, optional, tag = "33", default = "false")]
1522 pub deprecated: ::core::option::Option<bool>,
1523 /// The parser stores options it doesn't recognize here. See above.
1524 #[prost(message, repeated, tag = "999")]
1525 pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
1526}
1527impl ::prost::Name for ServiceOptions {
1528 const NAME: &'static str = "ServiceOptions";
1529 const PACKAGE: &'static str = "google.protobuf";
1530 fn full_name() -> ::prost::alloc::string::String {
1531 "google.protobuf.ServiceOptions".into()
1532 }
1533 fn type_url() -> ::prost::alloc::string::String {
1534 "type.googleapis.com/google.protobuf.ServiceOptions".into()
1535 }
1536}
1537#[derive(Clone, PartialEq, ::prost::Message)]
1538pub struct MethodOptions {
1539 /// Is this method deprecated?
1540 /// Depending on the target platform, this can emit Deprecated annotations
1541 /// for the method, or it will be completely ignored; in the very least,
1542 /// this is a formalization for deprecating methods.
1543 #[prost(bool, optional, tag = "33", default = "false")]
1544 pub deprecated: ::core::option::Option<bool>,
1545 #[prost(
1546 enumeration = "method_options::IdempotencyLevel",
1547 optional,
1548 tag = "34",
1549 default = "IdempotencyUnknown"
1550 )]
1551 pub idempotency_level: ::core::option::Option<i32>,
1552 /// Any features defined in the specific edition.
1553 /// WARNING: This field should only be used by protobuf plugins or special
1554 /// cases like the proto compiler. Other uses are discouraged and
1555 /// developers should rely on the protoreflect APIs for their client language.
1556 #[prost(message, optional, tag = "35")]
1557 pub features: ::core::option::Option<FeatureSet>,
1558 /// The parser stores options it doesn't recognize here. See above.
1559 #[prost(message, repeated, tag = "999")]
1560 pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
1561}
1562/// Nested message and enum types in `MethodOptions`.
1563pub mod method_options {
1564 /// Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
1565 /// or neither? HTTP based RPC implementation may choose GET verb for safe
1566 /// methods, and PUT verb for idempotent methods instead of the default POST.
1567 #[derive(
1568 Clone,
1569 Copy,
1570 Debug,
1571 PartialEq,
1572 Eq,
1573 Hash,
1574 PartialOrd,
1575 Ord,
1576 ::prost::Enumeration
1577 )]
1578 #[repr(i32)]
1579 pub enum IdempotencyLevel {
1580 IdempotencyUnknown = 0,
1581 /// implies idempotent
1582 NoSideEffects = 1,
1583 /// idempotent, but may have side effects
1584 Idempotent = 2,
1585 }
1586 impl IdempotencyLevel {
1587 /// String value of the enum field names used in the ProtoBuf definition.
1588 ///
1589 /// The values are not transformed in any way and thus are considered stable
1590 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1591 pub fn as_str_name(&self) -> &'static str {
1592 match self {
1593 Self::IdempotencyUnknown => "IDEMPOTENCY_UNKNOWN",
1594 Self::NoSideEffects => "NO_SIDE_EFFECTS",
1595 Self::Idempotent => "IDEMPOTENT",
1596 }
1597 }
1598 /// Creates an enum from field names used in the ProtoBuf definition.
1599 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1600 match value {
1601 "IDEMPOTENCY_UNKNOWN" => Some(Self::IdempotencyUnknown),
1602 "NO_SIDE_EFFECTS" => Some(Self::NoSideEffects),
1603 "IDEMPOTENT" => Some(Self::Idempotent),
1604 _ => None,
1605 }
1606 }
1607 }
1608}
1609impl ::prost::Name for MethodOptions {
1610 const NAME: &'static str = "MethodOptions";
1611 const PACKAGE: &'static str = "google.protobuf";
1612 fn full_name() -> ::prost::alloc::string::String {
1613 "google.protobuf.MethodOptions".into()
1614 }
1615 fn type_url() -> ::prost::alloc::string::String {
1616 "type.googleapis.com/google.protobuf.MethodOptions".into()
1617 }
1618}
1619/// A message representing a option the parser does not recognize. This only
1620/// appears in options protos created by the compiler::Parser class.
1621/// DescriptorPool resolves these when building Descriptor objects. Therefore,
1622/// options protos in descriptor objects (e.g. returned by Descriptor::options(),
1623/// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
1624/// in them.
1625#[derive(Clone, PartialEq, ::prost::Message)]
1626pub struct UninterpretedOption {
1627 #[prost(message, repeated, tag = "2")]
1628 pub name: ::prost::alloc::vec::Vec<uninterpreted_option::NamePart>,
1629 /// The value of the uninterpreted option, in whatever type the tokenizer
1630 /// identified it as during parsing. Exactly one of these should be set.
1631 #[prost(string, optional, tag = "3")]
1632 pub identifier_value: ::core::option::Option<::prost::alloc::string::String>,
1633 #[prost(uint64, optional, tag = "4")]
1634 pub positive_int_value: ::core::option::Option<u64>,
1635 #[prost(int64, optional, tag = "5")]
1636 pub negative_int_value: ::core::option::Option<i64>,
1637 #[prost(double, optional, tag = "6")]
1638 pub double_value: ::core::option::Option<f64>,
1639 #[prost(bytes = "vec", optional, tag = "7")]
1640 pub string_value: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
1641 #[prost(string, optional, tag = "8")]
1642 pub aggregate_value: ::core::option::Option<::prost::alloc::string::String>,
1643}
1644/// Nested message and enum types in `UninterpretedOption`.
1645pub mod uninterpreted_option {
1646 /// The name of the uninterpreted option. Each string represents a segment in
1647 /// a dot-separated name. is_extension is true iff a segment represents an
1648 /// extension (denoted with parentheses in options specs in .proto files).
1649 /// E.g.,{ \["foo", false\], \["bar.baz", true\], \["moo", false\] } represents
1650 /// "foo.(bar.baz).moo".
1651 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1652 pub struct NamePart {
1653 #[prost(string, required, tag = "1")]
1654 pub name_part: ::prost::alloc::string::String,
1655 #[prost(bool, required, tag = "2")]
1656 pub is_extension: bool,
1657 }
1658 impl ::prost::Name for NamePart {
1659 const NAME: &'static str = "NamePart";
1660 const PACKAGE: &'static str = "google.protobuf";
1661 fn full_name() -> ::prost::alloc::string::String {
1662 "google.protobuf.UninterpretedOption.NamePart".into()
1663 }
1664 fn type_url() -> ::prost::alloc::string::String {
1665 "type.googleapis.com/google.protobuf.UninterpretedOption.NamePart".into()
1666 }
1667 }
1668}
1669impl ::prost::Name for UninterpretedOption {
1670 const NAME: &'static str = "UninterpretedOption";
1671 const PACKAGE: &'static str = "google.protobuf";
1672 fn full_name() -> ::prost::alloc::string::String {
1673 "google.protobuf.UninterpretedOption".into()
1674 }
1675 fn type_url() -> ::prost::alloc::string::String {
1676 "type.googleapis.com/google.protobuf.UninterpretedOption".into()
1677 }
1678}
1679/// TODO Enums in C++ gencode (and potentially other languages) are
1680/// not well scoped. This means that each of the feature enums below can clash
1681/// with each other. The short names we've chosen maximize call-site
1682/// readability, but leave us very open to this scenario. A future feature will
1683/// be designed and implemented to handle this, hopefully before we ever hit a
1684/// conflict here.
1685#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1686pub struct FeatureSet {
1687 #[prost(enumeration = "feature_set::FieldPresence", optional, tag = "1")]
1688 pub field_presence: ::core::option::Option<i32>,
1689 #[prost(enumeration = "feature_set::EnumType", optional, tag = "2")]
1690 pub enum_type: ::core::option::Option<i32>,
1691 #[prost(enumeration = "feature_set::RepeatedFieldEncoding", optional, tag = "3")]
1692 pub repeated_field_encoding: ::core::option::Option<i32>,
1693 #[prost(enumeration = "feature_set::Utf8Validation", optional, tag = "4")]
1694 pub utf8_validation: ::core::option::Option<i32>,
1695 #[prost(enumeration = "feature_set::MessageEncoding", optional, tag = "5")]
1696 pub message_encoding: ::core::option::Option<i32>,
1697 #[prost(enumeration = "feature_set::JsonFormat", optional, tag = "6")]
1698 pub json_format: ::core::option::Option<i32>,
1699 #[prost(enumeration = "feature_set::EnforceNamingStyle", optional, tag = "7")]
1700 pub enforce_naming_style: ::core::option::Option<i32>,
1701 #[prost(
1702 enumeration = "feature_set::visibility_feature::DefaultSymbolVisibility",
1703 optional,
1704 tag = "8"
1705 )]
1706 pub default_symbol_visibility: ::core::option::Option<i32>,
1707}
1708/// Nested message and enum types in `FeatureSet`.
1709pub mod feature_set {
1710 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1711 pub struct VisibilityFeature {}
1712 /// Nested message and enum types in `VisibilityFeature`.
1713 pub mod visibility_feature {
1714 #[derive(
1715 Clone,
1716 Copy,
1717 Debug,
1718 PartialEq,
1719 Eq,
1720 Hash,
1721 PartialOrd,
1722 Ord,
1723 ::prost::Enumeration
1724 )]
1725 #[repr(i32)]
1726 pub enum DefaultSymbolVisibility {
1727 Unknown = 0,
1728 /// Default pre-EDITION_2024, all UNSET visibility are export.
1729 ExportAll = 1,
1730 /// All top-level symbols default to export, nested default to local.
1731 ExportTopLevel = 2,
1732 /// All symbols default to local.
1733 LocalAll = 3,
1734 /// All symbols local by default. Nested types cannot be exported.
1735 /// With special case caveat for message { enum {} reserved 1 to max; }
1736 /// This is the recommended setting for new protos.
1737 Strict = 4,
1738 }
1739 impl DefaultSymbolVisibility {
1740 /// String value of the enum field names used in the ProtoBuf definition.
1741 ///
1742 /// The values are not transformed in any way and thus are considered stable
1743 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1744 pub fn as_str_name(&self) -> &'static str {
1745 match self {
1746 Self::Unknown => "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",
1747 Self::ExportAll => "EXPORT_ALL",
1748 Self::ExportTopLevel => "EXPORT_TOP_LEVEL",
1749 Self::LocalAll => "LOCAL_ALL",
1750 Self::Strict => "STRICT",
1751 }
1752 }
1753 /// Creates an enum from field names used in the ProtoBuf definition.
1754 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1755 match value {
1756 "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" => Some(Self::Unknown),
1757 "EXPORT_ALL" => Some(Self::ExportAll),
1758 "EXPORT_TOP_LEVEL" => Some(Self::ExportTopLevel),
1759 "LOCAL_ALL" => Some(Self::LocalAll),
1760 "STRICT" => Some(Self::Strict),
1761 _ => None,
1762 }
1763 }
1764 }
1765 }
1766 impl ::prost::Name for VisibilityFeature {
1767 const NAME: &'static str = "VisibilityFeature";
1768 const PACKAGE: &'static str = "google.protobuf";
1769 fn full_name() -> ::prost::alloc::string::String {
1770 "google.protobuf.FeatureSet.VisibilityFeature".into()
1771 }
1772 fn type_url() -> ::prost::alloc::string::String {
1773 "type.googleapis.com/google.protobuf.FeatureSet.VisibilityFeature".into()
1774 }
1775 }
1776 #[derive(
1777 Clone,
1778 Copy,
1779 Debug,
1780 PartialEq,
1781 Eq,
1782 Hash,
1783 PartialOrd,
1784 Ord,
1785 ::prost::Enumeration
1786 )]
1787 #[repr(i32)]
1788 pub enum FieldPresence {
1789 Unknown = 0,
1790 Explicit = 1,
1791 Implicit = 2,
1792 LegacyRequired = 3,
1793 }
1794 impl FieldPresence {
1795 /// String value of the enum field names used in the ProtoBuf definition.
1796 ///
1797 /// The values are not transformed in any way and thus are considered stable
1798 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1799 pub fn as_str_name(&self) -> &'static str {
1800 match self {
1801 Self::Unknown => "FIELD_PRESENCE_UNKNOWN",
1802 Self::Explicit => "EXPLICIT",
1803 Self::Implicit => "IMPLICIT",
1804 Self::LegacyRequired => "LEGACY_REQUIRED",
1805 }
1806 }
1807 /// Creates an enum from field names used in the ProtoBuf definition.
1808 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1809 match value {
1810 "FIELD_PRESENCE_UNKNOWN" => Some(Self::Unknown),
1811 "EXPLICIT" => Some(Self::Explicit),
1812 "IMPLICIT" => Some(Self::Implicit),
1813 "LEGACY_REQUIRED" => Some(Self::LegacyRequired),
1814 _ => None,
1815 }
1816 }
1817 }
1818 #[derive(
1819 Clone,
1820 Copy,
1821 Debug,
1822 PartialEq,
1823 Eq,
1824 Hash,
1825 PartialOrd,
1826 Ord,
1827 ::prost::Enumeration
1828 )]
1829 #[repr(i32)]
1830 pub enum EnumType {
1831 Unknown = 0,
1832 Open = 1,
1833 Closed = 2,
1834 }
1835 impl EnumType {
1836 /// String value of the enum field names used in the ProtoBuf definition.
1837 ///
1838 /// The values are not transformed in any way and thus are considered stable
1839 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1840 pub fn as_str_name(&self) -> &'static str {
1841 match self {
1842 Self::Unknown => "ENUM_TYPE_UNKNOWN",
1843 Self::Open => "OPEN",
1844 Self::Closed => "CLOSED",
1845 }
1846 }
1847 /// Creates an enum from field names used in the ProtoBuf definition.
1848 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1849 match value {
1850 "ENUM_TYPE_UNKNOWN" => Some(Self::Unknown),
1851 "OPEN" => Some(Self::Open),
1852 "CLOSED" => Some(Self::Closed),
1853 _ => None,
1854 }
1855 }
1856 }
1857 #[derive(
1858 Clone,
1859 Copy,
1860 Debug,
1861 PartialEq,
1862 Eq,
1863 Hash,
1864 PartialOrd,
1865 Ord,
1866 ::prost::Enumeration
1867 )]
1868 #[repr(i32)]
1869 pub enum RepeatedFieldEncoding {
1870 Unknown = 0,
1871 Packed = 1,
1872 Expanded = 2,
1873 }
1874 impl RepeatedFieldEncoding {
1875 /// String value of the enum field names used in the ProtoBuf definition.
1876 ///
1877 /// The values are not transformed in any way and thus are considered stable
1878 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1879 pub fn as_str_name(&self) -> &'static str {
1880 match self {
1881 Self::Unknown => "REPEATED_FIELD_ENCODING_UNKNOWN",
1882 Self::Packed => "PACKED",
1883 Self::Expanded => "EXPANDED",
1884 }
1885 }
1886 /// Creates an enum from field names used in the ProtoBuf definition.
1887 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1888 match value {
1889 "REPEATED_FIELD_ENCODING_UNKNOWN" => Some(Self::Unknown),
1890 "PACKED" => Some(Self::Packed),
1891 "EXPANDED" => Some(Self::Expanded),
1892 _ => None,
1893 }
1894 }
1895 }
1896 #[derive(
1897 Clone,
1898 Copy,
1899 Debug,
1900 PartialEq,
1901 Eq,
1902 Hash,
1903 PartialOrd,
1904 Ord,
1905 ::prost::Enumeration
1906 )]
1907 #[repr(i32)]
1908 pub enum Utf8Validation {
1909 Unknown = 0,
1910 Verify = 2,
1911 None = 3,
1912 }
1913 impl Utf8Validation {
1914 /// String value of the enum field names used in the ProtoBuf definition.
1915 ///
1916 /// The values are not transformed in any way and thus are considered stable
1917 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1918 pub fn as_str_name(&self) -> &'static str {
1919 match self {
1920 Self::Unknown => "UTF8_VALIDATION_UNKNOWN",
1921 Self::Verify => "VERIFY",
1922 Self::None => "NONE",
1923 }
1924 }
1925 /// Creates an enum from field names used in the ProtoBuf definition.
1926 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1927 match value {
1928 "UTF8_VALIDATION_UNKNOWN" => Some(Self::Unknown),
1929 "VERIFY" => Some(Self::Verify),
1930 "NONE" => Some(Self::None),
1931 _ => None,
1932 }
1933 }
1934 }
1935 #[derive(
1936 Clone,
1937 Copy,
1938 Debug,
1939 PartialEq,
1940 Eq,
1941 Hash,
1942 PartialOrd,
1943 Ord,
1944 ::prost::Enumeration
1945 )]
1946 #[repr(i32)]
1947 pub enum MessageEncoding {
1948 Unknown = 0,
1949 LengthPrefixed = 1,
1950 Delimited = 2,
1951 }
1952 impl MessageEncoding {
1953 /// String value of the enum field names used in the ProtoBuf definition.
1954 ///
1955 /// The values are not transformed in any way and thus are considered stable
1956 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1957 pub fn as_str_name(&self) -> &'static str {
1958 match self {
1959 Self::Unknown => "MESSAGE_ENCODING_UNKNOWN",
1960 Self::LengthPrefixed => "LENGTH_PREFIXED",
1961 Self::Delimited => "DELIMITED",
1962 }
1963 }
1964 /// Creates an enum from field names used in the ProtoBuf definition.
1965 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1966 match value {
1967 "MESSAGE_ENCODING_UNKNOWN" => Some(Self::Unknown),
1968 "LENGTH_PREFIXED" => Some(Self::LengthPrefixed),
1969 "DELIMITED" => Some(Self::Delimited),
1970 _ => None,
1971 }
1972 }
1973 }
1974 #[derive(
1975 Clone,
1976 Copy,
1977 Debug,
1978 PartialEq,
1979 Eq,
1980 Hash,
1981 PartialOrd,
1982 Ord,
1983 ::prost::Enumeration
1984 )]
1985 #[repr(i32)]
1986 pub enum JsonFormat {
1987 Unknown = 0,
1988 Allow = 1,
1989 LegacyBestEffort = 2,
1990 }
1991 impl JsonFormat {
1992 /// String value of the enum field names used in the ProtoBuf definition.
1993 ///
1994 /// The values are not transformed in any way and thus are considered stable
1995 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1996 pub fn as_str_name(&self) -> &'static str {
1997 match self {
1998 Self::Unknown => "JSON_FORMAT_UNKNOWN",
1999 Self::Allow => "ALLOW",
2000 Self::LegacyBestEffort => "LEGACY_BEST_EFFORT",
2001 }
2002 }
2003 /// Creates an enum from field names used in the ProtoBuf definition.
2004 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2005 match value {
2006 "JSON_FORMAT_UNKNOWN" => Some(Self::Unknown),
2007 "ALLOW" => Some(Self::Allow),
2008 "LEGACY_BEST_EFFORT" => Some(Self::LegacyBestEffort),
2009 _ => None,
2010 }
2011 }
2012 }
2013 #[derive(
2014 Clone,
2015 Copy,
2016 Debug,
2017 PartialEq,
2018 Eq,
2019 Hash,
2020 PartialOrd,
2021 Ord,
2022 ::prost::Enumeration
2023 )]
2024 #[repr(i32)]
2025 pub enum EnforceNamingStyle {
2026 Unknown = 0,
2027 Style2024 = 1,
2028 StyleLegacy = 2,
2029 }
2030 impl EnforceNamingStyle {
2031 /// String value of the enum field names used in the ProtoBuf definition.
2032 ///
2033 /// The values are not transformed in any way and thus are considered stable
2034 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2035 pub fn as_str_name(&self) -> &'static str {
2036 match self {
2037 Self::Unknown => "ENFORCE_NAMING_STYLE_UNKNOWN",
2038 Self::Style2024 => "STYLE2024",
2039 Self::StyleLegacy => "STYLE_LEGACY",
2040 }
2041 }
2042 /// Creates an enum from field names used in the ProtoBuf definition.
2043 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2044 match value {
2045 "ENFORCE_NAMING_STYLE_UNKNOWN" => Some(Self::Unknown),
2046 "STYLE2024" => Some(Self::Style2024),
2047 "STYLE_LEGACY" => Some(Self::StyleLegacy),
2048 _ => None,
2049 }
2050 }
2051 }
2052}
2053impl ::prost::Name for FeatureSet {
2054 const NAME: &'static str = "FeatureSet";
2055 const PACKAGE: &'static str = "google.protobuf";
2056 fn full_name() -> ::prost::alloc::string::String {
2057 "google.protobuf.FeatureSet".into()
2058 }
2059 fn type_url() -> ::prost::alloc::string::String {
2060 "type.googleapis.com/google.protobuf.FeatureSet".into()
2061 }
2062}
2063/// A compiled specification for the defaults of a set of features. These
2064/// messages are generated from FeatureSet extensions and can be used to seed
2065/// feature resolution. The resolution with this object becomes a simple search
2066/// for the closest matching edition, followed by proto merges.
2067#[derive(Clone, PartialEq, ::prost::Message)]
2068pub struct FeatureSetDefaults {
2069 #[prost(message, repeated, tag = "1")]
2070 pub defaults: ::prost::alloc::vec::Vec<
2071 feature_set_defaults::FeatureSetEditionDefault,
2072 >,
2073 /// The minimum supported edition (inclusive) when this was constructed.
2074 /// Editions before this will not have defaults.
2075 #[prost(enumeration = "Edition", optional, tag = "4")]
2076 pub minimum_edition: ::core::option::Option<i32>,
2077 /// The maximum known edition (inclusive) when this was constructed. Editions
2078 /// after this will not have reliable defaults.
2079 #[prost(enumeration = "Edition", optional, tag = "5")]
2080 pub maximum_edition: ::core::option::Option<i32>,
2081}
2082/// Nested message and enum types in `FeatureSetDefaults`.
2083pub mod feature_set_defaults {
2084 /// A map from every known edition with a unique set of defaults to its
2085 /// defaults. Not all editions may be contained here. For a given edition,
2086 /// the defaults at the closest matching edition ordered at or before it should
2087 /// be used. This field must be in strict ascending order by edition.
2088 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2089 pub struct FeatureSetEditionDefault {
2090 #[prost(enumeration = "super::Edition", optional, tag = "3")]
2091 pub edition: ::core::option::Option<i32>,
2092 /// Defaults of features that can be overridden in this edition.
2093 #[prost(message, optional, tag = "4")]
2094 pub overridable_features: ::core::option::Option<super::FeatureSet>,
2095 /// Defaults of features that can't be overridden in this edition.
2096 #[prost(message, optional, tag = "5")]
2097 pub fixed_features: ::core::option::Option<super::FeatureSet>,
2098 }
2099 impl ::prost::Name for FeatureSetEditionDefault {
2100 const NAME: &'static str = "FeatureSetEditionDefault";
2101 const PACKAGE: &'static str = "google.protobuf";
2102 fn full_name() -> ::prost::alloc::string::String {
2103 "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault".into()
2104 }
2105 fn type_url() -> ::prost::alloc::string::String {
2106 "type.googleapis.com/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"
2107 .into()
2108 }
2109 }
2110}
2111impl ::prost::Name for FeatureSetDefaults {
2112 const NAME: &'static str = "FeatureSetDefaults";
2113 const PACKAGE: &'static str = "google.protobuf";
2114 fn full_name() -> ::prost::alloc::string::String {
2115 "google.protobuf.FeatureSetDefaults".into()
2116 }
2117 fn type_url() -> ::prost::alloc::string::String {
2118 "type.googleapis.com/google.protobuf.FeatureSetDefaults".into()
2119 }
2120}
2121/// Encapsulates information about the original source file from which a
2122/// FileDescriptorProto was generated.
2123#[derive(Clone, PartialEq, ::prost::Message)]
2124pub struct SourceCodeInfo {
2125 /// A Location identifies a piece of source code in a .proto file which
2126 /// corresponds to a particular definition. This information is intended
2127 /// to be useful to IDEs, code indexers, documentation generators, and similar
2128 /// tools.
2129 ///
2130 /// For example, say we have a file like:
2131 /// message Foo {
2132 /// optional string foo = 1;
2133 /// }
2134 /// Let's look at just the field definition:
2135 /// optional string foo = 1;
2136 /// ^ ^^ ^^ ^ ^^^
2137 /// a bc de f ghi
2138 /// We have the following locations:
2139 /// span path represents
2140 /// \[a,i) \[ 4, 0, 2, 0 \] The whole field definition.
2141 /// \[a,b) \[ 4, 0, 2, 0, 4 \] The label (optional).
2142 /// \[c,d) \[ 4, 0, 2, 0, 5 \] The type (string).
2143 /// \[e,f) \[ 4, 0, 2, 0, 1 \] The name (foo).
2144 /// \[g,h) \[ 4, 0, 2, 0, 3 \] The number (1).
2145 ///
2146 /// Notes:
2147 ///
2148 /// * A location may refer to a repeated field itself (i.e. not to any
2149 /// particular index within it). This is used whenever a set of elements are
2150 /// logically enclosed in a single code segment. For example, an entire
2151 /// extend block (possibly containing multiple extension definitions) will
2152 /// have an outer location whose path refers to the "extensions" repeated
2153 /// field without an index.
2154 /// * Multiple locations may have the same path. This happens when a single
2155 /// logical declaration is spread out across multiple places. The most
2156 /// obvious example is the "extend" block again -- there may be multiple
2157 /// extend blocks in the same scope, each of which will have the same path.
2158 /// * A location's span is not always a subset of its parent's span. For
2159 /// example, the "extendee" of an extension declaration appears at the
2160 /// beginning of the "extend" block and is shared by all extensions within
2161 /// the block.
2162 /// * Just because a location's span is a subset of some other location's span
2163 /// does not mean that it is a descendant. For example, a "group" defines
2164 /// both a type and a field in a single declaration. Thus, the locations
2165 /// corresponding to the type and field and their components will overlap.
2166 /// * Code which tries to interpret locations should probably be designed to
2167 /// ignore those that it doesn't understand, as more types of locations could
2168 /// be recorded in the future.
2169 #[prost(message, repeated, tag = "1")]
2170 pub location: ::prost::alloc::vec::Vec<source_code_info::Location>,
2171}
2172/// Nested message and enum types in `SourceCodeInfo`.
2173pub mod source_code_info {
2174 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2175 pub struct Location {
2176 /// Identifies which part of the FileDescriptorProto was defined at this
2177 /// location.
2178 ///
2179 /// Each element is a field number or an index. They form a path from
2180 /// the root FileDescriptorProto to the place where the definition appears.
2181 /// For example, this path:
2182 /// \[ 4, 3, 2, 7, 1 \]
2183 /// refers to:
2184 /// file.message_type(3) // 4, 3
2185 /// .field(7) // 2, 7
2186 /// .name() // 1
2187 /// This is because FileDescriptorProto.message_type has field number 4:
2188 /// repeated DescriptorProto message_type = 4;
2189 /// and DescriptorProto.field has field number 2:
2190 /// repeated FieldDescriptorProto field = 2;
2191 /// and FieldDescriptorProto.name has field number 1:
2192 /// optional string name = 1;
2193 ///
2194 /// Thus, the above path gives the location of a field name. If we removed
2195 /// the last element:
2196 /// \[ 4, 3, 2, 7 \]
2197 /// this path refers to the whole field declaration (from the beginning
2198 /// of the label to the terminating semicolon).
2199 #[prost(int32, repeated, tag = "1")]
2200 pub path: ::prost::alloc::vec::Vec<i32>,
2201 /// Always has exactly three or four elements: start line, start column,
2202 /// end line (optional, otherwise assumed same as start line), end column.
2203 /// These are packed into a single field for efficiency. Note that line
2204 /// and column numbers are zero-based -- typically you will want to add
2205 /// 1 to each before displaying to a user.
2206 #[prost(int32, repeated, tag = "2")]
2207 pub span: ::prost::alloc::vec::Vec<i32>,
2208 /// If this SourceCodeInfo represents a complete declaration, these are any
2209 /// comments appearing before and after the declaration which appear to be
2210 /// attached to the declaration.
2211 ///
2212 /// A series of line comments appearing on consecutive lines, with no other
2213 /// tokens appearing on those lines, will be treated as a single comment.
2214 ///
2215 /// leading_detached_comments will keep paragraphs of comments that appear
2216 /// before (but not connected to) the current element. Each paragraph,
2217 /// separated by empty lines, will be one comment element in the repeated
2218 /// field.
2219 ///
2220 /// Only the comment content is provided; comment markers (e.g. //) are
2221 /// stripped out. For block comments, leading whitespace and an asterisk
2222 /// will be stripped from the beginning of each line other than the first.
2223 /// Newlines are included in the output.
2224 ///
2225 /// Examples:
2226 ///
2227 /// optional int32 foo = 1; // Comment attached to foo.
2228 /// // Comment attached to bar.
2229 /// optional int32 bar = 2;
2230 ///
2231 /// optional string baz = 3;
2232 /// // Comment attached to baz.
2233 /// // Another line attached to baz.
2234 ///
2235 /// // Comment attached to moo.
2236 /// //
2237 /// // Another line attached to moo.
2238 /// optional double moo = 4;
2239 ///
2240 /// // Detached comment for corge. This is not leading or trailing comments
2241 /// // to moo or corge because there are blank lines separating it from
2242 /// // both.
2243 ///
2244 /// // Detached comment for corge paragraph 2.
2245 ///
2246 /// optional string corge = 5;
2247 /// /\* Block comment attached
2248 /// \* to corge. Leading asterisks
2249 /// \* will be removed. */
2250 /// /* Block comment attached to
2251 /// \* grault. \*/
2252 /// optional int32 grault = 6;
2253 ///
2254 /// // ignored detached comments.
2255 #[prost(string, optional, tag = "3")]
2256 pub leading_comments: ::core::option::Option<::prost::alloc::string::String>,
2257 #[prost(string, optional, tag = "4")]
2258 pub trailing_comments: ::core::option::Option<::prost::alloc::string::String>,
2259 #[prost(string, repeated, tag = "6")]
2260 pub leading_detached_comments: ::prost::alloc::vec::Vec<
2261 ::prost::alloc::string::String,
2262 >,
2263 }
2264 impl ::prost::Name for Location {
2265 const NAME: &'static str = "Location";
2266 const PACKAGE: &'static str = "google.protobuf";
2267 fn full_name() -> ::prost::alloc::string::String {
2268 "google.protobuf.SourceCodeInfo.Location".into()
2269 }
2270 fn type_url() -> ::prost::alloc::string::String {
2271 "type.googleapis.com/google.protobuf.SourceCodeInfo.Location".into()
2272 }
2273 }
2274}
2275impl ::prost::Name for SourceCodeInfo {
2276 const NAME: &'static str = "SourceCodeInfo";
2277 const PACKAGE: &'static str = "google.protobuf";
2278 fn full_name() -> ::prost::alloc::string::String {
2279 "google.protobuf.SourceCodeInfo".into()
2280 }
2281 fn type_url() -> ::prost::alloc::string::String {
2282 "type.googleapis.com/google.protobuf.SourceCodeInfo".into()
2283 }
2284}
2285/// Describes the relationship between generated code and its original source
2286/// file. A GeneratedCodeInfo message is associated with only one generated
2287/// source file, but may contain references to different source .proto files.
2288#[derive(Clone, PartialEq, ::prost::Message)]
2289pub struct GeneratedCodeInfo {
2290 /// An Annotation connects some span of text in generated code to an element
2291 /// of its generating .proto file.
2292 #[prost(message, repeated, tag = "1")]
2293 pub annotation: ::prost::alloc::vec::Vec<generated_code_info::Annotation>,
2294}
2295/// Nested message and enum types in `GeneratedCodeInfo`.
2296pub mod generated_code_info {
2297 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2298 pub struct Annotation {
2299 /// Identifies the element in the original source .proto file. This field
2300 /// is formatted the same as SourceCodeInfo.Location.path.
2301 #[prost(int32, repeated, tag = "1")]
2302 pub path: ::prost::alloc::vec::Vec<i32>,
2303 /// Identifies the filesystem path to the original source .proto.
2304 #[prost(string, optional, tag = "2")]
2305 pub source_file: ::core::option::Option<::prost::alloc::string::String>,
2306 /// Identifies the starting offset in bytes in the generated code
2307 /// that relates to the identified object.
2308 #[prost(int32, optional, tag = "3")]
2309 pub begin: ::core::option::Option<i32>,
2310 /// Identifies the ending offset in bytes in the generated code that
2311 /// relates to the identified object. The end offset should be one past
2312 /// the last relevant byte (so the length of the text = end - begin).
2313 #[prost(int32, optional, tag = "4")]
2314 pub end: ::core::option::Option<i32>,
2315 #[prost(enumeration = "annotation::Semantic", optional, tag = "5")]
2316 pub semantic: ::core::option::Option<i32>,
2317 }
2318 /// Nested message and enum types in `Annotation`.
2319 pub mod annotation {
2320 /// Represents the identified object's effect on the element in the original
2321 /// .proto file.
2322 #[derive(
2323 Clone,
2324 Copy,
2325 Debug,
2326 PartialEq,
2327 Eq,
2328 Hash,
2329 PartialOrd,
2330 Ord,
2331 ::prost::Enumeration
2332 )]
2333 #[repr(i32)]
2334 pub enum Semantic {
2335 /// There is no effect or the effect is indescribable.
2336 None = 0,
2337 /// The element is set or otherwise mutated.
2338 Set = 1,
2339 /// An alias to the element is returned.
2340 Alias = 2,
2341 }
2342 impl Semantic {
2343 /// String value of the enum field names used in the ProtoBuf definition.
2344 ///
2345 /// The values are not transformed in any way and thus are considered stable
2346 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2347 pub fn as_str_name(&self) -> &'static str {
2348 match self {
2349 Self::None => "NONE",
2350 Self::Set => "SET",
2351 Self::Alias => "ALIAS",
2352 }
2353 }
2354 /// Creates an enum from field names used in the ProtoBuf definition.
2355 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2356 match value {
2357 "NONE" => Some(Self::None),
2358 "SET" => Some(Self::Set),
2359 "ALIAS" => Some(Self::Alias),
2360 _ => None,
2361 }
2362 }
2363 }
2364 }
2365 impl ::prost::Name for Annotation {
2366 const NAME: &'static str = "Annotation";
2367 const PACKAGE: &'static str = "google.protobuf";
2368 fn full_name() -> ::prost::alloc::string::String {
2369 "google.protobuf.GeneratedCodeInfo.Annotation".into()
2370 }
2371 fn type_url() -> ::prost::alloc::string::String {
2372 "type.googleapis.com/google.protobuf.GeneratedCodeInfo.Annotation".into()
2373 }
2374 }
2375}
2376impl ::prost::Name for GeneratedCodeInfo {
2377 const NAME: &'static str = "GeneratedCodeInfo";
2378 const PACKAGE: &'static str = "google.protobuf";
2379 fn full_name() -> ::prost::alloc::string::String {
2380 "google.protobuf.GeneratedCodeInfo".into()
2381 }
2382 fn type_url() -> ::prost::alloc::string::String {
2383 "type.googleapis.com/google.protobuf.GeneratedCodeInfo".into()
2384 }
2385}
2386/// The full set of known editions.
2387#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2388#[repr(i32)]
2389pub enum Edition {
2390 /// A placeholder for an unknown edition value.
2391 Unknown = 0,
2392 /// A placeholder edition for specifying default behaviors *before* a feature
2393 /// was first introduced. This is effectively an "infinite past".
2394 Legacy = 900,
2395 /// Legacy syntax "editions". These pre-date editions, but behave much like
2396 /// distinct editions. These can't be used to specify the edition of proto
2397 /// files, but feature definitions must supply proto2/proto3 defaults for
2398 /// backwards compatibility.
2399 Proto2 = 998,
2400 Proto3 = 999,
2401 /// Editions that have been released. The specific values are arbitrary and
2402 /// should not be depended on, but they will always be time-ordered for easy
2403 /// comparison.
2404 Edition2023 = 1000,
2405 Edition2024 = 1001,
2406 /// A placeholder edition for developing and testing unscheduled features.
2407 Unstable = 9999,
2408 /// Placeholder editions for testing feature resolution. These should not be
2409 /// used or relied on outside of tests.
2410 Edition1TestOnly = 1,
2411 Edition2TestOnly = 2,
2412 Edition99997TestOnly = 99997,
2413 Edition99998TestOnly = 99998,
2414 Edition99999TestOnly = 99999,
2415 /// Placeholder for specifying unbounded edition support. This should only
2416 /// ever be used by plugins that can expect to never require any changes to
2417 /// support a new edition.
2418 Max = 2147483647,
2419}
2420impl Edition {
2421 /// String value of the enum field names used in the ProtoBuf definition.
2422 ///
2423 /// The values are not transformed in any way and thus are considered stable
2424 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2425 pub fn as_str_name(&self) -> &'static str {
2426 match self {
2427 Self::Unknown => "EDITION_UNKNOWN",
2428 Self::Legacy => "EDITION_LEGACY",
2429 Self::Proto2 => "EDITION_PROTO2",
2430 Self::Proto3 => "EDITION_PROTO3",
2431 Self::Edition2023 => "EDITION_2023",
2432 Self::Edition2024 => "EDITION_2024",
2433 Self::Unstable => "EDITION_UNSTABLE",
2434 Self::Edition1TestOnly => "EDITION_1_TEST_ONLY",
2435 Self::Edition2TestOnly => "EDITION_2_TEST_ONLY",
2436 Self::Edition99997TestOnly => "EDITION_99997_TEST_ONLY",
2437 Self::Edition99998TestOnly => "EDITION_99998_TEST_ONLY",
2438 Self::Edition99999TestOnly => "EDITION_99999_TEST_ONLY",
2439 Self::Max => "EDITION_MAX",
2440 }
2441 }
2442 /// Creates an enum from field names used in the ProtoBuf definition.
2443 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2444 match value {
2445 "EDITION_UNKNOWN" => Some(Self::Unknown),
2446 "EDITION_LEGACY" => Some(Self::Legacy),
2447 "EDITION_PROTO2" => Some(Self::Proto2),
2448 "EDITION_PROTO3" => Some(Self::Proto3),
2449 "EDITION_2023" => Some(Self::Edition2023),
2450 "EDITION_2024" => Some(Self::Edition2024),
2451 "EDITION_UNSTABLE" => Some(Self::Unstable),
2452 "EDITION_1_TEST_ONLY" => Some(Self::Edition1TestOnly),
2453 "EDITION_2_TEST_ONLY" => Some(Self::Edition2TestOnly),
2454 "EDITION_99997_TEST_ONLY" => Some(Self::Edition99997TestOnly),
2455 "EDITION_99998_TEST_ONLY" => Some(Self::Edition99998TestOnly),
2456 "EDITION_99999_TEST_ONLY" => Some(Self::Edition99999TestOnly),
2457 "EDITION_MAX" => Some(Self::Max),
2458 _ => None,
2459 }
2460 }
2461}
2462/// Describes the 'visibility' of a symbol with respect to the proto import
2463/// system. Symbols can only be imported when the visibility rules do not prevent
2464/// it (ex: local symbols cannot be imported). Visibility modifiers can only set
2465/// on `message` and `enum` as they are the only types available to be referenced
2466/// from other files.
2467#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2468#[repr(i32)]
2469pub enum SymbolVisibility {
2470 VisibilityUnset = 0,
2471 VisibilityLocal = 1,
2472 VisibilityExport = 2,
2473}
2474impl SymbolVisibility {
2475 /// String value of the enum field names used in the ProtoBuf definition.
2476 ///
2477 /// The values are not transformed in any way and thus are considered stable
2478 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2479 pub fn as_str_name(&self) -> &'static str {
2480 match self {
2481 Self::VisibilityUnset => "VISIBILITY_UNSET",
2482 Self::VisibilityLocal => "VISIBILITY_LOCAL",
2483 Self::VisibilityExport => "VISIBILITY_EXPORT",
2484 }
2485 }
2486 /// Creates an enum from field names used in the ProtoBuf definition.
2487 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2488 match value {
2489 "VISIBILITY_UNSET" => Some(Self::VisibilityUnset),
2490 "VISIBILITY_LOCAL" => Some(Self::VisibilityLocal),
2491 "VISIBILITY_EXPORT" => Some(Self::VisibilityExport),
2492 _ => None,
2493 }
2494 }
2495}
2496/// `Any` contains an arbitrary serialized protocol buffer message along with a
2497/// URL that describes the type of the serialized message.
2498///
2499/// Protobuf library provides support to pack/unpack Any values in the form
2500/// of utility functions or additional generated methods of the Any type.
2501///
2502/// Example 1: Pack and unpack a message in C++.
2503///
2504/// ```text
2505/// Foo foo = ...;
2506/// Any any;
2507/// any.PackFrom(foo);
2508/// ...
2509/// if (any.UnpackTo(&foo)) {
2510/// ...
2511/// }
2512/// ```
2513///
2514/// Example 2: Pack and unpack a message in Java.
2515///
2516/// ```text
2517/// Foo foo = ...;
2518/// Any any = Any.pack(foo);
2519/// ...
2520/// if (any.is(Foo.class)) {
2521/// foo = any.unpack(Foo.class);
2522/// }
2523/// // or ...
2524/// if (any.isSameTypeAs(Foo.getDefaultInstance())) {
2525/// foo = any.unpack(Foo.getDefaultInstance());
2526/// }
2527/// ```
2528///
2529/// Example 3: Pack and unpack a message in Python.
2530///
2531/// ```text
2532/// foo = Foo(...)
2533/// any = Any()
2534/// any.Pack(foo)
2535/// ...
2536/// if any.Is(Foo.DESCRIPTOR):
2537/// any.Unpack(foo)
2538/// ...
2539/// ```
2540///
2541/// Example 4: Pack and unpack a message in Go
2542///
2543/// ```text
2544/// foo := &pb.Foo{...}
2545/// any, err := anypb.New(foo)
2546/// if err != nil {
2547/// ...
2548/// }
2549/// ...
2550/// foo := &pb.Foo{}
2551/// if err := any.UnmarshalTo(foo); err != nil {
2552/// ...
2553/// }
2554/// ```
2555///
2556/// The pack methods provided by protobuf library will by default use
2557/// 'type.googleapis.com/full.type.name' as the type URL and the unpack
2558/// methods only use the fully qualified type name after the last '/'
2559/// in the type URL, for example "foo.bar.com/x/y.z" will yield type
2560/// name "y.z".
2561///
2562/// # JSON
2563///
2564/// The JSON representation of an `Any` value uses the regular
2565/// representation of the deserialized, embedded message, with an
2566/// additional field `@type` which contains the type URL. Example:
2567///
2568/// ```text
2569/// package google.profile;
2570/// message Person {
2571/// string first_name = 1;
2572/// string last_name = 2;
2573/// }
2574///
2575/// {
2576/// "@type": "type.googleapis.com/google.profile.Person",
2577/// "firstName": <string>,
2578/// "lastName": <string>
2579/// }
2580/// ```
2581///
2582/// If the embedded message type is well-known and has a custom JSON
2583/// representation, that representation will be embedded adding a field
2584/// `value` which holds the custom JSON in addition to the `@type`
2585/// field. Example (for message \[google.protobuf.Duration\]\[\]):
2586///
2587/// ```text
2588/// {
2589/// "@type": "type.googleapis.com/google.protobuf.Duration",
2590/// "value": "1.212s"
2591/// }
2592/// ```
2593#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2594pub struct Any {
2595 /// A URL/resource name that uniquely identifies the type of the serialized
2596 /// protocol buffer message. This string must contain at least
2597 /// one "/" character. The last segment of the URL's path must represent
2598 /// the fully qualified name of the type (as in
2599 /// `path/google.protobuf.Duration`). The name should be in a canonical form
2600 /// (e.g., leading "." is not accepted).
2601 ///
2602 /// In practice, teams usually precompile into the binary all types that they
2603 /// expect it to use in the context of Any. However, for URLs which use the
2604 /// scheme `http`, `https`, or no scheme, one can optionally set up a type
2605 /// server that maps type URLs to message definitions as follows:
2606 ///
2607 /// * If no scheme is provided, `https` is assumed.
2608 /// * An HTTP GET on the URL must yield a \[google.protobuf.Type\]\[\]
2609 /// value in binary format, or produce an error.
2610 /// * Applications are allowed to cache lookup results based on the
2611 /// URL, or have them precompiled into a binary to avoid any
2612 /// lookup. Therefore, binary compatibility needs to be preserved
2613 /// on changes to types. (Use versioned type names to manage
2614 /// breaking changes.)
2615 ///
2616 /// Note: this functionality is not currently available in the official
2617 /// protobuf release, and it is not used for type URLs beginning with
2618 /// type.googleapis.com. As of May 2023, there are no widely used type server
2619 /// implementations and no plans to implement one.
2620 ///
2621 /// Schemes other than `http`, `https` (or the empty scheme) might be
2622 /// used with implementation specific semantics.
2623 #[prost(string, tag = "1")]
2624 pub type_url: ::prost::alloc::string::String,
2625 /// Must be a valid serialized protocol buffer of the above specified type.
2626 #[prost(bytes = "vec", tag = "2")]
2627 pub value: ::prost::alloc::vec::Vec<u8>,
2628}
2629impl ::prost::Name for Any {
2630 const NAME: &'static str = "Any";
2631 const PACKAGE: &'static str = "google.protobuf";
2632 fn full_name() -> ::prost::alloc::string::String {
2633 "google.protobuf.Any".into()
2634 }
2635 fn type_url() -> ::prost::alloc::string::String {
2636 "type.googleapis.com/google.protobuf.Any".into()
2637 }
2638}
2639/// A Duration represents a signed, fixed-length span of time represented
2640/// as a count of seconds and fractions of seconds at nanosecond
2641/// resolution. It is independent of any calendar and concepts like "day"
2642/// or "month". It is related to Timestamp in that the difference between
2643/// two Timestamp values is a Duration and it can be added or subtracted
2644/// from a Timestamp. Range is approximately +-10,000 years.
2645///
2646/// # Examples
2647///
2648/// Example 1: Compute Duration from two Timestamps in pseudo code.
2649///
2650/// ```text
2651/// Timestamp start = ...;
2652/// Timestamp end = ...;
2653/// Duration duration = ...;
2654///
2655/// duration.seconds = end.seconds - start.seconds;
2656/// duration.nanos = end.nanos - start.nanos;
2657///
2658/// if (duration.seconds < 0 && duration.nanos > 0) {
2659/// duration.seconds += 1;
2660/// duration.nanos -= 1000000000;
2661/// } else if (duration.seconds > 0 && duration.nanos < 0) {
2662/// duration.seconds -= 1;
2663/// duration.nanos += 1000000000;
2664/// }
2665/// ```
2666///
2667/// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
2668///
2669/// ```text
2670/// Timestamp start = ...;
2671/// Duration duration = ...;
2672/// Timestamp end = ...;
2673///
2674/// end.seconds = start.seconds + duration.seconds;
2675/// end.nanos = start.nanos + duration.nanos;
2676///
2677/// if (end.nanos < 0) {
2678/// end.seconds -= 1;
2679/// end.nanos += 1000000000;
2680/// } else if (end.nanos >= 1000000000) {
2681/// end.seconds += 1;
2682/// end.nanos -= 1000000000;
2683/// }
2684/// ```
2685///
2686/// Example 3: Compute Duration from datetime.timedelta in Python.
2687///
2688/// ```text
2689/// td = datetime.timedelta(days=3, minutes=10)
2690/// duration = Duration()
2691/// duration.FromTimedelta(td)
2692/// ```
2693///
2694/// # JSON Mapping
2695///
2696/// In JSON format, the Duration type is encoded as a string rather than an
2697/// object, where the string ends in the suffix "s" (indicating seconds) and
2698/// is preceded by the number of seconds, with nanoseconds expressed as
2699/// fractional seconds. For example, 3 seconds with 0 nanoseconds should be
2700/// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
2701/// be expressed in JSON format as "3.000000001s", and 3 seconds and 1
2702/// microsecond should be expressed in JSON format as "3.000001s".
2703#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2704pub struct Duration {
2705 /// Signed seconds of the span of time. Must be from -315,576,000,000
2706 /// to +315,576,000,000 inclusive. Note: these bounds are computed from:
2707 /// 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
2708 #[prost(int64, tag = "1")]
2709 pub seconds: i64,
2710 /// Signed fractions of a second at nanosecond resolution of the span
2711 /// of time. Durations less than one second are represented with a 0
2712 /// `seconds` field and a positive or negative `nanos` field. For durations
2713 /// of one second or more, a non-zero value for the `nanos` field must be
2714 /// of the same sign as the `seconds` field. Must be from -999,999,999
2715 /// to +999,999,999 inclusive.
2716 #[prost(int32, tag = "2")]
2717 pub nanos: i32,
2718}
2719impl ::prost::Name for Duration {
2720 const NAME: &'static str = "Duration";
2721 const PACKAGE: &'static str = "google.protobuf";
2722 fn full_name() -> ::prost::alloc::string::String {
2723 "google.protobuf.Duration".into()
2724 }
2725 fn type_url() -> ::prost::alloc::string::String {
2726 "type.googleapis.com/google.protobuf.Duration".into()
2727 }
2728}
2729/// Wrapper message for `double`.
2730///
2731/// The JSON representation for `DoubleValue` is JSON number.
2732///
2733/// Not recommended for use in new APIs, but still useful for legacy APIs and
2734/// has no plan to be removed.
2735#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2736pub struct DoubleValue {
2737 /// The double value.
2738 #[prost(double, tag = "1")]
2739 pub value: f64,
2740}
2741impl ::prost::Name for DoubleValue {
2742 const NAME: &'static str = "DoubleValue";
2743 const PACKAGE: &'static str = "google.protobuf";
2744 fn full_name() -> ::prost::alloc::string::String {
2745 "google.protobuf.DoubleValue".into()
2746 }
2747 fn type_url() -> ::prost::alloc::string::String {
2748 "type.googleapis.com/google.protobuf.DoubleValue".into()
2749 }
2750}
2751/// Wrapper message for `float`.
2752///
2753/// The JSON representation for `FloatValue` is JSON number.
2754///
2755/// Not recommended for use in new APIs, but still useful for legacy APIs and
2756/// has no plan to be removed.
2757#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2758pub struct FloatValue {
2759 /// The float value.
2760 #[prost(float, tag = "1")]
2761 pub value: f32,
2762}
2763impl ::prost::Name for FloatValue {
2764 const NAME: &'static str = "FloatValue";
2765 const PACKAGE: &'static str = "google.protobuf";
2766 fn full_name() -> ::prost::alloc::string::String {
2767 "google.protobuf.FloatValue".into()
2768 }
2769 fn type_url() -> ::prost::alloc::string::String {
2770 "type.googleapis.com/google.protobuf.FloatValue".into()
2771 }
2772}
2773/// Wrapper message for `int64`.
2774///
2775/// The JSON representation for `Int64Value` is JSON string.
2776///
2777/// Not recommended for use in new APIs, but still useful for legacy APIs and
2778/// has no plan to be removed.
2779#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2780pub struct Int64Value {
2781 /// The int64 value.
2782 #[prost(int64, tag = "1")]
2783 pub value: i64,
2784}
2785impl ::prost::Name for Int64Value {
2786 const NAME: &'static str = "Int64Value";
2787 const PACKAGE: &'static str = "google.protobuf";
2788 fn full_name() -> ::prost::alloc::string::String {
2789 "google.protobuf.Int64Value".into()
2790 }
2791 fn type_url() -> ::prost::alloc::string::String {
2792 "type.googleapis.com/google.protobuf.Int64Value".into()
2793 }
2794}
2795/// Wrapper message for `uint64`.
2796///
2797/// The JSON representation for `UInt64Value` is JSON string.
2798///
2799/// Not recommended for use in new APIs, but still useful for legacy APIs and
2800/// has no plan to be removed.
2801#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2802pub struct UInt64Value {
2803 /// The uint64 value.
2804 #[prost(uint64, tag = "1")]
2805 pub value: u64,
2806}
2807impl ::prost::Name for UInt64Value {
2808 const NAME: &'static str = "UInt64Value";
2809 const PACKAGE: &'static str = "google.protobuf";
2810 fn full_name() -> ::prost::alloc::string::String {
2811 "google.protobuf.UInt64Value".into()
2812 }
2813 fn type_url() -> ::prost::alloc::string::String {
2814 "type.googleapis.com/google.protobuf.UInt64Value".into()
2815 }
2816}
2817/// Wrapper message for `int32`.
2818///
2819/// The JSON representation for `Int32Value` is JSON number.
2820///
2821/// Not recommended for use in new APIs, but still useful for legacy APIs and
2822/// has no plan to be removed.
2823#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2824pub struct Int32Value {
2825 /// The int32 value.
2826 #[prost(int32, tag = "1")]
2827 pub value: i32,
2828}
2829impl ::prost::Name for Int32Value {
2830 const NAME: &'static str = "Int32Value";
2831 const PACKAGE: &'static str = "google.protobuf";
2832 fn full_name() -> ::prost::alloc::string::String {
2833 "google.protobuf.Int32Value".into()
2834 }
2835 fn type_url() -> ::prost::alloc::string::String {
2836 "type.googleapis.com/google.protobuf.Int32Value".into()
2837 }
2838}
2839/// Wrapper message for `uint32`.
2840///
2841/// The JSON representation for `UInt32Value` is JSON number.
2842///
2843/// Not recommended for use in new APIs, but still useful for legacy APIs and
2844/// has no plan to be removed.
2845#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2846pub struct UInt32Value {
2847 /// The uint32 value.
2848 #[prost(uint32, tag = "1")]
2849 pub value: u32,
2850}
2851impl ::prost::Name for UInt32Value {
2852 const NAME: &'static str = "UInt32Value";
2853 const PACKAGE: &'static str = "google.protobuf";
2854 fn full_name() -> ::prost::alloc::string::String {
2855 "google.protobuf.UInt32Value".into()
2856 }
2857 fn type_url() -> ::prost::alloc::string::String {
2858 "type.googleapis.com/google.protobuf.UInt32Value".into()
2859 }
2860}
2861/// Wrapper message for `bool`.
2862///
2863/// The JSON representation for `BoolValue` is JSON `true` and `false`.
2864///
2865/// Not recommended for use in new APIs, but still useful for legacy APIs and
2866/// has no plan to be removed.
2867#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2868pub struct BoolValue {
2869 /// The bool value.
2870 #[prost(bool, tag = "1")]
2871 pub value: bool,
2872}
2873impl ::prost::Name for BoolValue {
2874 const NAME: &'static str = "BoolValue";
2875 const PACKAGE: &'static str = "google.protobuf";
2876 fn full_name() -> ::prost::alloc::string::String {
2877 "google.protobuf.BoolValue".into()
2878 }
2879 fn type_url() -> ::prost::alloc::string::String {
2880 "type.googleapis.com/google.protobuf.BoolValue".into()
2881 }
2882}
2883/// Wrapper message for `string`.
2884///
2885/// The JSON representation for `StringValue` is JSON string.
2886///
2887/// Not recommended for use in new APIs, but still useful for legacy APIs and
2888/// has no plan to be removed.
2889#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2890pub struct StringValue {
2891 /// The string value.
2892 #[prost(string, tag = "1")]
2893 pub value: ::prost::alloc::string::String,
2894}
2895impl ::prost::Name for StringValue {
2896 const NAME: &'static str = "StringValue";
2897 const PACKAGE: &'static str = "google.protobuf";
2898 fn full_name() -> ::prost::alloc::string::String {
2899 "google.protobuf.StringValue".into()
2900 }
2901 fn type_url() -> ::prost::alloc::string::String {
2902 "type.googleapis.com/google.protobuf.StringValue".into()
2903 }
2904}
2905/// Wrapper message for `bytes`.
2906///
2907/// The JSON representation for `BytesValue` is JSON string.
2908///
2909/// Not recommended for use in new APIs, but still useful for legacy APIs and
2910/// has no plan to be removed.
2911#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2912pub struct BytesValue {
2913 /// The bytes value.
2914 #[prost(bytes = "vec", tag = "1")]
2915 pub value: ::prost::alloc::vec::Vec<u8>,
2916}
2917impl ::prost::Name for BytesValue {
2918 const NAME: &'static str = "BytesValue";
2919 const PACKAGE: &'static str = "google.protobuf";
2920 fn full_name() -> ::prost::alloc::string::String {
2921 "google.protobuf.BytesValue".into()
2922 }
2923 fn type_url() -> ::prost::alloc::string::String {
2924 "type.googleapis.com/google.protobuf.BytesValue".into()
2925 }
2926}
2927/// `Struct` represents a structured data value, consisting of fields
2928/// which map to dynamically typed values. In some languages, `Struct`
2929/// might be supported by a native representation. For example, in
2930/// scripting languages like JS a struct is represented as an
2931/// object. The details of that representation are described together
2932/// with the proto support for the language.
2933///
2934/// The JSON representation for `Struct` is JSON object.
2935#[derive(Clone, PartialEq, ::prost::Message)]
2936pub struct Struct {
2937 /// Unordered map of dynamically typed values.
2938 #[prost(map = "string, message", tag = "1")]
2939 pub fields: ::std::collections::HashMap<::prost::alloc::string::String, Value>,
2940}
2941impl ::prost::Name for Struct {
2942 const NAME: &'static str = "Struct";
2943 const PACKAGE: &'static str = "google.protobuf";
2944 fn full_name() -> ::prost::alloc::string::String {
2945 "google.protobuf.Struct".into()
2946 }
2947 fn type_url() -> ::prost::alloc::string::String {
2948 "type.googleapis.com/google.protobuf.Struct".into()
2949 }
2950}
2951/// `Value` represents a dynamically typed value which can be either
2952/// null, a number, a string, a boolean, a recursive struct value, or a
2953/// list of values. A producer of value is expected to set one of these
2954/// variants. Absence of any variant indicates an error.
2955///
2956/// The JSON representation for `Value` is JSON value.
2957#[derive(Clone, PartialEq, ::prost::Message)]
2958pub struct Value {
2959 /// The kind of value.
2960 #[prost(oneof = "value::Kind", tags = "1, 2, 3, 4, 5, 6")]
2961 pub kind: ::core::option::Option<value::Kind>,
2962}
2963/// Nested message and enum types in `Value`.
2964pub mod value {
2965 /// The kind of value.
2966 #[derive(Clone, PartialEq, ::prost::Oneof)]
2967 pub enum Kind {
2968 /// Represents a null value.
2969 #[prost(enumeration = "super::NullValue", tag = "1")]
2970 NullValue(i32),
2971 /// Represents a double value.
2972 #[prost(double, tag = "2")]
2973 NumberValue(f64),
2974 /// Represents a string value.
2975 #[prost(string, tag = "3")]
2976 StringValue(::prost::alloc::string::String),
2977 /// Represents a boolean value.
2978 #[prost(bool, tag = "4")]
2979 BoolValue(bool),
2980 /// Represents a structured value.
2981 #[prost(message, tag = "5")]
2982 StructValue(super::Struct),
2983 /// Represents a repeated `Value`.
2984 #[prost(message, tag = "6")]
2985 ListValue(super::ListValue),
2986 }
2987}
2988impl ::prost::Name for Value {
2989 const NAME: &'static str = "Value";
2990 const PACKAGE: &'static str = "google.protobuf";
2991 fn full_name() -> ::prost::alloc::string::String {
2992 "google.protobuf.Value".into()
2993 }
2994 fn type_url() -> ::prost::alloc::string::String {
2995 "type.googleapis.com/google.protobuf.Value".into()
2996 }
2997}
2998/// `ListValue` is a wrapper around a repeated field of values.
2999///
3000/// The JSON representation for `ListValue` is JSON array.
3001#[derive(Clone, PartialEq, ::prost::Message)]
3002pub struct ListValue {
3003 /// Repeated field of dynamically typed values.
3004 #[prost(message, repeated, tag = "1")]
3005 pub values: ::prost::alloc::vec::Vec<Value>,
3006}
3007impl ::prost::Name for ListValue {
3008 const NAME: &'static str = "ListValue";
3009 const PACKAGE: &'static str = "google.protobuf";
3010 fn full_name() -> ::prost::alloc::string::String {
3011 "google.protobuf.ListValue".into()
3012 }
3013 fn type_url() -> ::prost::alloc::string::String {
3014 "type.googleapis.com/google.protobuf.ListValue".into()
3015 }
3016}
3017/// `NullValue` is a singleton enumeration to represent the null value for the
3018/// `Value` type union.
3019///
3020/// The JSON representation for `NullValue` is JSON `null`.
3021#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3022#[repr(i32)]
3023pub enum NullValue {
3024 /// Null value.
3025 NullValue = 0,
3026}
3027impl NullValue {
3028 /// String value of the enum field names used in the ProtoBuf definition.
3029 ///
3030 /// The values are not transformed in any way and thus are considered stable
3031 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3032 pub fn as_str_name(&self) -> &'static str {
3033 match self {
3034 Self::NullValue => "NULL_VALUE",
3035 }
3036 }
3037 /// Creates an enum from field names used in the ProtoBuf definition.
3038 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3039 match value {
3040 "NULL_VALUE" => Some(Self::NullValue),
3041 _ => None,
3042 }
3043 }
3044}
3045/// A generic empty message that you can re-use to avoid defining duplicated
3046/// empty messages in your APIs. A typical example is to use it as the request
3047/// or the response type of an API method. For instance:
3048///
3049/// ```text
3050/// service Foo {
3051/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
3052/// }
3053/// ```
3054#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3055pub struct Empty {}
3056impl ::prost::Name for Empty {
3057 const NAME: &'static str = "Empty";
3058 const PACKAGE: &'static str = "google.protobuf";
3059 fn full_name() -> ::prost::alloc::string::String {
3060 "google.protobuf.Empty".into()
3061 }
3062 fn type_url() -> ::prost::alloc::string::String {
3063 "type.googleapis.com/google.protobuf.Empty".into()
3064 }
3065}