google_cloud_rust_raw/rpc/
status.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/rpc/status.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 Status {
28    // message fields
29    pub code: i32,
30    pub message: ::std::string::String,
31    pub details: ::protobuf::RepeatedField<::protobuf::well_known_types::Any>,
32    // special fields
33    pub unknown_fields: ::protobuf::UnknownFields,
34    pub cached_size: ::protobuf::CachedSize,
35}
36
37impl<'a> ::std::default::Default for &'a Status {
38    fn default() -> &'a Status {
39        <Status as ::protobuf::Message>::default_instance()
40    }
41}
42
43impl Status {
44    pub fn new() -> Status {
45        ::std::default::Default::default()
46    }
47
48    // int32 code = 1;
49
50
51    pub fn get_code(&self) -> i32 {
52        self.code
53    }
54    pub fn clear_code(&mut self) {
55        self.code = 0;
56    }
57
58    // Param is passed by value, moved
59    pub fn set_code(&mut self, v: i32) {
60        self.code = v;
61    }
62
63    // string message = 2;
64
65
66    pub fn get_message(&self) -> &str {
67        &self.message
68    }
69    pub fn clear_message(&mut self) {
70        self.message.clear();
71    }
72
73    // Param is passed by value, moved
74    pub fn set_message(&mut self, v: ::std::string::String) {
75        self.message = v;
76    }
77
78    // Mutable pointer to the field.
79    // If field is not initialized, it is initialized with default value first.
80    pub fn mut_message(&mut self) -> &mut ::std::string::String {
81        &mut self.message
82    }
83
84    // Take field
85    pub fn take_message(&mut self) -> ::std::string::String {
86        ::std::mem::replace(&mut self.message, ::std::string::String::new())
87    }
88
89    // repeated .google.protobuf.Any details = 3;
90
91
92    pub fn get_details(&self) -> &[::protobuf::well_known_types::Any] {
93        &self.details
94    }
95    pub fn clear_details(&mut self) {
96        self.details.clear();
97    }
98
99    // Param is passed by value, moved
100    pub fn set_details(&mut self, v: ::protobuf::RepeatedField<::protobuf::well_known_types::Any>) {
101        self.details = v;
102    }
103
104    // Mutable pointer to the field.
105    pub fn mut_details(&mut self) -> &mut ::protobuf::RepeatedField<::protobuf::well_known_types::Any> {
106        &mut self.details
107    }
108
109    // Take field
110    pub fn take_details(&mut self) -> ::protobuf::RepeatedField<::protobuf::well_known_types::Any> {
111        ::std::mem::replace(&mut self.details, ::protobuf::RepeatedField::new())
112    }
113}
114
115impl ::protobuf::Message for Status {
116    fn is_initialized(&self) -> bool {
117        for v in &self.details {
118            if !v.is_initialized() {
119                return false;
120            }
121        };
122        true
123    }
124
125    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
126        while !is.eof()? {
127            let (field_number, wire_type) = is.read_tag_unpack()?;
128            match field_number {
129                1 => {
130                    if wire_type != ::protobuf::wire_format::WireTypeVarint {
131                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
132                    }
133                    let tmp = is.read_int32()?;
134                    self.code = tmp;
135                },
136                2 => {
137                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.message)?;
138                },
139                3 => {
140                    ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.details)?;
141                },
142                _ => {
143                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
144                },
145            };
146        }
147        ::std::result::Result::Ok(())
148    }
149
150    // Compute sizes of nested messages
151    #[allow(unused_variables)]
152    fn compute_size(&self) -> u32 {
153        let mut my_size = 0;
154        if self.code != 0 {
155            my_size += ::protobuf::rt::value_size(1, self.code, ::protobuf::wire_format::WireTypeVarint);
156        }
157        if !self.message.is_empty() {
158            my_size += ::protobuf::rt::string_size(2, &self.message);
159        }
160        for value in &self.details {
161            let len = value.compute_size();
162            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
163        };
164        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
165        self.cached_size.set(my_size);
166        my_size
167    }
168
169    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
170        if self.code != 0 {
171            os.write_int32(1, self.code)?;
172        }
173        if !self.message.is_empty() {
174            os.write_string(2, &self.message)?;
175        }
176        for v in &self.details {
177            os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?;
178            os.write_raw_varint32(v.get_cached_size())?;
179            v.write_to_with_cached_sizes(os)?;
180        };
181        os.write_unknown_fields(self.get_unknown_fields())?;
182        ::std::result::Result::Ok(())
183    }
184
185    fn get_cached_size(&self) -> u32 {
186        self.cached_size.get()
187    }
188
189    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
190        &self.unknown_fields
191    }
192
193    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
194        &mut self.unknown_fields
195    }
196
197    fn as_any(&self) -> &dyn (::std::any::Any) {
198        self as &dyn (::std::any::Any)
199    }
200    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
201        self as &mut dyn (::std::any::Any)
202    }
203    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
204        self
205    }
206
207    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
208        Self::descriptor_static()
209    }
210
211    fn new() -> Status {
212        Status::new()
213    }
214
215    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
216        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
217        descriptor.get(|| {
218            let mut fields = ::std::vec::Vec::new();
219            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
220                "code",
221                |m: &Status| { &m.code },
222                |m: &mut Status| { &mut m.code },
223            ));
224            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
225                "message",
226                |m: &Status| { &m.message },
227                |m: &mut Status| { &mut m.message },
228            ));
229            fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<::protobuf::well_known_types::Any>>(
230                "details",
231                |m: &Status| { &m.details },
232                |m: &mut Status| { &mut m.details },
233            ));
234            ::protobuf::reflect::MessageDescriptor::new_pb_name::<Status>(
235                "Status",
236                fields,
237                file_descriptor_proto()
238            )
239        })
240    }
241
242    fn default_instance() -> &'static Status {
243        static instance: ::protobuf::rt::LazyV2<Status> = ::protobuf::rt::LazyV2::INIT;
244        instance.get(Status::new)
245    }
246}
247
248impl ::protobuf::Clear for Status {
249    fn clear(&mut self) {
250        self.code = 0;
251        self.message.clear();
252        self.details.clear();
253        self.unknown_fields.clear();
254    }
255}
256
257impl ::std::fmt::Debug for Status {
258    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
259        ::protobuf::text_format::fmt(self, f)
260    }
261}
262
263impl ::protobuf::reflect::ProtobufValue for Status {
264    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
265        ::protobuf::reflect::ReflectValueRef::Message(self)
266    }
267}
268
269static file_descriptor_proto_data: &'static [u8] = b"\
270    \n\x17google/rpc/status.proto\x12\ngoogle.rpc\x1a\x19google/protobuf/any\
271    .proto\"f\n\x06Status\x12\x12\n\x04code\x18\x01\x20\x01(\x05R\x04code\
272    \x12\x18\n\x07message\x18\x02\x20\x01(\tR\x07message\x12.\n\x07details\
273    \x18\x03\x20\x03(\x0b2\x14.google.protobuf.AnyR\x07detailsBa\n\x0ecom.go\
274    ogle.rpcB\x0bStatusProtoP\x01Z7google.golang.org/genproto/googleapis/rpc\
275    /status;status\xf8\x01\x01\xa2\x02\x03RPCJ\x84\x0e\n\x06\x12\x04\x0e\00\
276    \x01\n\xbc\x04\n\x01\x0c\x12\x03\x0e\0\x122\xb1\x04\x20Copyright\x202022\
277    \x20Google\x20LLC\n\n\x20Licensed\x20under\x20the\x20Apache\x20License,\
278    \x20Version\x202.0\x20(the\x20\"License\");\n\x20you\x20may\x20not\x20us\
279    e\x20this\x20file\x20except\x20in\x20compliance\x20with\x20the\x20Licens\
280    e.\n\x20You\x20may\x20obtain\x20a\x20copy\x20of\x20the\x20License\x20at\
281    \n\n\x20\x20\x20\x20\x20http://www.apache.org/licenses/LICENSE-2.0\n\n\
282    \x20Unless\x20required\x20by\x20applicable\x20law\x20or\x20agreed\x20to\
283    \x20in\x20writing,\x20software\n\x20distributed\x20under\x20the\x20Licen\
284    se\x20is\x20distributed\x20on\x20an\x20\"AS\x20IS\"\x20BASIS,\n\x20WITHO\
285    UT\x20WARRANTIES\x20OR\x20CONDITIONS\x20OF\x20ANY\x20KIND,\x20either\x20\
286    express\x20or\x20implied.\n\x20See\x20the\x20License\x20for\x20the\x20sp\
287    ecific\x20language\x20governing\x20permissions\x20and\n\x20limitations\
288    \x20under\x20the\x20License.\n\n\x08\n\x01\x02\x12\x03\x10\0\x13\n\t\n\
289    \x02\x03\0\x12\x03\x12\0#\n\x08\n\x01\x08\x12\x03\x14\0\x1f\n\t\n\x02\
290    \x08\x1f\x12\x03\x14\0\x1f\n\x08\n\x01\x08\x12\x03\x15\0N\n\t\n\x02\x08\
291    \x0b\x12\x03\x15\0N\n\x08\n\x01\x08\x12\x03\x16\0\"\n\t\n\x02\x08\n\x12\
292    \x03\x16\0\"\n\x08\n\x01\x08\x12\x03\x17\0,\n\t\n\x02\x08\x08\x12\x03\
293    \x17\0,\n\x08\n\x01\x08\x12\x03\x18\0'\n\t\n\x02\x08\x01\x12\x03\x18\0'\
294    \n\x08\n\x01\x08\x12\x03\x19\0!\n\t\n\x02\x08$\x12\x03\x19\0!\n\xbe\x03\
295    \n\x02\x04\0\x12\x04\"\00\x01\x1a\xb1\x03\x20The\x20`Status`\x20type\x20\
296    defines\x20a\x20logical\x20error\x20model\x20that\x20is\x20suitable\x20f\
297    or\n\x20different\x20programming\x20environments,\x20including\x20REST\
298    \x20APIs\x20and\x20RPC\x20APIs.\x20It\x20is\n\x20used\x20by\x20[gRPC](ht\
299    tps://github.com/grpc).\x20Each\x20`Status`\x20message\x20contains\n\x20\
300    three\x20pieces\x20of\x20data:\x20error\x20code,\x20error\x20message,\
301    \x20and\x20error\x20details.\n\n\x20You\x20can\x20find\x20out\x20more\
302    \x20about\x20this\x20error\x20model\x20and\x20how\x20to\x20work\x20with\
303    \x20it\x20in\x20the\n\x20[API\x20Design\x20Guide](https://cloud.google.c\
304    om/apis/design/errors).\n\n\n\n\x03\x04\0\x01\x12\x03\"\x08\x0e\ne\n\x04\
305    \x04\0\x02\0\x12\x03%\x02\x11\x1aX\x20The\x20status\x20code,\x20which\
306    \x20should\x20be\x20an\x20enum\x20value\x20of\n\x20[google.rpc.Code][goo\
307    gle.rpc.Code].\n\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03%\x02\x07\n\x0c\n\
308    \x05\x04\0\x02\0\x01\x12\x03%\x08\x0c\n\x0c\n\x05\x04\0\x02\0\x03\x12\
309    \x03%\x0f\x10\n\xec\x01\n\x04\x04\0\x02\x01\x12\x03+\x02\x15\x1a\xde\x01\
310    \x20A\x20developer-facing\x20error\x20message,\x20which\x20should\x20be\
311    \x20in\x20English.\x20Any\n\x20user-facing\x20error\x20message\x20should\
312    \x20be\x20localized\x20and\x20sent\x20in\x20the\n\x20[google.rpc.Status.\
313    details][google.rpc.Status.details]\x20field,\x20or\x20localized\n\x20by\
314    \x20the\x20client.\n\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03+\x02\x08\n\
315    \x0c\n\x05\x04\0\x02\x01\x01\x12\x03+\t\x10\n\x0c\n\x05\x04\0\x02\x01\
316    \x03\x12\x03+\x13\x14\ny\n\x04\x04\0\x02\x02\x12\x03/\x02+\x1al\x20A\x20\
317    list\x20of\x20messages\x20that\x20carry\x20the\x20error\x20details.\x20\
318    \x20There\x20is\x20a\x20common\x20set\x20of\n\x20message\x20types\x20for\
319    \x20APIs\x20to\x20use.\n\n\x0c\n\x05\x04\0\x02\x02\x04\x12\x03/\x02\n\n\
320    \x0c\n\x05\x04\0\x02\x02\x06\x12\x03/\x0b\x1e\n\x0c\n\x05\x04\0\x02\x02\
321    \x01\x12\x03/\x1f&\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03/)*b\x06proto3\
322";
323
324static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
325
326fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
327    ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
328}
329
330pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
331    file_descriptor_proto_lazy.get(|| {
332        parse_descriptor_proto()
333    })
334}