google_cloud_rust_raw/api/
control.rs1#![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#[derive(PartialEq,Clone,Default)]
27pub struct Control {
28 pub environment: ::std::string::String,
30 pub method_policies: ::protobuf::RepeatedField<super::policy::MethodPolicy>,
31 pub unknown_fields: ::protobuf::UnknownFields,
33 pub cached_size: ::protobuf::CachedSize,
34}
35
36impl<'a> ::std::default::Default for &'a Control {
37 fn default() -> &'a Control {
38 <Control as ::protobuf::Message>::default_instance()
39 }
40}
41
42impl Control {
43 pub fn new() -> Control {
44 ::std::default::Default::default()
45 }
46
47 pub fn get_environment(&self) -> &str {
51 &self.environment
52 }
53 pub fn clear_environment(&mut self) {
54 self.environment.clear();
55 }
56
57 pub fn set_environment(&mut self, v: ::std::string::String) {
59 self.environment = v;
60 }
61
62 pub fn mut_environment(&mut self) -> &mut ::std::string::String {
65 &mut self.environment
66 }
67
68 pub fn take_environment(&mut self) -> ::std::string::String {
70 ::std::mem::replace(&mut self.environment, ::std::string::String::new())
71 }
72
73 pub fn get_method_policies(&self) -> &[super::policy::MethodPolicy] {
77 &self.method_policies
78 }
79 pub fn clear_method_policies(&mut self) {
80 self.method_policies.clear();
81 }
82
83 pub fn set_method_policies(&mut self, v: ::protobuf::RepeatedField<super::policy::MethodPolicy>) {
85 self.method_policies = v;
86 }
87
88 pub fn mut_method_policies(&mut self) -> &mut ::protobuf::RepeatedField<super::policy::MethodPolicy> {
90 &mut self.method_policies
91 }
92
93 pub fn take_method_policies(&mut self) -> ::protobuf::RepeatedField<super::policy::MethodPolicy> {
95 ::std::mem::replace(&mut self.method_policies, ::protobuf::RepeatedField::new())
96 }
97}
98
99impl ::protobuf::Message for Control {
100 fn is_initialized(&self) -> bool {
101 for v in &self.method_policies {
102 if !v.is_initialized() {
103 return false;
104 }
105 };
106 true
107 }
108
109 fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
110 while !is.eof()? {
111 let (field_number, wire_type) = is.read_tag_unpack()?;
112 match field_number {
113 1 => {
114 ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.environment)?;
115 },
116 4 => {
117 ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.method_policies)?;
118 },
119 _ => {
120 ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
121 },
122 };
123 }
124 ::std::result::Result::Ok(())
125 }
126
127 #[allow(unused_variables)]
129 fn compute_size(&self) -> u32 {
130 let mut my_size = 0;
131 if !self.environment.is_empty() {
132 my_size += ::protobuf::rt::string_size(1, &self.environment);
133 }
134 for value in &self.method_policies {
135 let len = value.compute_size();
136 my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
137 };
138 my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
139 self.cached_size.set(my_size);
140 my_size
141 }
142
143 fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
144 if !self.environment.is_empty() {
145 os.write_string(1, &self.environment)?;
146 }
147 for v in &self.method_policies {
148 os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?;
149 os.write_raw_varint32(v.get_cached_size())?;
150 v.write_to_with_cached_sizes(os)?;
151 };
152 os.write_unknown_fields(self.get_unknown_fields())?;
153 ::std::result::Result::Ok(())
154 }
155
156 fn get_cached_size(&self) -> u32 {
157 self.cached_size.get()
158 }
159
160 fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
161 &self.unknown_fields
162 }
163
164 fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
165 &mut self.unknown_fields
166 }
167
168 fn as_any(&self) -> &dyn (::std::any::Any) {
169 self as &dyn (::std::any::Any)
170 }
171 fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
172 self as &mut dyn (::std::any::Any)
173 }
174 fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
175 self
176 }
177
178 fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
179 Self::descriptor_static()
180 }
181
182 fn new() -> Control {
183 Control::new()
184 }
185
186 fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
187 static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
188 descriptor.get(|| {
189 let mut fields = ::std::vec::Vec::new();
190 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
191 "environment",
192 |m: &Control| { &m.environment },
193 |m: &mut Control| { &mut m.environment },
194 ));
195 fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::policy::MethodPolicy>>(
196 "method_policies",
197 |m: &Control| { &m.method_policies },
198 |m: &mut Control| { &mut m.method_policies },
199 ));
200 ::protobuf::reflect::MessageDescriptor::new_pb_name::<Control>(
201 "Control",
202 fields,
203 file_descriptor_proto()
204 )
205 })
206 }
207
208 fn default_instance() -> &'static Control {
209 static instance: ::protobuf::rt::LazyV2<Control> = ::protobuf::rt::LazyV2::INIT;
210 instance.get(Control::new)
211 }
212}
213
214impl ::protobuf::Clear for Control {
215 fn clear(&mut self) {
216 self.environment.clear();
217 self.method_policies.clear();
218 self.unknown_fields.clear();
219 }
220}
221
222impl ::std::fmt::Debug for Control {
223 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
224 ::protobuf::text_format::fmt(self, f)
225 }
226}
227
228impl ::protobuf::reflect::ProtobufValue for Control {
229 fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
230 ::protobuf::reflect::ReflectValueRef::Message(self)
231 }
232}
233
234static file_descriptor_proto_data: &'static [u8] = b"\
235 \n\x18google/api/control.proto\x12\ngoogle.api\x1a\x17google/api/policy.\
236 proto\"n\n\x07Control\x12\x20\n\x0benvironment\x18\x01\x20\x01(\tR\x0ben\
237 vironment\x12A\n\x0fmethod_policies\x18\x04\x20\x03(\x0b2\x18.google.api\
238 .MethodPolicyR\x0emethodPoliciesBn\n\x0ecom.google.apiB\x0cControlProtoP\
239 \x01ZEgoogle.golang.org/genproto/googleapis/api/serviceconfig;servicecon\
240 fig\xa2\x02\x04GAPIJ\xf5\t\n\x06\x12\x04\x0e\0(\x01\n\xbc\x04\n\x01\x0c\
241 \x12\x03\x0e\0\x122\xb1\x04\x20Copyright\x202023\x20Google\x20LLC\n\n\
242 \x20Licensed\x20under\x20the\x20Apache\x20License,\x20Version\x202.0\x20\
243 (the\x20\"License\");\n\x20you\x20may\x20not\x20use\x20this\x20file\x20e\
244 xcept\x20in\x20compliance\x20with\x20the\x20License.\n\x20You\x20may\x20\
245 obtain\x20a\x20copy\x20of\x20the\x20License\x20at\n\n\x20\x20\x20\x20\
246 \x20http://www.apache.org/licenses/LICENSE-2.0\n\n\x20Unless\x20required\
247 \x20by\x20applicable\x20law\x20or\x20agreed\x20to\x20in\x20writing,\x20s\
248 oftware\n\x20distributed\x20under\x20the\x20License\x20is\x20distributed\
249 \x20on\x20an\x20\"AS\x20IS\"\x20BASIS,\n\x20WITHOUT\x20WARRANTIES\x20OR\
250 \x20CONDITIONS\x20OF\x20ANY\x20KIND,\x20either\x20express\x20or\x20impli\
251 ed.\n\x20See\x20the\x20License\x20for\x20the\x20specific\x20language\x20\
252 governing\x20permissions\x20and\n\x20limitations\x20under\x20the\x20Lice\
253 nse.\n\n\x08\n\x01\x02\x12\x03\x10\0\x13\n\t\n\x02\x03\0\x12\x03\x12\0!\
254 \n\x08\n\x01\x08\x12\x03\x14\0\\\n\t\n\x02\x08\x0b\x12\x03\x14\0\\\n\x08\
255 \n\x01\x08\x12\x03\x15\0\"\n\t\n\x02\x08\n\x12\x03\x15\0\"\n\x08\n\x01\
256 \x08\x12\x03\x16\0-\n\t\n\x02\x08\x08\x12\x03\x16\0-\n\x08\n\x01\x08\x12\
257 \x03\x17\0'\n\t\n\x02\x08\x01\x12\x03\x17\0'\n\x08\n\x01\x08\x12\x03\x18\
258 \0\"\n\t\n\x02\x08$\x12\x03\x18\0\"\n\x9d\x01\n\x02\x04\0\x12\x04\x20\0(\
259 \x01\x1a\x90\x01\x20Selects\x20and\x20configures\x20the\x20service\x20co\
260 ntroller\x20used\x20by\x20the\x20service.\n\n\x20Example:\n\n\x20\x20\
261 \x20\x20\x20control:\n\x20\x20\x20\x20\x20\x20\x20environment:\x20servic\
262 econtrol.googleapis.com\n\n\n\n\x03\x04\0\x01\x12\x03\x20\x08\x0f\n\xd2\
263 \x01\n\x04\x04\0\x02\0\x12\x03$\x02\x19\x1a\xc4\x01\x20The\x20service\
264 \x20controller\x20environment\x20to\x20use.\x20If\x20empty,\x20no\x20con\
265 trol\x20plane\n\x20feature\x20(like\x20quota\x20and\x20billing)\x20will\
266 \x20be\x20enabled.\x20The\x20recommended\x20value\x20for\n\x20most\x20se\
267 rvices\x20is\x20servicecontrol.googleapis.com\n\n\x0c\n\x05\x04\0\x02\0\
268 \x05\x12\x03$\x02\x08\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03$\t\x14\n\x0c\n\
269 \x05\x04\0\x02\0\x03\x12\x03$\x17\x18\nK\n\x04\x04\0\x02\x01\x12\x03'\
270 \x02,\x1a>\x20Defines\x20policies\x20applying\x20to\x20the\x20API\x20met\
271 hods\x20of\x20the\x20service.\n\n\x0c\n\x05\x04\0\x02\x01\x04\x12\x03'\
272 \x02\n\n\x0c\n\x05\x04\0\x02\x01\x06\x12\x03'\x0b\x17\n\x0c\n\x05\x04\0\
273 \x02\x01\x01\x12\x03'\x18'\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03'*+b\x06\
274 proto3\
275";
276
277static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
278
279fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
280 ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
281}
282
283pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
284 file_descriptor_proto_lazy.get(|| {
285 parse_descriptor_proto()
286 })
287}