google_cloud_rust_raw/api/
label.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/api/label.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 LabelDescriptor {
28    // message fields
29    pub key: ::std::string::String,
30    pub value_type: LabelDescriptor_ValueType,
31    pub description: ::std::string::String,
32    // special fields
33    pub unknown_fields: ::protobuf::UnknownFields,
34    pub cached_size: ::protobuf::CachedSize,
35}
36
37impl<'a> ::std::default::Default for &'a LabelDescriptor {
38    fn default() -> &'a LabelDescriptor {
39        <LabelDescriptor as ::protobuf::Message>::default_instance()
40    }
41}
42
43impl LabelDescriptor {
44    pub fn new() -> LabelDescriptor {
45        ::std::default::Default::default()
46    }
47
48    // string key = 1;
49
50
51    pub fn get_key(&self) -> &str {
52        &self.key
53    }
54    pub fn clear_key(&mut self) {
55        self.key.clear();
56    }
57
58    // Param is passed by value, moved
59    pub fn set_key(&mut self, v: ::std::string::String) {
60        self.key = v;
61    }
62
63    // Mutable pointer to the field.
64    // If field is not initialized, it is initialized with default value first.
65    pub fn mut_key(&mut self) -> &mut ::std::string::String {
66        &mut self.key
67    }
68
69    // Take field
70    pub fn take_key(&mut self) -> ::std::string::String {
71        ::std::mem::replace(&mut self.key, ::std::string::String::new())
72    }
73
74    // .google.api.LabelDescriptor.ValueType value_type = 2;
75
76
77    pub fn get_value_type(&self) -> LabelDescriptor_ValueType {
78        self.value_type
79    }
80    pub fn clear_value_type(&mut self) {
81        self.value_type = LabelDescriptor_ValueType::STRING;
82    }
83
84    // Param is passed by value, moved
85    pub fn set_value_type(&mut self, v: LabelDescriptor_ValueType) {
86        self.value_type = v;
87    }
88
89    // string description = 3;
90
91
92    pub fn get_description(&self) -> &str {
93        &self.description
94    }
95    pub fn clear_description(&mut self) {
96        self.description.clear();
97    }
98
99    // Param is passed by value, moved
100    pub fn set_description(&mut self, v: ::std::string::String) {
101        self.description = v;
102    }
103
104    // Mutable pointer to the field.
105    // If field is not initialized, it is initialized with default value first.
106    pub fn mut_description(&mut self) -> &mut ::std::string::String {
107        &mut self.description
108    }
109
110    // Take field
111    pub fn take_description(&mut self) -> ::std::string::String {
112        ::std::mem::replace(&mut self.description, ::std::string::String::new())
113    }
114}
115
116impl ::protobuf::Message for LabelDescriptor {
117    fn is_initialized(&self) -> bool {
118        true
119    }
120
121    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
122        while !is.eof()? {
123            let (field_number, wire_type) = is.read_tag_unpack()?;
124            match field_number {
125                1 => {
126                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.key)?;
127                },
128                2 => {
129                    ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.value_type, 2, &mut self.unknown_fields)?
130                },
131                3 => {
132                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.description)?;
133                },
134                _ => {
135                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
136                },
137            };
138        }
139        ::std::result::Result::Ok(())
140    }
141
142    // Compute sizes of nested messages
143    #[allow(unused_variables)]
144    fn compute_size(&self) -> u32 {
145        let mut my_size = 0;
146        if !self.key.is_empty() {
147            my_size += ::protobuf::rt::string_size(1, &self.key);
148        }
149        if self.value_type != LabelDescriptor_ValueType::STRING {
150            my_size += ::protobuf::rt::enum_size(2, self.value_type);
151        }
152        if !self.description.is_empty() {
153            my_size += ::protobuf::rt::string_size(3, &self.description);
154        }
155        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
156        self.cached_size.set(my_size);
157        my_size
158    }
159
160    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
161        if !self.key.is_empty() {
162            os.write_string(1, &self.key)?;
163        }
164        if self.value_type != LabelDescriptor_ValueType::STRING {
165            os.write_enum(2, ::protobuf::ProtobufEnum::value(&self.value_type))?;
166        }
167        if !self.description.is_empty() {
168            os.write_string(3, &self.description)?;
169        }
170        os.write_unknown_fields(self.get_unknown_fields())?;
171        ::std::result::Result::Ok(())
172    }
173
174    fn get_cached_size(&self) -> u32 {
175        self.cached_size.get()
176    }
177
178    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
179        &self.unknown_fields
180    }
181
182    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
183        &mut self.unknown_fields
184    }
185
186    fn as_any(&self) -> &dyn (::std::any::Any) {
187        self as &dyn (::std::any::Any)
188    }
189    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
190        self as &mut dyn (::std::any::Any)
191    }
192    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
193        self
194    }
195
196    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
197        Self::descriptor_static()
198    }
199
200    fn new() -> LabelDescriptor {
201        LabelDescriptor::new()
202    }
203
204    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
205        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
206        descriptor.get(|| {
207            let mut fields = ::std::vec::Vec::new();
208            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
209                "key",
210                |m: &LabelDescriptor| { &m.key },
211                |m: &mut LabelDescriptor| { &mut m.key },
212            ));
213            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<LabelDescriptor_ValueType>>(
214                "value_type",
215                |m: &LabelDescriptor| { &m.value_type },
216                |m: &mut LabelDescriptor| { &mut m.value_type },
217            ));
218            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
219                "description",
220                |m: &LabelDescriptor| { &m.description },
221                |m: &mut LabelDescriptor| { &mut m.description },
222            ));
223            ::protobuf::reflect::MessageDescriptor::new_pb_name::<LabelDescriptor>(
224                "LabelDescriptor",
225                fields,
226                file_descriptor_proto()
227            )
228        })
229    }
230
231    fn default_instance() -> &'static LabelDescriptor {
232        static instance: ::protobuf::rt::LazyV2<LabelDescriptor> = ::protobuf::rt::LazyV2::INIT;
233        instance.get(LabelDescriptor::new)
234    }
235}
236
237impl ::protobuf::Clear for LabelDescriptor {
238    fn clear(&mut self) {
239        self.key.clear();
240        self.value_type = LabelDescriptor_ValueType::STRING;
241        self.description.clear();
242        self.unknown_fields.clear();
243    }
244}
245
246impl ::std::fmt::Debug for LabelDescriptor {
247    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
248        ::protobuf::text_format::fmt(self, f)
249    }
250}
251
252impl ::protobuf::reflect::ProtobufValue for LabelDescriptor {
253    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
254        ::protobuf::reflect::ReflectValueRef::Message(self)
255    }
256}
257
258#[derive(Clone,PartialEq,Eq,Debug,Hash)]
259pub enum LabelDescriptor_ValueType {
260    STRING = 0,
261    BOOL = 1,
262    INT64 = 2,
263}
264
265impl ::protobuf::ProtobufEnum for LabelDescriptor_ValueType {
266    fn value(&self) -> i32 {
267        *self as i32
268    }
269
270    fn from_i32(value: i32) -> ::std::option::Option<LabelDescriptor_ValueType> {
271        match value {
272            0 => ::std::option::Option::Some(LabelDescriptor_ValueType::STRING),
273            1 => ::std::option::Option::Some(LabelDescriptor_ValueType::BOOL),
274            2 => ::std::option::Option::Some(LabelDescriptor_ValueType::INT64),
275            _ => ::std::option::Option::None
276        }
277    }
278
279    fn values() -> &'static [Self] {
280        static values: &'static [LabelDescriptor_ValueType] = &[
281            LabelDescriptor_ValueType::STRING,
282            LabelDescriptor_ValueType::BOOL,
283            LabelDescriptor_ValueType::INT64,
284        ];
285        values
286    }
287
288    fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
289        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT;
290        descriptor.get(|| {
291            ::protobuf::reflect::EnumDescriptor::new_pb_name::<LabelDescriptor_ValueType>("LabelDescriptor.ValueType", file_descriptor_proto())
292        })
293    }
294}
295
296impl ::std::marker::Copy for LabelDescriptor_ValueType {
297}
298
299impl ::std::default::Default for LabelDescriptor_ValueType {
300    fn default() -> Self {
301        LabelDescriptor_ValueType::STRING
302    }
303}
304
305impl ::protobuf::reflect::ProtobufValue for LabelDescriptor_ValueType {
306    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
307        ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
308    }
309}
310
311static file_descriptor_proto_data: &'static [u8] = b"\
312    \n\x16google/api/label.proto\x12\ngoogle.api\"\xb9\x01\n\x0fLabelDescrip\
313    tor\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\x12D\n\nvalue_type\x18\
314    \x02\x20\x01(\x0e2%.google.api.LabelDescriptor.ValueTypeR\tvalueType\x12\
315    \x20\n\x0bdescription\x18\x03\x20\x01(\tR\x0bdescription\",\n\tValueType\
316    \x12\n\n\x06STRING\x10\0\x12\x08\n\x04BOOL\x10\x01\x12\t\n\x05INT64\x10\
317    \x02B_\n\x0ecom.google.apiB\nLabelProtoP\x01Z5google.golang.org/genproto\
318    /googleapis/api/label;label\xf8\x01\x01\xa2\x02\x04GAPIJ\xe4\n\n\x06\x12\
319    \x04\x0e\0/\x01\n\xbc\x04\n\x01\x0c\x12\x03\x0e\0\x122\xb1\x04\x20Copyri\
320    ght\x202023\x20Google\x20LLC\n\n\x20Licensed\x20under\x20the\x20Apache\
321    \x20License,\x20Version\x202.0\x20(the\x20\"License\");\n\x20you\x20may\
322    \x20not\x20use\x20this\x20file\x20except\x20in\x20compliance\x20with\x20\
323    the\x20License.\n\x20You\x20may\x20obtain\x20a\x20copy\x20of\x20the\x20L\
324    icense\x20at\n\n\x20\x20\x20\x20\x20http://www.apache.org/licenses/LICEN\
325    SE-2.0\n\n\x20Unless\x20required\x20by\x20applicable\x20law\x20or\x20agr\
326    eed\x20to\x20in\x20writing,\x20software\n\x20distributed\x20under\x20the\
327    \x20License\x20is\x20distributed\x20on\x20an\x20\"AS\x20IS\"\x20BASIS,\n\
328    \x20WITHOUT\x20WARRANTIES\x20OR\x20CONDITIONS\x20OF\x20ANY\x20KIND,\x20e\
329    ither\x20express\x20or\x20implied.\n\x20See\x20the\x20License\x20for\x20\
330    the\x20specific\x20language\x20governing\x20permissions\x20and\n\x20limi\
331    tations\x20under\x20the\x20License.\n\n\x08\n\x01\x02\x12\x03\x10\0\x13\
332    \n\x08\n\x01\x08\x12\x03\x12\0\x1f\n\t\n\x02\x08\x1f\x12\x03\x12\0\x1f\n\
333    \x08\n\x01\x08\x12\x03\x13\0L\n\t\n\x02\x08\x0b\x12\x03\x13\0L\n\x08\n\
334    \x01\x08\x12\x03\x14\0\"\n\t\n\x02\x08\n\x12\x03\x14\0\"\n\x08\n\x01\x08\
335    \x12\x03\x15\0+\n\t\n\x02\x08\x08\x12\x03\x15\0+\n\x08\n\x01\x08\x12\x03\
336    \x16\0'\n\t\n\x02\x08\x01\x12\x03\x16\0'\n\x08\n\x01\x08\x12\x03\x17\0\"\
337    \n\t\n\x02\x08$\x12\x03\x17\0\"\n'\n\x02\x04\0\x12\x04\x1a\0/\x01\x1a\
338    \x1b\x20A\x20description\x20of\x20a\x20label.\n\n\n\n\x03\x04\0\x01\x12\
339    \x03\x1a\x08\x17\n=\n\x04\x04\0\x04\0\x12\x04\x1c\x02%\x03\x1a/\x20Value\
340    \x20types\x20that\x20can\x20be\x20used\x20as\x20label\x20values.\n\n\x0c\
341    \n\x05\x04\0\x04\0\x01\x12\x03\x1c\x07\x10\n?\n\x06\x04\0\x04\0\x02\0\
342    \x12\x03\x1e\x04\x0f\x1a0\x20A\x20variable-length\x20string.\x20This\x20\
343    is\x20the\x20default.\n\n\x0e\n\x07\x04\0\x04\0\x02\0\x01\x12\x03\x1e\
344    \x04\n\n\x0e\n\x07\x04\0\x04\0\x02\0\x02\x12\x03\x1e\r\x0e\n(\n\x06\x04\
345    \0\x04\0\x02\x01\x12\x03!\x04\r\x1a\x19\x20Boolean;\x20true\x20or\x20fal\
346    se.\n\n\x0e\n\x07\x04\0\x04\0\x02\x01\x01\x12\x03!\x04\x08\n\x0e\n\x07\
347    \x04\0\x04\0\x02\x01\x02\x12\x03!\x0b\x0c\n)\n\x06\x04\0\x04\0\x02\x02\
348    \x12\x03$\x04\x0e\x1a\x1a\x20A\x2064-bit\x20signed\x20integer.\n\n\x0e\n\
349    \x07\x04\0\x04\0\x02\x02\x01\x12\x03$\x04\t\n\x0e\n\x07\x04\0\x04\0\x02\
350    \x02\x02\x12\x03$\x0c\r\n\x1d\n\x04\x04\0\x02\0\x12\x03(\x02\x11\x1a\x10\
351    \x20The\x20label\x20key.\n\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03(\x02\x08\
352    \n\x0c\n\x05\x04\0\x02\0\x01\x12\x03(\t\x0c\n\x0c\n\x05\x04\0\x02\0\x03\
353    \x12\x03(\x0f\x10\nB\n\x04\x04\0\x02\x01\x12\x03+\x02\x1b\x1a5\x20The\
354    \x20type\x20of\x20data\x20that\x20can\x20be\x20assigned\x20to\x20the\x20\
355    label.\n\n\x0c\n\x05\x04\0\x02\x01\x06\x12\x03+\x02\x0b\n\x0c\n\x05\x04\
356    \0\x02\x01\x01\x12\x03+\x0c\x16\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03+\
357    \x19\x1a\n:\n\x04\x04\0\x02\x02\x12\x03.\x02\x19\x1a-\x20A\x20human-read\
358    able\x20description\x20for\x20the\x20label.\n\n\x0c\n\x05\x04\0\x02\x02\
359    \x05\x12\x03.\x02\x08\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03.\t\x14\n\x0c\
360    \n\x05\x04\0\x02\x02\x03\x12\x03.\x17\x18b\x06proto3\
361";
362
363static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
364
365fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
366    ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
367}
368
369pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
370    file_descriptor_proto_lazy.get(|| {
371        parse_descriptor_proto()
372    })
373}