google_cloud_rust_raw/api/
billing.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/billing.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 Billing {
28    // message fields
29    pub consumer_destinations: ::protobuf::RepeatedField<Billing_BillingDestination>,
30    // special fields
31    pub unknown_fields: ::protobuf::UnknownFields,
32    pub cached_size: ::protobuf::CachedSize,
33}
34
35impl<'a> ::std::default::Default for &'a Billing {
36    fn default() -> &'a Billing {
37        <Billing as ::protobuf::Message>::default_instance()
38    }
39}
40
41impl Billing {
42    pub fn new() -> Billing {
43        ::std::default::Default::default()
44    }
45
46    // repeated .google.api.Billing.BillingDestination consumer_destinations = 8;
47
48
49    pub fn get_consumer_destinations(&self) -> &[Billing_BillingDestination] {
50        &self.consumer_destinations
51    }
52    pub fn clear_consumer_destinations(&mut self) {
53        self.consumer_destinations.clear();
54    }
55
56    // Param is passed by value, moved
57    pub fn set_consumer_destinations(&mut self, v: ::protobuf::RepeatedField<Billing_BillingDestination>) {
58        self.consumer_destinations = v;
59    }
60
61    // Mutable pointer to the field.
62    pub fn mut_consumer_destinations(&mut self) -> &mut ::protobuf::RepeatedField<Billing_BillingDestination> {
63        &mut self.consumer_destinations
64    }
65
66    // Take field
67    pub fn take_consumer_destinations(&mut self) -> ::protobuf::RepeatedField<Billing_BillingDestination> {
68        ::std::mem::replace(&mut self.consumer_destinations, ::protobuf::RepeatedField::new())
69    }
70}
71
72impl ::protobuf::Message for Billing {
73    fn is_initialized(&self) -> bool {
74        for v in &self.consumer_destinations {
75            if !v.is_initialized() {
76                return false;
77            }
78        };
79        true
80    }
81
82    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
83        while !is.eof()? {
84            let (field_number, wire_type) = is.read_tag_unpack()?;
85            match field_number {
86                8 => {
87                    ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.consumer_destinations)?;
88                },
89                _ => {
90                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
91                },
92            };
93        }
94        ::std::result::Result::Ok(())
95    }
96
97    // Compute sizes of nested messages
98    #[allow(unused_variables)]
99    fn compute_size(&self) -> u32 {
100        let mut my_size = 0;
101        for value in &self.consumer_destinations {
102            let len = value.compute_size();
103            my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
104        };
105        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
106        self.cached_size.set(my_size);
107        my_size
108    }
109
110    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
111        for v in &self.consumer_destinations {
112            os.write_tag(8, ::protobuf::wire_format::WireTypeLengthDelimited)?;
113            os.write_raw_varint32(v.get_cached_size())?;
114            v.write_to_with_cached_sizes(os)?;
115        };
116        os.write_unknown_fields(self.get_unknown_fields())?;
117        ::std::result::Result::Ok(())
118    }
119
120    fn get_cached_size(&self) -> u32 {
121        self.cached_size.get()
122    }
123
124    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
125        &self.unknown_fields
126    }
127
128    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
129        &mut self.unknown_fields
130    }
131
132    fn as_any(&self) -> &dyn (::std::any::Any) {
133        self as &dyn (::std::any::Any)
134    }
135    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
136        self as &mut dyn (::std::any::Any)
137    }
138    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
139        self
140    }
141
142    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
143        Self::descriptor_static()
144    }
145
146    fn new() -> Billing {
147        Billing::new()
148    }
149
150    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
151        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
152        descriptor.get(|| {
153            let mut fields = ::std::vec::Vec::new();
154            fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<Billing_BillingDestination>>(
155                "consumer_destinations",
156                |m: &Billing| { &m.consumer_destinations },
157                |m: &mut Billing| { &mut m.consumer_destinations },
158            ));
159            ::protobuf::reflect::MessageDescriptor::new_pb_name::<Billing>(
160                "Billing",
161                fields,
162                file_descriptor_proto()
163            )
164        })
165    }
166
167    fn default_instance() -> &'static Billing {
168        static instance: ::protobuf::rt::LazyV2<Billing> = ::protobuf::rt::LazyV2::INIT;
169        instance.get(Billing::new)
170    }
171}
172
173impl ::protobuf::Clear for Billing {
174    fn clear(&mut self) {
175        self.consumer_destinations.clear();
176        self.unknown_fields.clear();
177    }
178}
179
180impl ::std::fmt::Debug for Billing {
181    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
182        ::protobuf::text_format::fmt(self, f)
183    }
184}
185
186impl ::protobuf::reflect::ProtobufValue for Billing {
187    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
188        ::protobuf::reflect::ReflectValueRef::Message(self)
189    }
190}
191
192#[derive(PartialEq,Clone,Default)]
193pub struct Billing_BillingDestination {
194    // message fields
195    pub monitored_resource: ::std::string::String,
196    pub metrics: ::protobuf::RepeatedField<::std::string::String>,
197    // special fields
198    pub unknown_fields: ::protobuf::UnknownFields,
199    pub cached_size: ::protobuf::CachedSize,
200}
201
202impl<'a> ::std::default::Default for &'a Billing_BillingDestination {
203    fn default() -> &'a Billing_BillingDestination {
204        <Billing_BillingDestination as ::protobuf::Message>::default_instance()
205    }
206}
207
208impl Billing_BillingDestination {
209    pub fn new() -> Billing_BillingDestination {
210        ::std::default::Default::default()
211    }
212
213    // string monitored_resource = 1;
214
215
216    pub fn get_monitored_resource(&self) -> &str {
217        &self.monitored_resource
218    }
219    pub fn clear_monitored_resource(&mut self) {
220        self.monitored_resource.clear();
221    }
222
223    // Param is passed by value, moved
224    pub fn set_monitored_resource(&mut self, v: ::std::string::String) {
225        self.monitored_resource = v;
226    }
227
228    // Mutable pointer to the field.
229    // If field is not initialized, it is initialized with default value first.
230    pub fn mut_monitored_resource(&mut self) -> &mut ::std::string::String {
231        &mut self.monitored_resource
232    }
233
234    // Take field
235    pub fn take_monitored_resource(&mut self) -> ::std::string::String {
236        ::std::mem::replace(&mut self.monitored_resource, ::std::string::String::new())
237    }
238
239    // repeated string metrics = 2;
240
241
242    pub fn get_metrics(&self) -> &[::std::string::String] {
243        &self.metrics
244    }
245    pub fn clear_metrics(&mut self) {
246        self.metrics.clear();
247    }
248
249    // Param is passed by value, moved
250    pub fn set_metrics(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) {
251        self.metrics = v;
252    }
253
254    // Mutable pointer to the field.
255    pub fn mut_metrics(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> {
256        &mut self.metrics
257    }
258
259    // Take field
260    pub fn take_metrics(&mut self) -> ::protobuf::RepeatedField<::std::string::String> {
261        ::std::mem::replace(&mut self.metrics, ::protobuf::RepeatedField::new())
262    }
263}
264
265impl ::protobuf::Message for Billing_BillingDestination {
266    fn is_initialized(&self) -> bool {
267        true
268    }
269
270    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
271        while !is.eof()? {
272            let (field_number, wire_type) = is.read_tag_unpack()?;
273            match field_number {
274                1 => {
275                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.monitored_resource)?;
276                },
277                2 => {
278                    ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.metrics)?;
279                },
280                _ => {
281                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
282                },
283            };
284        }
285        ::std::result::Result::Ok(())
286    }
287
288    // Compute sizes of nested messages
289    #[allow(unused_variables)]
290    fn compute_size(&self) -> u32 {
291        let mut my_size = 0;
292        if !self.monitored_resource.is_empty() {
293            my_size += ::protobuf::rt::string_size(1, &self.monitored_resource);
294        }
295        for value in &self.metrics {
296            my_size += ::protobuf::rt::string_size(2, &value);
297        };
298        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
299        self.cached_size.set(my_size);
300        my_size
301    }
302
303    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
304        if !self.monitored_resource.is_empty() {
305            os.write_string(1, &self.monitored_resource)?;
306        }
307        for v in &self.metrics {
308            os.write_string(2, &v)?;
309        };
310        os.write_unknown_fields(self.get_unknown_fields())?;
311        ::std::result::Result::Ok(())
312    }
313
314    fn get_cached_size(&self) -> u32 {
315        self.cached_size.get()
316    }
317
318    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
319        &self.unknown_fields
320    }
321
322    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
323        &mut self.unknown_fields
324    }
325
326    fn as_any(&self) -> &dyn (::std::any::Any) {
327        self as &dyn (::std::any::Any)
328    }
329    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
330        self as &mut dyn (::std::any::Any)
331    }
332    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
333        self
334    }
335
336    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
337        Self::descriptor_static()
338    }
339
340    fn new() -> Billing_BillingDestination {
341        Billing_BillingDestination::new()
342    }
343
344    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
345        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
346        descriptor.get(|| {
347            let mut fields = ::std::vec::Vec::new();
348            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
349                "monitored_resource",
350                |m: &Billing_BillingDestination| { &m.monitored_resource },
351                |m: &mut Billing_BillingDestination| { &mut m.monitored_resource },
352            ));
353            fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
354                "metrics",
355                |m: &Billing_BillingDestination| { &m.metrics },
356                |m: &mut Billing_BillingDestination| { &mut m.metrics },
357            ));
358            ::protobuf::reflect::MessageDescriptor::new_pb_name::<Billing_BillingDestination>(
359                "Billing.BillingDestination",
360                fields,
361                file_descriptor_proto()
362            )
363        })
364    }
365
366    fn default_instance() -> &'static Billing_BillingDestination {
367        static instance: ::protobuf::rt::LazyV2<Billing_BillingDestination> = ::protobuf::rt::LazyV2::INIT;
368        instance.get(Billing_BillingDestination::new)
369    }
370}
371
372impl ::protobuf::Clear for Billing_BillingDestination {
373    fn clear(&mut self) {
374        self.monitored_resource.clear();
375        self.metrics.clear();
376        self.unknown_fields.clear();
377    }
378}
379
380impl ::std::fmt::Debug for Billing_BillingDestination {
381    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
382        ::protobuf::text_format::fmt(self, f)
383    }
384}
385
386impl ::protobuf::reflect::ProtobufValue for Billing_BillingDestination {
387    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
388        ::protobuf::reflect::ReflectValueRef::Message(self)
389    }
390}
391
392static file_descriptor_proto_data: &'static [u8] = b"\
393    \n\x18google/api/billing.proto\x12\ngoogle.api\"\xc5\x01\n\x07Billing\
394    \x12[\n\x15consumer_destinations\x18\x08\x20\x03(\x0b2&.google.api.Billi\
395    ng.BillingDestinationR\x14consumerDestinations\x1a]\n\x12BillingDestinat\
396    ion\x12-\n\x12monitored_resource\x18\x01\x20\x01(\tR\x11monitoredResourc\
397    e\x12\x18\n\x07metrics\x18\x02\x20\x03(\tR\x07metricsBn\n\x0ecom.google.\
398    apiB\x0cBillingProtoP\x01ZEgoogle.golang.org/genproto/googleapis/api/ser\
399    viceconfig;serviceconfig\xa2\x02\x04GAPIJ\xa8\x16\n\x06\x12\x04\x0e\0L\
400    \x01\n\xbc\x04\n\x01\x0c\x12\x03\x0e\0\x122\xb1\x04\x20Copyright\x202023\
401    \x20Google\x20LLC\n\n\x20Licensed\x20under\x20the\x20Apache\x20License,\
402    \x20Version\x202.0\x20(the\x20\"License\");\n\x20you\x20may\x20not\x20us\
403    e\x20this\x20file\x20except\x20in\x20compliance\x20with\x20the\x20Licens\
404    e.\n\x20You\x20may\x20obtain\x20a\x20copy\x20of\x20the\x20License\x20at\
405    \n\n\x20\x20\x20\x20\x20http://www.apache.org/licenses/LICENSE-2.0\n\n\
406    \x20Unless\x20required\x20by\x20applicable\x20law\x20or\x20agreed\x20to\
407    \x20in\x20writing,\x20software\n\x20distributed\x20under\x20the\x20Licen\
408    se\x20is\x20distributed\x20on\x20an\x20\"AS\x20IS\"\x20BASIS,\n\x20WITHO\
409    UT\x20WARRANTIES\x20OR\x20CONDITIONS\x20OF\x20ANY\x20KIND,\x20either\x20\
410    express\x20or\x20implied.\n\x20See\x20the\x20License\x20for\x20the\x20sp\
411    ecific\x20language\x20governing\x20permissions\x20and\n\x20limitations\
412    \x20under\x20the\x20License.\n\n\x08\n\x01\x02\x12\x03\x10\0\x13\n\x08\n\
413    \x01\x08\x12\x03\x12\0\\\n\t\n\x02\x08\x0b\x12\x03\x12\0\\\n\x08\n\x01\
414    \x08\x12\x03\x13\0\"\n\t\n\x02\x08\n\x12\x03\x13\0\"\n\x08\n\x01\x08\x12\
415    \x03\x14\0-\n\t\n\x02\x08\x08\x12\x03\x14\0-\n\x08\n\x01\x08\x12\x03\x15\
416    \0'\n\t\n\x02\x08\x01\x12\x03\x15\0'\n\x08\n\x01\x08\x12\x03\x16\0\"\n\t\
417    \n\x02\x08$\x12\x03\x16\0\"\n\xe7\t\n\x02\x04\0\x12\x048\0L\x01\x1a\xda\
418    \t\x20Billing\x20related\x20configuration\x20of\x20the\x20service.\n\n\
419    \x20The\x20following\x20example\x20shows\x20how\x20to\x20configure\x20mo\
420    nitored\x20resources\x20and\x20metrics\n\x20for\x20billing,\x20`consumer\
421    _destinations`\x20is\x20the\x20only\x20supported\x20destination\x20and\n\
422    \x20the\x20monitored\x20resources\x20need\x20at\x20least\x20one\x20label\
423    \x20key\n\x20`cloud.googleapis.com/location`\x20to\x20indicate\x20the\
424    \x20location\x20of\x20the\x20billing\n\x20usage,\x20using\x20different\
425    \x20monitored\x20resources\x20between\x20monitoring\x20and\x20billing\
426    \x20is\n\x20recommended\x20so\x20they\x20can\x20be\x20evolved\x20indepen\
427    dently:\n\n\n\x20\x20\x20\x20\x20monitored_resources:\n\x20\x20\x20\x20\
428    \x20-\x20type:\x20library.googleapis.com/billing_branch\n\x20\x20\x20\
429    \x20\x20\x20\x20labels:\n\x20\x20\x20\x20\x20\x20\x20-\x20key:\x20cloud.\
430    googleapis.com/location\n\x20\x20\x20\x20\x20\x20\x20\x20\x20description\
431    :\x20|\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Predefined\x20label\
432    \x20to\x20support\x20billing\x20location\x20restriction.\n\x20\x20\x20\
433    \x20\x20\x20\x20-\x20key:\x20city\n\x20\x20\x20\x20\x20\x20\x20\x20\x20d\
434    escription:\x20|\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Custom\x20\
435    label\x20to\x20define\x20the\x20city\x20where\x20the\x20library\x20branc\
436    h\x20is\x20located\n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20in.\n\
437    \x20\x20\x20\x20\x20\x20\x20-\x20key:\x20name\n\x20\x20\x20\x20\x20\x20\
438    \x20\x20\x20description:\x20Custom\x20label\x20to\x20define\x20the\x20na\
439    me\x20of\x20the\x20library\x20branch.\n\x20\x20\x20\x20\x20metrics:\n\
440    \x20\x20\x20\x20\x20-\x20name:\x20library.googleapis.com/book/borrowed_c\
441    ount\n\x20\x20\x20\x20\x20\x20\x20metric_kind:\x20DELTA\n\x20\x20\x20\
442    \x20\x20\x20\x20value_type:\x20INT64\n\x20\x20\x20\x20\x20\x20\x20unit:\
443    \x20\"1\"\n\x20\x20\x20\x20\x20billing:\n\x20\x20\x20\x20\x20\x20\x20con\
444    sumer_destinations:\n\x20\x20\x20\x20\x20\x20\x20-\x20monitored_resource\
445    :\x20library.googleapis.com/billing_branch\n\x20\x20\x20\x20\x20\x20\x20\
446    \x20\x20metrics:\n\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20library.googl\
447    eapis.com/book/borrowed_count\n\n\n\n\x03\x04\0\x01\x12\x038\x08\x0f\nx\
448    \n\x04\x04\0\x03\0\x12\x04;\x02E\x03\x1aj\x20Configuration\x20of\x20a\
449    \x20specific\x20billing\x20destination\x20(Currently\x20only\x20support\
450    \n\x20bill\x20against\x20consumer\x20project).\n\n\x0c\n\x05\x04\0\x03\0\
451    \x01\x12\x03;\n\x1c\n\x9b\x01\n\x06\x04\0\x03\0\x02\0\x12\x03?\x04\"\x1a\
452    \x8b\x01\x20The\x20monitored\x20resource\x20type.\x20The\x20type\x20must\
453    \x20be\x20defined\x20in\n\x20[Service.monitored_resources][google.api.Se\
454    rvice.monitored_resources]\n\x20section.\n\n\x0e\n\x07\x04\0\x03\0\x02\0\
455    \x05\x12\x03?\x04\n\n\x0e\n\x07\x04\0\x03\0\x02\0\x01\x12\x03?\x0b\x1d\n\
456    \x0e\n\x07\x04\0\x03\0\x02\0\x03\x12\x03?\x20!\n\xa3\x01\n\x06\x04\0\x03\
457    \0\x02\x01\x12\x03D\x04\x20\x1a\x93\x01\x20Names\x20of\x20the\x20metrics\
458    \x20to\x20report\x20to\x20this\x20billing\x20destination.\n\x20Each\x20n\
459    ame\x20must\x20be\x20defined\x20in\n\x20[Service.metrics][google.api.Ser\
460    vice.metrics]\x20section.\n\n\x0e\n\x07\x04\0\x03\0\x02\x01\x04\x12\x03D\
461    \x04\x0c\n\x0e\n\x07\x04\0\x03\0\x02\x01\x05\x12\x03D\r\x13\n\x0e\n\x07\
462    \x04\0\x03\0\x02\x01\x01\x12\x03D\x14\x1b\n\x0e\n\x07\x04\0\x03\0\x02\
463    \x01\x03\x12\x03D\x1e\x1f\n\x81\x02\n\x04\x04\0\x02\0\x12\x03K\x028\x1a\
464    \xf3\x01\x20Billing\x20configurations\x20for\x20sending\x20metrics\x20to\
465    \x20the\x20consumer\x20project.\n\x20There\x20can\x20be\x20multiple\x20c\
466    onsumer\x20destinations\x20per\x20service,\x20each\x20one\x20must\x20hav\
467    e\n\x20a\x20different\x20monitored\x20resource\x20type.\x20A\x20metric\
468    \x20can\x20be\x20used\x20in\x20at\x20most\n\x20one\x20consumer\x20destin\
469    ation.\n\n\x0c\n\x05\x04\0\x02\0\x04\x12\x03K\x02\n\n\x0c\n\x05\x04\0\
470    \x02\0\x06\x12\x03K\x0b\x1d\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03K\x1e3\n\
471    \x0c\n\x05\x04\0\x02\0\x03\x12\x03K67b\x06proto3\
472";
473
474static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
475
476fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
477    ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
478}
479
480pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
481    file_descriptor_proto_lazy.get(|| {
482        parse_descriptor_proto()
483    })
484}