google_cloud_rust_raw/spanner/v1/
commit_response.rs

1// This file is generated by rust-protobuf 2.28.0. Do not edit
2// @generated
3
4// https://github.com/rust-lang/rust-clippy/issues/702
5#![allow(unknown_lints)]
6#![allow(clippy::all)]
7
8#![allow(unused_attributes)]
9#![cfg_attr(rustfmt, rustfmt::skip)]
10
11#![allow(box_pointers)]
12#![allow(dead_code)]
13#![allow(missing_docs)]
14#![allow(non_camel_case_types)]
15#![allow(non_snake_case)]
16#![allow(non_upper_case_globals)]
17#![allow(trivial_casts)]
18#![allow(unused_imports)]
19#![allow(unused_results)]
20//! Generated file from `google/spanner/v1/commit_response.proto`
21
22/// Generated files are compatible only with the same version
23/// of protobuf runtime.
24// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_28_0;
25
26#[derive(PartialEq,Clone,Default)]
27pub struct CommitResponse {
28    // message fields
29    pub commit_timestamp: ::protobuf::SingularPtrField<::protobuf::well_known_types::Timestamp>,
30    pub commit_stats: ::protobuf::SingularPtrField<CommitResponse_CommitStats>,
31    // special fields
32    pub unknown_fields: ::protobuf::UnknownFields,
33    pub cached_size: ::protobuf::CachedSize,
34}
35
36impl<'a> ::std::default::Default for &'a CommitResponse {
37    fn default() -> &'a CommitResponse {
38        <CommitResponse as ::protobuf::Message>::default_instance()
39    }
40}
41
42impl CommitResponse {
43    pub fn new() -> CommitResponse {
44        ::std::default::Default::default()
45    }
46
47    // .google.protobuf.Timestamp commit_timestamp = 1;
48
49
50    pub fn get_commit_timestamp(&self) -> &::protobuf::well_known_types::Timestamp {
51        self.commit_timestamp.as_ref().unwrap_or_else(|| <::protobuf::well_known_types::Timestamp as ::protobuf::Message>::default_instance())
52    }
53    pub fn clear_commit_timestamp(&mut self) {
54        self.commit_timestamp.clear();
55    }
56
57    pub fn has_commit_timestamp(&self) -> bool {
58        self.commit_timestamp.is_some()
59    }
60
61    // Param is passed by value, moved
62    pub fn set_commit_timestamp(&mut self, v: ::protobuf::well_known_types::Timestamp) {
63        self.commit_timestamp = ::protobuf::SingularPtrField::some(v);
64    }
65
66    // Mutable pointer to the field.
67    // If field is not initialized, it is initialized with default value first.
68    pub fn mut_commit_timestamp(&mut self) -> &mut ::protobuf::well_known_types::Timestamp {
69        if self.commit_timestamp.is_none() {
70            self.commit_timestamp.set_default();
71        }
72        self.commit_timestamp.as_mut().unwrap()
73    }
74
75    // Take field
76    pub fn take_commit_timestamp(&mut self) -> ::protobuf::well_known_types::Timestamp {
77        self.commit_timestamp.take().unwrap_or_else(|| ::protobuf::well_known_types::Timestamp::new())
78    }
79
80    // .google.spanner.v1.CommitResponse.CommitStats commit_stats = 2;
81
82
83    pub fn get_commit_stats(&self) -> &CommitResponse_CommitStats {
84        self.commit_stats.as_ref().unwrap_or_else(|| <CommitResponse_CommitStats as ::protobuf::Message>::default_instance())
85    }
86    pub fn clear_commit_stats(&mut self) {
87        self.commit_stats.clear();
88    }
89
90    pub fn has_commit_stats(&self) -> bool {
91        self.commit_stats.is_some()
92    }
93
94    // Param is passed by value, moved
95    pub fn set_commit_stats(&mut self, v: CommitResponse_CommitStats) {
96        self.commit_stats = ::protobuf::SingularPtrField::some(v);
97    }
98
99    // Mutable pointer to the field.
100    // If field is not initialized, it is initialized with default value first.
101    pub fn mut_commit_stats(&mut self) -> &mut CommitResponse_CommitStats {
102        if self.commit_stats.is_none() {
103            self.commit_stats.set_default();
104        }
105        self.commit_stats.as_mut().unwrap()
106    }
107
108    // Take field
109    pub fn take_commit_stats(&mut self) -> CommitResponse_CommitStats {
110        self.commit_stats.take().unwrap_or_else(|| CommitResponse_CommitStats::new())
111    }
112}
113
114impl ::protobuf::Message for CommitResponse {
115    fn is_initialized(&self) -> bool {
116        for v in &self.commit_timestamp {
117            if !v.is_initialized() {
118                return false;
119            }
120        };
121        for v in &self.commit_stats {
122            if !v.is_initialized() {
123                return false;
124            }
125        };
126        true
127    }
128
129    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
130        while !is.eof()? {
131            let (field_number, wire_type) = is.read_tag_unpack()?;
132            match field_number {
133                1 => {
134                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.commit_timestamp)?;
135                },
136                2 => {
137                    ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.commit_stats)?;
138                },
139                _ => {
140                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
141                },
142            };
143        }
144        ::std::result::Result::Ok(())
145    }
146
147    // Compute sizes of nested messages
148    #[allow(unused_variables)]
149    fn compute_size(&self) -> u32 {
150        let mut my_size = 0;
151        if let Some(ref v) = self.commit_timestamp.as_ref() {
152            let len = v.compute_size();
153            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
154        }
155        if let Some(ref v) = self.commit_stats.as_ref() {
156            let len = v.compute_size();
157            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
158        }
159        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
160        self.cached_size.set(my_size);
161        my_size
162    }
163
164    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
165        if let Some(ref v) = self.commit_timestamp.as_ref() {
166            os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
167            os.write_raw_varint32(v.get_cached_size())?;
168            v.write_to_with_cached_sizes(os)?;
169        }
170        if let Some(ref v) = self.commit_stats.as_ref() {
171            os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
172            os.write_raw_varint32(v.get_cached_size())?;
173            v.write_to_with_cached_sizes(os)?;
174        }
175        os.write_unknown_fields(self.get_unknown_fields())?;
176        ::std::result::Result::Ok(())
177    }
178
179    fn get_cached_size(&self) -> u32 {
180        self.cached_size.get()
181    }
182
183    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
184        &self.unknown_fields
185    }
186
187    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
188        &mut self.unknown_fields
189    }
190
191    fn as_any(&self) -> &dyn (::std::any::Any) {
192        self as &dyn (::std::any::Any)
193    }
194    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
195        self as &mut dyn (::std::any::Any)
196    }
197    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
198        self
199    }
200
201    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
202        Self::descriptor_static()
203    }
204
205    fn new() -> CommitResponse {
206        CommitResponse::new()
207    }
208
209    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
210        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
211        descriptor.get(|| {
212            let mut fields = ::std::vec::Vec::new();
213            fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<::protobuf::well_known_types::Timestamp>>(
214                "commit_timestamp",
215                |m: &CommitResponse| { &m.commit_timestamp },
216                |m: &mut CommitResponse| { &mut m.commit_timestamp },
217            ));
218            fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<CommitResponse_CommitStats>>(
219                "commit_stats",
220                |m: &CommitResponse| { &m.commit_stats },
221                |m: &mut CommitResponse| { &mut m.commit_stats },
222            ));
223            ::protobuf::reflect::MessageDescriptor::new_pb_name::<CommitResponse>(
224                "CommitResponse",
225                fields,
226                file_descriptor_proto()
227            )
228        })
229    }
230
231    fn default_instance() -> &'static CommitResponse {
232        static instance: ::protobuf::rt::LazyV2<CommitResponse> = ::protobuf::rt::LazyV2::INIT;
233        instance.get(CommitResponse::new)
234    }
235}
236
237impl ::protobuf::Clear for CommitResponse {
238    fn clear(&mut self) {
239        self.commit_timestamp.clear();
240        self.commit_stats.clear();
241        self.unknown_fields.clear();
242    }
243}
244
245impl ::std::fmt::Debug for CommitResponse {
246    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
247        ::protobuf::text_format::fmt(self, f)
248    }
249}
250
251impl ::protobuf::reflect::ProtobufValue for CommitResponse {
252    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
253        ::protobuf::reflect::ReflectValueRef::Message(self)
254    }
255}
256
257#[derive(PartialEq,Clone,Default)]
258pub struct CommitResponse_CommitStats {
259    // message fields
260    pub mutation_count: i64,
261    // special fields
262    pub unknown_fields: ::protobuf::UnknownFields,
263    pub cached_size: ::protobuf::CachedSize,
264}
265
266impl<'a> ::std::default::Default for &'a CommitResponse_CommitStats {
267    fn default() -> &'a CommitResponse_CommitStats {
268        <CommitResponse_CommitStats as ::protobuf::Message>::default_instance()
269    }
270}
271
272impl CommitResponse_CommitStats {
273    pub fn new() -> CommitResponse_CommitStats {
274        ::std::default::Default::default()
275    }
276
277    // int64 mutation_count = 1;
278
279
280    pub fn get_mutation_count(&self) -> i64 {
281        self.mutation_count
282    }
283    pub fn clear_mutation_count(&mut self) {
284        self.mutation_count = 0;
285    }
286
287    // Param is passed by value, moved
288    pub fn set_mutation_count(&mut self, v: i64) {
289        self.mutation_count = v;
290    }
291}
292
293impl ::protobuf::Message for CommitResponse_CommitStats {
294    fn is_initialized(&self) -> bool {
295        true
296    }
297
298    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
299        while !is.eof()? {
300            let (field_number, wire_type) = is.read_tag_unpack()?;
301            match field_number {
302                1 => {
303                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
304                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
305                    }
306                    let tmp = is.read_int64()?;
307                    self.mutation_count = tmp;
308                },
309                _ => {
310                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
311                },
312            };
313        }
314        ::std::result::Result::Ok(())
315    }
316
317    // Compute sizes of nested messages
318    #[allow(unused_variables)]
319    fn compute_size(&self) -> u32 {
320        let mut my_size = 0;
321        if self.mutation_count != 0 {
322            my_size += ::protobuf::rt::value_size(1, self.mutation_count, ::protobuf::wire_format::WireTypeVarint);
323        }
324        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
325        self.cached_size.set(my_size);
326        my_size
327    }
328
329    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
330        if self.mutation_count != 0 {
331            os.write_int64(1, self.mutation_count)?;
332        }
333        os.write_unknown_fields(self.get_unknown_fields())?;
334        ::std::result::Result::Ok(())
335    }
336
337    fn get_cached_size(&self) -> u32 {
338        self.cached_size.get()
339    }
340
341    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
342        &self.unknown_fields
343    }
344
345    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
346        &mut self.unknown_fields
347    }
348
349    fn as_any(&self) -> &dyn (::std::any::Any) {
350        self as &dyn (::std::any::Any)
351    }
352    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
353        self as &mut dyn (::std::any::Any)
354    }
355    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
356        self
357    }
358
359    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
360        Self::descriptor_static()
361    }
362
363    fn new() -> CommitResponse_CommitStats {
364        CommitResponse_CommitStats::new()
365    }
366
367    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
368        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
369        descriptor.get(|| {
370            let mut fields = ::std::vec::Vec::new();
371            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
372                "mutation_count",
373                |m: &CommitResponse_CommitStats| { &m.mutation_count },
374                |m: &mut CommitResponse_CommitStats| { &mut m.mutation_count },
375            ));
376            ::protobuf::reflect::MessageDescriptor::new_pb_name::<CommitResponse_CommitStats>(
377                "CommitResponse.CommitStats",
378                fields,
379                file_descriptor_proto()
380            )
381        })
382    }
383
384    fn default_instance() -> &'static CommitResponse_CommitStats {
385        static instance: ::protobuf::rt::LazyV2<CommitResponse_CommitStats> = ::protobuf::rt::LazyV2::INIT;
386        instance.get(CommitResponse_CommitStats::new)
387    }
388}
389
390impl ::protobuf::Clear for CommitResponse_CommitStats {
391    fn clear(&mut self) {
392        self.mutation_count = 0;
393        self.unknown_fields.clear();
394    }
395}
396
397impl ::std::fmt::Debug for CommitResponse_CommitStats {
398    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
399        ::protobuf::text_format::fmt(self, f)
400    }
401}
402
403impl ::protobuf::reflect::ProtobufValue for CommitResponse_CommitStats {
404    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
405        ::protobuf::reflect::ReflectValueRef::Message(self)
406    }
407}
408
409static file_descriptor_proto_data: &'static [u8] = b"\
410    \n'google/spanner/v1/commit_response.proto\x12\x11google.spanner.v1\x1a\
411    \x1fgoogle/protobuf/timestamp.proto\"\xdf\x01\n\x0eCommitResponse\x12E\n\
412    \x10commit_timestamp\x18\x01\x20\x01(\x0b2\x1a.google.protobuf.Timestamp\
413    R\x0fcommitTimestamp\x12P\n\x0ccommit_stats\x18\x02\x20\x01(\x0b2-.googl\
414    e.spanner.v1.CommitResponse.CommitStatsR\x0bcommitStats\x1a4\n\x0bCommit\
415    Stats\x12%\n\x0emutation_count\x18\x01\x20\x01(\x03R\rmutationCountB\xb6\
416    \x01\n\x15com.google.spanner.v1B\x13CommitResponseProtoP\x01Z5cloud.goog\
417    le.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Span\
418    ner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::S\
419    panner::V1J\xe9\x0e\n\x06\x12\x04\x0e\01\x01\n\xbc\x04\n\x01\x0c\x12\x03\
420    \x0e\0\x122\xb1\x04\x20Copyright\x202022\x20Google\x20LLC\n\n\x20License\
421    d\x20under\x20the\x20Apache\x20License,\x20Version\x202.0\x20(the\x20\"L\
422    icense\");\n\x20you\x20may\x20not\x20use\x20this\x20file\x20except\x20in\
423    \x20compliance\x20with\x20the\x20License.\n\x20You\x20may\x20obtain\x20a\
424    \x20copy\x20of\x20the\x20License\x20at\n\n\x20\x20\x20\x20\x20http://www\
425    .apache.org/licenses/LICENSE-2.0\n\n\x20Unless\x20required\x20by\x20appl\
426    icable\x20law\x20or\x20agreed\x20to\x20in\x20writing,\x20software\n\x20d\
427    istributed\x20under\x20the\x20License\x20is\x20distributed\x20on\x20an\
428    \x20\"AS\x20IS\"\x20BASIS,\n\x20WITHOUT\x20WARRANTIES\x20OR\x20CONDITION\
429    S\x20OF\x20ANY\x20KIND,\x20either\x20express\x20or\x20implied.\n\x20See\
430    \x20the\x20License\x20for\x20the\x20specific\x20language\x20governing\
431    \x20permissions\x20and\n\x20limitations\x20under\x20the\x20License.\n\n\
432    \x08\n\x01\x02\x12\x03\x10\0\x1a\n\t\n\x02\x03\0\x12\x03\x12\0)\n\x08\n\
433    \x01\x08\x12\x03\x14\04\n\t\n\x02\x08%\x12\x03\x14\04\n\x08\n\x01\x08\
434    \x12\x03\x15\0L\n\t\n\x02\x08\x0b\x12\x03\x15\0L\n\x08\n\x01\x08\x12\x03\
435    \x16\0\"\n\t\n\x02\x08\n\x12\x03\x16\0\"\n\x08\n\x01\x08\x12\x03\x17\04\
436    \n\t\n\x02\x08\x08\x12\x03\x17\04\n\x08\n\x01\x08\x12\x03\x18\0.\n\t\n\
437    \x02\x08\x01\x12\x03\x18\0.\n\x08\n\x01\x08\x12\x03\x19\04\n\t\n\x02\x08\
438    )\x12\x03\x19\04\n\x08\n\x01\x08\x12\x03\x1a\03\n\t\n\x02\x08-\x12\x03\
439    \x1a\03\nJ\n\x02\x04\0\x12\x04\x1d\01\x01\x1a>\x20The\x20response\x20for\
440    \x20[Commit][google.spanner.v1.Spanner.Commit].\n\n\n\n\x03\x04\0\x01\
441    \x12\x03\x1d\x08\x16\n5\n\x04\x04\0\x03\0\x12\x04\x1f\x02(\x03\x1a'\x20A\
442    dditional\x20statistics\x20about\x20a\x20commit.\n\n\x0c\n\x05\x04\0\x03\
443    \0\x01\x12\x03\x1f\n\x15\n\xc3\x04\n\x06\x04\0\x03\0\x02\0\x12\x03'\x04\
444    \x1d\x1a\xb3\x04\x20The\x20total\x20number\x20of\x20mutations\x20for\x20\
445    the\x20transaction.\x20Knowing\x20the\n\x20`mutation_count`\x20value\x20\
446    can\x20help\x20you\x20maximize\x20the\x20number\x20of\x20mutations\n\x20\
447    in\x20a\x20transaction\x20and\x20minimize\x20the\x20number\x20of\x20API\
448    \x20round\x20trips.\x20You\x20can\n\x20also\x20monitor\x20this\x20value\
449    \x20to\x20prevent\x20transactions\x20from\x20exceeding\x20the\x20system\
450    \n\x20[limit](https://cloud.google.com/spanner/quotas#limits_for_creatin\
451    g_reading_updating_and_deleting_data).\n\x20If\x20the\x20number\x20of\
452    \x20mutations\x20exceeds\x20the\x20limit,\x20the\x20server\x20returns\n\
453    \x20[INVALID_ARGUMENT](https://cloud.google.com/spanner/docs/reference/r\
454    est/v1/Code#ENUM_VALUES.INVALID_ARGUMENT).\n\n\x0e\n\x07\x04\0\x03\0\x02\
455    \0\x05\x12\x03'\x04\t\n\x0e\n\x07\x04\0\x03\0\x02\0\x01\x12\x03'\n\x18\n\
456    \x0e\n\x07\x04\0\x03\0\x02\0\x03\x12\x03'\x1b\x1c\nN\n\x04\x04\0\x02\0\
457    \x12\x03+\x021\x1aA\x20The\x20Cloud\x20Spanner\x20timestamp\x20at\x20whi\
458    ch\x20the\x20transaction\x20committed.\n\n\x0c\n\x05\x04\0\x02\0\x06\x12\
459    \x03+\x02\x1b\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03+\x1c,\n\x0c\n\x05\x04\
460    \0\x02\0\x03\x12\x03+/0\n\xc0\x01\n\x04\x04\0\x02\x01\x12\x030\x02\x1f\
461    \x1a\xb2\x01\x20The\x20statistics\x20about\x20this\x20Commit.\x20Not\x20\
462    returned\x20by\x20default.\n\x20For\x20more\x20information,\x20see\n\x20\
463    [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.retu\
464    rn_commit_stats].\n\n\x0c\n\x05\x04\0\x02\x01\x06\x12\x030\x02\r\n\x0c\n\
465    \x05\x04\0\x02\x01\x01\x12\x030\x0e\x1a\n\x0c\n\x05\x04\0\x02\x01\x03\
466    \x12\x030\x1d\x1eb\x06proto3\
467";
468
469static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
470
471fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
472    ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
473}
474
475pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
476    file_descriptor_proto_lazy.get(|| {
477        parse_descriptor_proto()
478    })
479}