google_cloud_rust_raw/api/
httpbody.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 HttpBody {
28 pub content_type: ::std::string::String,
30 pub data: ::std::vec::Vec<u8>,
31 pub extensions: ::protobuf::RepeatedField<::protobuf::well_known_types::Any>,
32 pub unknown_fields: ::protobuf::UnknownFields,
34 pub cached_size: ::protobuf::CachedSize,
35}
36
37impl<'a> ::std::default::Default for &'a HttpBody {
38 fn default() -> &'a HttpBody {
39 <HttpBody as ::protobuf::Message>::default_instance()
40 }
41}
42
43impl HttpBody {
44 pub fn new() -> HttpBody {
45 ::std::default::Default::default()
46 }
47
48 pub fn get_content_type(&self) -> &str {
52 &self.content_type
53 }
54 pub fn clear_content_type(&mut self) {
55 self.content_type.clear();
56 }
57
58 pub fn set_content_type(&mut self, v: ::std::string::String) {
60 self.content_type = v;
61 }
62
63 pub fn mut_content_type(&mut self) -> &mut ::std::string::String {
66 &mut self.content_type
67 }
68
69 pub fn take_content_type(&mut self) -> ::std::string::String {
71 ::std::mem::replace(&mut self.content_type, ::std::string::String::new())
72 }
73
74 pub fn get_data(&self) -> &[u8] {
78 &self.data
79 }
80 pub fn clear_data(&mut self) {
81 self.data.clear();
82 }
83
84 pub fn set_data(&mut self, v: ::std::vec::Vec<u8>) {
86 self.data = v;
87 }
88
89 pub fn mut_data(&mut self) -> &mut ::std::vec::Vec<u8> {
92 &mut self.data
93 }
94
95 pub fn take_data(&mut self) -> ::std::vec::Vec<u8> {
97 ::std::mem::replace(&mut self.data, ::std::vec::Vec::new())
98 }
99
100 pub fn get_extensions(&self) -> &[::protobuf::well_known_types::Any] {
104 &self.extensions
105 }
106 pub fn clear_extensions(&mut self) {
107 self.extensions.clear();
108 }
109
110 pub fn set_extensions(&mut self, v: ::protobuf::RepeatedField<::protobuf::well_known_types::Any>) {
112 self.extensions = v;
113 }
114
115 pub fn mut_extensions(&mut self) -> &mut ::protobuf::RepeatedField<::protobuf::well_known_types::Any> {
117 &mut self.extensions
118 }
119
120 pub fn take_extensions(&mut self) -> ::protobuf::RepeatedField<::protobuf::well_known_types::Any> {
122 ::std::mem::replace(&mut self.extensions, ::protobuf::RepeatedField::new())
123 }
124}
125
126impl ::protobuf::Message for HttpBody {
127 fn is_initialized(&self) -> bool {
128 for v in &self.extensions {
129 if !v.is_initialized() {
130 return false;
131 }
132 };
133 true
134 }
135
136 fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
137 while !is.eof()? {
138 let (field_number, wire_type) = is.read_tag_unpack()?;
139 match field_number {
140 1 => {
141 ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.content_type)?;
142 },
143 2 => {
144 ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.data)?;
145 },
146 3 => {
147 ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.extensions)?;
148 },
149 _ => {
150 ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
151 },
152 };
153 }
154 ::std::result::Result::Ok(())
155 }
156
157 #[allow(unused_variables)]
159 fn compute_size(&self) -> u32 {
160 let mut my_size = 0;
161 if !self.content_type.is_empty() {
162 my_size += ::protobuf::rt::string_size(1, &self.content_type);
163 }
164 if !self.data.is_empty() {
165 my_size += ::protobuf::rt::bytes_size(2, &self.data);
166 }
167 for value in &self.extensions {
168 let len = value.compute_size();
169 my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
170 };
171 my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
172 self.cached_size.set(my_size);
173 my_size
174 }
175
176 fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
177 if !self.content_type.is_empty() {
178 os.write_string(1, &self.content_type)?;
179 }
180 if !self.data.is_empty() {
181 os.write_bytes(2, &self.data)?;
182 }
183 for v in &self.extensions {
184 os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?;
185 os.write_raw_varint32(v.get_cached_size())?;
186 v.write_to_with_cached_sizes(os)?;
187 };
188 os.write_unknown_fields(self.get_unknown_fields())?;
189 ::std::result::Result::Ok(())
190 }
191
192 fn get_cached_size(&self) -> u32 {
193 self.cached_size.get()
194 }
195
196 fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
197 &self.unknown_fields
198 }
199
200 fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
201 &mut self.unknown_fields
202 }
203
204 fn as_any(&self) -> &dyn (::std::any::Any) {
205 self as &dyn (::std::any::Any)
206 }
207 fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
208 self as &mut dyn (::std::any::Any)
209 }
210 fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
211 self
212 }
213
214 fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
215 Self::descriptor_static()
216 }
217
218 fn new() -> HttpBody {
219 HttpBody::new()
220 }
221
222 fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
223 static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
224 descriptor.get(|| {
225 let mut fields = ::std::vec::Vec::new();
226 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
227 "content_type",
228 |m: &HttpBody| { &m.content_type },
229 |m: &mut HttpBody| { &mut m.content_type },
230 ));
231 fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
232 "data",
233 |m: &HttpBody| { &m.data },
234 |m: &mut HttpBody| { &mut m.data },
235 ));
236 fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<::protobuf::well_known_types::Any>>(
237 "extensions",
238 |m: &HttpBody| { &m.extensions },
239 |m: &mut HttpBody| { &mut m.extensions },
240 ));
241 ::protobuf::reflect::MessageDescriptor::new_pb_name::<HttpBody>(
242 "HttpBody",
243 fields,
244 file_descriptor_proto()
245 )
246 })
247 }
248
249 fn default_instance() -> &'static HttpBody {
250 static instance: ::protobuf::rt::LazyV2<HttpBody> = ::protobuf::rt::LazyV2::INIT;
251 instance.get(HttpBody::new)
252 }
253}
254
255impl ::protobuf::Clear for HttpBody {
256 fn clear(&mut self) {
257 self.content_type.clear();
258 self.data.clear();
259 self.extensions.clear();
260 self.unknown_fields.clear();
261 }
262}
263
264impl ::std::fmt::Debug for HttpBody {
265 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
266 ::protobuf::text_format::fmt(self, f)
267 }
268}
269
270impl ::protobuf::reflect::ProtobufValue for HttpBody {
271 fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
272 ::protobuf::reflect::ReflectValueRef::Message(self)
273 }
274}
275
276static file_descriptor_proto_data: &'static [u8] = b"\
277 \n\x19google/api/httpbody.proto\x12\ngoogle.api\x1a\x19google/protobuf/a\
278 ny.proto\"w\n\x08HttpBody\x12!\n\x0ccontent_type\x18\x01\x20\x01(\tR\x0b\
279 contentType\x12\x12\n\x04data\x18\x02\x20\x01(\x0cR\x04data\x124\n\nexte\
280 nsions\x18\x03\x20\x03(\x0b2\x14.google.protobuf.AnyR\nextensionsBh\n\
281 \x0ecom.google.apiB\rHttpBodyProtoP\x01Z;google.golang.org/genproto/goog\
282 leapis/api/httpbody;httpbody\xf8\x01\x01\xa2\x02\x04GAPIJ\xb0\x13\n\x06\
283 \x12\x04\x0e\0P\x01\n\xbc\x04\n\x01\x0c\x12\x03\x0e\0\x122\xb1\x04\x20Co\
284 pyright\x202023\x20Google\x20LLC\n\n\x20Licensed\x20under\x20the\x20Apac\
285 he\x20License,\x20Version\x202.0\x20(the\x20\"License\");\n\x20you\x20ma\
286 y\x20not\x20use\x20this\x20file\x20except\x20in\x20compliance\x20with\
287 \x20the\x20License.\n\x20You\x20may\x20obtain\x20a\x20copy\x20of\x20the\
288 \x20License\x20at\n\n\x20\x20\x20\x20\x20http://www.apache.org/licenses/\
289 LICENSE-2.0\n\n\x20Unless\x20required\x20by\x20applicable\x20law\x20or\
290 \x20agreed\x20to\x20in\x20writing,\x20software\n\x20distributed\x20under\
291 \x20the\x20License\x20is\x20distributed\x20on\x20an\x20\"AS\x20IS\"\x20B\
292 ASIS,\n\x20WITHOUT\x20WARRANTIES\x20OR\x20CONDITIONS\x20OF\x20ANY\x20KIN\
293 D,\x20either\x20express\x20or\x20implied.\n\x20See\x20the\x20License\x20\
294 for\x20the\x20specific\x20language\x20governing\x20permissions\x20and\n\
295 \x20limitations\x20under\x20the\x20License.\n\n\x08\n\x01\x02\x12\x03\
296 \x10\0\x13\n\t\n\x02\x03\0\x12\x03\x12\0#\n\x08\n\x01\x08\x12\x03\x14\0\
297 \x1f\n\t\n\x02\x08\x1f\x12\x03\x14\0\x1f\n\x08\n\x01\x08\x12\x03\x15\0R\
298 \n\t\n\x02\x08\x0b\x12\x03\x15\0R\n\x08\n\x01\x08\x12\x03\x16\0\"\n\t\n\
299 \x02\x08\n\x12\x03\x16\0\"\n\x08\n\x01\x08\x12\x03\x17\0.\n\t\n\x02\x08\
300 \x08\x12\x03\x17\0.\n\x08\n\x01\x08\x12\x03\x18\0'\n\t\n\x02\x08\x01\x12\
301 \x03\x18\0'\n\x08\n\x01\x08\x12\x03\x19\0\"\n\t\n\x02\x08$\x12\x03\x19\0\
302 \"\n\xb2\n\n\x02\x04\0\x12\x04F\0P\x01\x1a\xa5\n\x20Message\x20that\x20r\
303 epresents\x20an\x20arbitrary\x20HTTP\x20body.\x20It\x20should\x20only\
304 \x20be\x20used\x20for\n\x20payload\x20formats\x20that\x20can't\x20be\x20\
305 represented\x20as\x20JSON,\x20such\x20as\x20raw\x20binary\x20or\n\x20an\
306 \x20HTML\x20page.\n\n\n\x20This\x20message\x20can\x20be\x20used\x20both\
307 \x20in\x20streaming\x20and\x20non-streaming\x20API\x20methods\x20in\n\
308 \x20the\x20request\x20as\x20well\x20as\x20the\x20response.\n\n\x20It\x20\
309 can\x20be\x20used\x20as\x20a\x20top-level\x20request\x20field,\x20which\
310 \x20is\x20convenient\x20if\x20one\n\x20wants\x20to\x20extract\x20paramet\
311 ers\x20from\x20either\x20the\x20URL\x20or\x20HTTP\x20template\x20into\
312 \x20the\n\x20request\x20fields\x20and\x20also\x20want\x20access\x20to\
313 \x20the\x20raw\x20HTTP\x20body.\n\n\x20Example:\n\n\x20\x20\x20\x20\x20m\
314 essage\x20GetResourceRequest\x20{\n\x20\x20\x20\x20\x20\x20\x20//\x20A\
315 \x20unique\x20request\x20id.\n\x20\x20\x20\x20\x20\x20\x20string\x20requ\
316 est_id\x20=\x201;\n\n\x20\x20\x20\x20\x20\x20\x20//\x20The\x20raw\x20HTT\
317 P\x20body\x20is\x20bound\x20to\x20this\x20field.\n\x20\x20\x20\x20\x20\
318 \x20\x20google.api.HttpBody\x20http_body\x20=\x202;\n\n\x20\x20\x20\x20\
319 \x20}\n\n\x20\x20\x20\x20\x20service\x20ResourceService\x20{\n\x20\x20\
320 \x20\x20\x20\x20\x20rpc\x20GetResource(GetResourceRequest)\n\x20\x20\x20\
321 \x20\x20\x20\x20\x20\x20returns\x20(google.api.HttpBody);\n\x20\x20\x20\
322 \x20\x20\x20\x20rpc\x20UpdateResource(google.api.HttpBody)\n\x20\x20\x20\
323 \x20\x20\x20\x20\x20\x20returns\x20(google.protobuf.Empty);\n\n\x20\x20\
324 \x20\x20\x20}\n\n\x20Example\x20with\x20streaming\x20methods:\n\n\x20\
325 \x20\x20\x20\x20service\x20CaldavService\x20{\n\x20\x20\x20\x20\x20\x20\
326 \x20rpc\x20GetCalendar(stream\x20google.api.HttpBody)\n\x20\x20\x20\x20\
327 \x20\x20\x20\x20\x20returns\x20(stream\x20google.api.HttpBody);\n\x20\
328 \x20\x20\x20\x20\x20\x20rpc\x20UpdateCalendar(stream\x20google.api.HttpB\
329 ody)\n\x20\x20\x20\x20\x20\x20\x20\x20\x20returns\x20(stream\x20google.a\
330 pi.HttpBody);\n\n\x20\x20\x20\x20\x20}\n\n\x20Use\x20of\x20this\x20type\
331 \x20only\x20changes\x20how\x20the\x20request\x20and\x20response\x20bodie\
332 s\x20are\n\x20handled,\x20all\x20other\x20features\x20will\x20continue\
333 \x20to\x20work\x20unchanged.\n\n\n\n\x03\x04\0\x01\x12\x03F\x08\x10\nZ\n\
334 \x04\x04\0\x02\0\x12\x03H\x02\x1a\x1aM\x20The\x20HTTP\x20Content-Type\
335 \x20header\x20value\x20specifying\x20the\x20content\x20type\x20of\x20the\
336 \x20body.\n\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03H\x02\x08\n\x0c\n\x05\x04\
337 \0\x02\0\x01\x12\x03H\t\x15\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03H\x18\x19\
338 \n<\n\x04\x04\0\x02\x01\x12\x03K\x02\x11\x1a/\x20The\x20HTTP\x20request/\
339 response\x20body\x20as\x20raw\x20binary.\n\n\x0c\n\x05\x04\0\x02\x01\x05\
340 \x12\x03K\x02\x07\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03K\x08\x0c\n\x0c\n\
341 \x05\x04\0\x02\x01\x03\x12\x03K\x0f\x10\nm\n\x04\x04\0\x02\x02\x12\x03O\
342 \x02.\x1a`\x20Application\x20specific\x20response\x20metadata.\x20Must\
343 \x20be\x20set\x20in\x20the\x20first\x20response\n\x20for\x20streaming\
344 \x20APIs.\n\n\x0c\n\x05\x04\0\x02\x02\x04\x12\x03O\x02\n\n\x0c\n\x05\x04\
345 \0\x02\x02\x06\x12\x03O\x0b\x1e\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03O\
346 \x1f)\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03O,-b\x06proto3\
347";
348
349static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
350
351fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
352 ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
353}
354
355pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
356 file_descriptor_proto_lazy.get(|| {
357 parse_descriptor_proto()
358 })
359}