prost_types/protobuf.rs
1// This file is @generated by prost-build.
2/// The protocol compiler can output a FileDescriptorSet containing the .proto
3/// files it parses.
4#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
5#[derive(Clone, PartialEq, ::prost::Message)]
6pub struct FileDescriptorSet {
7 #[prost(message, repeated, tag = "1")]
8 pub file: ::prost::alloc::vec::Vec<FileDescriptorProto>,
9}
10/// Describes a complete .proto file.
11#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
12#[derive(Clone, PartialEq, ::prost::Message)]
13pub struct FileDescriptorProto {
14 /// file name, relative to root of source tree
15 #[prost(string, optional, tag = "1")]
16 pub name: ::core::option::Option<::prost::alloc::string::String>,
17 /// e.g. "foo", "foo.bar", etc.
18 #[prost(string, optional, tag = "2")]
19 pub package: ::core::option::Option<::prost::alloc::string::String>,
20 /// Names of files imported by this file.
21 #[prost(string, repeated, tag = "3")]
22 pub dependency: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
23 /// Indexes of the public imported files in the dependency list above.
24 #[prost(int32, repeated, packed = "false", tag = "10")]
25 pub public_dependency: ::prost::alloc::vec::Vec<i32>,
26 /// Indexes of the weak imported files in the dependency list.
27 /// For Google-internal migration only. Do not use.
28 #[prost(int32, repeated, packed = "false", tag = "11")]
29 pub weak_dependency: ::prost::alloc::vec::Vec<i32>,
30 /// All top-level definitions in this file.
31 #[prost(message, repeated, tag = "4")]
32 pub message_type: ::prost::alloc::vec::Vec<DescriptorProto>,
33 #[prost(message, repeated, tag = "5")]
34 pub enum_type: ::prost::alloc::vec::Vec<EnumDescriptorProto>,
35 #[prost(message, repeated, tag = "6")]
36 pub service: ::prost::alloc::vec::Vec<ServiceDescriptorProto>,
37 #[prost(message, repeated, tag = "7")]
38 pub extension: ::prost::alloc::vec::Vec<FieldDescriptorProto>,
39 #[prost(message, optional, tag = "8")]
40 pub options: ::core::option::Option<FileOptions>,
41 /// This field contains optional information about the original source code.
42 /// You may safely remove this entire field without harming runtime
43 /// functionality of the descriptors -- the information is needed only by
44 /// development tools.
45 #[prost(message, optional, tag = "9")]
46 pub source_code_info: ::core::option::Option<SourceCodeInfo>,
47 /// The syntax of the proto file.
48 /// The supported values are "proto2" and "proto3".
49 #[prost(string, optional, tag = "12")]
50 pub syntax: ::core::option::Option<::prost::alloc::string::String>,
51}
52/// Describes a message type.
53#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
54#[derive(Clone, PartialEq, ::prost::Message)]
55pub struct DescriptorProto {
56 #[prost(string, optional, tag = "1")]
57 pub name: ::core::option::Option<::prost::alloc::string::String>,
58 #[prost(message, repeated, tag = "2")]
59 pub field: ::prost::alloc::vec::Vec<FieldDescriptorProto>,
60 #[prost(message, repeated, tag = "6")]
61 pub extension: ::prost::alloc::vec::Vec<FieldDescriptorProto>,
62 #[prost(message, repeated, tag = "3")]
63 pub nested_type: ::prost::alloc::vec::Vec<DescriptorProto>,
64 #[prost(message, repeated, tag = "4")]
65 pub enum_type: ::prost::alloc::vec::Vec<EnumDescriptorProto>,
66 #[prost(message, repeated, tag = "5")]
67 pub extension_range: ::prost::alloc::vec::Vec<descriptor_proto::ExtensionRange>,
68 #[prost(message, repeated, tag = "8")]
69 pub oneof_decl: ::prost::alloc::vec::Vec<OneofDescriptorProto>,
70 #[prost(message, optional, tag = "7")]
71 pub options: ::core::option::Option<MessageOptions>,
72 #[prost(message, repeated, tag = "9")]
73 pub reserved_range: ::prost::alloc::vec::Vec<descriptor_proto::ReservedRange>,
74 /// Reserved field names, which may not be used by fields in the same message.
75 /// A given name may only be reserved once.
76 #[prost(string, repeated, tag = "10")]
77 pub reserved_name: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
78}
79/// Nested message and enum types in `DescriptorProto`.
80pub mod descriptor_proto {
81 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
82 #[derive(Clone, PartialEq, ::prost::Message)]
83 pub struct ExtensionRange {
84 /// Inclusive.
85 #[prost(int32, optional, tag = "1")]
86 pub start: ::core::option::Option<i32>,
87 /// Exclusive.
88 #[prost(int32, optional, tag = "2")]
89 pub end: ::core::option::Option<i32>,
90 #[prost(message, optional, tag = "3")]
91 pub options: ::core::option::Option<super::ExtensionRangeOptions>,
92 }
93 /// Range of reserved tag numbers. Reserved tag numbers may not be used by
94 /// fields or extension ranges in the same message. Reserved ranges may
95 /// not overlap.
96 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
97 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
98 pub struct ReservedRange {
99 /// Inclusive.
100 #[prost(int32, optional, tag = "1")]
101 pub start: ::core::option::Option<i32>,
102 /// Exclusive.
103 #[prost(int32, optional, tag = "2")]
104 pub end: ::core::option::Option<i32>,
105 }
106}
107#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
108#[derive(Clone, PartialEq, ::prost::Message)]
109pub struct ExtensionRangeOptions {
110 /// The parser stores options it doesn't recognize here. See above.
111 #[prost(message, repeated, tag = "999")]
112 pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
113}
114/// Describes a field within a message.
115#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
116#[derive(Clone, PartialEq, ::prost::Message)]
117pub struct FieldDescriptorProto {
118 #[prost(string, optional, tag = "1")]
119 pub name: ::core::option::Option<::prost::alloc::string::String>,
120 #[prost(int32, optional, tag = "3")]
121 pub number: ::core::option::Option<i32>,
122 #[prost(enumeration = "field_descriptor_proto::Label", optional, tag = "4")]
123 pub label: ::core::option::Option<i32>,
124 /// If type_name is set, this need not be set. If both this and type_name
125 /// are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
126 #[prost(enumeration = "field_descriptor_proto::Type", optional, tag = "5")]
127 pub r#type: ::core::option::Option<i32>,
128 /// For message and enum types, this is the name of the type. If the name
129 /// starts with a '.', it is fully-qualified. Otherwise, C++-like scoping
130 /// rules are used to find the type (i.e. first the nested types within this
131 /// message are searched, then within the parent, on up to the root
132 /// namespace).
133 #[prost(string, optional, tag = "6")]
134 pub type_name: ::core::option::Option<::prost::alloc::string::String>,
135 /// For extensions, this is the name of the type being extended. It is
136 /// resolved in the same manner as type_name.
137 #[prost(string, optional, tag = "2")]
138 pub extendee: ::core::option::Option<::prost::alloc::string::String>,
139 /// For numeric types, contains the original text representation of the value.
140 /// For booleans, "true" or "false".
141 /// For strings, contains the default text contents (not escaped in any way).
142 /// For bytes, contains the C escaped value. All bytes >= 128 are escaped.
143 /// TODO(kenton): Base-64 encode?
144 #[prost(string, optional, tag = "7")]
145 pub default_value: ::core::option::Option<::prost::alloc::string::String>,
146 /// If set, gives the index of a oneof in the containing type's oneof_decl
147 /// list. This field is a member of that oneof.
148 #[prost(int32, optional, tag = "9")]
149 pub oneof_index: ::core::option::Option<i32>,
150 /// JSON name of this field. The value is set by protocol compiler. If the
151 /// user has set a "json_name" option on this field, that option's value
152 /// will be used. Otherwise, it's deduced from the field's name by converting
153 /// it to camelCase.
154 #[prost(string, optional, tag = "10")]
155 pub json_name: ::core::option::Option<::prost::alloc::string::String>,
156 #[prost(message, optional, tag = "8")]
157 pub options: ::core::option::Option<FieldOptions>,
158 /// If true, this is a proto3 "optional". When a proto3 field is optional, it
159 /// tracks presence regardless of field type.
160 ///
161 /// When proto3_optional is true, this field must be belong to a oneof to
162 /// signal to old proto3 clients that presence is tracked for this field. This
163 /// oneof is known as a "synthetic" oneof, and this field must be its sole
164 /// member (each proto3 optional field gets its own synthetic oneof). Synthetic
165 /// oneofs exist in the descriptor only, and do not generate any API. Synthetic
166 /// oneofs must be ordered after all "real" oneofs.
167 ///
168 /// For message fields, proto3_optional doesn't create any semantic change,
169 /// since non-repeated message fields always track presence. However it still
170 /// indicates the semantic detail of whether the user wrote "optional" or not.
171 /// This can be useful for round-tripping the .proto file. For consistency we
172 /// give message fields a synthetic oneof also, even though it is not required
173 /// to track presence. This is especially important because the parser can't
174 /// tell if a field is a message or an enum, so it must always create a
175 /// synthetic oneof.
176 ///
177 /// Proto2 optional fields do not set this flag, because they already indicate
178 /// optional with `LABEL_OPTIONAL`.
179 #[prost(bool, optional, tag = "17")]
180 pub proto3_optional: ::core::option::Option<bool>,
181}
182/// Nested message and enum types in `FieldDescriptorProto`.
183pub mod field_descriptor_proto {
184 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
185 #[derive(
186 Clone,
187 Copy,
188 Debug,
189 PartialEq,
190 Eq,
191 Hash,
192 PartialOrd,
193 Ord,
194 ::prost::Enumeration
195 )]
196 #[repr(i32)]
197 pub enum Type {
198 /// 0 is reserved for errors.
199 /// Order is weird for historical reasons.
200 Double = 1,
201 Float = 2,
202 /// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
203 /// negative values are likely.
204 Int64 = 3,
205 Uint64 = 4,
206 /// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
207 /// negative values are likely.
208 Int32 = 5,
209 Fixed64 = 6,
210 Fixed32 = 7,
211 Bool = 8,
212 String = 9,
213 /// Tag-delimited aggregate.
214 /// Group type is deprecated and not supported in proto3. However, Proto3
215 /// implementations should still be able to parse the group wire format and
216 /// treat group fields as unknown fields.
217 Group = 10,
218 /// Length-delimited aggregate.
219 Message = 11,
220 /// New in version 2.
221 Bytes = 12,
222 Uint32 = 13,
223 Enum = 14,
224 Sfixed32 = 15,
225 Sfixed64 = 16,
226 /// Uses ZigZag encoding.
227 Sint32 = 17,
228 /// Uses ZigZag encoding.
229 Sint64 = 18,
230 }
231 impl Type {
232 /// String value of the enum field names used in the ProtoBuf definition.
233 ///
234 /// The values are not transformed in any way and thus are considered stable
235 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
236 pub fn as_str_name(&self) -> &'static str {
237 match self {
238 Self::Double => "TYPE_DOUBLE",
239 Self::Float => "TYPE_FLOAT",
240 Self::Int64 => "TYPE_INT64",
241 Self::Uint64 => "TYPE_UINT64",
242 Self::Int32 => "TYPE_INT32",
243 Self::Fixed64 => "TYPE_FIXED64",
244 Self::Fixed32 => "TYPE_FIXED32",
245 Self::Bool => "TYPE_BOOL",
246 Self::String => "TYPE_STRING",
247 Self::Group => "TYPE_GROUP",
248 Self::Message => "TYPE_MESSAGE",
249 Self::Bytes => "TYPE_BYTES",
250 Self::Uint32 => "TYPE_UINT32",
251 Self::Enum => "TYPE_ENUM",
252 Self::Sfixed32 => "TYPE_SFIXED32",
253 Self::Sfixed64 => "TYPE_SFIXED64",
254 Self::Sint32 => "TYPE_SINT32",
255 Self::Sint64 => "TYPE_SINT64",
256 }
257 }
258 /// Creates an enum from field names used in the ProtoBuf definition.
259 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
260 match value {
261 "TYPE_DOUBLE" => Some(Self::Double),
262 "TYPE_FLOAT" => Some(Self::Float),
263 "TYPE_INT64" => Some(Self::Int64),
264 "TYPE_UINT64" => Some(Self::Uint64),
265 "TYPE_INT32" => Some(Self::Int32),
266 "TYPE_FIXED64" => Some(Self::Fixed64),
267 "TYPE_FIXED32" => Some(Self::Fixed32),
268 "TYPE_BOOL" => Some(Self::Bool),
269 "TYPE_STRING" => Some(Self::String),
270 "TYPE_GROUP" => Some(Self::Group),
271 "TYPE_MESSAGE" => Some(Self::Message),
272 "TYPE_BYTES" => Some(Self::Bytes),
273 "TYPE_UINT32" => Some(Self::Uint32),
274 "TYPE_ENUM" => Some(Self::Enum),
275 "TYPE_SFIXED32" => Some(Self::Sfixed32),
276 "TYPE_SFIXED64" => Some(Self::Sfixed64),
277 "TYPE_SINT32" => Some(Self::Sint32),
278 "TYPE_SINT64" => Some(Self::Sint64),
279 _ => None,
280 }
281 }
282 }
283 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
284 #[derive(
285 Clone,
286 Copy,
287 Debug,
288 PartialEq,
289 Eq,
290 Hash,
291 PartialOrd,
292 Ord,
293 ::prost::Enumeration
294 )]
295 #[repr(i32)]
296 pub enum Label {
297 /// 0 is reserved for errors
298 Optional = 1,
299 Required = 2,
300 Repeated = 3,
301 }
302 impl Label {
303 /// String value of the enum field names used in the ProtoBuf definition.
304 ///
305 /// The values are not transformed in any way and thus are considered stable
306 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
307 pub fn as_str_name(&self) -> &'static str {
308 match self {
309 Self::Optional => "LABEL_OPTIONAL",
310 Self::Required => "LABEL_REQUIRED",
311 Self::Repeated => "LABEL_REPEATED",
312 }
313 }
314 /// Creates an enum from field names used in the ProtoBuf definition.
315 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
316 match value {
317 "LABEL_OPTIONAL" => Some(Self::Optional),
318 "LABEL_REQUIRED" => Some(Self::Required),
319 "LABEL_REPEATED" => Some(Self::Repeated),
320 _ => None,
321 }
322 }
323 }
324}
325/// Describes a oneof.
326#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
327#[derive(Clone, PartialEq, ::prost::Message)]
328pub struct OneofDescriptorProto {
329 #[prost(string, optional, tag = "1")]
330 pub name: ::core::option::Option<::prost::alloc::string::String>,
331 #[prost(message, optional, tag = "2")]
332 pub options: ::core::option::Option<OneofOptions>,
333}
334/// Describes an enum type.
335#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
336#[derive(Clone, PartialEq, ::prost::Message)]
337pub struct EnumDescriptorProto {
338 #[prost(string, optional, tag = "1")]
339 pub name: ::core::option::Option<::prost::alloc::string::String>,
340 #[prost(message, repeated, tag = "2")]
341 pub value: ::prost::alloc::vec::Vec<EnumValueDescriptorProto>,
342 #[prost(message, optional, tag = "3")]
343 pub options: ::core::option::Option<EnumOptions>,
344 /// Range of reserved numeric values. Reserved numeric values may not be used
345 /// by enum values in the same enum declaration. Reserved ranges may not
346 /// overlap.
347 #[prost(message, repeated, tag = "4")]
348 pub reserved_range: ::prost::alloc::vec::Vec<
349 enum_descriptor_proto::EnumReservedRange,
350 >,
351 /// Reserved enum value names, which may not be reused. A given name may only
352 /// be reserved once.
353 #[prost(string, repeated, tag = "5")]
354 pub reserved_name: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
355}
356/// Nested message and enum types in `EnumDescriptorProto`.
357pub mod enum_descriptor_proto {
358 /// Range of reserved numeric values. Reserved values may not be used by
359 /// entries in the same enum. Reserved ranges may not overlap.
360 ///
361 /// Note that this is distinct from DescriptorProto.ReservedRange in that it
362 /// is inclusive such that it can appropriately represent the entire int32
363 /// domain.
364 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
365 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
366 pub struct EnumReservedRange {
367 /// Inclusive.
368 #[prost(int32, optional, tag = "1")]
369 pub start: ::core::option::Option<i32>,
370 /// Inclusive.
371 #[prost(int32, optional, tag = "2")]
372 pub end: ::core::option::Option<i32>,
373 }
374}
375/// Describes a value within an enum.
376#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
377#[derive(Clone, PartialEq, ::prost::Message)]
378pub struct EnumValueDescriptorProto {
379 #[prost(string, optional, tag = "1")]
380 pub name: ::core::option::Option<::prost::alloc::string::String>,
381 #[prost(int32, optional, tag = "2")]
382 pub number: ::core::option::Option<i32>,
383 #[prost(message, optional, tag = "3")]
384 pub options: ::core::option::Option<EnumValueOptions>,
385}
386/// Describes a service.
387#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
388#[derive(Clone, PartialEq, ::prost::Message)]
389pub struct ServiceDescriptorProto {
390 #[prost(string, optional, tag = "1")]
391 pub name: ::core::option::Option<::prost::alloc::string::String>,
392 #[prost(message, repeated, tag = "2")]
393 pub method: ::prost::alloc::vec::Vec<MethodDescriptorProto>,
394 #[prost(message, optional, tag = "3")]
395 pub options: ::core::option::Option<ServiceOptions>,
396}
397/// Describes a method of a service.
398#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
399#[derive(Clone, PartialEq, ::prost::Message)]
400pub struct MethodDescriptorProto {
401 #[prost(string, optional, tag = "1")]
402 pub name: ::core::option::Option<::prost::alloc::string::String>,
403 /// Input and output type names. These are resolved in the same way as
404 /// FieldDescriptorProto.type_name, but must refer to a message type.
405 #[prost(string, optional, tag = "2")]
406 pub input_type: ::core::option::Option<::prost::alloc::string::String>,
407 #[prost(string, optional, tag = "3")]
408 pub output_type: ::core::option::Option<::prost::alloc::string::String>,
409 #[prost(message, optional, tag = "4")]
410 pub options: ::core::option::Option<MethodOptions>,
411 /// Identifies if client streams multiple client messages
412 #[prost(bool, optional, tag = "5", default = "false")]
413 pub client_streaming: ::core::option::Option<bool>,
414 /// Identifies if server streams multiple server messages
415 #[prost(bool, optional, tag = "6", default = "false")]
416 pub server_streaming: ::core::option::Option<bool>,
417}
418/// Each of the definitions above may have "options" attached. These are
419/// just annotations which may cause code to be generated slightly differently
420/// or may contain hints for code that manipulates protocol messages.
421///
422/// Clients may define custom options as extensions of the \*Options messages.
423/// These extensions may not yet be known at parsing time, so the parser cannot
424/// store the values in them. Instead it stores them in a field in the \*Options
425/// message called uninterpreted_option. This field must have the same name
426/// across all \*Options messages. We then use this field to populate the
427/// extensions when we build a descriptor, at which point all protos have been
428/// parsed and so all extensions are known.
429///
430/// Extension numbers for custom options may be chosen as follows:
431///
432/// * For options which will only be used within a single application or
433/// organization, or for experimental options, use field numbers 50000
434/// through 99999. It is up to you to ensure that you do not use the
435/// same number for multiple options.
436/// * For options which will be published and used publicly by multiple
437/// independent entities, e-mail protobuf-global-extension-registry@google.com
438/// to reserve extension numbers. Simply provide your project name (e.g.
439/// Objective-C plugin) and your project website (if available) -- there's no
440/// need to explain how you intend to use them. Usually you only need one
441/// extension number. You can declare multiple options with only one extension
442/// number by putting them in a sub-message. See the Custom Options section of
443/// the docs for examples:
444/// <https://developers.google.com/protocol-buffers/docs/proto#options>
445/// If this turns out to be popular, a web service will be set up
446/// to automatically assign option numbers.
447#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
448#[derive(Clone, PartialEq, ::prost::Message)]
449pub struct FileOptions {
450 /// Sets the Java package where classes generated from this .proto will be
451 /// placed. By default, the proto package is used, but this is often
452 /// inappropriate because proto packages do not normally start with backwards
453 /// domain names.
454 #[prost(string, optional, tag = "1")]
455 pub java_package: ::core::option::Option<::prost::alloc::string::String>,
456 /// Controls the name of the wrapper Java class generated for the .proto file.
457 /// That class will always contain the .proto file's getDescriptor() method as
458 /// well as any top-level extensions defined in the .proto file.
459 /// If java_multiple_files is disabled, then all the other classes from the
460 /// .proto file will be nested inside the single wrapper outer class.
461 #[prost(string, optional, tag = "8")]
462 pub java_outer_classname: ::core::option::Option<::prost::alloc::string::String>,
463 /// If enabled, then the Java code generator will generate a separate .java
464 /// file for each top-level message, enum, and service defined in the .proto
465 /// file. Thus, these types will *not* be nested inside the wrapper class
466 /// named by java_outer_classname. However, the wrapper class will still be
467 /// generated to contain the file's getDescriptor() method as well as any
468 /// top-level extensions defined in the file.
469 #[prost(bool, optional, tag = "10", default = "false")]
470 pub java_multiple_files: ::core::option::Option<bool>,
471 /// This option does nothing.
472 #[deprecated]
473 #[prost(bool, optional, tag = "20")]
474 pub java_generate_equals_and_hash: ::core::option::Option<bool>,
475 /// If set true, then the Java2 code generator will generate code that
476 /// throws an exception whenever an attempt is made to assign a non-UTF-8
477 /// byte sequence to a string field.
478 /// Message reflection will do the same.
479 /// However, an extension field still accepts non-UTF-8 byte sequences.
480 /// This option has no effect on when used with the lite runtime.
481 #[prost(bool, optional, tag = "27", default = "false")]
482 pub java_string_check_utf8: ::core::option::Option<bool>,
483 #[prost(
484 enumeration = "file_options::OptimizeMode",
485 optional,
486 tag = "9",
487 default = "Speed"
488 )]
489 pub optimize_for: ::core::option::Option<i32>,
490 /// Sets the Go package where structs generated from this .proto will be
491 /// placed. If omitted, the Go package will be derived from the following:
492 ///
493 /// * The basename of the package import path, if provided.
494 /// * Otherwise, the package statement in the .proto file, if present.
495 /// * Otherwise, the basename of the .proto file, without extension.
496 #[prost(string, optional, tag = "11")]
497 pub go_package: ::core::option::Option<::prost::alloc::string::String>,
498 /// Should generic services be generated in each language? "Generic" services
499 /// are not specific to any particular RPC system. They are generated by the
500 /// main code generators in each language (without additional plugins).
501 /// Generic services were the only kind of service generation supported by
502 /// early versions of google.protobuf.
503 ///
504 /// Generic services are now considered deprecated in favor of using plugins
505 /// that generate code specific to your particular RPC system. Therefore,
506 /// these default to false. Old code which depends on generic services should
507 /// explicitly set them to true.
508 #[prost(bool, optional, tag = "16", default = "false")]
509 pub cc_generic_services: ::core::option::Option<bool>,
510 #[prost(bool, optional, tag = "17", default = "false")]
511 pub java_generic_services: ::core::option::Option<bool>,
512 #[prost(bool, optional, tag = "18", default = "false")]
513 pub py_generic_services: ::core::option::Option<bool>,
514 #[prost(bool, optional, tag = "42", default = "false")]
515 pub php_generic_services: ::core::option::Option<bool>,
516 /// Is this file deprecated?
517 /// Depending on the target platform, this can emit Deprecated annotations
518 /// for everything in the file, or it will be completely ignored; in the very
519 /// least, this is a formalization for deprecating files.
520 #[prost(bool, optional, tag = "23", default = "false")]
521 pub deprecated: ::core::option::Option<bool>,
522 /// Enables the use of arenas for the proto messages in this file. This applies
523 /// only to generated classes for C++.
524 #[prost(bool, optional, tag = "31", default = "true")]
525 pub cc_enable_arenas: ::core::option::Option<bool>,
526 /// Sets the objective c class prefix which is prepended to all objective c
527 /// generated classes from this .proto. There is no default.
528 #[prost(string, optional, tag = "36")]
529 pub objc_class_prefix: ::core::option::Option<::prost::alloc::string::String>,
530 /// Namespace for generated classes; defaults to the package.
531 #[prost(string, optional, tag = "37")]
532 pub csharp_namespace: ::core::option::Option<::prost::alloc::string::String>,
533 /// By default Swift generators will take the proto package and CamelCase it
534 /// replacing '.' with underscore and use that to prefix the types/symbols
535 /// defined. When this options is provided, they will use this value instead
536 /// to prefix the types/symbols defined.
537 #[prost(string, optional, tag = "39")]
538 pub swift_prefix: ::core::option::Option<::prost::alloc::string::String>,
539 /// Sets the php class prefix which is prepended to all php generated classes
540 /// from this .proto. Default is empty.
541 #[prost(string, optional, tag = "40")]
542 pub php_class_prefix: ::core::option::Option<::prost::alloc::string::String>,
543 /// Use this option to change the namespace of php generated classes. Default
544 /// is empty. When this option is empty, the package name will be used for
545 /// determining the namespace.
546 #[prost(string, optional, tag = "41")]
547 pub php_namespace: ::core::option::Option<::prost::alloc::string::String>,
548 /// Use this option to change the namespace of php generated metadata classes.
549 /// Default is empty. When this option is empty, the proto file name will be
550 /// used for determining the namespace.
551 #[prost(string, optional, tag = "44")]
552 pub php_metadata_namespace: ::core::option::Option<::prost::alloc::string::String>,
553 /// Use this option to change the package of ruby generated classes. Default
554 /// is empty. When this option is not set, the package name will be used for
555 /// determining the ruby package.
556 #[prost(string, optional, tag = "45")]
557 pub ruby_package: ::core::option::Option<::prost::alloc::string::String>,
558 /// The parser stores options it doesn't recognize here.
559 /// See the documentation for the "Options" section above.
560 #[prost(message, repeated, tag = "999")]
561 pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
562}
563/// Nested message and enum types in `FileOptions`.
564pub mod file_options {
565 /// Generated classes can be optimized for speed or code size.
566 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
567 #[derive(
568 Clone,
569 Copy,
570 Debug,
571 PartialEq,
572 Eq,
573 Hash,
574 PartialOrd,
575 Ord,
576 ::prost::Enumeration
577 )]
578 #[repr(i32)]
579 pub enum OptimizeMode {
580 /// Generate complete code for parsing, serialization,
581 Speed = 1,
582 /// etc.
583 ///
584 /// Use ReflectionOps to implement these methods.
585 CodeSize = 2,
586 /// Generate code using MessageLite and the lite runtime.
587 LiteRuntime = 3,
588 }
589 impl OptimizeMode {
590 /// String value of the enum field names used in the ProtoBuf definition.
591 ///
592 /// The values are not transformed in any way and thus are considered stable
593 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
594 pub fn as_str_name(&self) -> &'static str {
595 match self {
596 Self::Speed => "SPEED",
597 Self::CodeSize => "CODE_SIZE",
598 Self::LiteRuntime => "LITE_RUNTIME",
599 }
600 }
601 /// Creates an enum from field names used in the ProtoBuf definition.
602 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
603 match value {
604 "SPEED" => Some(Self::Speed),
605 "CODE_SIZE" => Some(Self::CodeSize),
606 "LITE_RUNTIME" => Some(Self::LiteRuntime),
607 _ => None,
608 }
609 }
610 }
611}
612#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
613#[derive(Clone, PartialEq, ::prost::Message)]
614pub struct MessageOptions {
615 /// Set true to use the old proto1 MessageSet wire format for extensions.
616 /// This is provided for backwards-compatibility with the MessageSet wire
617 /// format. You should not use this for any other reason: It's less
618 /// efficient, has fewer features, and is more complicated.
619 ///
620 /// The message must be defined exactly as follows:
621 /// message Foo {
622 /// option message_set_wire_format = true;
623 /// extensions 4 to max;
624 /// }
625 /// Note that the message cannot have any defined fields; MessageSets only
626 /// have extensions.
627 ///
628 /// All extensions of your type must be singular messages; e.g. they cannot
629 /// be int32s, enums, or repeated messages.
630 ///
631 /// Because this is an option, the above two restrictions are not enforced by
632 /// the protocol compiler.
633 #[prost(bool, optional, tag = "1", default = "false")]
634 pub message_set_wire_format: ::core::option::Option<bool>,
635 /// Disables the generation of the standard "descriptor()" accessor, which can
636 /// conflict with a field of the same name. This is meant to make migration
637 /// from proto1 easier; new code should avoid fields named "descriptor".
638 #[prost(bool, optional, tag = "2", default = "false")]
639 pub no_standard_descriptor_accessor: ::core::option::Option<bool>,
640 /// Is this message deprecated?
641 /// Depending on the target platform, this can emit Deprecated annotations
642 /// for the message, or it will be completely ignored; in the very least,
643 /// this is a formalization for deprecating messages.
644 #[prost(bool, optional, tag = "3", default = "false")]
645 pub deprecated: ::core::option::Option<bool>,
646 /// Whether the message is an automatically generated map entry type for the
647 /// maps field.
648 ///
649 /// For maps fields:
650 /// map\<KeyType, ValueType> map_field = 1;
651 /// The parsed descriptor looks like:
652 /// message MapFieldEntry {
653 /// option map_entry = true;
654 /// optional KeyType key = 1;
655 /// optional ValueType value = 2;
656 /// }
657 /// repeated MapFieldEntry map_field = 1;
658 ///
659 /// Implementations may choose not to generate the map_entry=true message, but
660 /// use a native map in the target language to hold the keys and values.
661 /// The reflection APIs in such implementations still need to work as
662 /// if the field is a repeated message field.
663 ///
664 /// NOTE: Do not set the option in .proto files. Always use the maps syntax
665 /// instead. The option should only be implicitly set by the proto compiler
666 /// parser.
667 #[prost(bool, optional, tag = "7")]
668 pub map_entry: ::core::option::Option<bool>,
669 /// The parser stores options it doesn't recognize here. See above.
670 #[prost(message, repeated, tag = "999")]
671 pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
672}
673#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
674#[derive(Clone, PartialEq, ::prost::Message)]
675pub struct FieldOptions {
676 /// The ctype option instructs the C++ code generator to use a different
677 /// representation of the field than it normally would. See the specific
678 /// options below. This option is not yet implemented in the open source
679 /// release -- sorry, we'll try to include it in a future version!
680 #[prost(
681 enumeration = "field_options::CType",
682 optional,
683 tag = "1",
684 default = "String"
685 )]
686 pub ctype: ::core::option::Option<i32>,
687 /// The packed option can be enabled for repeated primitive fields to enable
688 /// a more efficient representation on the wire. Rather than repeatedly
689 /// writing the tag and type for each element, the entire array is encoded as
690 /// a single length-delimited blob. In proto3, only explicit setting it to
691 /// false will avoid using packed encoding.
692 #[prost(bool, optional, tag = "2")]
693 pub packed: ::core::option::Option<bool>,
694 /// The jstype option determines the JavaScript type used for values of the
695 /// field. The option is permitted only for 64 bit integral and fixed types
696 /// (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING
697 /// is represented as JavaScript string, which avoids loss of precision that
698 /// can happen when a large value is converted to a floating point JavaScript.
699 /// Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
700 /// use the JavaScript "number" type. The behavior of the default option
701 /// JS_NORMAL is implementation dependent.
702 ///
703 /// This option is an enum to permit additional types to be added, e.g.
704 /// goog.math.Integer.
705 #[prost(
706 enumeration = "field_options::JsType",
707 optional,
708 tag = "6",
709 default = "JsNormal"
710 )]
711 pub jstype: ::core::option::Option<i32>,
712 /// Should this field be parsed lazily? Lazy applies only to message-type
713 /// fields. It means that when the outer message is initially parsed, the
714 /// inner message's contents will not be parsed but instead stored in encoded
715 /// form. The inner message will actually be parsed when it is first accessed.
716 ///
717 /// This is only a hint. Implementations are free to choose whether to use
718 /// eager or lazy parsing regardless of the value of this option. However,
719 /// setting this option true suggests that the protocol author believes that
720 /// using lazy parsing on this field is worth the additional bookkeeping
721 /// overhead typically needed to implement it.
722 ///
723 /// This option does not affect the public interface of any generated code;
724 /// all method signatures remain the same. Furthermore, thread-safety of the
725 /// interface is not affected by this option; const methods remain safe to
726 /// call from multiple threads concurrently, while non-const methods continue
727 /// to require exclusive access.
728 ///
729 /// Note that implementations may choose not to check required fields within
730 /// a lazy sub-message. That is, calling IsInitialized() on the outer message
731 /// may return true even if the inner message has missing required fields.
732 /// This is necessary because otherwise the inner message would have to be
733 /// parsed in order to perform the check, defeating the purpose of lazy
734 /// parsing. An implementation which chooses not to check required fields
735 /// must be consistent about it. That is, for any particular sub-message, the
736 /// implementation must either *always* check its required fields, or *never*
737 /// check its required fields, regardless of whether or not the message has
738 /// been parsed.
739 #[prost(bool, optional, tag = "5", default = "false")]
740 pub lazy: ::core::option::Option<bool>,
741 /// Is this field deprecated?
742 /// Depending on the target platform, this can emit Deprecated annotations
743 /// for accessors, or it will be completely ignored; in the very least, this
744 /// is a formalization for deprecating fields.
745 #[prost(bool, optional, tag = "3", default = "false")]
746 pub deprecated: ::core::option::Option<bool>,
747 /// For Google-internal migration only. Do not use.
748 #[prost(bool, optional, tag = "10", default = "false")]
749 pub weak: ::core::option::Option<bool>,
750 /// The parser stores options it doesn't recognize here. See above.
751 #[prost(message, repeated, tag = "999")]
752 pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
753}
754/// Nested message and enum types in `FieldOptions`.
755pub mod field_options {
756 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
757 #[derive(
758 Clone,
759 Copy,
760 Debug,
761 PartialEq,
762 Eq,
763 Hash,
764 PartialOrd,
765 Ord,
766 ::prost::Enumeration
767 )]
768 #[repr(i32)]
769 pub enum CType {
770 /// Default mode.
771 String = 0,
772 Cord = 1,
773 StringPiece = 2,
774 }
775 impl CType {
776 /// String value of the enum field names used in the ProtoBuf definition.
777 ///
778 /// The values are not transformed in any way and thus are considered stable
779 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
780 pub fn as_str_name(&self) -> &'static str {
781 match self {
782 Self::String => "STRING",
783 Self::Cord => "CORD",
784 Self::StringPiece => "STRING_PIECE",
785 }
786 }
787 /// Creates an enum from field names used in the ProtoBuf definition.
788 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
789 match value {
790 "STRING" => Some(Self::String),
791 "CORD" => Some(Self::Cord),
792 "STRING_PIECE" => Some(Self::StringPiece),
793 _ => None,
794 }
795 }
796 }
797 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
798 #[derive(
799 Clone,
800 Copy,
801 Debug,
802 PartialEq,
803 Eq,
804 Hash,
805 PartialOrd,
806 Ord,
807 ::prost::Enumeration
808 )]
809 #[repr(i32)]
810 pub enum JsType {
811 /// Use the default type.
812 JsNormal = 0,
813 /// Use JavaScript strings.
814 JsString = 1,
815 /// Use JavaScript numbers.
816 JsNumber = 2,
817 }
818 impl JsType {
819 /// String value of the enum field names used in the ProtoBuf definition.
820 ///
821 /// The values are not transformed in any way and thus are considered stable
822 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
823 pub fn as_str_name(&self) -> &'static str {
824 match self {
825 Self::JsNormal => "JS_NORMAL",
826 Self::JsString => "JS_STRING",
827 Self::JsNumber => "JS_NUMBER",
828 }
829 }
830 /// Creates an enum from field names used in the ProtoBuf definition.
831 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
832 match value {
833 "JS_NORMAL" => Some(Self::JsNormal),
834 "JS_STRING" => Some(Self::JsString),
835 "JS_NUMBER" => Some(Self::JsNumber),
836 _ => None,
837 }
838 }
839 }
840}
841#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
842#[derive(Clone, PartialEq, ::prost::Message)]
843pub struct OneofOptions {
844 /// The parser stores options it doesn't recognize here. See above.
845 #[prost(message, repeated, tag = "999")]
846 pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
847}
848#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
849#[derive(Clone, PartialEq, ::prost::Message)]
850pub struct EnumOptions {
851 /// Set this option to true to allow mapping different tag names to the same
852 /// value.
853 #[prost(bool, optional, tag = "2")]
854 pub allow_alias: ::core::option::Option<bool>,
855 /// Is this enum deprecated?
856 /// Depending on the target platform, this can emit Deprecated annotations
857 /// for the enum, or it will be completely ignored; in the very least, this
858 /// is a formalization for deprecating enums.
859 #[prost(bool, optional, tag = "3", default = "false")]
860 pub deprecated: ::core::option::Option<bool>,
861 /// The parser stores options it doesn't recognize here. See above.
862 #[prost(message, repeated, tag = "999")]
863 pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
864}
865#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
866#[derive(Clone, PartialEq, ::prost::Message)]
867pub struct EnumValueOptions {
868 /// Is this enum value deprecated?
869 /// Depending on the target platform, this can emit Deprecated annotations
870 /// for the enum value, or it will be completely ignored; in the very least,
871 /// this is a formalization for deprecating enum values.
872 #[prost(bool, optional, tag = "1", default = "false")]
873 pub deprecated: ::core::option::Option<bool>,
874 /// The parser stores options it doesn't recognize here. See above.
875 #[prost(message, repeated, tag = "999")]
876 pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
877}
878#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
879#[derive(Clone, PartialEq, ::prost::Message)]
880pub struct ServiceOptions {
881 /// Is this service deprecated?
882 /// Depending on the target platform, this can emit Deprecated annotations
883 /// for the service, or it will be completely ignored; in the very least,
884 /// this is a formalization for deprecating services.
885 #[prost(bool, optional, tag = "33", default = "false")]
886 pub deprecated: ::core::option::Option<bool>,
887 /// The parser stores options it doesn't recognize here. See above.
888 #[prost(message, repeated, tag = "999")]
889 pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
890}
891#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
892#[derive(Clone, PartialEq, ::prost::Message)]
893pub struct MethodOptions {
894 /// Is this method deprecated?
895 /// Depending on the target platform, this can emit Deprecated annotations
896 /// for the method, or it will be completely ignored; in the very least,
897 /// this is a formalization for deprecating methods.
898 #[prost(bool, optional, tag = "33", default = "false")]
899 pub deprecated: ::core::option::Option<bool>,
900 #[prost(
901 enumeration = "method_options::IdempotencyLevel",
902 optional,
903 tag = "34",
904 default = "IdempotencyUnknown"
905 )]
906 pub idempotency_level: ::core::option::Option<i32>,
907 /// The parser stores options it doesn't recognize here. See above.
908 #[prost(message, repeated, tag = "999")]
909 pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
910}
911/// Nested message and enum types in `MethodOptions`.
912pub mod method_options {
913 /// Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
914 /// or neither? HTTP based RPC implementation may choose GET verb for safe
915 /// methods, and PUT verb for idempotent methods instead of the default POST.
916 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
917 #[derive(
918 Clone,
919 Copy,
920 Debug,
921 PartialEq,
922 Eq,
923 Hash,
924 PartialOrd,
925 Ord,
926 ::prost::Enumeration
927 )]
928 #[repr(i32)]
929 pub enum IdempotencyLevel {
930 IdempotencyUnknown = 0,
931 /// implies idempotent
932 NoSideEffects = 1,
933 /// idempotent, but may have side effects
934 Idempotent = 2,
935 }
936 impl IdempotencyLevel {
937 /// String value of the enum field names used in the ProtoBuf definition.
938 ///
939 /// The values are not transformed in any way and thus are considered stable
940 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
941 pub fn as_str_name(&self) -> &'static str {
942 match self {
943 Self::IdempotencyUnknown => "IDEMPOTENCY_UNKNOWN",
944 Self::NoSideEffects => "NO_SIDE_EFFECTS",
945 Self::Idempotent => "IDEMPOTENT",
946 }
947 }
948 /// Creates an enum from field names used in the ProtoBuf definition.
949 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
950 match value {
951 "IDEMPOTENCY_UNKNOWN" => Some(Self::IdempotencyUnknown),
952 "NO_SIDE_EFFECTS" => Some(Self::NoSideEffects),
953 "IDEMPOTENT" => Some(Self::Idempotent),
954 _ => None,
955 }
956 }
957 }
958}
959/// A message representing a option the parser does not recognize. This only
960/// appears in options protos created by the compiler::Parser class.
961/// DescriptorPool resolves these when building Descriptor objects. Therefore,
962/// options protos in descriptor objects (e.g. returned by Descriptor::options(),
963/// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
964/// in them.
965#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
966#[derive(Clone, PartialEq, ::prost::Message)]
967pub struct UninterpretedOption {
968 #[prost(message, repeated, tag = "2")]
969 pub name: ::prost::alloc::vec::Vec<uninterpreted_option::NamePart>,
970 /// The value of the uninterpreted option, in whatever type the tokenizer
971 /// identified it as during parsing. Exactly one of these should be set.
972 #[prost(string, optional, tag = "3")]
973 pub identifier_value: ::core::option::Option<::prost::alloc::string::String>,
974 #[prost(uint64, optional, tag = "4")]
975 pub positive_int_value: ::core::option::Option<u64>,
976 #[prost(int64, optional, tag = "5")]
977 pub negative_int_value: ::core::option::Option<i64>,
978 #[prost(double, optional, tag = "6")]
979 pub double_value: ::core::option::Option<f64>,
980 #[prost(bytes = "vec", optional, tag = "7")]
981 pub string_value: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
982 #[prost(string, optional, tag = "8")]
983 pub aggregate_value: ::core::option::Option<::prost::alloc::string::String>,
984}
985/// Nested message and enum types in `UninterpretedOption`.
986pub mod uninterpreted_option {
987 /// The name of the uninterpreted option. Each string represents a segment in
988 /// a dot-separated name. is_extension is true iff a segment represents an
989 /// extension (denoted with parentheses in options specs in .proto files).
990 /// E.g.,{ \["foo", false\], \["bar.baz", true\], \["qux", false\] } represents
991 /// "foo.(bar.baz).qux".
992 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
993 #[derive(Clone, PartialEq, ::prost::Message)]
994 pub struct NamePart {
995 #[prost(string, required, tag = "1")]
996 pub name_part: ::prost::alloc::string::String,
997 #[prost(bool, required, tag = "2")]
998 pub is_extension: bool,
999 }
1000}
1001/// Encapsulates information about the original source file from which a
1002/// FileDescriptorProto was generated.
1003#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1004#[derive(Clone, PartialEq, ::prost::Message)]
1005pub struct SourceCodeInfo {
1006 /// A Location identifies a piece of source code in a .proto file which
1007 /// corresponds to a particular definition. This information is intended
1008 /// to be useful to IDEs, code indexers, documentation generators, and similar
1009 /// tools.
1010 ///
1011 /// For example, say we have a file like:
1012 /// message Foo {
1013 /// optional string foo = 1;
1014 /// }
1015 /// Let's look at just the field definition:
1016 /// optional string foo = 1;
1017 /// ^ ^^ ^^ ^ ^^^
1018 /// a bc de f ghi
1019 /// We have the following locations:
1020 /// span path represents
1021 /// \[a,i) \[ 4, 0, 2, 0 \] The whole field definition.
1022 /// \[a,b) \[ 4, 0, 2, 0, 4 \] The label (optional).
1023 /// \[c,d) \[ 4, 0, 2, 0, 5 \] The type (string).
1024 /// \[e,f) \[ 4, 0, 2, 0, 1 \] The name (foo).
1025 /// \[g,h) \[ 4, 0, 2, 0, 3 \] The number (1).
1026 ///
1027 /// Notes:
1028 ///
1029 /// * A location may refer to a repeated field itself (i.e. not to any
1030 /// particular index within it). This is used whenever a set of elements are
1031 /// logically enclosed in a single code segment. For example, an entire
1032 /// extend block (possibly containing multiple extension definitions) will
1033 /// have an outer location whose path refers to the "extensions" repeated
1034 /// field without an index.
1035 /// * Multiple locations may have the same path. This happens when a single
1036 /// logical declaration is spread out across multiple places. The most
1037 /// obvious example is the "extend" block again -- there may be multiple
1038 /// extend blocks in the same scope, each of which will have the same path.
1039 /// * A location's span is not always a subset of its parent's span. For
1040 /// example, the "extendee" of an extension declaration appears at the
1041 /// beginning of the "extend" block and is shared by all extensions within
1042 /// the block.
1043 /// * Just because a location's span is a subset of some other location's span
1044 /// does not mean that it is a descendant. For example, a "group" defines
1045 /// both a type and a field in a single declaration. Thus, the locations
1046 /// corresponding to the type and field and their components will overlap.
1047 /// * Code which tries to interpret locations should probably be designed to
1048 /// ignore those that it doesn't understand, as more types of locations could
1049 /// be recorded in the future.
1050 #[prost(message, repeated, tag = "1")]
1051 pub location: ::prost::alloc::vec::Vec<source_code_info::Location>,
1052}
1053/// Nested message and enum types in `SourceCodeInfo`.
1054pub mod source_code_info {
1055 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1056 #[derive(Clone, PartialEq, ::prost::Message)]
1057 pub struct Location {
1058 /// Identifies which part of the FileDescriptorProto was defined at this
1059 /// location.
1060 ///
1061 /// Each element is a field number or an index. They form a path from
1062 /// the root FileDescriptorProto to the place where the definition. For
1063 /// example, this path:
1064 /// \[ 4, 3, 2, 7, 1 \]
1065 /// refers to:
1066 /// file.message_type(3) // 4, 3
1067 /// .field(7) // 2, 7
1068 /// .name() // 1
1069 /// This is because FileDescriptorProto.message_type has field number 4:
1070 /// repeated DescriptorProto message_type = 4;
1071 /// and DescriptorProto.field has field number 2:
1072 /// repeated FieldDescriptorProto field = 2;
1073 /// and FieldDescriptorProto.name has field number 1:
1074 /// optional string name = 1;
1075 ///
1076 /// Thus, the above path gives the location of a field name. If we removed
1077 /// the last element:
1078 /// \[ 4, 3, 2, 7 \]
1079 /// this path refers to the whole field declaration (from the beginning
1080 /// of the label to the terminating semicolon).
1081 #[prost(int32, repeated, tag = "1")]
1082 pub path: ::prost::alloc::vec::Vec<i32>,
1083 /// Always has exactly three or four elements: start line, start column,
1084 /// end line (optional, otherwise assumed same as start line), end column.
1085 /// These are packed into a single field for efficiency. Note that line
1086 /// and column numbers are zero-based -- typically you will want to add
1087 /// 1 to each before displaying to a user.
1088 #[prost(int32, repeated, tag = "2")]
1089 pub span: ::prost::alloc::vec::Vec<i32>,
1090 /// If this SourceCodeInfo represents a complete declaration, these are any
1091 /// comments appearing before and after the declaration which appear to be
1092 /// attached to the declaration.
1093 ///
1094 /// A series of line comments appearing on consecutive lines, with no other
1095 /// tokens appearing on those lines, will be treated as a single comment.
1096 ///
1097 /// leading_detached_comments will keep paragraphs of comments that appear
1098 /// before (but not connected to) the current element. Each paragraph,
1099 /// separated by empty lines, will be one comment element in the repeated
1100 /// field.
1101 ///
1102 /// Only the comment content is provided; comment markers (e.g. //) are
1103 /// stripped out. For block comments, leading whitespace and an asterisk
1104 /// will be stripped from the beginning of each line other than the first.
1105 /// Newlines are included in the output.
1106 ///
1107 /// Examples:
1108 ///
1109 /// optional int32 foo = 1; // Comment attached to foo.
1110 /// // Comment attached to bar.
1111 /// optional int32 bar = 2;
1112 ///
1113 /// optional string baz = 3;
1114 /// // Comment attached to baz.
1115 /// // Another line attached to baz.
1116 ///
1117 /// // Comment attached to qux.
1118 /// //
1119 /// // Another line attached to qux.
1120 /// optional double qux = 4;
1121 ///
1122 /// // Detached comment for corge. This is not leading or trailing comments
1123 /// // to qux or corge because there are blank lines separating it from
1124 /// // both.
1125 ///
1126 /// // Detached comment for corge paragraph 2.
1127 ///
1128 /// optional string corge = 5;
1129 /// /\* Block comment attached
1130 /// \* to corge. Leading asterisks
1131 /// \* will be removed. */
1132 /// /* Block comment attached to
1133 /// \* grault. \*/
1134 /// optional int32 grault = 6;
1135 ///
1136 /// // ignored detached comments.
1137 #[prost(string, optional, tag = "3")]
1138 pub leading_comments: ::core::option::Option<::prost::alloc::string::String>,
1139 #[prost(string, optional, tag = "4")]
1140 pub trailing_comments: ::core::option::Option<::prost::alloc::string::String>,
1141 #[prost(string, repeated, tag = "6")]
1142 pub leading_detached_comments: ::prost::alloc::vec::Vec<
1143 ::prost::alloc::string::String,
1144 >,
1145 }
1146}
1147/// Describes the relationship between generated code and its original source
1148/// file. A GeneratedCodeInfo message is associated with only one generated
1149/// source file, but may contain references to different source .proto files.
1150#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1151#[derive(Clone, PartialEq, ::prost::Message)]
1152pub struct GeneratedCodeInfo {
1153 /// An Annotation connects some span of text in generated code to an element
1154 /// of its generating .proto file.
1155 #[prost(message, repeated, tag = "1")]
1156 pub annotation: ::prost::alloc::vec::Vec<generated_code_info::Annotation>,
1157}
1158/// Nested message and enum types in `GeneratedCodeInfo`.
1159pub mod generated_code_info {
1160 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1161 #[derive(Clone, PartialEq, ::prost::Message)]
1162 pub struct Annotation {
1163 /// Identifies the element in the original source .proto file. This field
1164 /// is formatted the same as SourceCodeInfo.Location.path.
1165 #[prost(int32, repeated, tag = "1")]
1166 pub path: ::prost::alloc::vec::Vec<i32>,
1167 /// Identifies the filesystem path to the original source .proto.
1168 #[prost(string, optional, tag = "2")]
1169 pub source_file: ::core::option::Option<::prost::alloc::string::String>,
1170 /// Identifies the starting offset in bytes in the generated code
1171 /// that relates to the identified object.
1172 #[prost(int32, optional, tag = "3")]
1173 pub begin: ::core::option::Option<i32>,
1174 /// Identifies the ending offset in bytes in the generated code that
1175 /// relates to the identified offset. The end offset should be one past
1176 /// the last relevant byte (so the length of the text = end - begin).
1177 #[prost(int32, optional, tag = "4")]
1178 pub end: ::core::option::Option<i32>,
1179 }
1180}
1181/// `Any` contains an arbitrary serialized protocol buffer message along with a
1182/// URL that describes the type of the serialized message.
1183///
1184/// Protobuf library provides support to pack/unpack Any values in the form
1185/// of utility functions or additional generated methods of the Any type.
1186///
1187/// Example 1: Pack and unpack a message in C++.
1188///
1189/// ```text
1190/// Foo foo = ...;
1191/// Any any;
1192/// any.PackFrom(foo);
1193/// ...
1194/// if (any.UnpackTo(&foo)) {
1195/// ...
1196/// }
1197/// ```
1198///
1199/// Example 2: Pack and unpack a message in Java.
1200///
1201/// ```text
1202/// Foo foo = ...;
1203/// Any any = Any.pack(foo);
1204/// ...
1205/// if (any.is(Foo.class)) {
1206/// foo = any.unpack(Foo.class);
1207/// }
1208/// ```
1209///
1210/// Example 3: Pack and unpack a message in Python.
1211///
1212/// ```text
1213/// foo = Foo(...)
1214/// any = Any()
1215/// any.Pack(foo)
1216/// ...
1217/// if any.Is(Foo.DESCRIPTOR):
1218/// any.Unpack(foo)
1219/// ...
1220/// ```
1221///
1222/// Example 4: Pack and unpack a message in Go
1223///
1224/// ```text
1225/// foo := &pb.Foo{...}
1226/// any, err := anypb.New(foo)
1227/// if err != nil {
1228/// ...
1229/// }
1230/// ...
1231/// foo := &pb.Foo{}
1232/// if err := any.UnmarshalTo(foo); err != nil {
1233/// ...
1234/// }
1235/// ```
1236///
1237/// The pack methods provided by protobuf library will by default use
1238/// 'type.googleapis.com/full.type.name' as the type URL and the unpack
1239/// methods only use the fully qualified type name after the last '/'
1240/// in the type URL, for example "foo.bar.com/x/y.z" will yield type
1241/// name "y.z".
1242///
1243/// # JSON
1244///
1245/// The JSON representation of an `Any` value uses the regular
1246/// representation of the deserialized, embedded message, with an
1247/// additional field `@type` which contains the type URL. Example:
1248///
1249/// ```text
1250/// package google.profile;
1251/// message Person {
1252/// string first_name = 1;
1253/// string last_name = 2;
1254/// }
1255///
1256/// {
1257/// "@type": "type.googleapis.com/google.profile.Person",
1258/// "firstName": <string>,
1259/// "lastName": <string>
1260/// }
1261/// ```
1262///
1263/// If the embedded message type is well-known and has a custom JSON
1264/// representation, that representation will be embedded adding a field
1265/// `value` which holds the custom JSON in addition to the `@type`
1266/// field. Example (for message \[google.protobuf.Duration\]\[\]):
1267///
1268/// ```text
1269/// {
1270/// "@type": "type.googleapis.com/google.protobuf.Duration",
1271/// "value": "1.212s"
1272/// }
1273/// ```
1274#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1275#[derive(Clone, PartialEq, ::prost::Message)]
1276pub struct Any {
1277 /// A URL/resource name that uniquely identifies the type of the serialized
1278 /// protocol buffer message. This string must contain at least
1279 /// one "/" character. The last segment of the URL's path must represent
1280 /// the fully qualified name of the type (as in
1281 /// `path/google.protobuf.Duration`). The name should be in a canonical form
1282 /// (e.g., leading "." is not accepted).
1283 ///
1284 /// In practice, teams usually precompile into the binary all types that they
1285 /// expect it to use in the context of Any. However, for URLs which use the
1286 /// scheme `http`, `https`, or no scheme, one can optionally set up a type
1287 /// server that maps type URLs to message definitions as follows:
1288 ///
1289 /// * If no scheme is provided, `https` is assumed.
1290 /// * An HTTP GET on the URL must yield a \[google.protobuf.Type\]\[\]
1291 /// value in binary format, or produce an error.
1292 /// * Applications are allowed to cache lookup results based on the
1293 /// URL, or have them precompiled into a binary to avoid any
1294 /// lookup. Therefore, binary compatibility needs to be preserved
1295 /// on changes to types. (Use versioned type names to manage
1296 /// breaking changes.)
1297 ///
1298 /// Note: this functionality is not currently available in the official
1299 /// protobuf release, and it is not used for type URLs beginning with
1300 /// type.googleapis.com.
1301 ///
1302 /// Schemes other than `http`, `https` (or the empty scheme) might be
1303 /// used with implementation specific semantics.
1304 #[prost(string, tag = "1")]
1305 pub type_url: ::prost::alloc::string::String,
1306 /// Must be a valid serialized protocol buffer of the above specified type.
1307 #[prost(bytes = "vec", tag = "2")]
1308 pub value: ::prost::alloc::vec::Vec<u8>,
1309}
1310/// `SourceContext` represents information about the source of a
1311/// protobuf element, like the file in which it is defined.
1312#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1313#[derive(Clone, PartialEq, ::prost::Message)]
1314pub struct SourceContext {
1315 /// The path-qualified name of the .proto file that contained the associated
1316 /// protobuf element. For example: `"google/protobuf/source_context.proto"`.
1317 #[prost(string, tag = "1")]
1318 pub file_name: ::prost::alloc::string::String,
1319}
1320/// A protocol buffer message type.
1321#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1322#[derive(Clone, PartialEq, ::prost::Message)]
1323pub struct Type {
1324 /// The fully qualified message name.
1325 #[prost(string, tag = "1")]
1326 pub name: ::prost::alloc::string::String,
1327 /// The list of fields.
1328 #[prost(message, repeated, tag = "2")]
1329 pub fields: ::prost::alloc::vec::Vec<Field>,
1330 /// The list of types appearing in `oneof` definitions in this type.
1331 #[prost(string, repeated, tag = "3")]
1332 pub oneofs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1333 /// The protocol buffer options.
1334 #[prost(message, repeated, tag = "4")]
1335 pub options: ::prost::alloc::vec::Vec<Option>,
1336 /// The source context.
1337 #[prost(message, optional, tag = "5")]
1338 pub source_context: ::core::option::Option<SourceContext>,
1339 /// The source syntax.
1340 #[prost(enumeration = "Syntax", tag = "6")]
1341 pub syntax: i32,
1342}
1343/// A single field of a message type.
1344#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1345#[derive(Clone, PartialEq, ::prost::Message)]
1346pub struct Field {
1347 /// The field type.
1348 #[prost(enumeration = "field::Kind", tag = "1")]
1349 pub kind: i32,
1350 /// The field cardinality.
1351 #[prost(enumeration = "field::Cardinality", tag = "2")]
1352 pub cardinality: i32,
1353 /// The field number.
1354 #[prost(int32, tag = "3")]
1355 pub number: i32,
1356 /// The field name.
1357 #[prost(string, tag = "4")]
1358 pub name: ::prost::alloc::string::String,
1359 /// The field type URL, without the scheme, for message or enumeration
1360 /// types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
1361 #[prost(string, tag = "6")]
1362 pub type_url: ::prost::alloc::string::String,
1363 /// The index of the field type in `Type.oneofs`, for message or enumeration
1364 /// types. The first type has index 1; zero means the type is not in the list.
1365 #[prost(int32, tag = "7")]
1366 pub oneof_index: i32,
1367 /// Whether to use alternative packed wire representation.
1368 #[prost(bool, tag = "8")]
1369 pub packed: bool,
1370 /// The protocol buffer options.
1371 #[prost(message, repeated, tag = "9")]
1372 pub options: ::prost::alloc::vec::Vec<Option>,
1373 /// The field JSON name.
1374 #[prost(string, tag = "10")]
1375 pub json_name: ::prost::alloc::string::String,
1376 /// The string value of the default value of this field. Proto2 syntax only.
1377 #[prost(string, tag = "11")]
1378 pub default_value: ::prost::alloc::string::String,
1379}
1380/// Nested message and enum types in `Field`.
1381pub mod field {
1382 /// Basic field types.
1383 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1384 #[derive(
1385 Clone,
1386 Copy,
1387 Debug,
1388 PartialEq,
1389 Eq,
1390 Hash,
1391 PartialOrd,
1392 Ord,
1393 ::prost::Enumeration
1394 )]
1395 #[repr(i32)]
1396 pub enum Kind {
1397 /// Field type unknown.
1398 TypeUnknown = 0,
1399 /// Field type double.
1400 TypeDouble = 1,
1401 /// Field type float.
1402 TypeFloat = 2,
1403 /// Field type int64.
1404 TypeInt64 = 3,
1405 /// Field type uint64.
1406 TypeUint64 = 4,
1407 /// Field type int32.
1408 TypeInt32 = 5,
1409 /// Field type fixed64.
1410 TypeFixed64 = 6,
1411 /// Field type fixed32.
1412 TypeFixed32 = 7,
1413 /// Field type bool.
1414 TypeBool = 8,
1415 /// Field type string.
1416 TypeString = 9,
1417 /// Field type group. Proto2 syntax only, and deprecated.
1418 TypeGroup = 10,
1419 /// Field type message.
1420 TypeMessage = 11,
1421 /// Field type bytes.
1422 TypeBytes = 12,
1423 /// Field type uint32.
1424 TypeUint32 = 13,
1425 /// Field type enum.
1426 TypeEnum = 14,
1427 /// Field type sfixed32.
1428 TypeSfixed32 = 15,
1429 /// Field type sfixed64.
1430 TypeSfixed64 = 16,
1431 /// Field type sint32.
1432 TypeSint32 = 17,
1433 /// Field type sint64.
1434 TypeSint64 = 18,
1435 }
1436 impl Kind {
1437 /// String value of the enum field names used in the ProtoBuf definition.
1438 ///
1439 /// The values are not transformed in any way and thus are considered stable
1440 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1441 pub fn as_str_name(&self) -> &'static str {
1442 match self {
1443 Self::TypeUnknown => "TYPE_UNKNOWN",
1444 Self::TypeDouble => "TYPE_DOUBLE",
1445 Self::TypeFloat => "TYPE_FLOAT",
1446 Self::TypeInt64 => "TYPE_INT64",
1447 Self::TypeUint64 => "TYPE_UINT64",
1448 Self::TypeInt32 => "TYPE_INT32",
1449 Self::TypeFixed64 => "TYPE_FIXED64",
1450 Self::TypeFixed32 => "TYPE_FIXED32",
1451 Self::TypeBool => "TYPE_BOOL",
1452 Self::TypeString => "TYPE_STRING",
1453 Self::TypeGroup => "TYPE_GROUP",
1454 Self::TypeMessage => "TYPE_MESSAGE",
1455 Self::TypeBytes => "TYPE_BYTES",
1456 Self::TypeUint32 => "TYPE_UINT32",
1457 Self::TypeEnum => "TYPE_ENUM",
1458 Self::TypeSfixed32 => "TYPE_SFIXED32",
1459 Self::TypeSfixed64 => "TYPE_SFIXED64",
1460 Self::TypeSint32 => "TYPE_SINT32",
1461 Self::TypeSint64 => "TYPE_SINT64",
1462 }
1463 }
1464 /// Creates an enum from field names used in the ProtoBuf definition.
1465 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1466 match value {
1467 "TYPE_UNKNOWN" => Some(Self::TypeUnknown),
1468 "TYPE_DOUBLE" => Some(Self::TypeDouble),
1469 "TYPE_FLOAT" => Some(Self::TypeFloat),
1470 "TYPE_INT64" => Some(Self::TypeInt64),
1471 "TYPE_UINT64" => Some(Self::TypeUint64),
1472 "TYPE_INT32" => Some(Self::TypeInt32),
1473 "TYPE_FIXED64" => Some(Self::TypeFixed64),
1474 "TYPE_FIXED32" => Some(Self::TypeFixed32),
1475 "TYPE_BOOL" => Some(Self::TypeBool),
1476 "TYPE_STRING" => Some(Self::TypeString),
1477 "TYPE_GROUP" => Some(Self::TypeGroup),
1478 "TYPE_MESSAGE" => Some(Self::TypeMessage),
1479 "TYPE_BYTES" => Some(Self::TypeBytes),
1480 "TYPE_UINT32" => Some(Self::TypeUint32),
1481 "TYPE_ENUM" => Some(Self::TypeEnum),
1482 "TYPE_SFIXED32" => Some(Self::TypeSfixed32),
1483 "TYPE_SFIXED64" => Some(Self::TypeSfixed64),
1484 "TYPE_SINT32" => Some(Self::TypeSint32),
1485 "TYPE_SINT64" => Some(Self::TypeSint64),
1486 _ => None,
1487 }
1488 }
1489 }
1490 /// Whether a field is optional, required, or repeated.
1491 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1492 #[derive(
1493 Clone,
1494 Copy,
1495 Debug,
1496 PartialEq,
1497 Eq,
1498 Hash,
1499 PartialOrd,
1500 Ord,
1501 ::prost::Enumeration
1502 )]
1503 #[repr(i32)]
1504 pub enum Cardinality {
1505 /// For fields with unknown cardinality.
1506 Unknown = 0,
1507 /// For optional fields.
1508 Optional = 1,
1509 /// For required fields. Proto2 syntax only.
1510 Required = 2,
1511 /// For repeated fields.
1512 Repeated = 3,
1513 }
1514 impl Cardinality {
1515 /// String value of the enum field names used in the ProtoBuf definition.
1516 ///
1517 /// The values are not transformed in any way and thus are considered stable
1518 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1519 pub fn as_str_name(&self) -> &'static str {
1520 match self {
1521 Self::Unknown => "CARDINALITY_UNKNOWN",
1522 Self::Optional => "CARDINALITY_OPTIONAL",
1523 Self::Required => "CARDINALITY_REQUIRED",
1524 Self::Repeated => "CARDINALITY_REPEATED",
1525 }
1526 }
1527 /// Creates an enum from field names used in the ProtoBuf definition.
1528 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1529 match value {
1530 "CARDINALITY_UNKNOWN" => Some(Self::Unknown),
1531 "CARDINALITY_OPTIONAL" => Some(Self::Optional),
1532 "CARDINALITY_REQUIRED" => Some(Self::Required),
1533 "CARDINALITY_REPEATED" => Some(Self::Repeated),
1534 _ => None,
1535 }
1536 }
1537 }
1538}
1539/// Enum type definition.
1540#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1541#[derive(Clone, PartialEq, ::prost::Message)]
1542pub struct Enum {
1543 /// Enum type name.
1544 #[prost(string, tag = "1")]
1545 pub name: ::prost::alloc::string::String,
1546 /// Enum value definitions.
1547 #[prost(message, repeated, tag = "2")]
1548 pub enumvalue: ::prost::alloc::vec::Vec<EnumValue>,
1549 /// Protocol buffer options.
1550 #[prost(message, repeated, tag = "3")]
1551 pub options: ::prost::alloc::vec::Vec<Option>,
1552 /// The source context.
1553 #[prost(message, optional, tag = "4")]
1554 pub source_context: ::core::option::Option<SourceContext>,
1555 /// The source syntax.
1556 #[prost(enumeration = "Syntax", tag = "5")]
1557 pub syntax: i32,
1558}
1559/// Enum value definition.
1560#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1561#[derive(Clone, PartialEq, ::prost::Message)]
1562pub struct EnumValue {
1563 /// Enum value name.
1564 #[prost(string, tag = "1")]
1565 pub name: ::prost::alloc::string::String,
1566 /// Enum value number.
1567 #[prost(int32, tag = "2")]
1568 pub number: i32,
1569 /// Protocol buffer options.
1570 #[prost(message, repeated, tag = "3")]
1571 pub options: ::prost::alloc::vec::Vec<Option>,
1572}
1573/// A protocol buffer option, which can be attached to a message, field,
1574/// enumeration, etc.
1575#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1576#[derive(Clone, PartialEq, ::prost::Message)]
1577pub struct Option {
1578 /// The option's name. For protobuf built-in options (options defined in
1579 /// descriptor.proto), this is the short name. For example, `"map_entry"`.
1580 /// For custom options, it should be the fully-qualified name. For example,
1581 /// `"google.api.http"`.
1582 #[prost(string, tag = "1")]
1583 pub name: ::prost::alloc::string::String,
1584 /// The option's value packed in an Any message. If the value is a primitive,
1585 /// the corresponding wrapper type defined in google/protobuf/wrappers.proto
1586 /// should be used. If the value is an enum, it should be stored as an int32
1587 /// value using the google.protobuf.Int32Value type.
1588 #[prost(message, optional, tag = "2")]
1589 pub value: ::core::option::Option<Any>,
1590}
1591/// The syntax in which a protocol buffer element is defined.
1592#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1593#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1594#[repr(i32)]
1595pub enum Syntax {
1596 /// Syntax `proto2`.
1597 Proto2 = 0,
1598 /// Syntax `proto3`.
1599 Proto3 = 1,
1600}
1601impl Syntax {
1602 /// String value of the enum field names used in the ProtoBuf definition.
1603 ///
1604 /// The values are not transformed in any way and thus are considered stable
1605 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1606 pub fn as_str_name(&self) -> &'static str {
1607 match self {
1608 Self::Proto2 => "SYNTAX_PROTO2",
1609 Self::Proto3 => "SYNTAX_PROTO3",
1610 }
1611 }
1612 /// Creates an enum from field names used in the ProtoBuf definition.
1613 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1614 match value {
1615 "SYNTAX_PROTO2" => Some(Self::Proto2),
1616 "SYNTAX_PROTO3" => Some(Self::Proto3),
1617 _ => None,
1618 }
1619 }
1620}
1621/// Api is a light-weight descriptor for an API Interface.
1622///
1623/// Interfaces are also described as "protocol buffer services" in some contexts,
1624/// such as by the "service" keyword in a .proto file, but they are different
1625/// from API Services, which represent a concrete implementation of an interface
1626/// as opposed to simply a description of methods and bindings. They are also
1627/// sometimes simply referred to as "APIs" in other contexts, such as the name of
1628/// this message itself. See <https://cloud.google.com/apis/design/glossary> for
1629/// detailed terminology.
1630#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1631#[derive(Clone, PartialEq, ::prost::Message)]
1632pub struct Api {
1633 /// The fully qualified name of this interface, including package name
1634 /// followed by the interface's simple name.
1635 #[prost(string, tag = "1")]
1636 pub name: ::prost::alloc::string::String,
1637 /// The methods of this interface, in unspecified order.
1638 #[prost(message, repeated, tag = "2")]
1639 pub methods: ::prost::alloc::vec::Vec<Method>,
1640 /// Any metadata attached to the interface.
1641 #[prost(message, repeated, tag = "3")]
1642 pub options: ::prost::alloc::vec::Vec<Option>,
1643 /// A version string for this interface. If specified, must have the form
1644 /// `major-version.minor-version`, as in `1.10`. If the minor version is
1645 /// omitted, it defaults to zero. If the entire version field is empty, the
1646 /// major version is derived from the package name, as outlined below. If the
1647 /// field is not empty, the version in the package name will be verified to be
1648 /// consistent with what is provided here.
1649 ///
1650 /// The versioning schema uses [semantic
1651 /// versioning](<http://semver.org>) where the major version number
1652 /// indicates a breaking change and the minor version an additive,
1653 /// non-breaking change. Both version numbers are signals to users
1654 /// what to expect from different versions, and should be carefully
1655 /// chosen based on the product plan.
1656 ///
1657 /// The major version is also reflected in the package name of the
1658 /// interface, which must end in `v<major-version>`, as in
1659 /// `google.feature.v1`. For major versions 0 and 1, the suffix can
1660 /// be omitted. Zero major versions must only be used for
1661 /// experimental, non-GA interfaces.
1662 #[prost(string, tag = "4")]
1663 pub version: ::prost::alloc::string::String,
1664 /// Source context for the protocol buffer service represented by this
1665 /// message.
1666 #[prost(message, optional, tag = "5")]
1667 pub source_context: ::core::option::Option<SourceContext>,
1668 /// Included interfaces. See \[Mixin\]\[\].
1669 #[prost(message, repeated, tag = "6")]
1670 pub mixins: ::prost::alloc::vec::Vec<Mixin>,
1671 /// The source syntax of the service.
1672 #[prost(enumeration = "Syntax", tag = "7")]
1673 pub syntax: i32,
1674}
1675/// Method represents a method of an API interface.
1676#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1677#[derive(Clone, PartialEq, ::prost::Message)]
1678pub struct Method {
1679 /// The simple name of this method.
1680 #[prost(string, tag = "1")]
1681 pub name: ::prost::alloc::string::String,
1682 /// A URL of the input message type.
1683 #[prost(string, tag = "2")]
1684 pub request_type_url: ::prost::alloc::string::String,
1685 /// If true, the request is streamed.
1686 #[prost(bool, tag = "3")]
1687 pub request_streaming: bool,
1688 /// The URL of the output message type.
1689 #[prost(string, tag = "4")]
1690 pub response_type_url: ::prost::alloc::string::String,
1691 /// If true, the response is streamed.
1692 #[prost(bool, tag = "5")]
1693 pub response_streaming: bool,
1694 /// Any metadata attached to the method.
1695 #[prost(message, repeated, tag = "6")]
1696 pub options: ::prost::alloc::vec::Vec<Option>,
1697 /// The source syntax of this method.
1698 #[prost(enumeration = "Syntax", tag = "7")]
1699 pub syntax: i32,
1700}
1701/// Declares an API Interface to be included in this interface. The including
1702/// interface must redeclare all the methods from the included interface, but
1703/// documentation and options are inherited as follows:
1704///
1705/// * If after comment and whitespace stripping, the documentation
1706/// string of the redeclared method is empty, it will be inherited
1707/// from the original method.
1708///
1709/// * Each annotation belonging to the service config (http,
1710/// visibility) which is not set in the redeclared method will be
1711/// inherited.
1712///
1713/// * If an http annotation is inherited, the path pattern will be
1714/// modified as follows. Any version prefix will be replaced by the
1715/// version of the including interface plus the \[root\]\[\] path if
1716/// specified.
1717///
1718/// Example of a simple mixin:
1719///
1720/// ```text
1721/// package google.acl.v1;
1722/// service AccessControl {
1723/// // Get the underlying ACL object.
1724/// rpc GetAcl(GetAclRequest) returns (Acl) {
1725/// option (google.api.http).get = "/v1/{resource=**}:getAcl";
1726/// }
1727/// }
1728///
1729/// package google.storage.v2;
1730/// service Storage {
1731/// rpc GetAcl(GetAclRequest) returns (Acl);
1732///
1733/// // Get a data record.
1734/// rpc GetData(GetDataRequest) returns (Data) {
1735/// option (google.api.http).get = "/v2/{resource=**}";
1736/// }
1737/// }
1738/// ```
1739///
1740/// Example of a mixin configuration:
1741///
1742/// ```text
1743/// apis:
1744/// - name: google.storage.v2.Storage
1745/// mixins:
1746/// - name: google.acl.v1.AccessControl
1747/// ```
1748///
1749/// The mixin construct implies that all methods in `AccessControl` are
1750/// also declared with same name and request/response types in
1751/// `Storage`. A documentation generator or annotation processor will
1752/// see the effective `Storage.GetAcl` method after inheriting
1753/// documentation and annotations as follows:
1754///
1755/// ```text
1756/// service Storage {
1757/// // Get the underlying ACL object.
1758/// rpc GetAcl(GetAclRequest) returns (Acl) {
1759/// option (google.api.http).get = "/v2/{resource=**}:getAcl";
1760/// }
1761/// ...
1762/// }
1763/// ```
1764///
1765/// Note how the version in the path pattern changed from `v1` to `v2`.
1766///
1767/// If the `root` field in the mixin is specified, it should be a
1768/// relative path under which inherited HTTP paths are placed. Example:
1769///
1770/// ```text
1771/// apis:
1772/// - name: google.storage.v2.Storage
1773/// mixins:
1774/// - name: google.acl.v1.AccessControl
1775/// root: acls
1776/// ```
1777///
1778/// This implies the following inherited HTTP annotation:
1779///
1780/// ```text
1781/// service Storage {
1782/// // Get the underlying ACL object.
1783/// rpc GetAcl(GetAclRequest) returns (Acl) {
1784/// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl";
1785/// }
1786/// ...
1787/// }
1788/// ```
1789#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1790#[derive(Clone, PartialEq, ::prost::Message)]
1791pub struct Mixin {
1792 /// The fully qualified name of the interface which is included.
1793 #[prost(string, tag = "1")]
1794 pub name: ::prost::alloc::string::String,
1795 /// If non-empty specifies a path under which inherited HTTP paths
1796 /// are rooted.
1797 #[prost(string, tag = "2")]
1798 pub root: ::prost::alloc::string::String,
1799}
1800/// A Duration represents a signed, fixed-length span of time represented
1801/// as a count of seconds and fractions of seconds at nanosecond
1802/// resolution. It is independent of any calendar and concepts like "day"
1803/// or "month". It is related to Timestamp in that the difference between
1804/// two Timestamp values is a Duration and it can be added or subtracted
1805/// from a Timestamp. Range is approximately +-10,000 years.
1806///
1807/// # Examples
1808///
1809/// Example 1: Compute Duration from two Timestamps in pseudo code.
1810///
1811/// ```text
1812/// Timestamp start = ...;
1813/// Timestamp end = ...;
1814/// Duration duration = ...;
1815///
1816/// duration.seconds = end.seconds - start.seconds;
1817/// duration.nanos = end.nanos - start.nanos;
1818///
1819/// if (duration.seconds < 0 && duration.nanos > 0) {
1820/// duration.seconds += 1;
1821/// duration.nanos -= 1000000000;
1822/// } else if (duration.seconds > 0 && duration.nanos < 0) {
1823/// duration.seconds -= 1;
1824/// duration.nanos += 1000000000;
1825/// }
1826/// ```
1827///
1828/// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
1829///
1830/// ```text
1831/// Timestamp start = ...;
1832/// Duration duration = ...;
1833/// Timestamp end = ...;
1834///
1835/// end.seconds = start.seconds + duration.seconds;
1836/// end.nanos = start.nanos + duration.nanos;
1837///
1838/// if (end.nanos < 0) {
1839/// end.seconds -= 1;
1840/// end.nanos += 1000000000;
1841/// } else if (end.nanos >= 1000000000) {
1842/// end.seconds += 1;
1843/// end.nanos -= 1000000000;
1844/// }
1845/// ```
1846///
1847/// Example 3: Compute Duration from datetime.timedelta in Python.
1848///
1849/// ```text
1850/// td = datetime.timedelta(days=3, minutes=10)
1851/// duration = Duration()
1852/// duration.FromTimedelta(td)
1853/// ```
1854///
1855/// # JSON Mapping
1856///
1857/// In JSON format, the Duration type is encoded as a string rather than an
1858/// object, where the string ends in the suffix "s" (indicating seconds) and
1859/// is preceded by the number of seconds, with nanoseconds expressed as
1860/// fractional seconds. For example, 3 seconds with 0 nanoseconds should be
1861/// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
1862/// be expressed in JSON format as "3.000000001s", and 3 seconds and 1
1863/// microsecond should be expressed in JSON format as "3.000001s".
1864#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
1865#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1866pub struct Duration {
1867 /// Signed seconds of the span of time. Must be from -315,576,000,000
1868 /// to +315,576,000,000 inclusive. Note: these bounds are computed from:
1869 /// 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
1870 #[prost(int64, tag = "1")]
1871 pub seconds: i64,
1872 /// Signed fractions of a second at nanosecond resolution of the span
1873 /// of time. Durations less than one second are represented with a 0
1874 /// `seconds` field and a positive or negative `nanos` field. For durations
1875 /// of one second or more, a non-zero value for the `nanos` field must be
1876 /// of the same sign as the `seconds` field. Must be from -999,999,999
1877 /// to +999,999,999 inclusive.
1878 #[prost(int32, tag = "2")]
1879 pub nanos: i32,
1880}
1881/// `FieldMask` represents a set of symbolic field paths, for example:
1882///
1883/// ```text
1884/// paths: "f.a"
1885/// paths: "f.b.d"
1886/// ```
1887///
1888/// Here `f` represents a field in some root message, `a` and `b`
1889/// fields in the message found in `f`, and `d` a field found in the
1890/// message in `f.b`.
1891///
1892/// Field masks are used to specify a subset of fields that should be
1893/// returned by a get operation or modified by an update operation.
1894/// Field masks also have a custom JSON encoding (see below).
1895///
1896/// # Field Masks in Projections
1897///
1898/// When used in the context of a projection, a response message or
1899/// sub-message is filtered by the API to only contain those fields as
1900/// specified in the mask. For example, if the mask in the previous
1901/// example is applied to a response message as follows:
1902///
1903/// ```text
1904/// f {
1905/// a : 22
1906/// b {
1907/// d : 1
1908/// x : 2
1909/// }
1910/// y : 13
1911/// }
1912/// z: 8
1913/// ```
1914///
1915/// The result will not contain specific values for fields x,y and z
1916/// (their value will be set to the default, and omitted in proto text
1917/// output):
1918///
1919/// ```text
1920/// f {
1921/// a : 22
1922/// b {
1923/// d : 1
1924/// }
1925/// }
1926/// ```
1927///
1928/// A repeated field is not allowed except at the last position of a
1929/// paths string.
1930///
1931/// If a FieldMask object is not present in a get operation, the
1932/// operation applies to all fields (as if a FieldMask of all fields
1933/// had been specified).
1934///
1935/// Note that a field mask does not necessarily apply to the
1936/// top-level response message. In case of a REST get operation, the
1937/// field mask applies directly to the response, but in case of a REST
1938/// list operation, the mask instead applies to each individual message
1939/// in the returned resource list. In case of a REST custom method,
1940/// other definitions may be used. Where the mask applies will be
1941/// clearly documented together with its declaration in the API. In
1942/// any case, the effect on the returned resource/resources is required
1943/// behavior for APIs.
1944///
1945/// # Field Masks in Update Operations
1946///
1947/// A field mask in update operations specifies which fields of the
1948/// targeted resource are going to be updated. The API is required
1949/// to only change the values of the fields as specified in the mask
1950/// and leave the others untouched. If a resource is passed in to
1951/// describe the updated values, the API ignores the values of all
1952/// fields not covered by the mask.
1953///
1954/// If a repeated field is specified for an update operation, new values will
1955/// be appended to the existing repeated field in the target resource. Note that
1956/// a repeated field is only allowed in the last position of a `paths` string.
1957///
1958/// If a sub-message is specified in the last position of the field mask for an
1959/// update operation, then new value will be merged into the existing sub-message
1960/// in the target resource.
1961///
1962/// For example, given the target message:
1963///
1964/// ```text
1965/// f {
1966/// b {
1967/// d: 1
1968/// x: 2
1969/// }
1970/// c: \[1\]
1971/// }
1972/// ```
1973///
1974/// And an update message:
1975///
1976/// ```text
1977/// f {
1978/// b {
1979/// d: 10
1980/// }
1981/// c: \[2\]
1982/// }
1983/// ```
1984///
1985/// then if the field mask is:
1986///
1987/// paths: \["f.b", "f.c"\]
1988///
1989/// then the result will be:
1990///
1991/// ```text
1992/// f {
1993/// b {
1994/// d: 10
1995/// x: 2
1996/// }
1997/// c: \[1, 2\]
1998/// }
1999/// ```
2000///
2001/// An implementation may provide options to override this default behavior for
2002/// repeated and message fields.
2003///
2004/// In order to reset a field's value to the default, the field must
2005/// be in the mask and set to the default value in the provided resource.
2006/// Hence, in order to reset all fields of a resource, provide a default
2007/// instance of the resource and set all fields in the mask, or do
2008/// not provide a mask as described below.
2009///
2010/// If a field mask is not present on update, the operation applies to
2011/// all fields (as if a field mask of all fields has been specified).
2012/// Note that in the presence of schema evolution, this may mean that
2013/// fields the client does not know and has therefore not filled into
2014/// the request will be reset to their default. If this is unwanted
2015/// behavior, a specific service may require a client to always specify
2016/// a field mask, producing an error if not.
2017///
2018/// As with get operations, the location of the resource which
2019/// describes the updated values in the request message depends on the
2020/// operation kind. In any case, the effect of the field mask is
2021/// required to be honored by the API.
2022///
2023/// ## Considerations for HTTP REST
2024///
2025/// The HTTP kind of an update operation which uses a field mask must
2026/// be set to PATCH instead of PUT in order to satisfy HTTP semantics
2027/// (PUT must only be used for full updates).
2028///
2029/// # JSON Encoding of Field Masks
2030///
2031/// In JSON, a field mask is encoded as a single string where paths are
2032/// separated by a comma. Fields name in each path are converted
2033/// to/from lower-camel naming conventions.
2034///
2035/// As an example, consider the following message declarations:
2036///
2037/// ```text
2038/// message Profile {
2039/// User user = 1;
2040/// Photo photo = 2;
2041/// }
2042/// message User {
2043/// string display_name = 1;
2044/// string address = 2;
2045/// }
2046/// ```
2047///
2048/// In proto a field mask for `Profile` may look as such:
2049///
2050/// ```text
2051/// mask {
2052/// paths: "user.display_name"
2053/// paths: "photo"
2054/// }
2055/// ```
2056///
2057/// In JSON, the same mask is represented as below:
2058///
2059/// ```text
2060/// {
2061/// mask: "user.displayName,photo"
2062/// }
2063/// ```
2064///
2065/// # Field Masks and Oneof Fields
2066///
2067/// Field masks treat fields in oneofs just as regular fields. Consider the
2068/// following message:
2069///
2070/// ```text
2071/// message SampleMessage {
2072/// oneof test_oneof {
2073/// string name = 4;
2074/// SubMessage sub_message = 9;
2075/// }
2076/// }
2077/// ```
2078///
2079/// The field mask can be:
2080///
2081/// ```text
2082/// mask {
2083/// paths: "name"
2084/// }
2085/// ```
2086///
2087/// Or:
2088///
2089/// ```text
2090/// mask {
2091/// paths: "sub_message"
2092/// }
2093/// ```
2094///
2095/// Note that oneof type names ("test_oneof" in this case) cannot be used in
2096/// paths.
2097///
2098/// ## Field Mask Verification
2099///
2100/// The implementation of any API method which has a FieldMask type field in the
2101/// request should verify the included field paths, and return an
2102/// `INVALID_ARGUMENT` error if any path is unmappable.
2103#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2104#[derive(Clone, PartialEq, ::prost::Message)]
2105pub struct FieldMask {
2106 /// The set of field mask paths.
2107 #[prost(string, repeated, tag = "1")]
2108 pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2109}
2110/// `Struct` represents a structured data value, consisting of fields
2111/// which map to dynamically typed values. In some languages, `Struct`
2112/// might be supported by a native representation. For example, in
2113/// scripting languages like JS a struct is represented as an
2114/// object. The details of that representation are described together
2115/// with the proto support for the language.
2116///
2117/// The JSON representation for `Struct` is JSON object.
2118#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2119#[derive(Clone, PartialEq, ::prost::Message)]
2120pub struct Struct {
2121 /// Unordered map of dynamically typed values.
2122 #[prost(btree_map = "string, message", tag = "1")]
2123 pub fields: ::prost::alloc::collections::BTreeMap<
2124 ::prost::alloc::string::String,
2125 Value,
2126 >,
2127}
2128/// `Value` represents a dynamically typed value which can be either
2129/// null, a number, a string, a boolean, a recursive struct value, or a
2130/// list of values. A producer of value is expected to set one of these
2131/// variants. Absence of any variant indicates an error.
2132///
2133/// The JSON representation for `Value` is JSON value.
2134#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2135#[derive(Clone, PartialEq, ::prost::Message)]
2136pub struct Value {
2137 /// The kind of value.
2138 #[prost(oneof = "value::Kind", tags = "1, 2, 3, 4, 5, 6")]
2139 pub kind: ::core::option::Option<value::Kind>,
2140}
2141/// Nested message and enum types in `Value`.
2142pub mod value {
2143 /// The kind of value.
2144 #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2145 #[derive(Clone, PartialEq, ::prost::Oneof)]
2146 pub enum Kind {
2147 /// Represents a null value.
2148 #[prost(enumeration = "super::NullValue", tag = "1")]
2149 NullValue(i32),
2150 /// Represents a double value.
2151 #[prost(double, tag = "2")]
2152 NumberValue(f64),
2153 /// Represents a string value.
2154 #[prost(string, tag = "3")]
2155 StringValue(::prost::alloc::string::String),
2156 /// Represents a boolean value.
2157 #[prost(bool, tag = "4")]
2158 BoolValue(bool),
2159 /// Represents a structured value.
2160 #[prost(message, tag = "5")]
2161 StructValue(super::Struct),
2162 /// Represents a repeated `Value`.
2163 #[prost(message, tag = "6")]
2164 ListValue(super::ListValue),
2165 }
2166}
2167/// `ListValue` is a wrapper around a repeated field of values.
2168///
2169/// The JSON representation for `ListValue` is JSON array.
2170#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2171#[derive(Clone, PartialEq, ::prost::Message)]
2172pub struct ListValue {
2173 /// Repeated field of dynamically typed values.
2174 #[prost(message, repeated, tag = "1")]
2175 pub values: ::prost::alloc::vec::Vec<Value>,
2176}
2177/// `NullValue` is a singleton enumeration to represent the null value for the
2178/// `Value` type union.
2179///
2180/// The JSON representation for `NullValue` is JSON `null`.
2181#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2182#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2183#[repr(i32)]
2184pub enum NullValue {
2185 /// Null value.
2186 NullValue = 0,
2187}
2188impl NullValue {
2189 /// String value of the enum field names used in the ProtoBuf definition.
2190 ///
2191 /// The values are not transformed in any way and thus are considered stable
2192 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2193 pub fn as_str_name(&self) -> &'static str {
2194 match self {
2195 Self::NullValue => "NULL_VALUE",
2196 }
2197 }
2198 /// Creates an enum from field names used in the ProtoBuf definition.
2199 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2200 match value {
2201 "NULL_VALUE" => Some(Self::NullValue),
2202 _ => None,
2203 }
2204 }
2205}
2206/// A Timestamp represents a point in time independent of any time zone or local
2207/// calendar, encoded as a count of seconds and fractions of seconds at
2208/// nanosecond resolution. The count is relative to an epoch at UTC midnight on
2209/// January 1, 1970, in the proleptic Gregorian calendar which extends the
2210/// Gregorian calendar backwards to year one.
2211///
2212/// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
2213/// second table is needed for interpretation, using a [24-hour linear
2214/// smear](<https://developers.google.com/time/smear>).
2215///
2216/// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
2217/// restricting to that range, we ensure that we can convert to and from [RFC
2218/// 3339](<https://www.ietf.org/rfc/rfc3339.txt>) date strings.
2219///
2220/// # Examples
2221///
2222/// Example 1: Compute Timestamp from POSIX `time()`.
2223///
2224/// ```text
2225/// Timestamp timestamp;
2226/// timestamp.set_seconds(time(NULL));
2227/// timestamp.set_nanos(0);
2228/// ```
2229///
2230/// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
2231///
2232/// ```text
2233/// struct timeval tv;
2234/// gettimeofday(&tv, NULL);
2235///
2236/// Timestamp timestamp;
2237/// timestamp.set_seconds(tv.tv_sec);
2238/// timestamp.set_nanos(tv.tv_usec * 1000);
2239/// ```
2240///
2241/// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
2242///
2243/// ```text
2244/// FILETIME ft;
2245/// GetSystemTimeAsFileTime(&ft);
2246/// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
2247///
2248/// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
2249/// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
2250/// Timestamp timestamp;
2251/// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
2252/// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
2253/// ```
2254///
2255/// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
2256///
2257/// ```text
2258/// long millis = System.currentTimeMillis();
2259///
2260/// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
2261/// .setNanos((int) ((millis % 1000) * 1000000)).build();
2262/// ```
2263///
2264/// Example 5: Compute Timestamp from Java `Instant.now()`.
2265///
2266/// ```text
2267/// Instant now = Instant.now();
2268///
2269/// Timestamp timestamp =
2270/// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
2271/// .setNanos(now.getNano()).build();
2272/// ```
2273///
2274/// Example 6: Compute Timestamp from current time in Python.
2275///
2276/// ```text
2277/// timestamp = Timestamp()
2278/// timestamp.GetCurrentTime()
2279/// ```
2280///
2281/// # JSON Mapping
2282///
2283/// In JSON format, the Timestamp type is encoded as a string in the
2284/// [RFC 3339](<https://www.ietf.org/rfc/rfc3339.txt>) format. That is, the
2285/// format is "{year}-{month}-{day}T{hour}:{min}:{sec}\[.{frac_sec}\]Z"
2286/// where {year} is always expressed using four digits while {month}, {day},
2287/// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
2288/// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
2289/// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
2290/// is required. A proto3 JSON serializer should always use UTC (as indicated by
2291/// "Z") when printing the Timestamp type and a proto3 JSON parser should be
2292/// able to accept both UTC and other timezones (as indicated by an offset).
2293///
2294/// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
2295/// 01:30 UTC on January 15, 2017.
2296///
2297/// In JavaScript, one can convert a Date object to this format using the
2298/// standard
2299/// [toISOString()](<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString>)
2300/// method. In Python, a standard `datetime.datetime` object can be converted
2301/// to this format using
2302/// [`strftime`](<https://docs.python.org/2/library/time.html#time.strftime>) with
2303/// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
2304/// the Joda Time's [`ISODateTimeFormat.dateTime()`](<http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D>) to obtain a formatter capable of generating timestamps in this format.
2305#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
2306#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2307pub struct Timestamp {
2308 /// Represents seconds of UTC time since Unix epoch
2309 /// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
2310 /// 9999-12-31T23:59:59Z inclusive.
2311 #[prost(int64, tag = "1")]
2312 pub seconds: i64,
2313 /// Non-negative fractions of a second at nanosecond resolution. Negative
2314 /// second values with fractions must still have non-negative nanos values
2315 /// that count forward in time. Must be from 0 to 999,999,999
2316 /// inclusive.
2317 #[prost(int32, tag = "2")]
2318 pub nanos: i32,
2319}