1#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate api;
21extern crate async_trait;
22extern crate bytes;
23extern crate gax;
24extern crate gaxi;
25extern crate iam_v1;
26extern crate lazy_static;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37#[derive(Clone, Debug, Default, PartialEq)]
39#[non_exhaustive]
40pub struct OperationMetadata {
41 pub create_time: std::option::Option<wkt::Timestamp>,
43
44 pub end_time: std::option::Option<wkt::Timestamp>,
46
47 pub target: std::string::String,
49
50 pub verb: std::string::String,
52
53 pub status_message: std::string::String,
55
56 pub requested_cancellation: bool,
64
65 pub api_version: std::string::String,
67
68 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
69}
70
71impl OperationMetadata {
72 pub fn new() -> Self {
73 std::default::Default::default()
74 }
75
76 pub fn set_create_time<T>(mut self, v: T) -> Self
78 where
79 T: std::convert::Into<wkt::Timestamp>,
80 {
81 self.create_time = std::option::Option::Some(v.into());
82 self
83 }
84
85 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
87 where
88 T: std::convert::Into<wkt::Timestamp>,
89 {
90 self.create_time = v.map(|x| x.into());
91 self
92 }
93
94 pub fn set_end_time<T>(mut self, v: T) -> Self
96 where
97 T: std::convert::Into<wkt::Timestamp>,
98 {
99 self.end_time = std::option::Option::Some(v.into());
100 self
101 }
102
103 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
105 where
106 T: std::convert::Into<wkt::Timestamp>,
107 {
108 self.end_time = v.map(|x| x.into());
109 self
110 }
111
112 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
114 self.target = v.into();
115 self
116 }
117
118 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
120 self.verb = v.into();
121 self
122 }
123
124 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
126 self.status_message = v.into();
127 self
128 }
129
130 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
132 self.requested_cancellation = v.into();
133 self
134 }
135
136 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
138 self.api_version = v.into();
139 self
140 }
141}
142
143impl wkt::message::Message for OperationMetadata {
144 fn typename() -> &'static str {
145 "type.googleapis.com/google.devtools.cloudbuild.v2.OperationMetadata"
146 }
147}
148
149#[doc(hidden)]
150impl<'de> serde::de::Deserialize<'de> for OperationMetadata {
151 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
152 where
153 D: serde::Deserializer<'de>,
154 {
155 #[allow(non_camel_case_types)]
156 #[doc(hidden)]
157 #[derive(PartialEq, Eq, Hash)]
158 enum __FieldTag {
159 __create_time,
160 __end_time,
161 __target,
162 __verb,
163 __status_message,
164 __requested_cancellation,
165 __api_version,
166 Unknown(std::string::String),
167 }
168 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
169 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
170 where
171 D: serde::Deserializer<'de>,
172 {
173 struct Visitor;
174 impl<'de> serde::de::Visitor<'de> for Visitor {
175 type Value = __FieldTag;
176 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
177 formatter.write_str("a field name for OperationMetadata")
178 }
179 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
180 where
181 E: serde::de::Error,
182 {
183 use std::result::Result::Ok;
184 use std::string::ToString;
185 match value {
186 "createTime" => Ok(__FieldTag::__create_time),
187 "create_time" => Ok(__FieldTag::__create_time),
188 "endTime" => Ok(__FieldTag::__end_time),
189 "end_time" => Ok(__FieldTag::__end_time),
190 "target" => Ok(__FieldTag::__target),
191 "verb" => Ok(__FieldTag::__verb),
192 "statusMessage" => Ok(__FieldTag::__status_message),
193 "status_message" => Ok(__FieldTag::__status_message),
194 "requestedCancellation" => Ok(__FieldTag::__requested_cancellation),
195 "requested_cancellation" => Ok(__FieldTag::__requested_cancellation),
196 "apiVersion" => Ok(__FieldTag::__api_version),
197 "api_version" => Ok(__FieldTag::__api_version),
198 _ => Ok(__FieldTag::Unknown(value.to_string())),
199 }
200 }
201 }
202 deserializer.deserialize_identifier(Visitor)
203 }
204 }
205 struct Visitor;
206 impl<'de> serde::de::Visitor<'de> for Visitor {
207 type Value = OperationMetadata;
208 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
209 formatter.write_str("struct OperationMetadata")
210 }
211 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
212 where
213 A: serde::de::MapAccess<'de>,
214 {
215 #[allow(unused_imports)]
216 use serde::de::Error;
217 use std::option::Option::Some;
218 let mut fields = std::collections::HashSet::new();
219 let mut result = Self::Value::new();
220 while let Some(tag) = map.next_key::<__FieldTag>()? {
221 #[allow(clippy::match_single_binding)]
222 match tag {
223 __FieldTag::__create_time => {
224 if !fields.insert(__FieldTag::__create_time) {
225 return std::result::Result::Err(A::Error::duplicate_field(
226 "multiple values for create_time",
227 ));
228 }
229 result.create_time =
230 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
231 }
232 __FieldTag::__end_time => {
233 if !fields.insert(__FieldTag::__end_time) {
234 return std::result::Result::Err(A::Error::duplicate_field(
235 "multiple values for end_time",
236 ));
237 }
238 result.end_time =
239 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
240 }
241 __FieldTag::__target => {
242 if !fields.insert(__FieldTag::__target) {
243 return std::result::Result::Err(A::Error::duplicate_field(
244 "multiple values for target",
245 ));
246 }
247 result.target = map
248 .next_value::<std::option::Option<std::string::String>>()?
249 .unwrap_or_default();
250 }
251 __FieldTag::__verb => {
252 if !fields.insert(__FieldTag::__verb) {
253 return std::result::Result::Err(A::Error::duplicate_field(
254 "multiple values for verb",
255 ));
256 }
257 result.verb = map
258 .next_value::<std::option::Option<std::string::String>>()?
259 .unwrap_or_default();
260 }
261 __FieldTag::__status_message => {
262 if !fields.insert(__FieldTag::__status_message) {
263 return std::result::Result::Err(A::Error::duplicate_field(
264 "multiple values for status_message",
265 ));
266 }
267 result.status_message = map
268 .next_value::<std::option::Option<std::string::String>>()?
269 .unwrap_or_default();
270 }
271 __FieldTag::__requested_cancellation => {
272 if !fields.insert(__FieldTag::__requested_cancellation) {
273 return std::result::Result::Err(A::Error::duplicate_field(
274 "multiple values for requested_cancellation",
275 ));
276 }
277 result.requested_cancellation = map
278 .next_value::<std::option::Option<bool>>()?
279 .unwrap_or_default();
280 }
281 __FieldTag::__api_version => {
282 if !fields.insert(__FieldTag::__api_version) {
283 return std::result::Result::Err(A::Error::duplicate_field(
284 "multiple values for api_version",
285 ));
286 }
287 result.api_version = map
288 .next_value::<std::option::Option<std::string::String>>()?
289 .unwrap_or_default();
290 }
291 __FieldTag::Unknown(key) => {
292 let value = map.next_value::<serde_json::Value>()?;
293 result._unknown_fields.insert(key, value);
294 }
295 }
296 }
297 std::result::Result::Ok(result)
298 }
299 }
300 deserializer.deserialize_any(Visitor)
301 }
302}
303
304#[doc(hidden)]
305impl serde::ser::Serialize for OperationMetadata {
306 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
307 where
308 S: serde::ser::Serializer,
309 {
310 use serde::ser::SerializeMap;
311 #[allow(unused_imports)]
312 use std::option::Option::Some;
313 let mut state = serializer.serialize_map(std::option::Option::None)?;
314 if self.create_time.is_some() {
315 state.serialize_entry("createTime", &self.create_time)?;
316 }
317 if self.end_time.is_some() {
318 state.serialize_entry("endTime", &self.end_time)?;
319 }
320 if !self.target.is_empty() {
321 state.serialize_entry("target", &self.target)?;
322 }
323 if !self.verb.is_empty() {
324 state.serialize_entry("verb", &self.verb)?;
325 }
326 if !self.status_message.is_empty() {
327 state.serialize_entry("statusMessage", &self.status_message)?;
328 }
329 if !wkt::internal::is_default(&self.requested_cancellation) {
330 state.serialize_entry("requestedCancellation", &self.requested_cancellation)?;
331 }
332 if !self.api_version.is_empty() {
333 state.serialize_entry("apiVersion", &self.api_version)?;
334 }
335 if !self._unknown_fields.is_empty() {
336 for (key, value) in self._unknown_fields.iter() {
337 state.serialize_entry(key, &value)?;
338 }
339 }
340 state.end()
341 }
342}
343
344#[derive(Clone, Debug, Default, PartialEq)]
346#[non_exhaustive]
347pub struct RunWorkflowCustomOperationMetadata {
348 pub create_time: std::option::Option<wkt::Timestamp>,
350
351 pub end_time: std::option::Option<wkt::Timestamp>,
353
354 pub verb: std::string::String,
356
357 pub requested_cancellation: bool,
365
366 pub api_version: std::string::String,
368
369 pub target: std::string::String,
371
372 pub pipeline_run_id: std::string::String,
374
375 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
376}
377
378impl RunWorkflowCustomOperationMetadata {
379 pub fn new() -> Self {
380 std::default::Default::default()
381 }
382
383 pub fn set_create_time<T>(mut self, v: T) -> Self
385 where
386 T: std::convert::Into<wkt::Timestamp>,
387 {
388 self.create_time = std::option::Option::Some(v.into());
389 self
390 }
391
392 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
394 where
395 T: std::convert::Into<wkt::Timestamp>,
396 {
397 self.create_time = v.map(|x| x.into());
398 self
399 }
400
401 pub fn set_end_time<T>(mut self, v: T) -> Self
403 where
404 T: std::convert::Into<wkt::Timestamp>,
405 {
406 self.end_time = std::option::Option::Some(v.into());
407 self
408 }
409
410 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
412 where
413 T: std::convert::Into<wkt::Timestamp>,
414 {
415 self.end_time = v.map(|x| x.into());
416 self
417 }
418
419 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
421 self.verb = v.into();
422 self
423 }
424
425 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
427 self.requested_cancellation = v.into();
428 self
429 }
430
431 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
433 self.api_version = v.into();
434 self
435 }
436
437 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
439 self.target = v.into();
440 self
441 }
442
443 pub fn set_pipeline_run_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
445 self.pipeline_run_id = v.into();
446 self
447 }
448}
449
450impl wkt::message::Message for RunWorkflowCustomOperationMetadata {
451 fn typename() -> &'static str {
452 "type.googleapis.com/google.devtools.cloudbuild.v2.RunWorkflowCustomOperationMetadata"
453 }
454}
455
456#[doc(hidden)]
457impl<'de> serde::de::Deserialize<'de> for RunWorkflowCustomOperationMetadata {
458 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
459 where
460 D: serde::Deserializer<'de>,
461 {
462 #[allow(non_camel_case_types)]
463 #[doc(hidden)]
464 #[derive(PartialEq, Eq, Hash)]
465 enum __FieldTag {
466 __create_time,
467 __end_time,
468 __verb,
469 __requested_cancellation,
470 __api_version,
471 __target,
472 __pipeline_run_id,
473 Unknown(std::string::String),
474 }
475 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
476 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
477 where
478 D: serde::Deserializer<'de>,
479 {
480 struct Visitor;
481 impl<'de> serde::de::Visitor<'de> for Visitor {
482 type Value = __FieldTag;
483 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
484 formatter.write_str("a field name for RunWorkflowCustomOperationMetadata")
485 }
486 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
487 where
488 E: serde::de::Error,
489 {
490 use std::result::Result::Ok;
491 use std::string::ToString;
492 match value {
493 "createTime" => Ok(__FieldTag::__create_time),
494 "create_time" => Ok(__FieldTag::__create_time),
495 "endTime" => Ok(__FieldTag::__end_time),
496 "end_time" => Ok(__FieldTag::__end_time),
497 "verb" => Ok(__FieldTag::__verb),
498 "requestedCancellation" => Ok(__FieldTag::__requested_cancellation),
499 "requested_cancellation" => Ok(__FieldTag::__requested_cancellation),
500 "apiVersion" => Ok(__FieldTag::__api_version),
501 "api_version" => Ok(__FieldTag::__api_version),
502 "target" => Ok(__FieldTag::__target),
503 "pipelineRunId" => Ok(__FieldTag::__pipeline_run_id),
504 "pipeline_run_id" => Ok(__FieldTag::__pipeline_run_id),
505 _ => Ok(__FieldTag::Unknown(value.to_string())),
506 }
507 }
508 }
509 deserializer.deserialize_identifier(Visitor)
510 }
511 }
512 struct Visitor;
513 impl<'de> serde::de::Visitor<'de> for Visitor {
514 type Value = RunWorkflowCustomOperationMetadata;
515 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
516 formatter.write_str("struct RunWorkflowCustomOperationMetadata")
517 }
518 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
519 where
520 A: serde::de::MapAccess<'de>,
521 {
522 #[allow(unused_imports)]
523 use serde::de::Error;
524 use std::option::Option::Some;
525 let mut fields = std::collections::HashSet::new();
526 let mut result = Self::Value::new();
527 while let Some(tag) = map.next_key::<__FieldTag>()? {
528 #[allow(clippy::match_single_binding)]
529 match tag {
530 __FieldTag::__create_time => {
531 if !fields.insert(__FieldTag::__create_time) {
532 return std::result::Result::Err(A::Error::duplicate_field(
533 "multiple values for create_time",
534 ));
535 }
536 result.create_time =
537 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
538 }
539 __FieldTag::__end_time => {
540 if !fields.insert(__FieldTag::__end_time) {
541 return std::result::Result::Err(A::Error::duplicate_field(
542 "multiple values for end_time",
543 ));
544 }
545 result.end_time =
546 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
547 }
548 __FieldTag::__verb => {
549 if !fields.insert(__FieldTag::__verb) {
550 return std::result::Result::Err(A::Error::duplicate_field(
551 "multiple values for verb",
552 ));
553 }
554 result.verb = map
555 .next_value::<std::option::Option<std::string::String>>()?
556 .unwrap_or_default();
557 }
558 __FieldTag::__requested_cancellation => {
559 if !fields.insert(__FieldTag::__requested_cancellation) {
560 return std::result::Result::Err(A::Error::duplicate_field(
561 "multiple values for requested_cancellation",
562 ));
563 }
564 result.requested_cancellation = map
565 .next_value::<std::option::Option<bool>>()?
566 .unwrap_or_default();
567 }
568 __FieldTag::__api_version => {
569 if !fields.insert(__FieldTag::__api_version) {
570 return std::result::Result::Err(A::Error::duplicate_field(
571 "multiple values for api_version",
572 ));
573 }
574 result.api_version = map
575 .next_value::<std::option::Option<std::string::String>>()?
576 .unwrap_or_default();
577 }
578 __FieldTag::__target => {
579 if !fields.insert(__FieldTag::__target) {
580 return std::result::Result::Err(A::Error::duplicate_field(
581 "multiple values for target",
582 ));
583 }
584 result.target = map
585 .next_value::<std::option::Option<std::string::String>>()?
586 .unwrap_or_default();
587 }
588 __FieldTag::__pipeline_run_id => {
589 if !fields.insert(__FieldTag::__pipeline_run_id) {
590 return std::result::Result::Err(A::Error::duplicate_field(
591 "multiple values for pipeline_run_id",
592 ));
593 }
594 result.pipeline_run_id = map
595 .next_value::<std::option::Option<std::string::String>>()?
596 .unwrap_or_default();
597 }
598 __FieldTag::Unknown(key) => {
599 let value = map.next_value::<serde_json::Value>()?;
600 result._unknown_fields.insert(key, value);
601 }
602 }
603 }
604 std::result::Result::Ok(result)
605 }
606 }
607 deserializer.deserialize_any(Visitor)
608 }
609}
610
611#[doc(hidden)]
612impl serde::ser::Serialize for RunWorkflowCustomOperationMetadata {
613 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
614 where
615 S: serde::ser::Serializer,
616 {
617 use serde::ser::SerializeMap;
618 #[allow(unused_imports)]
619 use std::option::Option::Some;
620 let mut state = serializer.serialize_map(std::option::Option::None)?;
621 if self.create_time.is_some() {
622 state.serialize_entry("createTime", &self.create_time)?;
623 }
624 if self.end_time.is_some() {
625 state.serialize_entry("endTime", &self.end_time)?;
626 }
627 if !self.verb.is_empty() {
628 state.serialize_entry("verb", &self.verb)?;
629 }
630 if !wkt::internal::is_default(&self.requested_cancellation) {
631 state.serialize_entry("requestedCancellation", &self.requested_cancellation)?;
632 }
633 if !self.api_version.is_empty() {
634 state.serialize_entry("apiVersion", &self.api_version)?;
635 }
636 if !self.target.is_empty() {
637 state.serialize_entry("target", &self.target)?;
638 }
639 if !self.pipeline_run_id.is_empty() {
640 state.serialize_entry("pipelineRunId", &self.pipeline_run_id)?;
641 }
642 if !self._unknown_fields.is_empty() {
643 for (key, value) in self._unknown_fields.iter() {
644 state.serialize_entry(key, &value)?;
645 }
646 }
647 state.end()
648 }
649}
650
651#[derive(Clone, Debug, Default, PartialEq)]
654#[non_exhaustive]
655pub struct Connection {
656 pub name: std::string::String,
659
660 pub create_time: std::option::Option<wkt::Timestamp>,
662
663 pub update_time: std::option::Option<wkt::Timestamp>,
665
666 pub installation_state: std::option::Option<crate::model::InstallationState>,
668
669 pub disabled: bool,
673
674 pub reconciling: bool,
677
678 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
680
681 pub etag: std::string::String,
685
686 pub connection_config: std::option::Option<crate::model::connection::ConnectionConfig>,
688
689 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
690}
691
692impl Connection {
693 pub fn new() -> Self {
694 std::default::Default::default()
695 }
696
697 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
699 self.name = v.into();
700 self
701 }
702
703 pub fn set_create_time<T>(mut self, v: T) -> Self
705 where
706 T: std::convert::Into<wkt::Timestamp>,
707 {
708 self.create_time = std::option::Option::Some(v.into());
709 self
710 }
711
712 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
714 where
715 T: std::convert::Into<wkt::Timestamp>,
716 {
717 self.create_time = v.map(|x| x.into());
718 self
719 }
720
721 pub fn set_update_time<T>(mut self, v: T) -> Self
723 where
724 T: std::convert::Into<wkt::Timestamp>,
725 {
726 self.update_time = std::option::Option::Some(v.into());
727 self
728 }
729
730 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
732 where
733 T: std::convert::Into<wkt::Timestamp>,
734 {
735 self.update_time = v.map(|x| x.into());
736 self
737 }
738
739 pub fn set_installation_state<T>(mut self, v: T) -> Self
741 where
742 T: std::convert::Into<crate::model::InstallationState>,
743 {
744 self.installation_state = std::option::Option::Some(v.into());
745 self
746 }
747
748 pub fn set_or_clear_installation_state<T>(mut self, v: std::option::Option<T>) -> Self
750 where
751 T: std::convert::Into<crate::model::InstallationState>,
752 {
753 self.installation_state = v.map(|x| x.into());
754 self
755 }
756
757 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
759 self.disabled = v.into();
760 self
761 }
762
763 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
765 self.reconciling = v.into();
766 self
767 }
768
769 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
771 where
772 T: std::iter::IntoIterator<Item = (K, V)>,
773 K: std::convert::Into<std::string::String>,
774 V: std::convert::Into<std::string::String>,
775 {
776 use std::iter::Iterator;
777 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
778 self
779 }
780
781 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
783 self.etag = v.into();
784 self
785 }
786
787 pub fn set_connection_config<
792 T: std::convert::Into<std::option::Option<crate::model::connection::ConnectionConfig>>,
793 >(
794 mut self,
795 v: T,
796 ) -> Self {
797 self.connection_config = v.into();
798 self
799 }
800
801 pub fn github_config(
805 &self,
806 ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubConfig>> {
807 #[allow(unreachable_patterns)]
808 self.connection_config.as_ref().and_then(|v| match v {
809 crate::model::connection::ConnectionConfig::GithubConfig(v) => {
810 std::option::Option::Some(v)
811 }
812 _ => std::option::Option::None,
813 })
814 }
815
816 pub fn set_github_config<T: std::convert::Into<std::boxed::Box<crate::model::GitHubConfig>>>(
822 mut self,
823 v: T,
824 ) -> Self {
825 self.connection_config = std::option::Option::Some(
826 crate::model::connection::ConnectionConfig::GithubConfig(v.into()),
827 );
828 self
829 }
830
831 pub fn github_enterprise_config(
835 &self,
836 ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubEnterpriseConfig>> {
837 #[allow(unreachable_patterns)]
838 self.connection_config.as_ref().and_then(|v| match v {
839 crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v) => {
840 std::option::Option::Some(v)
841 }
842 _ => std::option::Option::None,
843 })
844 }
845
846 pub fn set_github_enterprise_config<
852 T: std::convert::Into<std::boxed::Box<crate::model::GitHubEnterpriseConfig>>,
853 >(
854 mut self,
855 v: T,
856 ) -> Self {
857 self.connection_config = std::option::Option::Some(
858 crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v.into()),
859 );
860 self
861 }
862
863 pub fn gitlab_config(
867 &self,
868 ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabConfig>> {
869 #[allow(unreachable_patterns)]
870 self.connection_config.as_ref().and_then(|v| match v {
871 crate::model::connection::ConnectionConfig::GitlabConfig(v) => {
872 std::option::Option::Some(v)
873 }
874 _ => std::option::Option::None,
875 })
876 }
877
878 pub fn set_gitlab_config<T: std::convert::Into<std::boxed::Box<crate::model::GitLabConfig>>>(
884 mut self,
885 v: T,
886 ) -> Self {
887 self.connection_config = std::option::Option::Some(
888 crate::model::connection::ConnectionConfig::GitlabConfig(v.into()),
889 );
890 self
891 }
892
893 pub fn bitbucket_data_center_config(
897 &self,
898 ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketDataCenterConfig>> {
899 #[allow(unreachable_patterns)]
900 self.connection_config.as_ref().and_then(|v| match v {
901 crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v) => {
902 std::option::Option::Some(v)
903 }
904 _ => std::option::Option::None,
905 })
906 }
907
908 pub fn set_bitbucket_data_center_config<
914 T: std::convert::Into<std::boxed::Box<crate::model::BitbucketDataCenterConfig>>,
915 >(
916 mut self,
917 v: T,
918 ) -> Self {
919 self.connection_config = std::option::Option::Some(
920 crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v.into()),
921 );
922 self
923 }
924
925 pub fn bitbucket_cloud_config(
929 &self,
930 ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketCloudConfig>> {
931 #[allow(unreachable_patterns)]
932 self.connection_config.as_ref().and_then(|v| match v {
933 crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v) => {
934 std::option::Option::Some(v)
935 }
936 _ => std::option::Option::None,
937 })
938 }
939
940 pub fn set_bitbucket_cloud_config<
946 T: std::convert::Into<std::boxed::Box<crate::model::BitbucketCloudConfig>>,
947 >(
948 mut self,
949 v: T,
950 ) -> Self {
951 self.connection_config = std::option::Option::Some(
952 crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v.into()),
953 );
954 self
955 }
956}
957
958impl wkt::message::Message for Connection {
959 fn typename() -> &'static str {
960 "type.googleapis.com/google.devtools.cloudbuild.v2.Connection"
961 }
962}
963
964#[doc(hidden)]
965impl<'de> serde::de::Deserialize<'de> for Connection {
966 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
967 where
968 D: serde::Deserializer<'de>,
969 {
970 #[allow(non_camel_case_types)]
971 #[doc(hidden)]
972 #[derive(PartialEq, Eq, Hash)]
973 enum __FieldTag {
974 __name,
975 __create_time,
976 __update_time,
977 __github_config,
978 __github_enterprise_config,
979 __gitlab_config,
980 __bitbucket_data_center_config,
981 __bitbucket_cloud_config,
982 __installation_state,
983 __disabled,
984 __reconciling,
985 __annotations,
986 __etag,
987 Unknown(std::string::String),
988 }
989 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
990 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
991 where
992 D: serde::Deserializer<'de>,
993 {
994 struct Visitor;
995 impl<'de> serde::de::Visitor<'de> for Visitor {
996 type Value = __FieldTag;
997 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
998 formatter.write_str("a field name for Connection")
999 }
1000 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1001 where
1002 E: serde::de::Error,
1003 {
1004 use std::result::Result::Ok;
1005 use std::string::ToString;
1006 match value {
1007 "name" => Ok(__FieldTag::__name),
1008 "createTime" => Ok(__FieldTag::__create_time),
1009 "create_time" => Ok(__FieldTag::__create_time),
1010 "updateTime" => Ok(__FieldTag::__update_time),
1011 "update_time" => Ok(__FieldTag::__update_time),
1012 "githubConfig" => Ok(__FieldTag::__github_config),
1013 "github_config" => Ok(__FieldTag::__github_config),
1014 "githubEnterpriseConfig" => Ok(__FieldTag::__github_enterprise_config),
1015 "github_enterprise_config" => {
1016 Ok(__FieldTag::__github_enterprise_config)
1017 }
1018 "gitlabConfig" => Ok(__FieldTag::__gitlab_config),
1019 "gitlab_config" => Ok(__FieldTag::__gitlab_config),
1020 "bitbucketDataCenterConfig" => {
1021 Ok(__FieldTag::__bitbucket_data_center_config)
1022 }
1023 "bitbucket_data_center_config" => {
1024 Ok(__FieldTag::__bitbucket_data_center_config)
1025 }
1026 "bitbucketCloudConfig" => Ok(__FieldTag::__bitbucket_cloud_config),
1027 "bitbucket_cloud_config" => Ok(__FieldTag::__bitbucket_cloud_config),
1028 "installationState" => Ok(__FieldTag::__installation_state),
1029 "installation_state" => Ok(__FieldTag::__installation_state),
1030 "disabled" => Ok(__FieldTag::__disabled),
1031 "reconciling" => Ok(__FieldTag::__reconciling),
1032 "annotations" => Ok(__FieldTag::__annotations),
1033 "etag" => Ok(__FieldTag::__etag),
1034 _ => Ok(__FieldTag::Unknown(value.to_string())),
1035 }
1036 }
1037 }
1038 deserializer.deserialize_identifier(Visitor)
1039 }
1040 }
1041 struct Visitor;
1042 impl<'de> serde::de::Visitor<'de> for Visitor {
1043 type Value = Connection;
1044 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1045 formatter.write_str("struct Connection")
1046 }
1047 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1048 where
1049 A: serde::de::MapAccess<'de>,
1050 {
1051 #[allow(unused_imports)]
1052 use serde::de::Error;
1053 use std::option::Option::Some;
1054 let mut fields = std::collections::HashSet::new();
1055 let mut result = Self::Value::new();
1056 while let Some(tag) = map.next_key::<__FieldTag>()? {
1057 #[allow(clippy::match_single_binding)]
1058 match tag {
1059 __FieldTag::__name => {
1060 if !fields.insert(__FieldTag::__name) {
1061 return std::result::Result::Err(A::Error::duplicate_field(
1062 "multiple values for name",
1063 ));
1064 }
1065 result.name = map
1066 .next_value::<std::option::Option<std::string::String>>()?
1067 .unwrap_or_default();
1068 }
1069 __FieldTag::__create_time => {
1070 if !fields.insert(__FieldTag::__create_time) {
1071 return std::result::Result::Err(A::Error::duplicate_field(
1072 "multiple values for create_time",
1073 ));
1074 }
1075 result.create_time =
1076 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
1077 }
1078 __FieldTag::__update_time => {
1079 if !fields.insert(__FieldTag::__update_time) {
1080 return std::result::Result::Err(A::Error::duplicate_field(
1081 "multiple values for update_time",
1082 ));
1083 }
1084 result.update_time =
1085 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
1086 }
1087 __FieldTag::__github_config => {
1088 if !fields.insert(__FieldTag::__github_config) {
1089 return std::result::Result::Err(A::Error::duplicate_field(
1090 "multiple values for github_config",
1091 ));
1092 }
1093 if result.connection_config.is_some() {
1094 return std::result::Result::Err(A::Error::duplicate_field(
1095 "multiple values for `connection_config`, a oneof with full ID .google.devtools.cloudbuild.v2.Connection.github_config, latest field was githubConfig",
1096 ));
1097 }
1098 result.connection_config = std::option::Option::Some(
1099 crate::model::connection::ConnectionConfig::GithubConfig(
1100 map.next_value::<std::option::Option<
1101 std::boxed::Box<crate::model::GitHubConfig>,
1102 >>()?
1103 .unwrap_or_default(),
1104 ),
1105 );
1106 }
1107 __FieldTag::__github_enterprise_config => {
1108 if !fields.insert(__FieldTag::__github_enterprise_config) {
1109 return std::result::Result::Err(A::Error::duplicate_field(
1110 "multiple values for github_enterprise_config",
1111 ));
1112 }
1113 if result.connection_config.is_some() {
1114 return std::result::Result::Err(A::Error::duplicate_field(
1115 "multiple values for `connection_config`, a oneof with full ID .google.devtools.cloudbuild.v2.Connection.github_enterprise_config, latest field was githubEnterpriseConfig",
1116 ));
1117 }
1118 result.connection_config = std::option::Option::Some(
1119 crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(
1120 map.next_value::<std::option::Option<
1121 std::boxed::Box<crate::model::GitHubEnterpriseConfig>,
1122 >>()?
1123 .unwrap_or_default(),
1124 ),
1125 );
1126 }
1127 __FieldTag::__gitlab_config => {
1128 if !fields.insert(__FieldTag::__gitlab_config) {
1129 return std::result::Result::Err(A::Error::duplicate_field(
1130 "multiple values for gitlab_config",
1131 ));
1132 }
1133 if result.connection_config.is_some() {
1134 return std::result::Result::Err(A::Error::duplicate_field(
1135 "multiple values for `connection_config`, a oneof with full ID .google.devtools.cloudbuild.v2.Connection.gitlab_config, latest field was gitlabConfig",
1136 ));
1137 }
1138 result.connection_config = std::option::Option::Some(
1139 crate::model::connection::ConnectionConfig::GitlabConfig(
1140 map.next_value::<std::option::Option<
1141 std::boxed::Box<crate::model::GitLabConfig>,
1142 >>()?
1143 .unwrap_or_default(),
1144 ),
1145 );
1146 }
1147 __FieldTag::__bitbucket_data_center_config => {
1148 if !fields.insert(__FieldTag::__bitbucket_data_center_config) {
1149 return std::result::Result::Err(A::Error::duplicate_field(
1150 "multiple values for bitbucket_data_center_config",
1151 ));
1152 }
1153 if result.connection_config.is_some() {
1154 return std::result::Result::Err(A::Error::duplicate_field(
1155 "multiple values for `connection_config`, a oneof with full ID .google.devtools.cloudbuild.v2.Connection.bitbucket_data_center_config, latest field was bitbucketDataCenterConfig",
1156 ));
1157 }
1158 result.connection_config = std::option::Option::Some(
1159 crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(
1160 map.next_value::<std::option::Option<std::boxed::Box<crate::model::BitbucketDataCenterConfig>>>()?.unwrap_or_default()
1161 ),
1162 );
1163 }
1164 __FieldTag::__bitbucket_cloud_config => {
1165 if !fields.insert(__FieldTag::__bitbucket_cloud_config) {
1166 return std::result::Result::Err(A::Error::duplicate_field(
1167 "multiple values for bitbucket_cloud_config",
1168 ));
1169 }
1170 if result.connection_config.is_some() {
1171 return std::result::Result::Err(A::Error::duplicate_field(
1172 "multiple values for `connection_config`, a oneof with full ID .google.devtools.cloudbuild.v2.Connection.bitbucket_cloud_config, latest field was bitbucketCloudConfig",
1173 ));
1174 }
1175 result.connection_config = std::option::Option::Some(
1176 crate::model::connection::ConnectionConfig::BitbucketCloudConfig(
1177 map.next_value::<std::option::Option<
1178 std::boxed::Box<crate::model::BitbucketCloudConfig>,
1179 >>()?
1180 .unwrap_or_default(),
1181 ),
1182 );
1183 }
1184 __FieldTag::__installation_state => {
1185 if !fields.insert(__FieldTag::__installation_state) {
1186 return std::result::Result::Err(A::Error::duplicate_field(
1187 "multiple values for installation_state",
1188 ));
1189 }
1190 result.installation_state = map
1191 .next_value::<std::option::Option<crate::model::InstallationState>>(
1192 )?;
1193 }
1194 __FieldTag::__disabled => {
1195 if !fields.insert(__FieldTag::__disabled) {
1196 return std::result::Result::Err(A::Error::duplicate_field(
1197 "multiple values for disabled",
1198 ));
1199 }
1200 result.disabled = map
1201 .next_value::<std::option::Option<bool>>()?
1202 .unwrap_or_default();
1203 }
1204 __FieldTag::__reconciling => {
1205 if !fields.insert(__FieldTag::__reconciling) {
1206 return std::result::Result::Err(A::Error::duplicate_field(
1207 "multiple values for reconciling",
1208 ));
1209 }
1210 result.reconciling = map
1211 .next_value::<std::option::Option<bool>>()?
1212 .unwrap_or_default();
1213 }
1214 __FieldTag::__annotations => {
1215 if !fields.insert(__FieldTag::__annotations) {
1216 return std::result::Result::Err(A::Error::duplicate_field(
1217 "multiple values for annotations",
1218 ));
1219 }
1220 result.annotations = map
1221 .next_value::<std::option::Option<
1222 std::collections::HashMap<
1223 std::string::String,
1224 std::string::String,
1225 >,
1226 >>()?
1227 .unwrap_or_default();
1228 }
1229 __FieldTag::__etag => {
1230 if !fields.insert(__FieldTag::__etag) {
1231 return std::result::Result::Err(A::Error::duplicate_field(
1232 "multiple values for etag",
1233 ));
1234 }
1235 result.etag = map
1236 .next_value::<std::option::Option<std::string::String>>()?
1237 .unwrap_or_default();
1238 }
1239 __FieldTag::Unknown(key) => {
1240 let value = map.next_value::<serde_json::Value>()?;
1241 result._unknown_fields.insert(key, value);
1242 }
1243 }
1244 }
1245 std::result::Result::Ok(result)
1246 }
1247 }
1248 deserializer.deserialize_any(Visitor)
1249 }
1250}
1251
1252#[doc(hidden)]
1253impl serde::ser::Serialize for Connection {
1254 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1255 where
1256 S: serde::ser::Serializer,
1257 {
1258 use serde::ser::SerializeMap;
1259 #[allow(unused_imports)]
1260 use std::option::Option::Some;
1261 let mut state = serializer.serialize_map(std::option::Option::None)?;
1262 if !self.name.is_empty() {
1263 state.serialize_entry("name", &self.name)?;
1264 }
1265 if self.create_time.is_some() {
1266 state.serialize_entry("createTime", &self.create_time)?;
1267 }
1268 if self.update_time.is_some() {
1269 state.serialize_entry("updateTime", &self.update_time)?;
1270 }
1271 if let Some(value) = self.github_config() {
1272 state.serialize_entry("githubConfig", value)?;
1273 }
1274 if let Some(value) = self.github_enterprise_config() {
1275 state.serialize_entry("githubEnterpriseConfig", value)?;
1276 }
1277 if let Some(value) = self.gitlab_config() {
1278 state.serialize_entry("gitlabConfig", value)?;
1279 }
1280 if let Some(value) = self.bitbucket_data_center_config() {
1281 state.serialize_entry("bitbucketDataCenterConfig", value)?;
1282 }
1283 if let Some(value) = self.bitbucket_cloud_config() {
1284 state.serialize_entry("bitbucketCloudConfig", value)?;
1285 }
1286 if self.installation_state.is_some() {
1287 state.serialize_entry("installationState", &self.installation_state)?;
1288 }
1289 if !wkt::internal::is_default(&self.disabled) {
1290 state.serialize_entry("disabled", &self.disabled)?;
1291 }
1292 if !wkt::internal::is_default(&self.reconciling) {
1293 state.serialize_entry("reconciling", &self.reconciling)?;
1294 }
1295 if !self.annotations.is_empty() {
1296 state.serialize_entry("annotations", &self.annotations)?;
1297 }
1298 if !self.etag.is_empty() {
1299 state.serialize_entry("etag", &self.etag)?;
1300 }
1301 if !self._unknown_fields.is_empty() {
1302 for (key, value) in self._unknown_fields.iter() {
1303 state.serialize_entry(key, &value)?;
1304 }
1305 }
1306 state.end()
1307 }
1308}
1309
1310pub mod connection {
1312 #[allow(unused_imports)]
1313 use super::*;
1314
1315 #[derive(Clone, Debug, PartialEq)]
1317 #[non_exhaustive]
1318 pub enum ConnectionConfig {
1319 GithubConfig(std::boxed::Box<crate::model::GitHubConfig>),
1321 GithubEnterpriseConfig(std::boxed::Box<crate::model::GitHubEnterpriseConfig>),
1323 GitlabConfig(std::boxed::Box<crate::model::GitLabConfig>),
1326 BitbucketDataCenterConfig(std::boxed::Box<crate::model::BitbucketDataCenterConfig>),
1328 BitbucketCloudConfig(std::boxed::Box<crate::model::BitbucketCloudConfig>),
1330 }
1331}
1332
1333#[derive(Clone, Debug, Default, PartialEq)]
1337#[non_exhaustive]
1338pub struct InstallationState {
1339 pub stage: crate::model::installation_state::Stage,
1341
1342 pub message: std::string::String,
1345
1346 pub action_uri: std::string::String,
1349
1350 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1351}
1352
1353impl InstallationState {
1354 pub fn new() -> Self {
1355 std::default::Default::default()
1356 }
1357
1358 pub fn set_stage<T: std::convert::Into<crate::model::installation_state::Stage>>(
1360 mut self,
1361 v: T,
1362 ) -> Self {
1363 self.stage = v.into();
1364 self
1365 }
1366
1367 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1369 self.message = v.into();
1370 self
1371 }
1372
1373 pub fn set_action_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1375 self.action_uri = v.into();
1376 self
1377 }
1378}
1379
1380impl wkt::message::Message for InstallationState {
1381 fn typename() -> &'static str {
1382 "type.googleapis.com/google.devtools.cloudbuild.v2.InstallationState"
1383 }
1384}
1385
1386#[doc(hidden)]
1387impl<'de> serde::de::Deserialize<'de> for InstallationState {
1388 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1389 where
1390 D: serde::Deserializer<'de>,
1391 {
1392 #[allow(non_camel_case_types)]
1393 #[doc(hidden)]
1394 #[derive(PartialEq, Eq, Hash)]
1395 enum __FieldTag {
1396 __stage,
1397 __message,
1398 __action_uri,
1399 Unknown(std::string::String),
1400 }
1401 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1402 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1403 where
1404 D: serde::Deserializer<'de>,
1405 {
1406 struct Visitor;
1407 impl<'de> serde::de::Visitor<'de> for Visitor {
1408 type Value = __FieldTag;
1409 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1410 formatter.write_str("a field name for InstallationState")
1411 }
1412 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1413 where
1414 E: serde::de::Error,
1415 {
1416 use std::result::Result::Ok;
1417 use std::string::ToString;
1418 match value {
1419 "stage" => Ok(__FieldTag::__stage),
1420 "message" => Ok(__FieldTag::__message),
1421 "actionUri" => Ok(__FieldTag::__action_uri),
1422 "action_uri" => Ok(__FieldTag::__action_uri),
1423 _ => Ok(__FieldTag::Unknown(value.to_string())),
1424 }
1425 }
1426 }
1427 deserializer.deserialize_identifier(Visitor)
1428 }
1429 }
1430 struct Visitor;
1431 impl<'de> serde::de::Visitor<'de> for Visitor {
1432 type Value = InstallationState;
1433 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1434 formatter.write_str("struct InstallationState")
1435 }
1436 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1437 where
1438 A: serde::de::MapAccess<'de>,
1439 {
1440 #[allow(unused_imports)]
1441 use serde::de::Error;
1442 use std::option::Option::Some;
1443 let mut fields = std::collections::HashSet::new();
1444 let mut result = Self::Value::new();
1445 while let Some(tag) = map.next_key::<__FieldTag>()? {
1446 #[allow(clippy::match_single_binding)]
1447 match tag {
1448 __FieldTag::__stage => {
1449 if !fields.insert(__FieldTag::__stage) {
1450 return std::result::Result::Err(A::Error::duplicate_field(
1451 "multiple values for stage",
1452 ));
1453 }
1454 result.stage = map.next_value::<std::option::Option<crate::model::installation_state::Stage>>()?.unwrap_or_default();
1455 }
1456 __FieldTag::__message => {
1457 if !fields.insert(__FieldTag::__message) {
1458 return std::result::Result::Err(A::Error::duplicate_field(
1459 "multiple values for message",
1460 ));
1461 }
1462 result.message = map
1463 .next_value::<std::option::Option<std::string::String>>()?
1464 .unwrap_or_default();
1465 }
1466 __FieldTag::__action_uri => {
1467 if !fields.insert(__FieldTag::__action_uri) {
1468 return std::result::Result::Err(A::Error::duplicate_field(
1469 "multiple values for action_uri",
1470 ));
1471 }
1472 result.action_uri = map
1473 .next_value::<std::option::Option<std::string::String>>()?
1474 .unwrap_or_default();
1475 }
1476 __FieldTag::Unknown(key) => {
1477 let value = map.next_value::<serde_json::Value>()?;
1478 result._unknown_fields.insert(key, value);
1479 }
1480 }
1481 }
1482 std::result::Result::Ok(result)
1483 }
1484 }
1485 deserializer.deserialize_any(Visitor)
1486 }
1487}
1488
1489#[doc(hidden)]
1490impl serde::ser::Serialize for InstallationState {
1491 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1492 where
1493 S: serde::ser::Serializer,
1494 {
1495 use serde::ser::SerializeMap;
1496 #[allow(unused_imports)]
1497 use std::option::Option::Some;
1498 let mut state = serializer.serialize_map(std::option::Option::None)?;
1499 if !wkt::internal::is_default(&self.stage) {
1500 state.serialize_entry("stage", &self.stage)?;
1501 }
1502 if !self.message.is_empty() {
1503 state.serialize_entry("message", &self.message)?;
1504 }
1505 if !self.action_uri.is_empty() {
1506 state.serialize_entry("actionUri", &self.action_uri)?;
1507 }
1508 if !self._unknown_fields.is_empty() {
1509 for (key, value) in self._unknown_fields.iter() {
1510 state.serialize_entry(key, &value)?;
1511 }
1512 }
1513 state.end()
1514 }
1515}
1516
1517pub mod installation_state {
1519 #[allow(unused_imports)]
1520 use super::*;
1521
1522 #[derive(Clone, Debug, PartialEq)]
1538 #[non_exhaustive]
1539 pub enum Stage {
1540 Unspecified,
1542 PendingCreateApp,
1545 PendingUserOauth,
1547 PendingInstallApp,
1549 Complete,
1551 UnknownValue(stage::UnknownValue),
1556 }
1557
1558 #[doc(hidden)]
1559 pub mod stage {
1560 #[allow(unused_imports)]
1561 use super::*;
1562 #[derive(Clone, Debug, PartialEq)]
1563 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1564 }
1565
1566 impl Stage {
1567 pub fn value(&self) -> std::option::Option<i32> {
1572 match self {
1573 Self::Unspecified => std::option::Option::Some(0),
1574 Self::PendingCreateApp => std::option::Option::Some(1),
1575 Self::PendingUserOauth => std::option::Option::Some(2),
1576 Self::PendingInstallApp => std::option::Option::Some(3),
1577 Self::Complete => std::option::Option::Some(10),
1578 Self::UnknownValue(u) => u.0.value(),
1579 }
1580 }
1581
1582 pub fn name(&self) -> std::option::Option<&str> {
1587 match self {
1588 Self::Unspecified => std::option::Option::Some("STAGE_UNSPECIFIED"),
1589 Self::PendingCreateApp => std::option::Option::Some("PENDING_CREATE_APP"),
1590 Self::PendingUserOauth => std::option::Option::Some("PENDING_USER_OAUTH"),
1591 Self::PendingInstallApp => std::option::Option::Some("PENDING_INSTALL_APP"),
1592 Self::Complete => std::option::Option::Some("COMPLETE"),
1593 Self::UnknownValue(u) => u.0.name(),
1594 }
1595 }
1596 }
1597
1598 impl std::default::Default for Stage {
1599 fn default() -> Self {
1600 use std::convert::From;
1601 Self::from(0)
1602 }
1603 }
1604
1605 impl std::fmt::Display for Stage {
1606 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1607 wkt::internal::display_enum(f, self.name(), self.value())
1608 }
1609 }
1610
1611 impl std::convert::From<i32> for Stage {
1612 fn from(value: i32) -> Self {
1613 match value {
1614 0 => Self::Unspecified,
1615 1 => Self::PendingCreateApp,
1616 2 => Self::PendingUserOauth,
1617 3 => Self::PendingInstallApp,
1618 10 => Self::Complete,
1619 _ => Self::UnknownValue(stage::UnknownValue(
1620 wkt::internal::UnknownEnumValue::Integer(value),
1621 )),
1622 }
1623 }
1624 }
1625
1626 impl std::convert::From<&str> for Stage {
1627 fn from(value: &str) -> Self {
1628 use std::string::ToString;
1629 match value {
1630 "STAGE_UNSPECIFIED" => Self::Unspecified,
1631 "PENDING_CREATE_APP" => Self::PendingCreateApp,
1632 "PENDING_USER_OAUTH" => Self::PendingUserOauth,
1633 "PENDING_INSTALL_APP" => Self::PendingInstallApp,
1634 "COMPLETE" => Self::Complete,
1635 _ => Self::UnknownValue(stage::UnknownValue(
1636 wkt::internal::UnknownEnumValue::String(value.to_string()),
1637 )),
1638 }
1639 }
1640 }
1641
1642 impl serde::ser::Serialize for Stage {
1643 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1644 where
1645 S: serde::Serializer,
1646 {
1647 match self {
1648 Self::Unspecified => serializer.serialize_i32(0),
1649 Self::PendingCreateApp => serializer.serialize_i32(1),
1650 Self::PendingUserOauth => serializer.serialize_i32(2),
1651 Self::PendingInstallApp => serializer.serialize_i32(3),
1652 Self::Complete => serializer.serialize_i32(10),
1653 Self::UnknownValue(u) => u.0.serialize(serializer),
1654 }
1655 }
1656 }
1657
1658 impl<'de> serde::de::Deserialize<'de> for Stage {
1659 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1660 where
1661 D: serde::Deserializer<'de>,
1662 {
1663 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Stage>::new(
1664 ".google.devtools.cloudbuild.v2.InstallationState.Stage",
1665 ))
1666 }
1667 }
1668}
1669
1670#[derive(Clone, Debug, Default, PartialEq)]
1672#[non_exhaustive]
1673pub struct FetchLinkableRepositoriesRequest {
1674 pub connection: std::string::String,
1677
1678 pub page_size: i32,
1680
1681 pub page_token: std::string::String,
1683
1684 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1685}
1686
1687impl FetchLinkableRepositoriesRequest {
1688 pub fn new() -> Self {
1689 std::default::Default::default()
1690 }
1691
1692 pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1694 self.connection = v.into();
1695 self
1696 }
1697
1698 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1700 self.page_size = v.into();
1701 self
1702 }
1703
1704 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1706 self.page_token = v.into();
1707 self
1708 }
1709}
1710
1711impl wkt::message::Message for FetchLinkableRepositoriesRequest {
1712 fn typename() -> &'static str {
1713 "type.googleapis.com/google.devtools.cloudbuild.v2.FetchLinkableRepositoriesRequest"
1714 }
1715}
1716
1717#[doc(hidden)]
1718impl<'de> serde::de::Deserialize<'de> for FetchLinkableRepositoriesRequest {
1719 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1720 where
1721 D: serde::Deserializer<'de>,
1722 {
1723 #[allow(non_camel_case_types)]
1724 #[doc(hidden)]
1725 #[derive(PartialEq, Eq, Hash)]
1726 enum __FieldTag {
1727 __connection,
1728 __page_size,
1729 __page_token,
1730 Unknown(std::string::String),
1731 }
1732 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1733 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1734 where
1735 D: serde::Deserializer<'de>,
1736 {
1737 struct Visitor;
1738 impl<'de> serde::de::Visitor<'de> for Visitor {
1739 type Value = __FieldTag;
1740 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1741 formatter.write_str("a field name for FetchLinkableRepositoriesRequest")
1742 }
1743 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1744 where
1745 E: serde::de::Error,
1746 {
1747 use std::result::Result::Ok;
1748 use std::string::ToString;
1749 match value {
1750 "connection" => Ok(__FieldTag::__connection),
1751 "pageSize" => Ok(__FieldTag::__page_size),
1752 "page_size" => Ok(__FieldTag::__page_size),
1753 "pageToken" => Ok(__FieldTag::__page_token),
1754 "page_token" => Ok(__FieldTag::__page_token),
1755 _ => Ok(__FieldTag::Unknown(value.to_string())),
1756 }
1757 }
1758 }
1759 deserializer.deserialize_identifier(Visitor)
1760 }
1761 }
1762 struct Visitor;
1763 impl<'de> serde::de::Visitor<'de> for Visitor {
1764 type Value = FetchLinkableRepositoriesRequest;
1765 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1766 formatter.write_str("struct FetchLinkableRepositoriesRequest")
1767 }
1768 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1769 where
1770 A: serde::de::MapAccess<'de>,
1771 {
1772 #[allow(unused_imports)]
1773 use serde::de::Error;
1774 use std::option::Option::Some;
1775 let mut fields = std::collections::HashSet::new();
1776 let mut result = Self::Value::new();
1777 while let Some(tag) = map.next_key::<__FieldTag>()? {
1778 #[allow(clippy::match_single_binding)]
1779 match tag {
1780 __FieldTag::__connection => {
1781 if !fields.insert(__FieldTag::__connection) {
1782 return std::result::Result::Err(A::Error::duplicate_field(
1783 "multiple values for connection",
1784 ));
1785 }
1786 result.connection = map
1787 .next_value::<std::option::Option<std::string::String>>()?
1788 .unwrap_or_default();
1789 }
1790 __FieldTag::__page_size => {
1791 if !fields.insert(__FieldTag::__page_size) {
1792 return std::result::Result::Err(A::Error::duplicate_field(
1793 "multiple values for page_size",
1794 ));
1795 }
1796 struct __With(std::option::Option<i32>);
1797 impl<'de> serde::de::Deserialize<'de> for __With {
1798 fn deserialize<D>(
1799 deserializer: D,
1800 ) -> std::result::Result<Self, D::Error>
1801 where
1802 D: serde::de::Deserializer<'de>,
1803 {
1804 serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
1805 }
1806 }
1807 result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
1808 }
1809 __FieldTag::__page_token => {
1810 if !fields.insert(__FieldTag::__page_token) {
1811 return std::result::Result::Err(A::Error::duplicate_field(
1812 "multiple values for page_token",
1813 ));
1814 }
1815 result.page_token = map
1816 .next_value::<std::option::Option<std::string::String>>()?
1817 .unwrap_or_default();
1818 }
1819 __FieldTag::Unknown(key) => {
1820 let value = map.next_value::<serde_json::Value>()?;
1821 result._unknown_fields.insert(key, value);
1822 }
1823 }
1824 }
1825 std::result::Result::Ok(result)
1826 }
1827 }
1828 deserializer.deserialize_any(Visitor)
1829 }
1830}
1831
1832#[doc(hidden)]
1833impl serde::ser::Serialize for FetchLinkableRepositoriesRequest {
1834 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1835 where
1836 S: serde::ser::Serializer,
1837 {
1838 use serde::ser::SerializeMap;
1839 #[allow(unused_imports)]
1840 use std::option::Option::Some;
1841 let mut state = serializer.serialize_map(std::option::Option::None)?;
1842 if !self.connection.is_empty() {
1843 state.serialize_entry("connection", &self.connection)?;
1844 }
1845 if !wkt::internal::is_default(&self.page_size) {
1846 struct __With<'a>(&'a i32);
1847 impl<'a> serde::ser::Serialize for __With<'a> {
1848 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1849 where
1850 S: serde::ser::Serializer,
1851 {
1852 serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
1853 }
1854 }
1855 state.serialize_entry("pageSize", &__With(&self.page_size))?;
1856 }
1857 if !self.page_token.is_empty() {
1858 state.serialize_entry("pageToken", &self.page_token)?;
1859 }
1860 if !self._unknown_fields.is_empty() {
1861 for (key, value) in self._unknown_fields.iter() {
1862 state.serialize_entry(key, &value)?;
1863 }
1864 }
1865 state.end()
1866 }
1867}
1868
1869#[derive(Clone, Debug, Default, PartialEq)]
1871#[non_exhaustive]
1872pub struct FetchLinkableRepositoriesResponse {
1873 pub repositories: std::vec::Vec<crate::model::Repository>,
1875
1876 pub next_page_token: std::string::String,
1878
1879 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1880}
1881
1882impl FetchLinkableRepositoriesResponse {
1883 pub fn new() -> Self {
1884 std::default::Default::default()
1885 }
1886
1887 pub fn set_repositories<T, V>(mut self, v: T) -> Self
1889 where
1890 T: std::iter::IntoIterator<Item = V>,
1891 V: std::convert::Into<crate::model::Repository>,
1892 {
1893 use std::iter::Iterator;
1894 self.repositories = v.into_iter().map(|i| i.into()).collect();
1895 self
1896 }
1897
1898 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1900 self.next_page_token = v.into();
1901 self
1902 }
1903}
1904
1905impl wkt::message::Message for FetchLinkableRepositoriesResponse {
1906 fn typename() -> &'static str {
1907 "type.googleapis.com/google.devtools.cloudbuild.v2.FetchLinkableRepositoriesResponse"
1908 }
1909}
1910
1911#[doc(hidden)]
1912impl gax::paginator::internal::PageableResponse for FetchLinkableRepositoriesResponse {
1913 type PageItem = crate::model::Repository;
1914
1915 fn items(self) -> std::vec::Vec<Self::PageItem> {
1916 self.repositories
1917 }
1918
1919 fn next_page_token(&self) -> std::string::String {
1920 use std::clone::Clone;
1921 self.next_page_token.clone()
1922 }
1923}
1924
1925#[doc(hidden)]
1926impl<'de> serde::de::Deserialize<'de> for FetchLinkableRepositoriesResponse {
1927 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1928 where
1929 D: serde::Deserializer<'de>,
1930 {
1931 #[allow(non_camel_case_types)]
1932 #[doc(hidden)]
1933 #[derive(PartialEq, Eq, Hash)]
1934 enum __FieldTag {
1935 __repositories,
1936 __next_page_token,
1937 Unknown(std::string::String),
1938 }
1939 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1940 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1941 where
1942 D: serde::Deserializer<'de>,
1943 {
1944 struct Visitor;
1945 impl<'de> serde::de::Visitor<'de> for Visitor {
1946 type Value = __FieldTag;
1947 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1948 formatter.write_str("a field name for FetchLinkableRepositoriesResponse")
1949 }
1950 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1951 where
1952 E: serde::de::Error,
1953 {
1954 use std::result::Result::Ok;
1955 use std::string::ToString;
1956 match value {
1957 "repositories" => Ok(__FieldTag::__repositories),
1958 "nextPageToken" => Ok(__FieldTag::__next_page_token),
1959 "next_page_token" => Ok(__FieldTag::__next_page_token),
1960 _ => Ok(__FieldTag::Unknown(value.to_string())),
1961 }
1962 }
1963 }
1964 deserializer.deserialize_identifier(Visitor)
1965 }
1966 }
1967 struct Visitor;
1968 impl<'de> serde::de::Visitor<'de> for Visitor {
1969 type Value = FetchLinkableRepositoriesResponse;
1970 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1971 formatter.write_str("struct FetchLinkableRepositoriesResponse")
1972 }
1973 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1974 where
1975 A: serde::de::MapAccess<'de>,
1976 {
1977 #[allow(unused_imports)]
1978 use serde::de::Error;
1979 use std::option::Option::Some;
1980 let mut fields = std::collections::HashSet::new();
1981 let mut result = Self::Value::new();
1982 while let Some(tag) = map.next_key::<__FieldTag>()? {
1983 #[allow(clippy::match_single_binding)]
1984 match tag {
1985 __FieldTag::__repositories => {
1986 if !fields.insert(__FieldTag::__repositories) {
1987 return std::result::Result::Err(A::Error::duplicate_field(
1988 "multiple values for repositories",
1989 ));
1990 }
1991 result.repositories = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Repository>>>()?.unwrap_or_default();
1992 }
1993 __FieldTag::__next_page_token => {
1994 if !fields.insert(__FieldTag::__next_page_token) {
1995 return std::result::Result::Err(A::Error::duplicate_field(
1996 "multiple values for next_page_token",
1997 ));
1998 }
1999 result.next_page_token = map
2000 .next_value::<std::option::Option<std::string::String>>()?
2001 .unwrap_or_default();
2002 }
2003 __FieldTag::Unknown(key) => {
2004 let value = map.next_value::<serde_json::Value>()?;
2005 result._unknown_fields.insert(key, value);
2006 }
2007 }
2008 }
2009 std::result::Result::Ok(result)
2010 }
2011 }
2012 deserializer.deserialize_any(Visitor)
2013 }
2014}
2015
2016#[doc(hidden)]
2017impl serde::ser::Serialize for FetchLinkableRepositoriesResponse {
2018 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2019 where
2020 S: serde::ser::Serializer,
2021 {
2022 use serde::ser::SerializeMap;
2023 #[allow(unused_imports)]
2024 use std::option::Option::Some;
2025 let mut state = serializer.serialize_map(std::option::Option::None)?;
2026 if !self.repositories.is_empty() {
2027 state.serialize_entry("repositories", &self.repositories)?;
2028 }
2029 if !self.next_page_token.is_empty() {
2030 state.serialize_entry("nextPageToken", &self.next_page_token)?;
2031 }
2032 if !self._unknown_fields.is_empty() {
2033 for (key, value) in self._unknown_fields.iter() {
2034 state.serialize_entry(key, &value)?;
2035 }
2036 }
2037 state.end()
2038 }
2039}
2040
2041#[derive(Clone, Debug, Default, PartialEq)]
2043#[non_exhaustive]
2044pub struct GitHubConfig {
2045 pub authorizer_credential: std::option::Option<crate::model::OAuthCredential>,
2049
2050 pub app_installation_id: i64,
2052
2053 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2054}
2055
2056impl GitHubConfig {
2057 pub fn new() -> Self {
2058 std::default::Default::default()
2059 }
2060
2061 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2063 where
2064 T: std::convert::Into<crate::model::OAuthCredential>,
2065 {
2066 self.authorizer_credential = std::option::Option::Some(v.into());
2067 self
2068 }
2069
2070 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2072 where
2073 T: std::convert::Into<crate::model::OAuthCredential>,
2074 {
2075 self.authorizer_credential = v.map(|x| x.into());
2076 self
2077 }
2078
2079 pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2081 self.app_installation_id = v.into();
2082 self
2083 }
2084}
2085
2086impl wkt::message::Message for GitHubConfig {
2087 fn typename() -> &'static str {
2088 "type.googleapis.com/google.devtools.cloudbuild.v2.GitHubConfig"
2089 }
2090}
2091
2092#[doc(hidden)]
2093impl<'de> serde::de::Deserialize<'de> for GitHubConfig {
2094 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2095 where
2096 D: serde::Deserializer<'de>,
2097 {
2098 #[allow(non_camel_case_types)]
2099 #[doc(hidden)]
2100 #[derive(PartialEq, Eq, Hash)]
2101 enum __FieldTag {
2102 __authorizer_credential,
2103 __app_installation_id,
2104 Unknown(std::string::String),
2105 }
2106 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2107 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2108 where
2109 D: serde::Deserializer<'de>,
2110 {
2111 struct Visitor;
2112 impl<'de> serde::de::Visitor<'de> for Visitor {
2113 type Value = __FieldTag;
2114 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2115 formatter.write_str("a field name for GitHubConfig")
2116 }
2117 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2118 where
2119 E: serde::de::Error,
2120 {
2121 use std::result::Result::Ok;
2122 use std::string::ToString;
2123 match value {
2124 "authorizerCredential" => Ok(__FieldTag::__authorizer_credential),
2125 "authorizer_credential" => Ok(__FieldTag::__authorizer_credential),
2126 "appInstallationId" => Ok(__FieldTag::__app_installation_id),
2127 "app_installation_id" => Ok(__FieldTag::__app_installation_id),
2128 _ => Ok(__FieldTag::Unknown(value.to_string())),
2129 }
2130 }
2131 }
2132 deserializer.deserialize_identifier(Visitor)
2133 }
2134 }
2135 struct Visitor;
2136 impl<'de> serde::de::Visitor<'de> for Visitor {
2137 type Value = GitHubConfig;
2138 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2139 formatter.write_str("struct GitHubConfig")
2140 }
2141 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2142 where
2143 A: serde::de::MapAccess<'de>,
2144 {
2145 #[allow(unused_imports)]
2146 use serde::de::Error;
2147 use std::option::Option::Some;
2148 let mut fields = std::collections::HashSet::new();
2149 let mut result = Self::Value::new();
2150 while let Some(tag) = map.next_key::<__FieldTag>()? {
2151 #[allow(clippy::match_single_binding)]
2152 match tag {
2153 __FieldTag::__authorizer_credential => {
2154 if !fields.insert(__FieldTag::__authorizer_credential) {
2155 return std::result::Result::Err(A::Error::duplicate_field(
2156 "multiple values for authorizer_credential",
2157 ));
2158 }
2159 result.authorizer_credential = map
2160 .next_value::<std::option::Option<crate::model::OAuthCredential>>(
2161 )?;
2162 }
2163 __FieldTag::__app_installation_id => {
2164 if !fields.insert(__FieldTag::__app_installation_id) {
2165 return std::result::Result::Err(A::Error::duplicate_field(
2166 "multiple values for app_installation_id",
2167 ));
2168 }
2169 struct __With(std::option::Option<i64>);
2170 impl<'de> serde::de::Deserialize<'de> for __With {
2171 fn deserialize<D>(
2172 deserializer: D,
2173 ) -> std::result::Result<Self, D::Error>
2174 where
2175 D: serde::de::Deserializer<'de>,
2176 {
2177 serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
2178 }
2179 }
2180 result.app_installation_id =
2181 map.next_value::<__With>()?.0.unwrap_or_default();
2182 }
2183 __FieldTag::Unknown(key) => {
2184 let value = map.next_value::<serde_json::Value>()?;
2185 result._unknown_fields.insert(key, value);
2186 }
2187 }
2188 }
2189 std::result::Result::Ok(result)
2190 }
2191 }
2192 deserializer.deserialize_any(Visitor)
2193 }
2194}
2195
2196#[doc(hidden)]
2197impl serde::ser::Serialize for GitHubConfig {
2198 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2199 where
2200 S: serde::ser::Serializer,
2201 {
2202 use serde::ser::SerializeMap;
2203 #[allow(unused_imports)]
2204 use std::option::Option::Some;
2205 let mut state = serializer.serialize_map(std::option::Option::None)?;
2206 if self.authorizer_credential.is_some() {
2207 state.serialize_entry("authorizerCredential", &self.authorizer_credential)?;
2208 }
2209 if !wkt::internal::is_default(&self.app_installation_id) {
2210 struct __With<'a>(&'a i64);
2211 impl<'a> serde::ser::Serialize for __With<'a> {
2212 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2213 where
2214 S: serde::ser::Serializer,
2215 {
2216 serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
2217 }
2218 }
2219 state.serialize_entry("appInstallationId", &__With(&self.app_installation_id))?;
2220 }
2221 if !self._unknown_fields.is_empty() {
2222 for (key, value) in self._unknown_fields.iter() {
2223 state.serialize_entry(key, &value)?;
2224 }
2225 }
2226 state.end()
2227 }
2228}
2229
2230#[derive(Clone, Debug, Default, PartialEq)]
2232#[non_exhaustive]
2233pub struct GitHubEnterpriseConfig {
2234 pub host_uri: std::string::String,
2236
2237 pub api_key: std::string::String,
2239
2240 pub app_id: i64,
2242
2243 pub app_slug: std::string::String,
2245
2246 pub private_key_secret_version: std::string::String,
2249
2250 pub webhook_secret_secret_version: std::string::String,
2253
2254 pub app_installation_id: i64,
2256
2257 pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
2263
2264 pub ssl_ca: std::string::String,
2266
2267 pub server_version: std::string::String,
2269
2270 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2271}
2272
2273impl GitHubEnterpriseConfig {
2274 pub fn new() -> Self {
2275 std::default::Default::default()
2276 }
2277
2278 pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2280 self.host_uri = v.into();
2281 self
2282 }
2283
2284 pub fn set_api_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2286 self.api_key = v.into();
2287 self
2288 }
2289
2290 pub fn set_app_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2292 self.app_id = v.into();
2293 self
2294 }
2295
2296 pub fn set_app_slug<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2298 self.app_slug = v.into();
2299 self
2300 }
2301
2302 pub fn set_private_key_secret_version<T: std::convert::Into<std::string::String>>(
2304 mut self,
2305 v: T,
2306 ) -> Self {
2307 self.private_key_secret_version = v.into();
2308 self
2309 }
2310
2311 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2313 mut self,
2314 v: T,
2315 ) -> Self {
2316 self.webhook_secret_secret_version = v.into();
2317 self
2318 }
2319
2320 pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2322 self.app_installation_id = v.into();
2323 self
2324 }
2325
2326 pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2328 where
2329 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2330 {
2331 self.service_directory_config = std::option::Option::Some(v.into());
2332 self
2333 }
2334
2335 pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2337 where
2338 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2339 {
2340 self.service_directory_config = v.map(|x| x.into());
2341 self
2342 }
2343
2344 pub fn set_ssl_ca<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2346 self.ssl_ca = v.into();
2347 self
2348 }
2349
2350 pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2352 self.server_version = v.into();
2353 self
2354 }
2355}
2356
2357impl wkt::message::Message for GitHubEnterpriseConfig {
2358 fn typename() -> &'static str {
2359 "type.googleapis.com/google.devtools.cloudbuild.v2.GitHubEnterpriseConfig"
2360 }
2361}
2362
2363#[doc(hidden)]
2364impl<'de> serde::de::Deserialize<'de> for GitHubEnterpriseConfig {
2365 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2366 where
2367 D: serde::Deserializer<'de>,
2368 {
2369 #[allow(non_camel_case_types)]
2370 #[doc(hidden)]
2371 #[derive(PartialEq, Eq, Hash)]
2372 enum __FieldTag {
2373 __host_uri,
2374 __api_key,
2375 __app_id,
2376 __app_slug,
2377 __private_key_secret_version,
2378 __webhook_secret_secret_version,
2379 __app_installation_id,
2380 __service_directory_config,
2381 __ssl_ca,
2382 __server_version,
2383 Unknown(std::string::String),
2384 }
2385 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2386 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2387 where
2388 D: serde::Deserializer<'de>,
2389 {
2390 struct Visitor;
2391 impl<'de> serde::de::Visitor<'de> for Visitor {
2392 type Value = __FieldTag;
2393 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2394 formatter.write_str("a field name for GitHubEnterpriseConfig")
2395 }
2396 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2397 where
2398 E: serde::de::Error,
2399 {
2400 use std::result::Result::Ok;
2401 use std::string::ToString;
2402 match value {
2403 "hostUri" => Ok(__FieldTag::__host_uri),
2404 "host_uri" => Ok(__FieldTag::__host_uri),
2405 "apiKey" => Ok(__FieldTag::__api_key),
2406 "api_key" => Ok(__FieldTag::__api_key),
2407 "appId" => Ok(__FieldTag::__app_id),
2408 "app_id" => Ok(__FieldTag::__app_id),
2409 "appSlug" => Ok(__FieldTag::__app_slug),
2410 "app_slug" => Ok(__FieldTag::__app_slug),
2411 "privateKeySecretVersion" => {
2412 Ok(__FieldTag::__private_key_secret_version)
2413 }
2414 "private_key_secret_version" => {
2415 Ok(__FieldTag::__private_key_secret_version)
2416 }
2417 "webhookSecretSecretVersion" => {
2418 Ok(__FieldTag::__webhook_secret_secret_version)
2419 }
2420 "webhook_secret_secret_version" => {
2421 Ok(__FieldTag::__webhook_secret_secret_version)
2422 }
2423 "appInstallationId" => Ok(__FieldTag::__app_installation_id),
2424 "app_installation_id" => Ok(__FieldTag::__app_installation_id),
2425 "serviceDirectoryConfig" => Ok(__FieldTag::__service_directory_config),
2426 "service_directory_config" => {
2427 Ok(__FieldTag::__service_directory_config)
2428 }
2429 "sslCa" => Ok(__FieldTag::__ssl_ca),
2430 "ssl_ca" => Ok(__FieldTag::__ssl_ca),
2431 "serverVersion" => Ok(__FieldTag::__server_version),
2432 "server_version" => Ok(__FieldTag::__server_version),
2433 _ => Ok(__FieldTag::Unknown(value.to_string())),
2434 }
2435 }
2436 }
2437 deserializer.deserialize_identifier(Visitor)
2438 }
2439 }
2440 struct Visitor;
2441 impl<'de> serde::de::Visitor<'de> for Visitor {
2442 type Value = GitHubEnterpriseConfig;
2443 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2444 formatter.write_str("struct GitHubEnterpriseConfig")
2445 }
2446 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2447 where
2448 A: serde::de::MapAccess<'de>,
2449 {
2450 #[allow(unused_imports)]
2451 use serde::de::Error;
2452 use std::option::Option::Some;
2453 let mut fields = std::collections::HashSet::new();
2454 let mut result = Self::Value::new();
2455 while let Some(tag) = map.next_key::<__FieldTag>()? {
2456 #[allow(clippy::match_single_binding)]
2457 match tag {
2458 __FieldTag::__host_uri => {
2459 if !fields.insert(__FieldTag::__host_uri) {
2460 return std::result::Result::Err(A::Error::duplicate_field(
2461 "multiple values for host_uri",
2462 ));
2463 }
2464 result.host_uri = map
2465 .next_value::<std::option::Option<std::string::String>>()?
2466 .unwrap_or_default();
2467 }
2468 __FieldTag::__api_key => {
2469 if !fields.insert(__FieldTag::__api_key) {
2470 return std::result::Result::Err(A::Error::duplicate_field(
2471 "multiple values for api_key",
2472 ));
2473 }
2474 result.api_key = map
2475 .next_value::<std::option::Option<std::string::String>>()?
2476 .unwrap_or_default();
2477 }
2478 __FieldTag::__app_id => {
2479 if !fields.insert(__FieldTag::__app_id) {
2480 return std::result::Result::Err(A::Error::duplicate_field(
2481 "multiple values for app_id",
2482 ));
2483 }
2484 struct __With(std::option::Option<i64>);
2485 impl<'de> serde::de::Deserialize<'de> for __With {
2486 fn deserialize<D>(
2487 deserializer: D,
2488 ) -> std::result::Result<Self, D::Error>
2489 where
2490 D: serde::de::Deserializer<'de>,
2491 {
2492 serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
2493 }
2494 }
2495 result.app_id = map.next_value::<__With>()?.0.unwrap_or_default();
2496 }
2497 __FieldTag::__app_slug => {
2498 if !fields.insert(__FieldTag::__app_slug) {
2499 return std::result::Result::Err(A::Error::duplicate_field(
2500 "multiple values for app_slug",
2501 ));
2502 }
2503 result.app_slug = map
2504 .next_value::<std::option::Option<std::string::String>>()?
2505 .unwrap_or_default();
2506 }
2507 __FieldTag::__private_key_secret_version => {
2508 if !fields.insert(__FieldTag::__private_key_secret_version) {
2509 return std::result::Result::Err(A::Error::duplicate_field(
2510 "multiple values for private_key_secret_version",
2511 ));
2512 }
2513 result.private_key_secret_version = map
2514 .next_value::<std::option::Option<std::string::String>>()?
2515 .unwrap_or_default();
2516 }
2517 __FieldTag::__webhook_secret_secret_version => {
2518 if !fields.insert(__FieldTag::__webhook_secret_secret_version) {
2519 return std::result::Result::Err(A::Error::duplicate_field(
2520 "multiple values for webhook_secret_secret_version",
2521 ));
2522 }
2523 result.webhook_secret_secret_version = map
2524 .next_value::<std::option::Option<std::string::String>>()?
2525 .unwrap_or_default();
2526 }
2527 __FieldTag::__app_installation_id => {
2528 if !fields.insert(__FieldTag::__app_installation_id) {
2529 return std::result::Result::Err(A::Error::duplicate_field(
2530 "multiple values for app_installation_id",
2531 ));
2532 }
2533 struct __With(std::option::Option<i64>);
2534 impl<'de> serde::de::Deserialize<'de> for __With {
2535 fn deserialize<D>(
2536 deserializer: D,
2537 ) -> std::result::Result<Self, D::Error>
2538 where
2539 D: serde::de::Deserializer<'de>,
2540 {
2541 serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
2542 }
2543 }
2544 result.app_installation_id =
2545 map.next_value::<__With>()?.0.unwrap_or_default();
2546 }
2547 __FieldTag::__service_directory_config => {
2548 if !fields.insert(__FieldTag::__service_directory_config) {
2549 return std::result::Result::Err(A::Error::duplicate_field(
2550 "multiple values for service_directory_config",
2551 ));
2552 }
2553 result.service_directory_config = map.next_value::<std::option::Option<crate::model::ServiceDirectoryConfig>>()?
2554 ;
2555 }
2556 __FieldTag::__ssl_ca => {
2557 if !fields.insert(__FieldTag::__ssl_ca) {
2558 return std::result::Result::Err(A::Error::duplicate_field(
2559 "multiple values for ssl_ca",
2560 ));
2561 }
2562 result.ssl_ca = map
2563 .next_value::<std::option::Option<std::string::String>>()?
2564 .unwrap_or_default();
2565 }
2566 __FieldTag::__server_version => {
2567 if !fields.insert(__FieldTag::__server_version) {
2568 return std::result::Result::Err(A::Error::duplicate_field(
2569 "multiple values for server_version",
2570 ));
2571 }
2572 result.server_version = map
2573 .next_value::<std::option::Option<std::string::String>>()?
2574 .unwrap_or_default();
2575 }
2576 __FieldTag::Unknown(key) => {
2577 let value = map.next_value::<serde_json::Value>()?;
2578 result._unknown_fields.insert(key, value);
2579 }
2580 }
2581 }
2582 std::result::Result::Ok(result)
2583 }
2584 }
2585 deserializer.deserialize_any(Visitor)
2586 }
2587}
2588
2589#[doc(hidden)]
2590impl serde::ser::Serialize for GitHubEnterpriseConfig {
2591 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2592 where
2593 S: serde::ser::Serializer,
2594 {
2595 use serde::ser::SerializeMap;
2596 #[allow(unused_imports)]
2597 use std::option::Option::Some;
2598 let mut state = serializer.serialize_map(std::option::Option::None)?;
2599 if !self.host_uri.is_empty() {
2600 state.serialize_entry("hostUri", &self.host_uri)?;
2601 }
2602 if !self.api_key.is_empty() {
2603 state.serialize_entry("apiKey", &self.api_key)?;
2604 }
2605 if !wkt::internal::is_default(&self.app_id) {
2606 struct __With<'a>(&'a i64);
2607 impl<'a> serde::ser::Serialize for __With<'a> {
2608 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2609 where
2610 S: serde::ser::Serializer,
2611 {
2612 serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
2613 }
2614 }
2615 state.serialize_entry("appId", &__With(&self.app_id))?;
2616 }
2617 if !self.app_slug.is_empty() {
2618 state.serialize_entry("appSlug", &self.app_slug)?;
2619 }
2620 if !self.private_key_secret_version.is_empty() {
2621 state.serialize_entry("privateKeySecretVersion", &self.private_key_secret_version)?;
2622 }
2623 if !self.webhook_secret_secret_version.is_empty() {
2624 state.serialize_entry(
2625 "webhookSecretSecretVersion",
2626 &self.webhook_secret_secret_version,
2627 )?;
2628 }
2629 if !wkt::internal::is_default(&self.app_installation_id) {
2630 struct __With<'a>(&'a i64);
2631 impl<'a> serde::ser::Serialize for __With<'a> {
2632 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2633 where
2634 S: serde::ser::Serializer,
2635 {
2636 serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
2637 }
2638 }
2639 state.serialize_entry("appInstallationId", &__With(&self.app_installation_id))?;
2640 }
2641 if self.service_directory_config.is_some() {
2642 state.serialize_entry("serviceDirectoryConfig", &self.service_directory_config)?;
2643 }
2644 if !self.ssl_ca.is_empty() {
2645 state.serialize_entry("sslCa", &self.ssl_ca)?;
2646 }
2647 if !self.server_version.is_empty() {
2648 state.serialize_entry("serverVersion", &self.server_version)?;
2649 }
2650 if !self._unknown_fields.is_empty() {
2651 for (key, value) in self._unknown_fields.iter() {
2652 state.serialize_entry(key, &value)?;
2653 }
2654 }
2655 state.end()
2656 }
2657}
2658
2659#[derive(Clone, Debug, Default, PartialEq)]
2662#[non_exhaustive]
2663pub struct GitLabConfig {
2664 pub host_uri: std::string::String,
2667
2668 pub webhook_secret_secret_version: std::string::String,
2672
2673 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
2676
2677 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
2679
2680 pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
2686
2687 pub ssl_ca: std::string::String,
2689
2690 pub server_version: std::string::String,
2693
2694 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2695}
2696
2697impl GitLabConfig {
2698 pub fn new() -> Self {
2699 std::default::Default::default()
2700 }
2701
2702 pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2704 self.host_uri = v.into();
2705 self
2706 }
2707
2708 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2710 mut self,
2711 v: T,
2712 ) -> Self {
2713 self.webhook_secret_secret_version = v.into();
2714 self
2715 }
2716
2717 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
2719 where
2720 T: std::convert::Into<crate::model::UserCredential>,
2721 {
2722 self.read_authorizer_credential = std::option::Option::Some(v.into());
2723 self
2724 }
2725
2726 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2728 where
2729 T: std::convert::Into<crate::model::UserCredential>,
2730 {
2731 self.read_authorizer_credential = v.map(|x| x.into());
2732 self
2733 }
2734
2735 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2737 where
2738 T: std::convert::Into<crate::model::UserCredential>,
2739 {
2740 self.authorizer_credential = std::option::Option::Some(v.into());
2741 self
2742 }
2743
2744 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2746 where
2747 T: std::convert::Into<crate::model::UserCredential>,
2748 {
2749 self.authorizer_credential = v.map(|x| x.into());
2750 self
2751 }
2752
2753 pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2755 where
2756 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2757 {
2758 self.service_directory_config = std::option::Option::Some(v.into());
2759 self
2760 }
2761
2762 pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2764 where
2765 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2766 {
2767 self.service_directory_config = v.map(|x| x.into());
2768 self
2769 }
2770
2771 pub fn set_ssl_ca<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2773 self.ssl_ca = v.into();
2774 self
2775 }
2776
2777 pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2779 self.server_version = v.into();
2780 self
2781 }
2782}
2783
2784impl wkt::message::Message for GitLabConfig {
2785 fn typename() -> &'static str {
2786 "type.googleapis.com/google.devtools.cloudbuild.v2.GitLabConfig"
2787 }
2788}
2789
2790#[doc(hidden)]
2791impl<'de> serde::de::Deserialize<'de> for GitLabConfig {
2792 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2793 where
2794 D: serde::Deserializer<'de>,
2795 {
2796 #[allow(non_camel_case_types)]
2797 #[doc(hidden)]
2798 #[derive(PartialEq, Eq, Hash)]
2799 enum __FieldTag {
2800 __host_uri,
2801 __webhook_secret_secret_version,
2802 __read_authorizer_credential,
2803 __authorizer_credential,
2804 __service_directory_config,
2805 __ssl_ca,
2806 __server_version,
2807 Unknown(std::string::String),
2808 }
2809 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2810 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2811 where
2812 D: serde::Deserializer<'de>,
2813 {
2814 struct Visitor;
2815 impl<'de> serde::de::Visitor<'de> for Visitor {
2816 type Value = __FieldTag;
2817 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2818 formatter.write_str("a field name for GitLabConfig")
2819 }
2820 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2821 where
2822 E: serde::de::Error,
2823 {
2824 use std::result::Result::Ok;
2825 use std::string::ToString;
2826 match value {
2827 "hostUri" => Ok(__FieldTag::__host_uri),
2828 "host_uri" => Ok(__FieldTag::__host_uri),
2829 "webhookSecretSecretVersion" => {
2830 Ok(__FieldTag::__webhook_secret_secret_version)
2831 }
2832 "webhook_secret_secret_version" => {
2833 Ok(__FieldTag::__webhook_secret_secret_version)
2834 }
2835 "readAuthorizerCredential" => {
2836 Ok(__FieldTag::__read_authorizer_credential)
2837 }
2838 "read_authorizer_credential" => {
2839 Ok(__FieldTag::__read_authorizer_credential)
2840 }
2841 "authorizerCredential" => Ok(__FieldTag::__authorizer_credential),
2842 "authorizer_credential" => Ok(__FieldTag::__authorizer_credential),
2843 "serviceDirectoryConfig" => Ok(__FieldTag::__service_directory_config),
2844 "service_directory_config" => {
2845 Ok(__FieldTag::__service_directory_config)
2846 }
2847 "sslCa" => Ok(__FieldTag::__ssl_ca),
2848 "ssl_ca" => Ok(__FieldTag::__ssl_ca),
2849 "serverVersion" => Ok(__FieldTag::__server_version),
2850 "server_version" => Ok(__FieldTag::__server_version),
2851 _ => Ok(__FieldTag::Unknown(value.to_string())),
2852 }
2853 }
2854 }
2855 deserializer.deserialize_identifier(Visitor)
2856 }
2857 }
2858 struct Visitor;
2859 impl<'de> serde::de::Visitor<'de> for Visitor {
2860 type Value = GitLabConfig;
2861 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2862 formatter.write_str("struct GitLabConfig")
2863 }
2864 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2865 where
2866 A: serde::de::MapAccess<'de>,
2867 {
2868 #[allow(unused_imports)]
2869 use serde::de::Error;
2870 use std::option::Option::Some;
2871 let mut fields = std::collections::HashSet::new();
2872 let mut result = Self::Value::new();
2873 while let Some(tag) = map.next_key::<__FieldTag>()? {
2874 #[allow(clippy::match_single_binding)]
2875 match tag {
2876 __FieldTag::__host_uri => {
2877 if !fields.insert(__FieldTag::__host_uri) {
2878 return std::result::Result::Err(A::Error::duplicate_field(
2879 "multiple values for host_uri",
2880 ));
2881 }
2882 result.host_uri = map
2883 .next_value::<std::option::Option<std::string::String>>()?
2884 .unwrap_or_default();
2885 }
2886 __FieldTag::__webhook_secret_secret_version => {
2887 if !fields.insert(__FieldTag::__webhook_secret_secret_version) {
2888 return std::result::Result::Err(A::Error::duplicate_field(
2889 "multiple values for webhook_secret_secret_version",
2890 ));
2891 }
2892 result.webhook_secret_secret_version = map
2893 .next_value::<std::option::Option<std::string::String>>()?
2894 .unwrap_or_default();
2895 }
2896 __FieldTag::__read_authorizer_credential => {
2897 if !fields.insert(__FieldTag::__read_authorizer_credential) {
2898 return std::result::Result::Err(A::Error::duplicate_field(
2899 "multiple values for read_authorizer_credential",
2900 ));
2901 }
2902 result.read_authorizer_credential = map
2903 .next_value::<std::option::Option<crate::model::UserCredential>>(
2904 )?;
2905 }
2906 __FieldTag::__authorizer_credential => {
2907 if !fields.insert(__FieldTag::__authorizer_credential) {
2908 return std::result::Result::Err(A::Error::duplicate_field(
2909 "multiple values for authorizer_credential",
2910 ));
2911 }
2912 result.authorizer_credential = map
2913 .next_value::<std::option::Option<crate::model::UserCredential>>(
2914 )?;
2915 }
2916 __FieldTag::__service_directory_config => {
2917 if !fields.insert(__FieldTag::__service_directory_config) {
2918 return std::result::Result::Err(A::Error::duplicate_field(
2919 "multiple values for service_directory_config",
2920 ));
2921 }
2922 result.service_directory_config = map.next_value::<std::option::Option<crate::model::ServiceDirectoryConfig>>()?
2923 ;
2924 }
2925 __FieldTag::__ssl_ca => {
2926 if !fields.insert(__FieldTag::__ssl_ca) {
2927 return std::result::Result::Err(A::Error::duplicate_field(
2928 "multiple values for ssl_ca",
2929 ));
2930 }
2931 result.ssl_ca = map
2932 .next_value::<std::option::Option<std::string::String>>()?
2933 .unwrap_or_default();
2934 }
2935 __FieldTag::__server_version => {
2936 if !fields.insert(__FieldTag::__server_version) {
2937 return std::result::Result::Err(A::Error::duplicate_field(
2938 "multiple values for server_version",
2939 ));
2940 }
2941 result.server_version = map
2942 .next_value::<std::option::Option<std::string::String>>()?
2943 .unwrap_or_default();
2944 }
2945 __FieldTag::Unknown(key) => {
2946 let value = map.next_value::<serde_json::Value>()?;
2947 result._unknown_fields.insert(key, value);
2948 }
2949 }
2950 }
2951 std::result::Result::Ok(result)
2952 }
2953 }
2954 deserializer.deserialize_any(Visitor)
2955 }
2956}
2957
2958#[doc(hidden)]
2959impl serde::ser::Serialize for GitLabConfig {
2960 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2961 where
2962 S: serde::ser::Serializer,
2963 {
2964 use serde::ser::SerializeMap;
2965 #[allow(unused_imports)]
2966 use std::option::Option::Some;
2967 let mut state = serializer.serialize_map(std::option::Option::None)?;
2968 if !self.host_uri.is_empty() {
2969 state.serialize_entry("hostUri", &self.host_uri)?;
2970 }
2971 if !self.webhook_secret_secret_version.is_empty() {
2972 state.serialize_entry(
2973 "webhookSecretSecretVersion",
2974 &self.webhook_secret_secret_version,
2975 )?;
2976 }
2977 if self.read_authorizer_credential.is_some() {
2978 state.serialize_entry("readAuthorizerCredential", &self.read_authorizer_credential)?;
2979 }
2980 if self.authorizer_credential.is_some() {
2981 state.serialize_entry("authorizerCredential", &self.authorizer_credential)?;
2982 }
2983 if self.service_directory_config.is_some() {
2984 state.serialize_entry("serviceDirectoryConfig", &self.service_directory_config)?;
2985 }
2986 if !self.ssl_ca.is_empty() {
2987 state.serialize_entry("sslCa", &self.ssl_ca)?;
2988 }
2989 if !self.server_version.is_empty() {
2990 state.serialize_entry("serverVersion", &self.server_version)?;
2991 }
2992 if !self._unknown_fields.is_empty() {
2993 for (key, value) in self._unknown_fields.iter() {
2994 state.serialize_entry(key, &value)?;
2995 }
2996 }
2997 state.end()
2998 }
2999}
3000
3001#[derive(Clone, Debug, Default, PartialEq)]
3003#[non_exhaustive]
3004pub struct BitbucketDataCenterConfig {
3005 pub host_uri: std::string::String,
3008
3009 pub webhook_secret_secret_version: std::string::String,
3013
3014 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
3016
3017 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
3019
3020 pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
3026
3027 pub ssl_ca: std::string::String,
3029
3030 pub server_version: std::string::String,
3033
3034 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3035}
3036
3037impl BitbucketDataCenterConfig {
3038 pub fn new() -> Self {
3039 std::default::Default::default()
3040 }
3041
3042 pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3044 self.host_uri = v.into();
3045 self
3046 }
3047
3048 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
3050 mut self,
3051 v: T,
3052 ) -> Self {
3053 self.webhook_secret_secret_version = v.into();
3054 self
3055 }
3056
3057 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
3059 where
3060 T: std::convert::Into<crate::model::UserCredential>,
3061 {
3062 self.read_authorizer_credential = std::option::Option::Some(v.into());
3063 self
3064 }
3065
3066 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3068 where
3069 T: std::convert::Into<crate::model::UserCredential>,
3070 {
3071 self.read_authorizer_credential = v.map(|x| x.into());
3072 self
3073 }
3074
3075 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
3077 where
3078 T: std::convert::Into<crate::model::UserCredential>,
3079 {
3080 self.authorizer_credential = std::option::Option::Some(v.into());
3081 self
3082 }
3083
3084 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3086 where
3087 T: std::convert::Into<crate::model::UserCredential>,
3088 {
3089 self.authorizer_credential = v.map(|x| x.into());
3090 self
3091 }
3092
3093 pub fn set_service_directory_config<T>(mut self, v: T) -> Self
3095 where
3096 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
3097 {
3098 self.service_directory_config = std::option::Option::Some(v.into());
3099 self
3100 }
3101
3102 pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
3104 where
3105 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
3106 {
3107 self.service_directory_config = v.map(|x| x.into());
3108 self
3109 }
3110
3111 pub fn set_ssl_ca<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3113 self.ssl_ca = v.into();
3114 self
3115 }
3116
3117 pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3119 self.server_version = v.into();
3120 self
3121 }
3122}
3123
3124impl wkt::message::Message for BitbucketDataCenterConfig {
3125 fn typename() -> &'static str {
3126 "type.googleapis.com/google.devtools.cloudbuild.v2.BitbucketDataCenterConfig"
3127 }
3128}
3129
3130#[doc(hidden)]
3131impl<'de> serde::de::Deserialize<'de> for BitbucketDataCenterConfig {
3132 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3133 where
3134 D: serde::Deserializer<'de>,
3135 {
3136 #[allow(non_camel_case_types)]
3137 #[doc(hidden)]
3138 #[derive(PartialEq, Eq, Hash)]
3139 enum __FieldTag {
3140 __host_uri,
3141 __webhook_secret_secret_version,
3142 __read_authorizer_credential,
3143 __authorizer_credential,
3144 __service_directory_config,
3145 __ssl_ca,
3146 __server_version,
3147 Unknown(std::string::String),
3148 }
3149 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3150 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3151 where
3152 D: serde::Deserializer<'de>,
3153 {
3154 struct Visitor;
3155 impl<'de> serde::de::Visitor<'de> for Visitor {
3156 type Value = __FieldTag;
3157 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3158 formatter.write_str("a field name for BitbucketDataCenterConfig")
3159 }
3160 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3161 where
3162 E: serde::de::Error,
3163 {
3164 use std::result::Result::Ok;
3165 use std::string::ToString;
3166 match value {
3167 "hostUri" => Ok(__FieldTag::__host_uri),
3168 "host_uri" => Ok(__FieldTag::__host_uri),
3169 "webhookSecretSecretVersion" => {
3170 Ok(__FieldTag::__webhook_secret_secret_version)
3171 }
3172 "webhook_secret_secret_version" => {
3173 Ok(__FieldTag::__webhook_secret_secret_version)
3174 }
3175 "readAuthorizerCredential" => {
3176 Ok(__FieldTag::__read_authorizer_credential)
3177 }
3178 "read_authorizer_credential" => {
3179 Ok(__FieldTag::__read_authorizer_credential)
3180 }
3181 "authorizerCredential" => Ok(__FieldTag::__authorizer_credential),
3182 "authorizer_credential" => Ok(__FieldTag::__authorizer_credential),
3183 "serviceDirectoryConfig" => Ok(__FieldTag::__service_directory_config),
3184 "service_directory_config" => {
3185 Ok(__FieldTag::__service_directory_config)
3186 }
3187 "sslCa" => Ok(__FieldTag::__ssl_ca),
3188 "ssl_ca" => Ok(__FieldTag::__ssl_ca),
3189 "serverVersion" => Ok(__FieldTag::__server_version),
3190 "server_version" => Ok(__FieldTag::__server_version),
3191 _ => Ok(__FieldTag::Unknown(value.to_string())),
3192 }
3193 }
3194 }
3195 deserializer.deserialize_identifier(Visitor)
3196 }
3197 }
3198 struct Visitor;
3199 impl<'de> serde::de::Visitor<'de> for Visitor {
3200 type Value = BitbucketDataCenterConfig;
3201 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3202 formatter.write_str("struct BitbucketDataCenterConfig")
3203 }
3204 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3205 where
3206 A: serde::de::MapAccess<'de>,
3207 {
3208 #[allow(unused_imports)]
3209 use serde::de::Error;
3210 use std::option::Option::Some;
3211 let mut fields = std::collections::HashSet::new();
3212 let mut result = Self::Value::new();
3213 while let Some(tag) = map.next_key::<__FieldTag>()? {
3214 #[allow(clippy::match_single_binding)]
3215 match tag {
3216 __FieldTag::__host_uri => {
3217 if !fields.insert(__FieldTag::__host_uri) {
3218 return std::result::Result::Err(A::Error::duplicate_field(
3219 "multiple values for host_uri",
3220 ));
3221 }
3222 result.host_uri = map
3223 .next_value::<std::option::Option<std::string::String>>()?
3224 .unwrap_or_default();
3225 }
3226 __FieldTag::__webhook_secret_secret_version => {
3227 if !fields.insert(__FieldTag::__webhook_secret_secret_version) {
3228 return std::result::Result::Err(A::Error::duplicate_field(
3229 "multiple values for webhook_secret_secret_version",
3230 ));
3231 }
3232 result.webhook_secret_secret_version = map
3233 .next_value::<std::option::Option<std::string::String>>()?
3234 .unwrap_or_default();
3235 }
3236 __FieldTag::__read_authorizer_credential => {
3237 if !fields.insert(__FieldTag::__read_authorizer_credential) {
3238 return std::result::Result::Err(A::Error::duplicate_field(
3239 "multiple values for read_authorizer_credential",
3240 ));
3241 }
3242 result.read_authorizer_credential = map
3243 .next_value::<std::option::Option<crate::model::UserCredential>>(
3244 )?;
3245 }
3246 __FieldTag::__authorizer_credential => {
3247 if !fields.insert(__FieldTag::__authorizer_credential) {
3248 return std::result::Result::Err(A::Error::duplicate_field(
3249 "multiple values for authorizer_credential",
3250 ));
3251 }
3252 result.authorizer_credential = map
3253 .next_value::<std::option::Option<crate::model::UserCredential>>(
3254 )?;
3255 }
3256 __FieldTag::__service_directory_config => {
3257 if !fields.insert(__FieldTag::__service_directory_config) {
3258 return std::result::Result::Err(A::Error::duplicate_field(
3259 "multiple values for service_directory_config",
3260 ));
3261 }
3262 result.service_directory_config = map.next_value::<std::option::Option<crate::model::ServiceDirectoryConfig>>()?
3263 ;
3264 }
3265 __FieldTag::__ssl_ca => {
3266 if !fields.insert(__FieldTag::__ssl_ca) {
3267 return std::result::Result::Err(A::Error::duplicate_field(
3268 "multiple values for ssl_ca",
3269 ));
3270 }
3271 result.ssl_ca = map
3272 .next_value::<std::option::Option<std::string::String>>()?
3273 .unwrap_or_default();
3274 }
3275 __FieldTag::__server_version => {
3276 if !fields.insert(__FieldTag::__server_version) {
3277 return std::result::Result::Err(A::Error::duplicate_field(
3278 "multiple values for server_version",
3279 ));
3280 }
3281 result.server_version = map
3282 .next_value::<std::option::Option<std::string::String>>()?
3283 .unwrap_or_default();
3284 }
3285 __FieldTag::Unknown(key) => {
3286 let value = map.next_value::<serde_json::Value>()?;
3287 result._unknown_fields.insert(key, value);
3288 }
3289 }
3290 }
3291 std::result::Result::Ok(result)
3292 }
3293 }
3294 deserializer.deserialize_any(Visitor)
3295 }
3296}
3297
3298#[doc(hidden)]
3299impl serde::ser::Serialize for BitbucketDataCenterConfig {
3300 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3301 where
3302 S: serde::ser::Serializer,
3303 {
3304 use serde::ser::SerializeMap;
3305 #[allow(unused_imports)]
3306 use std::option::Option::Some;
3307 let mut state = serializer.serialize_map(std::option::Option::None)?;
3308 if !self.host_uri.is_empty() {
3309 state.serialize_entry("hostUri", &self.host_uri)?;
3310 }
3311 if !self.webhook_secret_secret_version.is_empty() {
3312 state.serialize_entry(
3313 "webhookSecretSecretVersion",
3314 &self.webhook_secret_secret_version,
3315 )?;
3316 }
3317 if self.read_authorizer_credential.is_some() {
3318 state.serialize_entry("readAuthorizerCredential", &self.read_authorizer_credential)?;
3319 }
3320 if self.authorizer_credential.is_some() {
3321 state.serialize_entry("authorizerCredential", &self.authorizer_credential)?;
3322 }
3323 if self.service_directory_config.is_some() {
3324 state.serialize_entry("serviceDirectoryConfig", &self.service_directory_config)?;
3325 }
3326 if !self.ssl_ca.is_empty() {
3327 state.serialize_entry("sslCa", &self.ssl_ca)?;
3328 }
3329 if !self.server_version.is_empty() {
3330 state.serialize_entry("serverVersion", &self.server_version)?;
3331 }
3332 if !self._unknown_fields.is_empty() {
3333 for (key, value) in self._unknown_fields.iter() {
3334 state.serialize_entry(key, &value)?;
3335 }
3336 }
3337 state.end()
3338 }
3339}
3340
3341#[derive(Clone, Debug, Default, PartialEq)]
3343#[non_exhaustive]
3344pub struct BitbucketCloudConfig {
3345 pub workspace: std::string::String,
3348
3349 pub webhook_secret_secret_version: std::string::String,
3352
3353 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
3357
3358 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
3363
3364 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3365}
3366
3367impl BitbucketCloudConfig {
3368 pub fn new() -> Self {
3369 std::default::Default::default()
3370 }
3371
3372 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3374 self.workspace = v.into();
3375 self
3376 }
3377
3378 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
3380 mut self,
3381 v: T,
3382 ) -> Self {
3383 self.webhook_secret_secret_version = v.into();
3384 self
3385 }
3386
3387 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
3389 where
3390 T: std::convert::Into<crate::model::UserCredential>,
3391 {
3392 self.read_authorizer_credential = std::option::Option::Some(v.into());
3393 self
3394 }
3395
3396 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3398 where
3399 T: std::convert::Into<crate::model::UserCredential>,
3400 {
3401 self.read_authorizer_credential = v.map(|x| x.into());
3402 self
3403 }
3404
3405 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
3407 where
3408 T: std::convert::Into<crate::model::UserCredential>,
3409 {
3410 self.authorizer_credential = std::option::Option::Some(v.into());
3411 self
3412 }
3413
3414 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3416 where
3417 T: std::convert::Into<crate::model::UserCredential>,
3418 {
3419 self.authorizer_credential = v.map(|x| x.into());
3420 self
3421 }
3422}
3423
3424impl wkt::message::Message for BitbucketCloudConfig {
3425 fn typename() -> &'static str {
3426 "type.googleapis.com/google.devtools.cloudbuild.v2.BitbucketCloudConfig"
3427 }
3428}
3429
3430#[doc(hidden)]
3431impl<'de> serde::de::Deserialize<'de> for BitbucketCloudConfig {
3432 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3433 where
3434 D: serde::Deserializer<'de>,
3435 {
3436 #[allow(non_camel_case_types)]
3437 #[doc(hidden)]
3438 #[derive(PartialEq, Eq, Hash)]
3439 enum __FieldTag {
3440 __workspace,
3441 __webhook_secret_secret_version,
3442 __read_authorizer_credential,
3443 __authorizer_credential,
3444 Unknown(std::string::String),
3445 }
3446 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3447 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3448 where
3449 D: serde::Deserializer<'de>,
3450 {
3451 struct Visitor;
3452 impl<'de> serde::de::Visitor<'de> for Visitor {
3453 type Value = __FieldTag;
3454 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3455 formatter.write_str("a field name for BitbucketCloudConfig")
3456 }
3457 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3458 where
3459 E: serde::de::Error,
3460 {
3461 use std::result::Result::Ok;
3462 use std::string::ToString;
3463 match value {
3464 "workspace" => Ok(__FieldTag::__workspace),
3465 "webhookSecretSecretVersion" => {
3466 Ok(__FieldTag::__webhook_secret_secret_version)
3467 }
3468 "webhook_secret_secret_version" => {
3469 Ok(__FieldTag::__webhook_secret_secret_version)
3470 }
3471 "readAuthorizerCredential" => {
3472 Ok(__FieldTag::__read_authorizer_credential)
3473 }
3474 "read_authorizer_credential" => {
3475 Ok(__FieldTag::__read_authorizer_credential)
3476 }
3477 "authorizerCredential" => Ok(__FieldTag::__authorizer_credential),
3478 "authorizer_credential" => Ok(__FieldTag::__authorizer_credential),
3479 _ => Ok(__FieldTag::Unknown(value.to_string())),
3480 }
3481 }
3482 }
3483 deserializer.deserialize_identifier(Visitor)
3484 }
3485 }
3486 struct Visitor;
3487 impl<'de> serde::de::Visitor<'de> for Visitor {
3488 type Value = BitbucketCloudConfig;
3489 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3490 formatter.write_str("struct BitbucketCloudConfig")
3491 }
3492 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3493 where
3494 A: serde::de::MapAccess<'de>,
3495 {
3496 #[allow(unused_imports)]
3497 use serde::de::Error;
3498 use std::option::Option::Some;
3499 let mut fields = std::collections::HashSet::new();
3500 let mut result = Self::Value::new();
3501 while let Some(tag) = map.next_key::<__FieldTag>()? {
3502 #[allow(clippy::match_single_binding)]
3503 match tag {
3504 __FieldTag::__workspace => {
3505 if !fields.insert(__FieldTag::__workspace) {
3506 return std::result::Result::Err(A::Error::duplicate_field(
3507 "multiple values for workspace",
3508 ));
3509 }
3510 result.workspace = map
3511 .next_value::<std::option::Option<std::string::String>>()?
3512 .unwrap_or_default();
3513 }
3514 __FieldTag::__webhook_secret_secret_version => {
3515 if !fields.insert(__FieldTag::__webhook_secret_secret_version) {
3516 return std::result::Result::Err(A::Error::duplicate_field(
3517 "multiple values for webhook_secret_secret_version",
3518 ));
3519 }
3520 result.webhook_secret_secret_version = map
3521 .next_value::<std::option::Option<std::string::String>>()?
3522 .unwrap_or_default();
3523 }
3524 __FieldTag::__read_authorizer_credential => {
3525 if !fields.insert(__FieldTag::__read_authorizer_credential) {
3526 return std::result::Result::Err(A::Error::duplicate_field(
3527 "multiple values for read_authorizer_credential",
3528 ));
3529 }
3530 result.read_authorizer_credential = map
3531 .next_value::<std::option::Option<crate::model::UserCredential>>(
3532 )?;
3533 }
3534 __FieldTag::__authorizer_credential => {
3535 if !fields.insert(__FieldTag::__authorizer_credential) {
3536 return std::result::Result::Err(A::Error::duplicate_field(
3537 "multiple values for authorizer_credential",
3538 ));
3539 }
3540 result.authorizer_credential = map
3541 .next_value::<std::option::Option<crate::model::UserCredential>>(
3542 )?;
3543 }
3544 __FieldTag::Unknown(key) => {
3545 let value = map.next_value::<serde_json::Value>()?;
3546 result._unknown_fields.insert(key, value);
3547 }
3548 }
3549 }
3550 std::result::Result::Ok(result)
3551 }
3552 }
3553 deserializer.deserialize_any(Visitor)
3554 }
3555}
3556
3557#[doc(hidden)]
3558impl serde::ser::Serialize for BitbucketCloudConfig {
3559 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3560 where
3561 S: serde::ser::Serializer,
3562 {
3563 use serde::ser::SerializeMap;
3564 #[allow(unused_imports)]
3565 use std::option::Option::Some;
3566 let mut state = serializer.serialize_map(std::option::Option::None)?;
3567 if !self.workspace.is_empty() {
3568 state.serialize_entry("workspace", &self.workspace)?;
3569 }
3570 if !self.webhook_secret_secret_version.is_empty() {
3571 state.serialize_entry(
3572 "webhookSecretSecretVersion",
3573 &self.webhook_secret_secret_version,
3574 )?;
3575 }
3576 if self.read_authorizer_credential.is_some() {
3577 state.serialize_entry("readAuthorizerCredential", &self.read_authorizer_credential)?;
3578 }
3579 if self.authorizer_credential.is_some() {
3580 state.serialize_entry("authorizerCredential", &self.authorizer_credential)?;
3581 }
3582 if !self._unknown_fields.is_empty() {
3583 for (key, value) in self._unknown_fields.iter() {
3584 state.serialize_entry(key, &value)?;
3585 }
3586 }
3587 state.end()
3588 }
3589}
3590
3591#[derive(Clone, Debug, Default, PartialEq)]
3594#[non_exhaustive]
3595pub struct ServiceDirectoryConfig {
3596 pub service: std::string::String,
3600
3601 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3602}
3603
3604impl ServiceDirectoryConfig {
3605 pub fn new() -> Self {
3606 std::default::Default::default()
3607 }
3608
3609 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3611 self.service = v.into();
3612 self
3613 }
3614}
3615
3616impl wkt::message::Message for ServiceDirectoryConfig {
3617 fn typename() -> &'static str {
3618 "type.googleapis.com/google.devtools.cloudbuild.v2.ServiceDirectoryConfig"
3619 }
3620}
3621
3622#[doc(hidden)]
3623impl<'de> serde::de::Deserialize<'de> for ServiceDirectoryConfig {
3624 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3625 where
3626 D: serde::Deserializer<'de>,
3627 {
3628 #[allow(non_camel_case_types)]
3629 #[doc(hidden)]
3630 #[derive(PartialEq, Eq, Hash)]
3631 enum __FieldTag {
3632 __service,
3633 Unknown(std::string::String),
3634 }
3635 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3636 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3637 where
3638 D: serde::Deserializer<'de>,
3639 {
3640 struct Visitor;
3641 impl<'de> serde::de::Visitor<'de> for Visitor {
3642 type Value = __FieldTag;
3643 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3644 formatter.write_str("a field name for ServiceDirectoryConfig")
3645 }
3646 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3647 where
3648 E: serde::de::Error,
3649 {
3650 use std::result::Result::Ok;
3651 use std::string::ToString;
3652 match value {
3653 "service" => Ok(__FieldTag::__service),
3654 _ => Ok(__FieldTag::Unknown(value.to_string())),
3655 }
3656 }
3657 }
3658 deserializer.deserialize_identifier(Visitor)
3659 }
3660 }
3661 struct Visitor;
3662 impl<'de> serde::de::Visitor<'de> for Visitor {
3663 type Value = ServiceDirectoryConfig;
3664 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3665 formatter.write_str("struct ServiceDirectoryConfig")
3666 }
3667 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3668 where
3669 A: serde::de::MapAccess<'de>,
3670 {
3671 #[allow(unused_imports)]
3672 use serde::de::Error;
3673 use std::option::Option::Some;
3674 let mut fields = std::collections::HashSet::new();
3675 let mut result = Self::Value::new();
3676 while let Some(tag) = map.next_key::<__FieldTag>()? {
3677 #[allow(clippy::match_single_binding)]
3678 match tag {
3679 __FieldTag::__service => {
3680 if !fields.insert(__FieldTag::__service) {
3681 return std::result::Result::Err(A::Error::duplicate_field(
3682 "multiple values for service",
3683 ));
3684 }
3685 result.service = map
3686 .next_value::<std::option::Option<std::string::String>>()?
3687 .unwrap_or_default();
3688 }
3689 __FieldTag::Unknown(key) => {
3690 let value = map.next_value::<serde_json::Value>()?;
3691 result._unknown_fields.insert(key, value);
3692 }
3693 }
3694 }
3695 std::result::Result::Ok(result)
3696 }
3697 }
3698 deserializer.deserialize_any(Visitor)
3699 }
3700}
3701
3702#[doc(hidden)]
3703impl serde::ser::Serialize for ServiceDirectoryConfig {
3704 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3705 where
3706 S: serde::ser::Serializer,
3707 {
3708 use serde::ser::SerializeMap;
3709 #[allow(unused_imports)]
3710 use std::option::Option::Some;
3711 let mut state = serializer.serialize_map(std::option::Option::None)?;
3712 if !self.service.is_empty() {
3713 state.serialize_entry("service", &self.service)?;
3714 }
3715 if !self._unknown_fields.is_empty() {
3716 for (key, value) in self._unknown_fields.iter() {
3717 state.serialize_entry(key, &value)?;
3718 }
3719 }
3720 state.end()
3721 }
3722}
3723
3724#[derive(Clone, Debug, Default, PartialEq)]
3726#[non_exhaustive]
3727pub struct Repository {
3728 pub name: std::string::String,
3731
3732 pub remote_uri: std::string::String,
3734
3735 pub create_time: std::option::Option<wkt::Timestamp>,
3737
3738 pub update_time: std::option::Option<wkt::Timestamp>,
3740
3741 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
3743
3744 pub etag: std::string::String,
3748
3749 pub webhook_id: std::string::String,
3751
3752 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3753}
3754
3755impl Repository {
3756 pub fn new() -> Self {
3757 std::default::Default::default()
3758 }
3759
3760 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3762 self.name = v.into();
3763 self
3764 }
3765
3766 pub fn set_remote_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3768 self.remote_uri = v.into();
3769 self
3770 }
3771
3772 pub fn set_create_time<T>(mut self, v: T) -> Self
3774 where
3775 T: std::convert::Into<wkt::Timestamp>,
3776 {
3777 self.create_time = std::option::Option::Some(v.into());
3778 self
3779 }
3780
3781 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3783 where
3784 T: std::convert::Into<wkt::Timestamp>,
3785 {
3786 self.create_time = v.map(|x| x.into());
3787 self
3788 }
3789
3790 pub fn set_update_time<T>(mut self, v: T) -> Self
3792 where
3793 T: std::convert::Into<wkt::Timestamp>,
3794 {
3795 self.update_time = std::option::Option::Some(v.into());
3796 self
3797 }
3798
3799 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3801 where
3802 T: std::convert::Into<wkt::Timestamp>,
3803 {
3804 self.update_time = v.map(|x| x.into());
3805 self
3806 }
3807
3808 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
3810 where
3811 T: std::iter::IntoIterator<Item = (K, V)>,
3812 K: std::convert::Into<std::string::String>,
3813 V: std::convert::Into<std::string::String>,
3814 {
3815 use std::iter::Iterator;
3816 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3817 self
3818 }
3819
3820 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3822 self.etag = v.into();
3823 self
3824 }
3825
3826 pub fn set_webhook_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3828 self.webhook_id = v.into();
3829 self
3830 }
3831}
3832
3833impl wkt::message::Message for Repository {
3834 fn typename() -> &'static str {
3835 "type.googleapis.com/google.devtools.cloudbuild.v2.Repository"
3836 }
3837}
3838
3839#[doc(hidden)]
3840impl<'de> serde::de::Deserialize<'de> for Repository {
3841 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3842 where
3843 D: serde::Deserializer<'de>,
3844 {
3845 #[allow(non_camel_case_types)]
3846 #[doc(hidden)]
3847 #[derive(PartialEq, Eq, Hash)]
3848 enum __FieldTag {
3849 __name,
3850 __remote_uri,
3851 __create_time,
3852 __update_time,
3853 __annotations,
3854 __etag,
3855 __webhook_id,
3856 Unknown(std::string::String),
3857 }
3858 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3859 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3860 where
3861 D: serde::Deserializer<'de>,
3862 {
3863 struct Visitor;
3864 impl<'de> serde::de::Visitor<'de> for Visitor {
3865 type Value = __FieldTag;
3866 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3867 formatter.write_str("a field name for Repository")
3868 }
3869 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3870 where
3871 E: serde::de::Error,
3872 {
3873 use std::result::Result::Ok;
3874 use std::string::ToString;
3875 match value {
3876 "name" => Ok(__FieldTag::__name),
3877 "remoteUri" => Ok(__FieldTag::__remote_uri),
3878 "remote_uri" => Ok(__FieldTag::__remote_uri),
3879 "createTime" => Ok(__FieldTag::__create_time),
3880 "create_time" => Ok(__FieldTag::__create_time),
3881 "updateTime" => Ok(__FieldTag::__update_time),
3882 "update_time" => Ok(__FieldTag::__update_time),
3883 "annotations" => Ok(__FieldTag::__annotations),
3884 "etag" => Ok(__FieldTag::__etag),
3885 "webhookId" => Ok(__FieldTag::__webhook_id),
3886 "webhook_id" => Ok(__FieldTag::__webhook_id),
3887 _ => Ok(__FieldTag::Unknown(value.to_string())),
3888 }
3889 }
3890 }
3891 deserializer.deserialize_identifier(Visitor)
3892 }
3893 }
3894 struct Visitor;
3895 impl<'de> serde::de::Visitor<'de> for Visitor {
3896 type Value = Repository;
3897 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3898 formatter.write_str("struct Repository")
3899 }
3900 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3901 where
3902 A: serde::de::MapAccess<'de>,
3903 {
3904 #[allow(unused_imports)]
3905 use serde::de::Error;
3906 use std::option::Option::Some;
3907 let mut fields = std::collections::HashSet::new();
3908 let mut result = Self::Value::new();
3909 while let Some(tag) = map.next_key::<__FieldTag>()? {
3910 #[allow(clippy::match_single_binding)]
3911 match tag {
3912 __FieldTag::__name => {
3913 if !fields.insert(__FieldTag::__name) {
3914 return std::result::Result::Err(A::Error::duplicate_field(
3915 "multiple values for name",
3916 ));
3917 }
3918 result.name = map
3919 .next_value::<std::option::Option<std::string::String>>()?
3920 .unwrap_or_default();
3921 }
3922 __FieldTag::__remote_uri => {
3923 if !fields.insert(__FieldTag::__remote_uri) {
3924 return std::result::Result::Err(A::Error::duplicate_field(
3925 "multiple values for remote_uri",
3926 ));
3927 }
3928 result.remote_uri = map
3929 .next_value::<std::option::Option<std::string::String>>()?
3930 .unwrap_or_default();
3931 }
3932 __FieldTag::__create_time => {
3933 if !fields.insert(__FieldTag::__create_time) {
3934 return std::result::Result::Err(A::Error::duplicate_field(
3935 "multiple values for create_time",
3936 ));
3937 }
3938 result.create_time =
3939 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
3940 }
3941 __FieldTag::__update_time => {
3942 if !fields.insert(__FieldTag::__update_time) {
3943 return std::result::Result::Err(A::Error::duplicate_field(
3944 "multiple values for update_time",
3945 ));
3946 }
3947 result.update_time =
3948 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
3949 }
3950 __FieldTag::__annotations => {
3951 if !fields.insert(__FieldTag::__annotations) {
3952 return std::result::Result::Err(A::Error::duplicate_field(
3953 "multiple values for annotations",
3954 ));
3955 }
3956 result.annotations = map
3957 .next_value::<std::option::Option<
3958 std::collections::HashMap<
3959 std::string::String,
3960 std::string::String,
3961 >,
3962 >>()?
3963 .unwrap_or_default();
3964 }
3965 __FieldTag::__etag => {
3966 if !fields.insert(__FieldTag::__etag) {
3967 return std::result::Result::Err(A::Error::duplicate_field(
3968 "multiple values for etag",
3969 ));
3970 }
3971 result.etag = map
3972 .next_value::<std::option::Option<std::string::String>>()?
3973 .unwrap_or_default();
3974 }
3975 __FieldTag::__webhook_id => {
3976 if !fields.insert(__FieldTag::__webhook_id) {
3977 return std::result::Result::Err(A::Error::duplicate_field(
3978 "multiple values for webhook_id",
3979 ));
3980 }
3981 result.webhook_id = map
3982 .next_value::<std::option::Option<std::string::String>>()?
3983 .unwrap_or_default();
3984 }
3985 __FieldTag::Unknown(key) => {
3986 let value = map.next_value::<serde_json::Value>()?;
3987 result._unknown_fields.insert(key, value);
3988 }
3989 }
3990 }
3991 std::result::Result::Ok(result)
3992 }
3993 }
3994 deserializer.deserialize_any(Visitor)
3995 }
3996}
3997
3998#[doc(hidden)]
3999impl serde::ser::Serialize for Repository {
4000 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4001 where
4002 S: serde::ser::Serializer,
4003 {
4004 use serde::ser::SerializeMap;
4005 #[allow(unused_imports)]
4006 use std::option::Option::Some;
4007 let mut state = serializer.serialize_map(std::option::Option::None)?;
4008 if !self.name.is_empty() {
4009 state.serialize_entry("name", &self.name)?;
4010 }
4011 if !self.remote_uri.is_empty() {
4012 state.serialize_entry("remoteUri", &self.remote_uri)?;
4013 }
4014 if self.create_time.is_some() {
4015 state.serialize_entry("createTime", &self.create_time)?;
4016 }
4017 if self.update_time.is_some() {
4018 state.serialize_entry("updateTime", &self.update_time)?;
4019 }
4020 if !self.annotations.is_empty() {
4021 state.serialize_entry("annotations", &self.annotations)?;
4022 }
4023 if !self.etag.is_empty() {
4024 state.serialize_entry("etag", &self.etag)?;
4025 }
4026 if !self.webhook_id.is_empty() {
4027 state.serialize_entry("webhookId", &self.webhook_id)?;
4028 }
4029 if !self._unknown_fields.is_empty() {
4030 for (key, value) in self._unknown_fields.iter() {
4031 state.serialize_entry(key, &value)?;
4032 }
4033 }
4034 state.end()
4035 }
4036}
4037
4038#[derive(Clone, Debug, Default, PartialEq)]
4041#[non_exhaustive]
4042pub struct OAuthCredential {
4043 pub oauth_token_secret_version: std::string::String,
4046
4047 pub username: std::string::String,
4049
4050 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4051}
4052
4053impl OAuthCredential {
4054 pub fn new() -> Self {
4055 std::default::Default::default()
4056 }
4057
4058 pub fn set_oauth_token_secret_version<T: std::convert::Into<std::string::String>>(
4060 mut self,
4061 v: T,
4062 ) -> Self {
4063 self.oauth_token_secret_version = v.into();
4064 self
4065 }
4066
4067 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4069 self.username = v.into();
4070 self
4071 }
4072}
4073
4074impl wkt::message::Message for OAuthCredential {
4075 fn typename() -> &'static str {
4076 "type.googleapis.com/google.devtools.cloudbuild.v2.OAuthCredential"
4077 }
4078}
4079
4080#[doc(hidden)]
4081impl<'de> serde::de::Deserialize<'de> for OAuthCredential {
4082 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4083 where
4084 D: serde::Deserializer<'de>,
4085 {
4086 #[allow(non_camel_case_types)]
4087 #[doc(hidden)]
4088 #[derive(PartialEq, Eq, Hash)]
4089 enum __FieldTag {
4090 __oauth_token_secret_version,
4091 __username,
4092 Unknown(std::string::String),
4093 }
4094 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4095 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4096 where
4097 D: serde::Deserializer<'de>,
4098 {
4099 struct Visitor;
4100 impl<'de> serde::de::Visitor<'de> for Visitor {
4101 type Value = __FieldTag;
4102 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4103 formatter.write_str("a field name for OAuthCredential")
4104 }
4105 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4106 where
4107 E: serde::de::Error,
4108 {
4109 use std::result::Result::Ok;
4110 use std::string::ToString;
4111 match value {
4112 "oauthTokenSecretVersion" => {
4113 Ok(__FieldTag::__oauth_token_secret_version)
4114 }
4115 "oauth_token_secret_version" => {
4116 Ok(__FieldTag::__oauth_token_secret_version)
4117 }
4118 "username" => Ok(__FieldTag::__username),
4119 _ => Ok(__FieldTag::Unknown(value.to_string())),
4120 }
4121 }
4122 }
4123 deserializer.deserialize_identifier(Visitor)
4124 }
4125 }
4126 struct Visitor;
4127 impl<'de> serde::de::Visitor<'de> for Visitor {
4128 type Value = OAuthCredential;
4129 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4130 formatter.write_str("struct OAuthCredential")
4131 }
4132 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4133 where
4134 A: serde::de::MapAccess<'de>,
4135 {
4136 #[allow(unused_imports)]
4137 use serde::de::Error;
4138 use std::option::Option::Some;
4139 let mut fields = std::collections::HashSet::new();
4140 let mut result = Self::Value::new();
4141 while let Some(tag) = map.next_key::<__FieldTag>()? {
4142 #[allow(clippy::match_single_binding)]
4143 match tag {
4144 __FieldTag::__oauth_token_secret_version => {
4145 if !fields.insert(__FieldTag::__oauth_token_secret_version) {
4146 return std::result::Result::Err(A::Error::duplicate_field(
4147 "multiple values for oauth_token_secret_version",
4148 ));
4149 }
4150 result.oauth_token_secret_version = map
4151 .next_value::<std::option::Option<std::string::String>>()?
4152 .unwrap_or_default();
4153 }
4154 __FieldTag::__username => {
4155 if !fields.insert(__FieldTag::__username) {
4156 return std::result::Result::Err(A::Error::duplicate_field(
4157 "multiple values for username",
4158 ));
4159 }
4160 result.username = map
4161 .next_value::<std::option::Option<std::string::String>>()?
4162 .unwrap_or_default();
4163 }
4164 __FieldTag::Unknown(key) => {
4165 let value = map.next_value::<serde_json::Value>()?;
4166 result._unknown_fields.insert(key, value);
4167 }
4168 }
4169 }
4170 std::result::Result::Ok(result)
4171 }
4172 }
4173 deserializer.deserialize_any(Visitor)
4174 }
4175}
4176
4177#[doc(hidden)]
4178impl serde::ser::Serialize for OAuthCredential {
4179 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4180 where
4181 S: serde::ser::Serializer,
4182 {
4183 use serde::ser::SerializeMap;
4184 #[allow(unused_imports)]
4185 use std::option::Option::Some;
4186 let mut state = serializer.serialize_map(std::option::Option::None)?;
4187 if !self.oauth_token_secret_version.is_empty() {
4188 state.serialize_entry("oauthTokenSecretVersion", &self.oauth_token_secret_version)?;
4189 }
4190 if !self.username.is_empty() {
4191 state.serialize_entry("username", &self.username)?;
4192 }
4193 if !self._unknown_fields.is_empty() {
4194 for (key, value) in self._unknown_fields.iter() {
4195 state.serialize_entry(key, &value)?;
4196 }
4197 }
4198 state.end()
4199 }
4200}
4201
4202#[derive(Clone, Debug, Default, PartialEq)]
4205#[non_exhaustive]
4206pub struct UserCredential {
4207 pub user_token_secret_version: std::string::String,
4211
4212 pub username: std::string::String,
4214
4215 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4216}
4217
4218impl UserCredential {
4219 pub fn new() -> Self {
4220 std::default::Default::default()
4221 }
4222
4223 pub fn set_user_token_secret_version<T: std::convert::Into<std::string::String>>(
4225 mut self,
4226 v: T,
4227 ) -> Self {
4228 self.user_token_secret_version = v.into();
4229 self
4230 }
4231
4232 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4234 self.username = v.into();
4235 self
4236 }
4237}
4238
4239impl wkt::message::Message for UserCredential {
4240 fn typename() -> &'static str {
4241 "type.googleapis.com/google.devtools.cloudbuild.v2.UserCredential"
4242 }
4243}
4244
4245#[doc(hidden)]
4246impl<'de> serde::de::Deserialize<'de> for UserCredential {
4247 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4248 where
4249 D: serde::Deserializer<'de>,
4250 {
4251 #[allow(non_camel_case_types)]
4252 #[doc(hidden)]
4253 #[derive(PartialEq, Eq, Hash)]
4254 enum __FieldTag {
4255 __user_token_secret_version,
4256 __username,
4257 Unknown(std::string::String),
4258 }
4259 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4260 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4261 where
4262 D: serde::Deserializer<'de>,
4263 {
4264 struct Visitor;
4265 impl<'de> serde::de::Visitor<'de> for Visitor {
4266 type Value = __FieldTag;
4267 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4268 formatter.write_str("a field name for UserCredential")
4269 }
4270 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4271 where
4272 E: serde::de::Error,
4273 {
4274 use std::result::Result::Ok;
4275 use std::string::ToString;
4276 match value {
4277 "userTokenSecretVersion" => Ok(__FieldTag::__user_token_secret_version),
4278 "user_token_secret_version" => {
4279 Ok(__FieldTag::__user_token_secret_version)
4280 }
4281 "username" => Ok(__FieldTag::__username),
4282 _ => Ok(__FieldTag::Unknown(value.to_string())),
4283 }
4284 }
4285 }
4286 deserializer.deserialize_identifier(Visitor)
4287 }
4288 }
4289 struct Visitor;
4290 impl<'de> serde::de::Visitor<'de> for Visitor {
4291 type Value = UserCredential;
4292 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4293 formatter.write_str("struct UserCredential")
4294 }
4295 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4296 where
4297 A: serde::de::MapAccess<'de>,
4298 {
4299 #[allow(unused_imports)]
4300 use serde::de::Error;
4301 use std::option::Option::Some;
4302 let mut fields = std::collections::HashSet::new();
4303 let mut result = Self::Value::new();
4304 while let Some(tag) = map.next_key::<__FieldTag>()? {
4305 #[allow(clippy::match_single_binding)]
4306 match tag {
4307 __FieldTag::__user_token_secret_version => {
4308 if !fields.insert(__FieldTag::__user_token_secret_version) {
4309 return std::result::Result::Err(A::Error::duplicate_field(
4310 "multiple values for user_token_secret_version",
4311 ));
4312 }
4313 result.user_token_secret_version = map
4314 .next_value::<std::option::Option<std::string::String>>()?
4315 .unwrap_or_default();
4316 }
4317 __FieldTag::__username => {
4318 if !fields.insert(__FieldTag::__username) {
4319 return std::result::Result::Err(A::Error::duplicate_field(
4320 "multiple values for username",
4321 ));
4322 }
4323 result.username = map
4324 .next_value::<std::option::Option<std::string::String>>()?
4325 .unwrap_or_default();
4326 }
4327 __FieldTag::Unknown(key) => {
4328 let value = map.next_value::<serde_json::Value>()?;
4329 result._unknown_fields.insert(key, value);
4330 }
4331 }
4332 }
4333 std::result::Result::Ok(result)
4334 }
4335 }
4336 deserializer.deserialize_any(Visitor)
4337 }
4338}
4339
4340#[doc(hidden)]
4341impl serde::ser::Serialize for UserCredential {
4342 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4343 where
4344 S: serde::ser::Serializer,
4345 {
4346 use serde::ser::SerializeMap;
4347 #[allow(unused_imports)]
4348 use std::option::Option::Some;
4349 let mut state = serializer.serialize_map(std::option::Option::None)?;
4350 if !self.user_token_secret_version.is_empty() {
4351 state.serialize_entry("userTokenSecretVersion", &self.user_token_secret_version)?;
4352 }
4353 if !self.username.is_empty() {
4354 state.serialize_entry("username", &self.username)?;
4355 }
4356 if !self._unknown_fields.is_empty() {
4357 for (key, value) in self._unknown_fields.iter() {
4358 state.serialize_entry(key, &value)?;
4359 }
4360 }
4361 state.end()
4362 }
4363}
4364
4365#[derive(Clone, Debug, Default, PartialEq)]
4367#[non_exhaustive]
4368pub struct CreateConnectionRequest {
4369 pub parent: std::string::String,
4372
4373 pub connection: std::option::Option<crate::model::Connection>,
4375
4376 pub connection_id: std::string::String,
4381
4382 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4383}
4384
4385impl CreateConnectionRequest {
4386 pub fn new() -> Self {
4387 std::default::Default::default()
4388 }
4389
4390 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4392 self.parent = v.into();
4393 self
4394 }
4395
4396 pub fn set_connection<T>(mut self, v: T) -> Self
4398 where
4399 T: std::convert::Into<crate::model::Connection>,
4400 {
4401 self.connection = std::option::Option::Some(v.into());
4402 self
4403 }
4404
4405 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
4407 where
4408 T: std::convert::Into<crate::model::Connection>,
4409 {
4410 self.connection = v.map(|x| x.into());
4411 self
4412 }
4413
4414 pub fn set_connection_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4416 self.connection_id = v.into();
4417 self
4418 }
4419}
4420
4421impl wkt::message::Message for CreateConnectionRequest {
4422 fn typename() -> &'static str {
4423 "type.googleapis.com/google.devtools.cloudbuild.v2.CreateConnectionRequest"
4424 }
4425}
4426
4427#[doc(hidden)]
4428impl<'de> serde::de::Deserialize<'de> for CreateConnectionRequest {
4429 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4430 where
4431 D: serde::Deserializer<'de>,
4432 {
4433 #[allow(non_camel_case_types)]
4434 #[doc(hidden)]
4435 #[derive(PartialEq, Eq, Hash)]
4436 enum __FieldTag {
4437 __parent,
4438 __connection,
4439 __connection_id,
4440 Unknown(std::string::String),
4441 }
4442 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4443 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4444 where
4445 D: serde::Deserializer<'de>,
4446 {
4447 struct Visitor;
4448 impl<'de> serde::de::Visitor<'de> for Visitor {
4449 type Value = __FieldTag;
4450 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4451 formatter.write_str("a field name for CreateConnectionRequest")
4452 }
4453 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4454 where
4455 E: serde::de::Error,
4456 {
4457 use std::result::Result::Ok;
4458 use std::string::ToString;
4459 match value {
4460 "parent" => Ok(__FieldTag::__parent),
4461 "connection" => Ok(__FieldTag::__connection),
4462 "connectionId" => Ok(__FieldTag::__connection_id),
4463 "connection_id" => Ok(__FieldTag::__connection_id),
4464 _ => Ok(__FieldTag::Unknown(value.to_string())),
4465 }
4466 }
4467 }
4468 deserializer.deserialize_identifier(Visitor)
4469 }
4470 }
4471 struct Visitor;
4472 impl<'de> serde::de::Visitor<'de> for Visitor {
4473 type Value = CreateConnectionRequest;
4474 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4475 formatter.write_str("struct CreateConnectionRequest")
4476 }
4477 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4478 where
4479 A: serde::de::MapAccess<'de>,
4480 {
4481 #[allow(unused_imports)]
4482 use serde::de::Error;
4483 use std::option::Option::Some;
4484 let mut fields = std::collections::HashSet::new();
4485 let mut result = Self::Value::new();
4486 while let Some(tag) = map.next_key::<__FieldTag>()? {
4487 #[allow(clippy::match_single_binding)]
4488 match tag {
4489 __FieldTag::__parent => {
4490 if !fields.insert(__FieldTag::__parent) {
4491 return std::result::Result::Err(A::Error::duplicate_field(
4492 "multiple values for parent",
4493 ));
4494 }
4495 result.parent = map
4496 .next_value::<std::option::Option<std::string::String>>()?
4497 .unwrap_or_default();
4498 }
4499 __FieldTag::__connection => {
4500 if !fields.insert(__FieldTag::__connection) {
4501 return std::result::Result::Err(A::Error::duplicate_field(
4502 "multiple values for connection",
4503 ));
4504 }
4505 result.connection =
4506 map.next_value::<std::option::Option<crate::model::Connection>>()?;
4507 }
4508 __FieldTag::__connection_id => {
4509 if !fields.insert(__FieldTag::__connection_id) {
4510 return std::result::Result::Err(A::Error::duplicate_field(
4511 "multiple values for connection_id",
4512 ));
4513 }
4514 result.connection_id = map
4515 .next_value::<std::option::Option<std::string::String>>()?
4516 .unwrap_or_default();
4517 }
4518 __FieldTag::Unknown(key) => {
4519 let value = map.next_value::<serde_json::Value>()?;
4520 result._unknown_fields.insert(key, value);
4521 }
4522 }
4523 }
4524 std::result::Result::Ok(result)
4525 }
4526 }
4527 deserializer.deserialize_any(Visitor)
4528 }
4529}
4530
4531#[doc(hidden)]
4532impl serde::ser::Serialize for CreateConnectionRequest {
4533 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4534 where
4535 S: serde::ser::Serializer,
4536 {
4537 use serde::ser::SerializeMap;
4538 #[allow(unused_imports)]
4539 use std::option::Option::Some;
4540 let mut state = serializer.serialize_map(std::option::Option::None)?;
4541 if !self.parent.is_empty() {
4542 state.serialize_entry("parent", &self.parent)?;
4543 }
4544 if self.connection.is_some() {
4545 state.serialize_entry("connection", &self.connection)?;
4546 }
4547 if !self.connection_id.is_empty() {
4548 state.serialize_entry("connectionId", &self.connection_id)?;
4549 }
4550 if !self._unknown_fields.is_empty() {
4551 for (key, value) in self._unknown_fields.iter() {
4552 state.serialize_entry(key, &value)?;
4553 }
4554 }
4555 state.end()
4556 }
4557}
4558
4559#[derive(Clone, Debug, Default, PartialEq)]
4561#[non_exhaustive]
4562pub struct GetConnectionRequest {
4563 pub name: std::string::String,
4566
4567 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4568}
4569
4570impl GetConnectionRequest {
4571 pub fn new() -> Self {
4572 std::default::Default::default()
4573 }
4574
4575 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4577 self.name = v.into();
4578 self
4579 }
4580}
4581
4582impl wkt::message::Message for GetConnectionRequest {
4583 fn typename() -> &'static str {
4584 "type.googleapis.com/google.devtools.cloudbuild.v2.GetConnectionRequest"
4585 }
4586}
4587
4588#[doc(hidden)]
4589impl<'de> serde::de::Deserialize<'de> for GetConnectionRequest {
4590 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4591 where
4592 D: serde::Deserializer<'de>,
4593 {
4594 #[allow(non_camel_case_types)]
4595 #[doc(hidden)]
4596 #[derive(PartialEq, Eq, Hash)]
4597 enum __FieldTag {
4598 __name,
4599 Unknown(std::string::String),
4600 }
4601 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4602 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4603 where
4604 D: serde::Deserializer<'de>,
4605 {
4606 struct Visitor;
4607 impl<'de> serde::de::Visitor<'de> for Visitor {
4608 type Value = __FieldTag;
4609 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4610 formatter.write_str("a field name for GetConnectionRequest")
4611 }
4612 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4613 where
4614 E: serde::de::Error,
4615 {
4616 use std::result::Result::Ok;
4617 use std::string::ToString;
4618 match value {
4619 "name" => Ok(__FieldTag::__name),
4620 _ => Ok(__FieldTag::Unknown(value.to_string())),
4621 }
4622 }
4623 }
4624 deserializer.deserialize_identifier(Visitor)
4625 }
4626 }
4627 struct Visitor;
4628 impl<'de> serde::de::Visitor<'de> for Visitor {
4629 type Value = GetConnectionRequest;
4630 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4631 formatter.write_str("struct GetConnectionRequest")
4632 }
4633 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4634 where
4635 A: serde::de::MapAccess<'de>,
4636 {
4637 #[allow(unused_imports)]
4638 use serde::de::Error;
4639 use std::option::Option::Some;
4640 let mut fields = std::collections::HashSet::new();
4641 let mut result = Self::Value::new();
4642 while let Some(tag) = map.next_key::<__FieldTag>()? {
4643 #[allow(clippy::match_single_binding)]
4644 match tag {
4645 __FieldTag::__name => {
4646 if !fields.insert(__FieldTag::__name) {
4647 return std::result::Result::Err(A::Error::duplicate_field(
4648 "multiple values for name",
4649 ));
4650 }
4651 result.name = map
4652 .next_value::<std::option::Option<std::string::String>>()?
4653 .unwrap_or_default();
4654 }
4655 __FieldTag::Unknown(key) => {
4656 let value = map.next_value::<serde_json::Value>()?;
4657 result._unknown_fields.insert(key, value);
4658 }
4659 }
4660 }
4661 std::result::Result::Ok(result)
4662 }
4663 }
4664 deserializer.deserialize_any(Visitor)
4665 }
4666}
4667
4668#[doc(hidden)]
4669impl serde::ser::Serialize for GetConnectionRequest {
4670 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4671 where
4672 S: serde::ser::Serializer,
4673 {
4674 use serde::ser::SerializeMap;
4675 #[allow(unused_imports)]
4676 use std::option::Option::Some;
4677 let mut state = serializer.serialize_map(std::option::Option::None)?;
4678 if !self.name.is_empty() {
4679 state.serialize_entry("name", &self.name)?;
4680 }
4681 if !self._unknown_fields.is_empty() {
4682 for (key, value) in self._unknown_fields.iter() {
4683 state.serialize_entry(key, &value)?;
4684 }
4685 }
4686 state.end()
4687 }
4688}
4689
4690#[derive(Clone, Debug, Default, PartialEq)]
4692#[non_exhaustive]
4693pub struct ListConnectionsRequest {
4694 pub parent: std::string::String,
4697
4698 pub page_size: i32,
4700
4701 pub page_token: std::string::String,
4703
4704 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4705}
4706
4707impl ListConnectionsRequest {
4708 pub fn new() -> Self {
4709 std::default::Default::default()
4710 }
4711
4712 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4714 self.parent = v.into();
4715 self
4716 }
4717
4718 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4720 self.page_size = v.into();
4721 self
4722 }
4723
4724 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4726 self.page_token = v.into();
4727 self
4728 }
4729}
4730
4731impl wkt::message::Message for ListConnectionsRequest {
4732 fn typename() -> &'static str {
4733 "type.googleapis.com/google.devtools.cloudbuild.v2.ListConnectionsRequest"
4734 }
4735}
4736
4737#[doc(hidden)]
4738impl<'de> serde::de::Deserialize<'de> for ListConnectionsRequest {
4739 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4740 where
4741 D: serde::Deserializer<'de>,
4742 {
4743 #[allow(non_camel_case_types)]
4744 #[doc(hidden)]
4745 #[derive(PartialEq, Eq, Hash)]
4746 enum __FieldTag {
4747 __parent,
4748 __page_size,
4749 __page_token,
4750 Unknown(std::string::String),
4751 }
4752 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4753 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4754 where
4755 D: serde::Deserializer<'de>,
4756 {
4757 struct Visitor;
4758 impl<'de> serde::de::Visitor<'de> for Visitor {
4759 type Value = __FieldTag;
4760 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4761 formatter.write_str("a field name for ListConnectionsRequest")
4762 }
4763 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4764 where
4765 E: serde::de::Error,
4766 {
4767 use std::result::Result::Ok;
4768 use std::string::ToString;
4769 match value {
4770 "parent" => Ok(__FieldTag::__parent),
4771 "pageSize" => Ok(__FieldTag::__page_size),
4772 "page_size" => Ok(__FieldTag::__page_size),
4773 "pageToken" => Ok(__FieldTag::__page_token),
4774 "page_token" => Ok(__FieldTag::__page_token),
4775 _ => Ok(__FieldTag::Unknown(value.to_string())),
4776 }
4777 }
4778 }
4779 deserializer.deserialize_identifier(Visitor)
4780 }
4781 }
4782 struct Visitor;
4783 impl<'de> serde::de::Visitor<'de> for Visitor {
4784 type Value = ListConnectionsRequest;
4785 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4786 formatter.write_str("struct ListConnectionsRequest")
4787 }
4788 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4789 where
4790 A: serde::de::MapAccess<'de>,
4791 {
4792 #[allow(unused_imports)]
4793 use serde::de::Error;
4794 use std::option::Option::Some;
4795 let mut fields = std::collections::HashSet::new();
4796 let mut result = Self::Value::new();
4797 while let Some(tag) = map.next_key::<__FieldTag>()? {
4798 #[allow(clippy::match_single_binding)]
4799 match tag {
4800 __FieldTag::__parent => {
4801 if !fields.insert(__FieldTag::__parent) {
4802 return std::result::Result::Err(A::Error::duplicate_field(
4803 "multiple values for parent",
4804 ));
4805 }
4806 result.parent = map
4807 .next_value::<std::option::Option<std::string::String>>()?
4808 .unwrap_or_default();
4809 }
4810 __FieldTag::__page_size => {
4811 if !fields.insert(__FieldTag::__page_size) {
4812 return std::result::Result::Err(A::Error::duplicate_field(
4813 "multiple values for page_size",
4814 ));
4815 }
4816 struct __With(std::option::Option<i32>);
4817 impl<'de> serde::de::Deserialize<'de> for __With {
4818 fn deserialize<D>(
4819 deserializer: D,
4820 ) -> std::result::Result<Self, D::Error>
4821 where
4822 D: serde::de::Deserializer<'de>,
4823 {
4824 serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4825 }
4826 }
4827 result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
4828 }
4829 __FieldTag::__page_token => {
4830 if !fields.insert(__FieldTag::__page_token) {
4831 return std::result::Result::Err(A::Error::duplicate_field(
4832 "multiple values for page_token",
4833 ));
4834 }
4835 result.page_token = map
4836 .next_value::<std::option::Option<std::string::String>>()?
4837 .unwrap_or_default();
4838 }
4839 __FieldTag::Unknown(key) => {
4840 let value = map.next_value::<serde_json::Value>()?;
4841 result._unknown_fields.insert(key, value);
4842 }
4843 }
4844 }
4845 std::result::Result::Ok(result)
4846 }
4847 }
4848 deserializer.deserialize_any(Visitor)
4849 }
4850}
4851
4852#[doc(hidden)]
4853impl serde::ser::Serialize for ListConnectionsRequest {
4854 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4855 where
4856 S: serde::ser::Serializer,
4857 {
4858 use serde::ser::SerializeMap;
4859 #[allow(unused_imports)]
4860 use std::option::Option::Some;
4861 let mut state = serializer.serialize_map(std::option::Option::None)?;
4862 if !self.parent.is_empty() {
4863 state.serialize_entry("parent", &self.parent)?;
4864 }
4865 if !wkt::internal::is_default(&self.page_size) {
4866 struct __With<'a>(&'a i32);
4867 impl<'a> serde::ser::Serialize for __With<'a> {
4868 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4869 where
4870 S: serde::ser::Serializer,
4871 {
4872 serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
4873 }
4874 }
4875 state.serialize_entry("pageSize", &__With(&self.page_size))?;
4876 }
4877 if !self.page_token.is_empty() {
4878 state.serialize_entry("pageToken", &self.page_token)?;
4879 }
4880 if !self._unknown_fields.is_empty() {
4881 for (key, value) in self._unknown_fields.iter() {
4882 state.serialize_entry(key, &value)?;
4883 }
4884 }
4885 state.end()
4886 }
4887}
4888
4889#[derive(Clone, Debug, Default, PartialEq)]
4891#[non_exhaustive]
4892pub struct ListConnectionsResponse {
4893 pub connections: std::vec::Vec<crate::model::Connection>,
4895
4896 pub next_page_token: std::string::String,
4898
4899 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4900}
4901
4902impl ListConnectionsResponse {
4903 pub fn new() -> Self {
4904 std::default::Default::default()
4905 }
4906
4907 pub fn set_connections<T, V>(mut self, v: T) -> Self
4909 where
4910 T: std::iter::IntoIterator<Item = V>,
4911 V: std::convert::Into<crate::model::Connection>,
4912 {
4913 use std::iter::Iterator;
4914 self.connections = v.into_iter().map(|i| i.into()).collect();
4915 self
4916 }
4917
4918 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4920 self.next_page_token = v.into();
4921 self
4922 }
4923}
4924
4925impl wkt::message::Message for ListConnectionsResponse {
4926 fn typename() -> &'static str {
4927 "type.googleapis.com/google.devtools.cloudbuild.v2.ListConnectionsResponse"
4928 }
4929}
4930
4931#[doc(hidden)]
4932impl gax::paginator::internal::PageableResponse for ListConnectionsResponse {
4933 type PageItem = crate::model::Connection;
4934
4935 fn items(self) -> std::vec::Vec<Self::PageItem> {
4936 self.connections
4937 }
4938
4939 fn next_page_token(&self) -> std::string::String {
4940 use std::clone::Clone;
4941 self.next_page_token.clone()
4942 }
4943}
4944
4945#[doc(hidden)]
4946impl<'de> serde::de::Deserialize<'de> for ListConnectionsResponse {
4947 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4948 where
4949 D: serde::Deserializer<'de>,
4950 {
4951 #[allow(non_camel_case_types)]
4952 #[doc(hidden)]
4953 #[derive(PartialEq, Eq, Hash)]
4954 enum __FieldTag {
4955 __connections,
4956 __next_page_token,
4957 Unknown(std::string::String),
4958 }
4959 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4960 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4961 where
4962 D: serde::Deserializer<'de>,
4963 {
4964 struct Visitor;
4965 impl<'de> serde::de::Visitor<'de> for Visitor {
4966 type Value = __FieldTag;
4967 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4968 formatter.write_str("a field name for ListConnectionsResponse")
4969 }
4970 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4971 where
4972 E: serde::de::Error,
4973 {
4974 use std::result::Result::Ok;
4975 use std::string::ToString;
4976 match value {
4977 "connections" => Ok(__FieldTag::__connections),
4978 "nextPageToken" => Ok(__FieldTag::__next_page_token),
4979 "next_page_token" => Ok(__FieldTag::__next_page_token),
4980 _ => Ok(__FieldTag::Unknown(value.to_string())),
4981 }
4982 }
4983 }
4984 deserializer.deserialize_identifier(Visitor)
4985 }
4986 }
4987 struct Visitor;
4988 impl<'de> serde::de::Visitor<'de> for Visitor {
4989 type Value = ListConnectionsResponse;
4990 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4991 formatter.write_str("struct ListConnectionsResponse")
4992 }
4993 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4994 where
4995 A: serde::de::MapAccess<'de>,
4996 {
4997 #[allow(unused_imports)]
4998 use serde::de::Error;
4999 use std::option::Option::Some;
5000 let mut fields = std::collections::HashSet::new();
5001 let mut result = Self::Value::new();
5002 while let Some(tag) = map.next_key::<__FieldTag>()? {
5003 #[allow(clippy::match_single_binding)]
5004 match tag {
5005 __FieldTag::__connections => {
5006 if !fields.insert(__FieldTag::__connections) {
5007 return std::result::Result::Err(A::Error::duplicate_field(
5008 "multiple values for connections",
5009 ));
5010 }
5011 result.connections = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Connection>>>()?.unwrap_or_default();
5012 }
5013 __FieldTag::__next_page_token => {
5014 if !fields.insert(__FieldTag::__next_page_token) {
5015 return std::result::Result::Err(A::Error::duplicate_field(
5016 "multiple values for next_page_token",
5017 ));
5018 }
5019 result.next_page_token = map
5020 .next_value::<std::option::Option<std::string::String>>()?
5021 .unwrap_or_default();
5022 }
5023 __FieldTag::Unknown(key) => {
5024 let value = map.next_value::<serde_json::Value>()?;
5025 result._unknown_fields.insert(key, value);
5026 }
5027 }
5028 }
5029 std::result::Result::Ok(result)
5030 }
5031 }
5032 deserializer.deserialize_any(Visitor)
5033 }
5034}
5035
5036#[doc(hidden)]
5037impl serde::ser::Serialize for ListConnectionsResponse {
5038 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5039 where
5040 S: serde::ser::Serializer,
5041 {
5042 use serde::ser::SerializeMap;
5043 #[allow(unused_imports)]
5044 use std::option::Option::Some;
5045 let mut state = serializer.serialize_map(std::option::Option::None)?;
5046 if !self.connections.is_empty() {
5047 state.serialize_entry("connections", &self.connections)?;
5048 }
5049 if !self.next_page_token.is_empty() {
5050 state.serialize_entry("nextPageToken", &self.next_page_token)?;
5051 }
5052 if !self._unknown_fields.is_empty() {
5053 for (key, value) in self._unknown_fields.iter() {
5054 state.serialize_entry(key, &value)?;
5055 }
5056 }
5057 state.end()
5058 }
5059}
5060
5061#[derive(Clone, Debug, Default, PartialEq)]
5063#[non_exhaustive]
5064pub struct UpdateConnectionRequest {
5065 pub connection: std::option::Option<crate::model::Connection>,
5067
5068 pub update_mask: std::option::Option<wkt::FieldMask>,
5070
5071 pub allow_missing: bool,
5077
5078 pub etag: std::string::String,
5082
5083 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5084}
5085
5086impl UpdateConnectionRequest {
5087 pub fn new() -> Self {
5088 std::default::Default::default()
5089 }
5090
5091 pub fn set_connection<T>(mut self, v: T) -> Self
5093 where
5094 T: std::convert::Into<crate::model::Connection>,
5095 {
5096 self.connection = std::option::Option::Some(v.into());
5097 self
5098 }
5099
5100 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
5102 where
5103 T: std::convert::Into<crate::model::Connection>,
5104 {
5105 self.connection = v.map(|x| x.into());
5106 self
5107 }
5108
5109 pub fn set_update_mask<T>(mut self, v: T) -> Self
5111 where
5112 T: std::convert::Into<wkt::FieldMask>,
5113 {
5114 self.update_mask = std::option::Option::Some(v.into());
5115 self
5116 }
5117
5118 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5120 where
5121 T: std::convert::Into<wkt::FieldMask>,
5122 {
5123 self.update_mask = v.map(|x| x.into());
5124 self
5125 }
5126
5127 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5129 self.allow_missing = v.into();
5130 self
5131 }
5132
5133 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5135 self.etag = v.into();
5136 self
5137 }
5138}
5139
5140impl wkt::message::Message for UpdateConnectionRequest {
5141 fn typename() -> &'static str {
5142 "type.googleapis.com/google.devtools.cloudbuild.v2.UpdateConnectionRequest"
5143 }
5144}
5145
5146#[doc(hidden)]
5147impl<'de> serde::de::Deserialize<'de> for UpdateConnectionRequest {
5148 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5149 where
5150 D: serde::Deserializer<'de>,
5151 {
5152 #[allow(non_camel_case_types)]
5153 #[doc(hidden)]
5154 #[derive(PartialEq, Eq, Hash)]
5155 enum __FieldTag {
5156 __connection,
5157 __update_mask,
5158 __allow_missing,
5159 __etag,
5160 Unknown(std::string::String),
5161 }
5162 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5163 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5164 where
5165 D: serde::Deserializer<'de>,
5166 {
5167 struct Visitor;
5168 impl<'de> serde::de::Visitor<'de> for Visitor {
5169 type Value = __FieldTag;
5170 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5171 formatter.write_str("a field name for UpdateConnectionRequest")
5172 }
5173 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5174 where
5175 E: serde::de::Error,
5176 {
5177 use std::result::Result::Ok;
5178 use std::string::ToString;
5179 match value {
5180 "connection" => Ok(__FieldTag::__connection),
5181 "updateMask" => Ok(__FieldTag::__update_mask),
5182 "update_mask" => Ok(__FieldTag::__update_mask),
5183 "allowMissing" => Ok(__FieldTag::__allow_missing),
5184 "allow_missing" => Ok(__FieldTag::__allow_missing),
5185 "etag" => Ok(__FieldTag::__etag),
5186 _ => Ok(__FieldTag::Unknown(value.to_string())),
5187 }
5188 }
5189 }
5190 deserializer.deserialize_identifier(Visitor)
5191 }
5192 }
5193 struct Visitor;
5194 impl<'de> serde::de::Visitor<'de> for Visitor {
5195 type Value = UpdateConnectionRequest;
5196 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5197 formatter.write_str("struct UpdateConnectionRequest")
5198 }
5199 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5200 where
5201 A: serde::de::MapAccess<'de>,
5202 {
5203 #[allow(unused_imports)]
5204 use serde::de::Error;
5205 use std::option::Option::Some;
5206 let mut fields = std::collections::HashSet::new();
5207 let mut result = Self::Value::new();
5208 while let Some(tag) = map.next_key::<__FieldTag>()? {
5209 #[allow(clippy::match_single_binding)]
5210 match tag {
5211 __FieldTag::__connection => {
5212 if !fields.insert(__FieldTag::__connection) {
5213 return std::result::Result::Err(A::Error::duplicate_field(
5214 "multiple values for connection",
5215 ));
5216 }
5217 result.connection =
5218 map.next_value::<std::option::Option<crate::model::Connection>>()?;
5219 }
5220 __FieldTag::__update_mask => {
5221 if !fields.insert(__FieldTag::__update_mask) {
5222 return std::result::Result::Err(A::Error::duplicate_field(
5223 "multiple values for update_mask",
5224 ));
5225 }
5226 result.update_mask =
5227 map.next_value::<std::option::Option<wkt::FieldMask>>()?;
5228 }
5229 __FieldTag::__allow_missing => {
5230 if !fields.insert(__FieldTag::__allow_missing) {
5231 return std::result::Result::Err(A::Error::duplicate_field(
5232 "multiple values for allow_missing",
5233 ));
5234 }
5235 result.allow_missing = map
5236 .next_value::<std::option::Option<bool>>()?
5237 .unwrap_or_default();
5238 }
5239 __FieldTag::__etag => {
5240 if !fields.insert(__FieldTag::__etag) {
5241 return std::result::Result::Err(A::Error::duplicate_field(
5242 "multiple values for etag",
5243 ));
5244 }
5245 result.etag = map
5246 .next_value::<std::option::Option<std::string::String>>()?
5247 .unwrap_or_default();
5248 }
5249 __FieldTag::Unknown(key) => {
5250 let value = map.next_value::<serde_json::Value>()?;
5251 result._unknown_fields.insert(key, value);
5252 }
5253 }
5254 }
5255 std::result::Result::Ok(result)
5256 }
5257 }
5258 deserializer.deserialize_any(Visitor)
5259 }
5260}
5261
5262#[doc(hidden)]
5263impl serde::ser::Serialize for UpdateConnectionRequest {
5264 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5265 where
5266 S: serde::ser::Serializer,
5267 {
5268 use serde::ser::SerializeMap;
5269 #[allow(unused_imports)]
5270 use std::option::Option::Some;
5271 let mut state = serializer.serialize_map(std::option::Option::None)?;
5272 if self.connection.is_some() {
5273 state.serialize_entry("connection", &self.connection)?;
5274 }
5275 if self.update_mask.is_some() {
5276 state.serialize_entry("updateMask", &self.update_mask)?;
5277 }
5278 if !wkt::internal::is_default(&self.allow_missing) {
5279 state.serialize_entry("allowMissing", &self.allow_missing)?;
5280 }
5281 if !self.etag.is_empty() {
5282 state.serialize_entry("etag", &self.etag)?;
5283 }
5284 if !self._unknown_fields.is_empty() {
5285 for (key, value) in self._unknown_fields.iter() {
5286 state.serialize_entry(key, &value)?;
5287 }
5288 }
5289 state.end()
5290 }
5291}
5292
5293#[derive(Clone, Debug, Default, PartialEq)]
5295#[non_exhaustive]
5296pub struct DeleteConnectionRequest {
5297 pub name: std::string::String,
5300
5301 pub etag: std::string::String,
5305
5306 pub validate_only: bool,
5308
5309 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5310}
5311
5312impl DeleteConnectionRequest {
5313 pub fn new() -> Self {
5314 std::default::Default::default()
5315 }
5316
5317 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5319 self.name = v.into();
5320 self
5321 }
5322
5323 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5325 self.etag = v.into();
5326 self
5327 }
5328
5329 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5331 self.validate_only = v.into();
5332 self
5333 }
5334}
5335
5336impl wkt::message::Message for DeleteConnectionRequest {
5337 fn typename() -> &'static str {
5338 "type.googleapis.com/google.devtools.cloudbuild.v2.DeleteConnectionRequest"
5339 }
5340}
5341
5342#[doc(hidden)]
5343impl<'de> serde::de::Deserialize<'de> for DeleteConnectionRequest {
5344 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5345 where
5346 D: serde::Deserializer<'de>,
5347 {
5348 #[allow(non_camel_case_types)]
5349 #[doc(hidden)]
5350 #[derive(PartialEq, Eq, Hash)]
5351 enum __FieldTag {
5352 __name,
5353 __etag,
5354 __validate_only,
5355 Unknown(std::string::String),
5356 }
5357 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5358 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5359 where
5360 D: serde::Deserializer<'de>,
5361 {
5362 struct Visitor;
5363 impl<'de> serde::de::Visitor<'de> for Visitor {
5364 type Value = __FieldTag;
5365 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5366 formatter.write_str("a field name for DeleteConnectionRequest")
5367 }
5368 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5369 where
5370 E: serde::de::Error,
5371 {
5372 use std::result::Result::Ok;
5373 use std::string::ToString;
5374 match value {
5375 "name" => Ok(__FieldTag::__name),
5376 "etag" => Ok(__FieldTag::__etag),
5377 "validateOnly" => Ok(__FieldTag::__validate_only),
5378 "validate_only" => Ok(__FieldTag::__validate_only),
5379 _ => Ok(__FieldTag::Unknown(value.to_string())),
5380 }
5381 }
5382 }
5383 deserializer.deserialize_identifier(Visitor)
5384 }
5385 }
5386 struct Visitor;
5387 impl<'de> serde::de::Visitor<'de> for Visitor {
5388 type Value = DeleteConnectionRequest;
5389 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5390 formatter.write_str("struct DeleteConnectionRequest")
5391 }
5392 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5393 where
5394 A: serde::de::MapAccess<'de>,
5395 {
5396 #[allow(unused_imports)]
5397 use serde::de::Error;
5398 use std::option::Option::Some;
5399 let mut fields = std::collections::HashSet::new();
5400 let mut result = Self::Value::new();
5401 while let Some(tag) = map.next_key::<__FieldTag>()? {
5402 #[allow(clippy::match_single_binding)]
5403 match tag {
5404 __FieldTag::__name => {
5405 if !fields.insert(__FieldTag::__name) {
5406 return std::result::Result::Err(A::Error::duplicate_field(
5407 "multiple values for name",
5408 ));
5409 }
5410 result.name = map
5411 .next_value::<std::option::Option<std::string::String>>()?
5412 .unwrap_or_default();
5413 }
5414 __FieldTag::__etag => {
5415 if !fields.insert(__FieldTag::__etag) {
5416 return std::result::Result::Err(A::Error::duplicate_field(
5417 "multiple values for etag",
5418 ));
5419 }
5420 result.etag = map
5421 .next_value::<std::option::Option<std::string::String>>()?
5422 .unwrap_or_default();
5423 }
5424 __FieldTag::__validate_only => {
5425 if !fields.insert(__FieldTag::__validate_only) {
5426 return std::result::Result::Err(A::Error::duplicate_field(
5427 "multiple values for validate_only",
5428 ));
5429 }
5430 result.validate_only = map
5431 .next_value::<std::option::Option<bool>>()?
5432 .unwrap_or_default();
5433 }
5434 __FieldTag::Unknown(key) => {
5435 let value = map.next_value::<serde_json::Value>()?;
5436 result._unknown_fields.insert(key, value);
5437 }
5438 }
5439 }
5440 std::result::Result::Ok(result)
5441 }
5442 }
5443 deserializer.deserialize_any(Visitor)
5444 }
5445}
5446
5447#[doc(hidden)]
5448impl serde::ser::Serialize for DeleteConnectionRequest {
5449 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5450 where
5451 S: serde::ser::Serializer,
5452 {
5453 use serde::ser::SerializeMap;
5454 #[allow(unused_imports)]
5455 use std::option::Option::Some;
5456 let mut state = serializer.serialize_map(std::option::Option::None)?;
5457 if !self.name.is_empty() {
5458 state.serialize_entry("name", &self.name)?;
5459 }
5460 if !self.etag.is_empty() {
5461 state.serialize_entry("etag", &self.etag)?;
5462 }
5463 if !wkt::internal::is_default(&self.validate_only) {
5464 state.serialize_entry("validateOnly", &self.validate_only)?;
5465 }
5466 if !self._unknown_fields.is_empty() {
5467 for (key, value) in self._unknown_fields.iter() {
5468 state.serialize_entry(key, &value)?;
5469 }
5470 }
5471 state.end()
5472 }
5473}
5474
5475#[derive(Clone, Debug, Default, PartialEq)]
5477#[non_exhaustive]
5478pub struct CreateRepositoryRequest {
5479 pub parent: std::string::String,
5483
5484 pub repository: std::option::Option<crate::model::Repository>,
5486
5487 pub repository_id: std::string::String,
5492
5493 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5494}
5495
5496impl CreateRepositoryRequest {
5497 pub fn new() -> Self {
5498 std::default::Default::default()
5499 }
5500
5501 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5503 self.parent = v.into();
5504 self
5505 }
5506
5507 pub fn set_repository<T>(mut self, v: T) -> Self
5509 where
5510 T: std::convert::Into<crate::model::Repository>,
5511 {
5512 self.repository = std::option::Option::Some(v.into());
5513 self
5514 }
5515
5516 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
5518 where
5519 T: std::convert::Into<crate::model::Repository>,
5520 {
5521 self.repository = v.map(|x| x.into());
5522 self
5523 }
5524
5525 pub fn set_repository_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5527 self.repository_id = v.into();
5528 self
5529 }
5530}
5531
5532impl wkt::message::Message for CreateRepositoryRequest {
5533 fn typename() -> &'static str {
5534 "type.googleapis.com/google.devtools.cloudbuild.v2.CreateRepositoryRequest"
5535 }
5536}
5537
5538#[doc(hidden)]
5539impl<'de> serde::de::Deserialize<'de> for CreateRepositoryRequest {
5540 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5541 where
5542 D: serde::Deserializer<'de>,
5543 {
5544 #[allow(non_camel_case_types)]
5545 #[doc(hidden)]
5546 #[derive(PartialEq, Eq, Hash)]
5547 enum __FieldTag {
5548 __parent,
5549 __repository,
5550 __repository_id,
5551 Unknown(std::string::String),
5552 }
5553 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5554 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5555 where
5556 D: serde::Deserializer<'de>,
5557 {
5558 struct Visitor;
5559 impl<'de> serde::de::Visitor<'de> for Visitor {
5560 type Value = __FieldTag;
5561 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5562 formatter.write_str("a field name for CreateRepositoryRequest")
5563 }
5564 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5565 where
5566 E: serde::de::Error,
5567 {
5568 use std::result::Result::Ok;
5569 use std::string::ToString;
5570 match value {
5571 "parent" => Ok(__FieldTag::__parent),
5572 "repository" => Ok(__FieldTag::__repository),
5573 "repositoryId" => Ok(__FieldTag::__repository_id),
5574 "repository_id" => Ok(__FieldTag::__repository_id),
5575 _ => Ok(__FieldTag::Unknown(value.to_string())),
5576 }
5577 }
5578 }
5579 deserializer.deserialize_identifier(Visitor)
5580 }
5581 }
5582 struct Visitor;
5583 impl<'de> serde::de::Visitor<'de> for Visitor {
5584 type Value = CreateRepositoryRequest;
5585 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5586 formatter.write_str("struct CreateRepositoryRequest")
5587 }
5588 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5589 where
5590 A: serde::de::MapAccess<'de>,
5591 {
5592 #[allow(unused_imports)]
5593 use serde::de::Error;
5594 use std::option::Option::Some;
5595 let mut fields = std::collections::HashSet::new();
5596 let mut result = Self::Value::new();
5597 while let Some(tag) = map.next_key::<__FieldTag>()? {
5598 #[allow(clippy::match_single_binding)]
5599 match tag {
5600 __FieldTag::__parent => {
5601 if !fields.insert(__FieldTag::__parent) {
5602 return std::result::Result::Err(A::Error::duplicate_field(
5603 "multiple values for parent",
5604 ));
5605 }
5606 result.parent = map
5607 .next_value::<std::option::Option<std::string::String>>()?
5608 .unwrap_or_default();
5609 }
5610 __FieldTag::__repository => {
5611 if !fields.insert(__FieldTag::__repository) {
5612 return std::result::Result::Err(A::Error::duplicate_field(
5613 "multiple values for repository",
5614 ));
5615 }
5616 result.repository =
5617 map.next_value::<std::option::Option<crate::model::Repository>>()?;
5618 }
5619 __FieldTag::__repository_id => {
5620 if !fields.insert(__FieldTag::__repository_id) {
5621 return std::result::Result::Err(A::Error::duplicate_field(
5622 "multiple values for repository_id",
5623 ));
5624 }
5625 result.repository_id = map
5626 .next_value::<std::option::Option<std::string::String>>()?
5627 .unwrap_or_default();
5628 }
5629 __FieldTag::Unknown(key) => {
5630 let value = map.next_value::<serde_json::Value>()?;
5631 result._unknown_fields.insert(key, value);
5632 }
5633 }
5634 }
5635 std::result::Result::Ok(result)
5636 }
5637 }
5638 deserializer.deserialize_any(Visitor)
5639 }
5640}
5641
5642#[doc(hidden)]
5643impl serde::ser::Serialize for CreateRepositoryRequest {
5644 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5645 where
5646 S: serde::ser::Serializer,
5647 {
5648 use serde::ser::SerializeMap;
5649 #[allow(unused_imports)]
5650 use std::option::Option::Some;
5651 let mut state = serializer.serialize_map(std::option::Option::None)?;
5652 if !self.parent.is_empty() {
5653 state.serialize_entry("parent", &self.parent)?;
5654 }
5655 if self.repository.is_some() {
5656 state.serialize_entry("repository", &self.repository)?;
5657 }
5658 if !self.repository_id.is_empty() {
5659 state.serialize_entry("repositoryId", &self.repository_id)?;
5660 }
5661 if !self._unknown_fields.is_empty() {
5662 for (key, value) in self._unknown_fields.iter() {
5663 state.serialize_entry(key, &value)?;
5664 }
5665 }
5666 state.end()
5667 }
5668}
5669
5670#[derive(Clone, Debug, Default, PartialEq)]
5672#[non_exhaustive]
5673pub struct BatchCreateRepositoriesRequest {
5674 pub parent: std::string::String,
5679
5680 pub requests: std::vec::Vec<crate::model::CreateRepositoryRequest>,
5682
5683 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5684}
5685
5686impl BatchCreateRepositoriesRequest {
5687 pub fn new() -> Self {
5688 std::default::Default::default()
5689 }
5690
5691 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5693 self.parent = v.into();
5694 self
5695 }
5696
5697 pub fn set_requests<T, V>(mut self, v: T) -> Self
5699 where
5700 T: std::iter::IntoIterator<Item = V>,
5701 V: std::convert::Into<crate::model::CreateRepositoryRequest>,
5702 {
5703 use std::iter::Iterator;
5704 self.requests = v.into_iter().map(|i| i.into()).collect();
5705 self
5706 }
5707}
5708
5709impl wkt::message::Message for BatchCreateRepositoriesRequest {
5710 fn typename() -> &'static str {
5711 "type.googleapis.com/google.devtools.cloudbuild.v2.BatchCreateRepositoriesRequest"
5712 }
5713}
5714
5715#[doc(hidden)]
5716impl<'de> serde::de::Deserialize<'de> for BatchCreateRepositoriesRequest {
5717 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5718 where
5719 D: serde::Deserializer<'de>,
5720 {
5721 #[allow(non_camel_case_types)]
5722 #[doc(hidden)]
5723 #[derive(PartialEq, Eq, Hash)]
5724 enum __FieldTag {
5725 __parent,
5726 __requests,
5727 Unknown(std::string::String),
5728 }
5729 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5730 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5731 where
5732 D: serde::Deserializer<'de>,
5733 {
5734 struct Visitor;
5735 impl<'de> serde::de::Visitor<'de> for Visitor {
5736 type Value = __FieldTag;
5737 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5738 formatter.write_str("a field name for BatchCreateRepositoriesRequest")
5739 }
5740 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5741 where
5742 E: serde::de::Error,
5743 {
5744 use std::result::Result::Ok;
5745 use std::string::ToString;
5746 match value {
5747 "parent" => Ok(__FieldTag::__parent),
5748 "requests" => Ok(__FieldTag::__requests),
5749 _ => Ok(__FieldTag::Unknown(value.to_string())),
5750 }
5751 }
5752 }
5753 deserializer.deserialize_identifier(Visitor)
5754 }
5755 }
5756 struct Visitor;
5757 impl<'de> serde::de::Visitor<'de> for Visitor {
5758 type Value = BatchCreateRepositoriesRequest;
5759 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5760 formatter.write_str("struct BatchCreateRepositoriesRequest")
5761 }
5762 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5763 where
5764 A: serde::de::MapAccess<'de>,
5765 {
5766 #[allow(unused_imports)]
5767 use serde::de::Error;
5768 use std::option::Option::Some;
5769 let mut fields = std::collections::HashSet::new();
5770 let mut result = Self::Value::new();
5771 while let Some(tag) = map.next_key::<__FieldTag>()? {
5772 #[allow(clippy::match_single_binding)]
5773 match tag {
5774 __FieldTag::__parent => {
5775 if !fields.insert(__FieldTag::__parent) {
5776 return std::result::Result::Err(A::Error::duplicate_field(
5777 "multiple values for parent",
5778 ));
5779 }
5780 result.parent = map
5781 .next_value::<std::option::Option<std::string::String>>()?
5782 .unwrap_or_default();
5783 }
5784 __FieldTag::__requests => {
5785 if !fields.insert(__FieldTag::__requests) {
5786 return std::result::Result::Err(A::Error::duplicate_field(
5787 "multiple values for requests",
5788 ));
5789 }
5790 result.requests = map
5791 .next_value::<std::option::Option<
5792 std::vec::Vec<crate::model::CreateRepositoryRequest>,
5793 >>()?
5794 .unwrap_or_default();
5795 }
5796 __FieldTag::Unknown(key) => {
5797 let value = map.next_value::<serde_json::Value>()?;
5798 result._unknown_fields.insert(key, value);
5799 }
5800 }
5801 }
5802 std::result::Result::Ok(result)
5803 }
5804 }
5805 deserializer.deserialize_any(Visitor)
5806 }
5807}
5808
5809#[doc(hidden)]
5810impl serde::ser::Serialize for BatchCreateRepositoriesRequest {
5811 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5812 where
5813 S: serde::ser::Serializer,
5814 {
5815 use serde::ser::SerializeMap;
5816 #[allow(unused_imports)]
5817 use std::option::Option::Some;
5818 let mut state = serializer.serialize_map(std::option::Option::None)?;
5819 if !self.parent.is_empty() {
5820 state.serialize_entry("parent", &self.parent)?;
5821 }
5822 if !self.requests.is_empty() {
5823 state.serialize_entry("requests", &self.requests)?;
5824 }
5825 if !self._unknown_fields.is_empty() {
5826 for (key, value) in self._unknown_fields.iter() {
5827 state.serialize_entry(key, &value)?;
5828 }
5829 }
5830 state.end()
5831 }
5832}
5833
5834#[derive(Clone, Debug, Default, PartialEq)]
5836#[non_exhaustive]
5837pub struct BatchCreateRepositoriesResponse {
5838 pub repositories: std::vec::Vec<crate::model::Repository>,
5840
5841 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5842}
5843
5844impl BatchCreateRepositoriesResponse {
5845 pub fn new() -> Self {
5846 std::default::Default::default()
5847 }
5848
5849 pub fn set_repositories<T, V>(mut self, v: T) -> Self
5851 where
5852 T: std::iter::IntoIterator<Item = V>,
5853 V: std::convert::Into<crate::model::Repository>,
5854 {
5855 use std::iter::Iterator;
5856 self.repositories = v.into_iter().map(|i| i.into()).collect();
5857 self
5858 }
5859}
5860
5861impl wkt::message::Message for BatchCreateRepositoriesResponse {
5862 fn typename() -> &'static str {
5863 "type.googleapis.com/google.devtools.cloudbuild.v2.BatchCreateRepositoriesResponse"
5864 }
5865}
5866
5867#[doc(hidden)]
5868impl<'de> serde::de::Deserialize<'de> for BatchCreateRepositoriesResponse {
5869 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5870 where
5871 D: serde::Deserializer<'de>,
5872 {
5873 #[allow(non_camel_case_types)]
5874 #[doc(hidden)]
5875 #[derive(PartialEq, Eq, Hash)]
5876 enum __FieldTag {
5877 __repositories,
5878 Unknown(std::string::String),
5879 }
5880 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5881 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5882 where
5883 D: serde::Deserializer<'de>,
5884 {
5885 struct Visitor;
5886 impl<'de> serde::de::Visitor<'de> for Visitor {
5887 type Value = __FieldTag;
5888 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5889 formatter.write_str("a field name for BatchCreateRepositoriesResponse")
5890 }
5891 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5892 where
5893 E: serde::de::Error,
5894 {
5895 use std::result::Result::Ok;
5896 use std::string::ToString;
5897 match value {
5898 "repositories" => Ok(__FieldTag::__repositories),
5899 _ => Ok(__FieldTag::Unknown(value.to_string())),
5900 }
5901 }
5902 }
5903 deserializer.deserialize_identifier(Visitor)
5904 }
5905 }
5906 struct Visitor;
5907 impl<'de> serde::de::Visitor<'de> for Visitor {
5908 type Value = BatchCreateRepositoriesResponse;
5909 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5910 formatter.write_str("struct BatchCreateRepositoriesResponse")
5911 }
5912 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5913 where
5914 A: serde::de::MapAccess<'de>,
5915 {
5916 #[allow(unused_imports)]
5917 use serde::de::Error;
5918 use std::option::Option::Some;
5919 let mut fields = std::collections::HashSet::new();
5920 let mut result = Self::Value::new();
5921 while let Some(tag) = map.next_key::<__FieldTag>()? {
5922 #[allow(clippy::match_single_binding)]
5923 match tag {
5924 __FieldTag::__repositories => {
5925 if !fields.insert(__FieldTag::__repositories) {
5926 return std::result::Result::Err(A::Error::duplicate_field(
5927 "multiple values for repositories",
5928 ));
5929 }
5930 result.repositories = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Repository>>>()?.unwrap_or_default();
5931 }
5932 __FieldTag::Unknown(key) => {
5933 let value = map.next_value::<serde_json::Value>()?;
5934 result._unknown_fields.insert(key, value);
5935 }
5936 }
5937 }
5938 std::result::Result::Ok(result)
5939 }
5940 }
5941 deserializer.deserialize_any(Visitor)
5942 }
5943}
5944
5945#[doc(hidden)]
5946impl serde::ser::Serialize for BatchCreateRepositoriesResponse {
5947 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5948 where
5949 S: serde::ser::Serializer,
5950 {
5951 use serde::ser::SerializeMap;
5952 #[allow(unused_imports)]
5953 use std::option::Option::Some;
5954 let mut state = serializer.serialize_map(std::option::Option::None)?;
5955 if !self.repositories.is_empty() {
5956 state.serialize_entry("repositories", &self.repositories)?;
5957 }
5958 if !self._unknown_fields.is_empty() {
5959 for (key, value) in self._unknown_fields.iter() {
5960 state.serialize_entry(key, &value)?;
5961 }
5962 }
5963 state.end()
5964 }
5965}
5966
5967#[derive(Clone, Debug, Default, PartialEq)]
5969#[non_exhaustive]
5970pub struct GetRepositoryRequest {
5971 pub name: std::string::String,
5974
5975 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5976}
5977
5978impl GetRepositoryRequest {
5979 pub fn new() -> Self {
5980 std::default::Default::default()
5981 }
5982
5983 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5985 self.name = v.into();
5986 self
5987 }
5988}
5989
5990impl wkt::message::Message for GetRepositoryRequest {
5991 fn typename() -> &'static str {
5992 "type.googleapis.com/google.devtools.cloudbuild.v2.GetRepositoryRequest"
5993 }
5994}
5995
5996#[doc(hidden)]
5997impl<'de> serde::de::Deserialize<'de> for GetRepositoryRequest {
5998 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5999 where
6000 D: serde::Deserializer<'de>,
6001 {
6002 #[allow(non_camel_case_types)]
6003 #[doc(hidden)]
6004 #[derive(PartialEq, Eq, Hash)]
6005 enum __FieldTag {
6006 __name,
6007 Unknown(std::string::String),
6008 }
6009 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6010 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6011 where
6012 D: serde::Deserializer<'de>,
6013 {
6014 struct Visitor;
6015 impl<'de> serde::de::Visitor<'de> for Visitor {
6016 type Value = __FieldTag;
6017 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6018 formatter.write_str("a field name for GetRepositoryRequest")
6019 }
6020 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6021 where
6022 E: serde::de::Error,
6023 {
6024 use std::result::Result::Ok;
6025 use std::string::ToString;
6026 match value {
6027 "name" => Ok(__FieldTag::__name),
6028 _ => Ok(__FieldTag::Unknown(value.to_string())),
6029 }
6030 }
6031 }
6032 deserializer.deserialize_identifier(Visitor)
6033 }
6034 }
6035 struct Visitor;
6036 impl<'de> serde::de::Visitor<'de> for Visitor {
6037 type Value = GetRepositoryRequest;
6038 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6039 formatter.write_str("struct GetRepositoryRequest")
6040 }
6041 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6042 where
6043 A: serde::de::MapAccess<'de>,
6044 {
6045 #[allow(unused_imports)]
6046 use serde::de::Error;
6047 use std::option::Option::Some;
6048 let mut fields = std::collections::HashSet::new();
6049 let mut result = Self::Value::new();
6050 while let Some(tag) = map.next_key::<__FieldTag>()? {
6051 #[allow(clippy::match_single_binding)]
6052 match tag {
6053 __FieldTag::__name => {
6054 if !fields.insert(__FieldTag::__name) {
6055 return std::result::Result::Err(A::Error::duplicate_field(
6056 "multiple values for name",
6057 ));
6058 }
6059 result.name = map
6060 .next_value::<std::option::Option<std::string::String>>()?
6061 .unwrap_or_default();
6062 }
6063 __FieldTag::Unknown(key) => {
6064 let value = map.next_value::<serde_json::Value>()?;
6065 result._unknown_fields.insert(key, value);
6066 }
6067 }
6068 }
6069 std::result::Result::Ok(result)
6070 }
6071 }
6072 deserializer.deserialize_any(Visitor)
6073 }
6074}
6075
6076#[doc(hidden)]
6077impl serde::ser::Serialize for GetRepositoryRequest {
6078 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6079 where
6080 S: serde::ser::Serializer,
6081 {
6082 use serde::ser::SerializeMap;
6083 #[allow(unused_imports)]
6084 use std::option::Option::Some;
6085 let mut state = serializer.serialize_map(std::option::Option::None)?;
6086 if !self.name.is_empty() {
6087 state.serialize_entry("name", &self.name)?;
6088 }
6089 if !self._unknown_fields.is_empty() {
6090 for (key, value) in self._unknown_fields.iter() {
6091 state.serialize_entry(key, &value)?;
6092 }
6093 }
6094 state.end()
6095 }
6096}
6097
6098#[derive(Clone, Debug, Default, PartialEq)]
6100#[non_exhaustive]
6101pub struct ListRepositoriesRequest {
6102 pub parent: std::string::String,
6105
6106 pub page_size: i32,
6108
6109 pub page_token: std::string::String,
6111
6112 pub filter: std::string::String,
6117
6118 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6119}
6120
6121impl ListRepositoriesRequest {
6122 pub fn new() -> Self {
6123 std::default::Default::default()
6124 }
6125
6126 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6128 self.parent = v.into();
6129 self
6130 }
6131
6132 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6134 self.page_size = v.into();
6135 self
6136 }
6137
6138 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6140 self.page_token = v.into();
6141 self
6142 }
6143
6144 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6146 self.filter = v.into();
6147 self
6148 }
6149}
6150
6151impl wkt::message::Message for ListRepositoriesRequest {
6152 fn typename() -> &'static str {
6153 "type.googleapis.com/google.devtools.cloudbuild.v2.ListRepositoriesRequest"
6154 }
6155}
6156
6157#[doc(hidden)]
6158impl<'de> serde::de::Deserialize<'de> for ListRepositoriesRequest {
6159 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6160 where
6161 D: serde::Deserializer<'de>,
6162 {
6163 #[allow(non_camel_case_types)]
6164 #[doc(hidden)]
6165 #[derive(PartialEq, Eq, Hash)]
6166 enum __FieldTag {
6167 __parent,
6168 __page_size,
6169 __page_token,
6170 __filter,
6171 Unknown(std::string::String),
6172 }
6173 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6174 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6175 where
6176 D: serde::Deserializer<'de>,
6177 {
6178 struct Visitor;
6179 impl<'de> serde::de::Visitor<'de> for Visitor {
6180 type Value = __FieldTag;
6181 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6182 formatter.write_str("a field name for ListRepositoriesRequest")
6183 }
6184 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6185 where
6186 E: serde::de::Error,
6187 {
6188 use std::result::Result::Ok;
6189 use std::string::ToString;
6190 match value {
6191 "parent" => Ok(__FieldTag::__parent),
6192 "pageSize" => Ok(__FieldTag::__page_size),
6193 "page_size" => Ok(__FieldTag::__page_size),
6194 "pageToken" => Ok(__FieldTag::__page_token),
6195 "page_token" => Ok(__FieldTag::__page_token),
6196 "filter" => Ok(__FieldTag::__filter),
6197 _ => Ok(__FieldTag::Unknown(value.to_string())),
6198 }
6199 }
6200 }
6201 deserializer.deserialize_identifier(Visitor)
6202 }
6203 }
6204 struct Visitor;
6205 impl<'de> serde::de::Visitor<'de> for Visitor {
6206 type Value = ListRepositoriesRequest;
6207 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6208 formatter.write_str("struct ListRepositoriesRequest")
6209 }
6210 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6211 where
6212 A: serde::de::MapAccess<'de>,
6213 {
6214 #[allow(unused_imports)]
6215 use serde::de::Error;
6216 use std::option::Option::Some;
6217 let mut fields = std::collections::HashSet::new();
6218 let mut result = Self::Value::new();
6219 while let Some(tag) = map.next_key::<__FieldTag>()? {
6220 #[allow(clippy::match_single_binding)]
6221 match tag {
6222 __FieldTag::__parent => {
6223 if !fields.insert(__FieldTag::__parent) {
6224 return std::result::Result::Err(A::Error::duplicate_field(
6225 "multiple values for parent",
6226 ));
6227 }
6228 result.parent = map
6229 .next_value::<std::option::Option<std::string::String>>()?
6230 .unwrap_or_default();
6231 }
6232 __FieldTag::__page_size => {
6233 if !fields.insert(__FieldTag::__page_size) {
6234 return std::result::Result::Err(A::Error::duplicate_field(
6235 "multiple values for page_size",
6236 ));
6237 }
6238 struct __With(std::option::Option<i32>);
6239 impl<'de> serde::de::Deserialize<'de> for __With {
6240 fn deserialize<D>(
6241 deserializer: D,
6242 ) -> std::result::Result<Self, D::Error>
6243 where
6244 D: serde::de::Deserializer<'de>,
6245 {
6246 serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
6247 }
6248 }
6249 result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
6250 }
6251 __FieldTag::__page_token => {
6252 if !fields.insert(__FieldTag::__page_token) {
6253 return std::result::Result::Err(A::Error::duplicate_field(
6254 "multiple values for page_token",
6255 ));
6256 }
6257 result.page_token = map
6258 .next_value::<std::option::Option<std::string::String>>()?
6259 .unwrap_or_default();
6260 }
6261 __FieldTag::__filter => {
6262 if !fields.insert(__FieldTag::__filter) {
6263 return std::result::Result::Err(A::Error::duplicate_field(
6264 "multiple values for filter",
6265 ));
6266 }
6267 result.filter = map
6268 .next_value::<std::option::Option<std::string::String>>()?
6269 .unwrap_or_default();
6270 }
6271 __FieldTag::Unknown(key) => {
6272 let value = map.next_value::<serde_json::Value>()?;
6273 result._unknown_fields.insert(key, value);
6274 }
6275 }
6276 }
6277 std::result::Result::Ok(result)
6278 }
6279 }
6280 deserializer.deserialize_any(Visitor)
6281 }
6282}
6283
6284#[doc(hidden)]
6285impl serde::ser::Serialize for ListRepositoriesRequest {
6286 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6287 where
6288 S: serde::ser::Serializer,
6289 {
6290 use serde::ser::SerializeMap;
6291 #[allow(unused_imports)]
6292 use std::option::Option::Some;
6293 let mut state = serializer.serialize_map(std::option::Option::None)?;
6294 if !self.parent.is_empty() {
6295 state.serialize_entry("parent", &self.parent)?;
6296 }
6297 if !wkt::internal::is_default(&self.page_size) {
6298 struct __With<'a>(&'a i32);
6299 impl<'a> serde::ser::Serialize for __With<'a> {
6300 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6301 where
6302 S: serde::ser::Serializer,
6303 {
6304 serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
6305 }
6306 }
6307 state.serialize_entry("pageSize", &__With(&self.page_size))?;
6308 }
6309 if !self.page_token.is_empty() {
6310 state.serialize_entry("pageToken", &self.page_token)?;
6311 }
6312 if !self.filter.is_empty() {
6313 state.serialize_entry("filter", &self.filter)?;
6314 }
6315 if !self._unknown_fields.is_empty() {
6316 for (key, value) in self._unknown_fields.iter() {
6317 state.serialize_entry(key, &value)?;
6318 }
6319 }
6320 state.end()
6321 }
6322}
6323
6324#[derive(Clone, Debug, Default, PartialEq)]
6326#[non_exhaustive]
6327pub struct ListRepositoriesResponse {
6328 pub repositories: std::vec::Vec<crate::model::Repository>,
6330
6331 pub next_page_token: std::string::String,
6333
6334 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6335}
6336
6337impl ListRepositoriesResponse {
6338 pub fn new() -> Self {
6339 std::default::Default::default()
6340 }
6341
6342 pub fn set_repositories<T, V>(mut self, v: T) -> Self
6344 where
6345 T: std::iter::IntoIterator<Item = V>,
6346 V: std::convert::Into<crate::model::Repository>,
6347 {
6348 use std::iter::Iterator;
6349 self.repositories = v.into_iter().map(|i| i.into()).collect();
6350 self
6351 }
6352
6353 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6355 self.next_page_token = v.into();
6356 self
6357 }
6358}
6359
6360impl wkt::message::Message for ListRepositoriesResponse {
6361 fn typename() -> &'static str {
6362 "type.googleapis.com/google.devtools.cloudbuild.v2.ListRepositoriesResponse"
6363 }
6364}
6365
6366#[doc(hidden)]
6367impl gax::paginator::internal::PageableResponse for ListRepositoriesResponse {
6368 type PageItem = crate::model::Repository;
6369
6370 fn items(self) -> std::vec::Vec<Self::PageItem> {
6371 self.repositories
6372 }
6373
6374 fn next_page_token(&self) -> std::string::String {
6375 use std::clone::Clone;
6376 self.next_page_token.clone()
6377 }
6378}
6379
6380#[doc(hidden)]
6381impl<'de> serde::de::Deserialize<'de> for ListRepositoriesResponse {
6382 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6383 where
6384 D: serde::Deserializer<'de>,
6385 {
6386 #[allow(non_camel_case_types)]
6387 #[doc(hidden)]
6388 #[derive(PartialEq, Eq, Hash)]
6389 enum __FieldTag {
6390 __repositories,
6391 __next_page_token,
6392 Unknown(std::string::String),
6393 }
6394 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6395 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6396 where
6397 D: serde::Deserializer<'de>,
6398 {
6399 struct Visitor;
6400 impl<'de> serde::de::Visitor<'de> for Visitor {
6401 type Value = __FieldTag;
6402 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6403 formatter.write_str("a field name for ListRepositoriesResponse")
6404 }
6405 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6406 where
6407 E: serde::de::Error,
6408 {
6409 use std::result::Result::Ok;
6410 use std::string::ToString;
6411 match value {
6412 "repositories" => Ok(__FieldTag::__repositories),
6413 "nextPageToken" => Ok(__FieldTag::__next_page_token),
6414 "next_page_token" => Ok(__FieldTag::__next_page_token),
6415 _ => Ok(__FieldTag::Unknown(value.to_string())),
6416 }
6417 }
6418 }
6419 deserializer.deserialize_identifier(Visitor)
6420 }
6421 }
6422 struct Visitor;
6423 impl<'de> serde::de::Visitor<'de> for Visitor {
6424 type Value = ListRepositoriesResponse;
6425 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6426 formatter.write_str("struct ListRepositoriesResponse")
6427 }
6428 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6429 where
6430 A: serde::de::MapAccess<'de>,
6431 {
6432 #[allow(unused_imports)]
6433 use serde::de::Error;
6434 use std::option::Option::Some;
6435 let mut fields = std::collections::HashSet::new();
6436 let mut result = Self::Value::new();
6437 while let Some(tag) = map.next_key::<__FieldTag>()? {
6438 #[allow(clippy::match_single_binding)]
6439 match tag {
6440 __FieldTag::__repositories => {
6441 if !fields.insert(__FieldTag::__repositories) {
6442 return std::result::Result::Err(A::Error::duplicate_field(
6443 "multiple values for repositories",
6444 ));
6445 }
6446 result.repositories = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Repository>>>()?.unwrap_or_default();
6447 }
6448 __FieldTag::__next_page_token => {
6449 if !fields.insert(__FieldTag::__next_page_token) {
6450 return std::result::Result::Err(A::Error::duplicate_field(
6451 "multiple values for next_page_token",
6452 ));
6453 }
6454 result.next_page_token = map
6455 .next_value::<std::option::Option<std::string::String>>()?
6456 .unwrap_or_default();
6457 }
6458 __FieldTag::Unknown(key) => {
6459 let value = map.next_value::<serde_json::Value>()?;
6460 result._unknown_fields.insert(key, value);
6461 }
6462 }
6463 }
6464 std::result::Result::Ok(result)
6465 }
6466 }
6467 deserializer.deserialize_any(Visitor)
6468 }
6469}
6470
6471#[doc(hidden)]
6472impl serde::ser::Serialize for ListRepositoriesResponse {
6473 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6474 where
6475 S: serde::ser::Serializer,
6476 {
6477 use serde::ser::SerializeMap;
6478 #[allow(unused_imports)]
6479 use std::option::Option::Some;
6480 let mut state = serializer.serialize_map(std::option::Option::None)?;
6481 if !self.repositories.is_empty() {
6482 state.serialize_entry("repositories", &self.repositories)?;
6483 }
6484 if !self.next_page_token.is_empty() {
6485 state.serialize_entry("nextPageToken", &self.next_page_token)?;
6486 }
6487 if !self._unknown_fields.is_empty() {
6488 for (key, value) in self._unknown_fields.iter() {
6489 state.serialize_entry(key, &value)?;
6490 }
6491 }
6492 state.end()
6493 }
6494}
6495
6496#[derive(Clone, Debug, Default, PartialEq)]
6498#[non_exhaustive]
6499pub struct DeleteRepositoryRequest {
6500 pub name: std::string::String,
6503
6504 pub etag: std::string::String,
6508
6509 pub validate_only: bool,
6511
6512 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6513}
6514
6515impl DeleteRepositoryRequest {
6516 pub fn new() -> Self {
6517 std::default::Default::default()
6518 }
6519
6520 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6522 self.name = v.into();
6523 self
6524 }
6525
6526 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6528 self.etag = v.into();
6529 self
6530 }
6531
6532 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6534 self.validate_only = v.into();
6535 self
6536 }
6537}
6538
6539impl wkt::message::Message for DeleteRepositoryRequest {
6540 fn typename() -> &'static str {
6541 "type.googleapis.com/google.devtools.cloudbuild.v2.DeleteRepositoryRequest"
6542 }
6543}
6544
6545#[doc(hidden)]
6546impl<'de> serde::de::Deserialize<'de> for DeleteRepositoryRequest {
6547 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6548 where
6549 D: serde::Deserializer<'de>,
6550 {
6551 #[allow(non_camel_case_types)]
6552 #[doc(hidden)]
6553 #[derive(PartialEq, Eq, Hash)]
6554 enum __FieldTag {
6555 __name,
6556 __etag,
6557 __validate_only,
6558 Unknown(std::string::String),
6559 }
6560 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6561 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6562 where
6563 D: serde::Deserializer<'de>,
6564 {
6565 struct Visitor;
6566 impl<'de> serde::de::Visitor<'de> for Visitor {
6567 type Value = __FieldTag;
6568 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6569 formatter.write_str("a field name for DeleteRepositoryRequest")
6570 }
6571 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6572 where
6573 E: serde::de::Error,
6574 {
6575 use std::result::Result::Ok;
6576 use std::string::ToString;
6577 match value {
6578 "name" => Ok(__FieldTag::__name),
6579 "etag" => Ok(__FieldTag::__etag),
6580 "validateOnly" => Ok(__FieldTag::__validate_only),
6581 "validate_only" => Ok(__FieldTag::__validate_only),
6582 _ => Ok(__FieldTag::Unknown(value.to_string())),
6583 }
6584 }
6585 }
6586 deserializer.deserialize_identifier(Visitor)
6587 }
6588 }
6589 struct Visitor;
6590 impl<'de> serde::de::Visitor<'de> for Visitor {
6591 type Value = DeleteRepositoryRequest;
6592 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6593 formatter.write_str("struct DeleteRepositoryRequest")
6594 }
6595 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6596 where
6597 A: serde::de::MapAccess<'de>,
6598 {
6599 #[allow(unused_imports)]
6600 use serde::de::Error;
6601 use std::option::Option::Some;
6602 let mut fields = std::collections::HashSet::new();
6603 let mut result = Self::Value::new();
6604 while let Some(tag) = map.next_key::<__FieldTag>()? {
6605 #[allow(clippy::match_single_binding)]
6606 match tag {
6607 __FieldTag::__name => {
6608 if !fields.insert(__FieldTag::__name) {
6609 return std::result::Result::Err(A::Error::duplicate_field(
6610 "multiple values for name",
6611 ));
6612 }
6613 result.name = map
6614 .next_value::<std::option::Option<std::string::String>>()?
6615 .unwrap_or_default();
6616 }
6617 __FieldTag::__etag => {
6618 if !fields.insert(__FieldTag::__etag) {
6619 return std::result::Result::Err(A::Error::duplicate_field(
6620 "multiple values for etag",
6621 ));
6622 }
6623 result.etag = map
6624 .next_value::<std::option::Option<std::string::String>>()?
6625 .unwrap_or_default();
6626 }
6627 __FieldTag::__validate_only => {
6628 if !fields.insert(__FieldTag::__validate_only) {
6629 return std::result::Result::Err(A::Error::duplicate_field(
6630 "multiple values for validate_only",
6631 ));
6632 }
6633 result.validate_only = map
6634 .next_value::<std::option::Option<bool>>()?
6635 .unwrap_or_default();
6636 }
6637 __FieldTag::Unknown(key) => {
6638 let value = map.next_value::<serde_json::Value>()?;
6639 result._unknown_fields.insert(key, value);
6640 }
6641 }
6642 }
6643 std::result::Result::Ok(result)
6644 }
6645 }
6646 deserializer.deserialize_any(Visitor)
6647 }
6648}
6649
6650#[doc(hidden)]
6651impl serde::ser::Serialize for DeleteRepositoryRequest {
6652 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6653 where
6654 S: serde::ser::Serializer,
6655 {
6656 use serde::ser::SerializeMap;
6657 #[allow(unused_imports)]
6658 use std::option::Option::Some;
6659 let mut state = serializer.serialize_map(std::option::Option::None)?;
6660 if !self.name.is_empty() {
6661 state.serialize_entry("name", &self.name)?;
6662 }
6663 if !self.etag.is_empty() {
6664 state.serialize_entry("etag", &self.etag)?;
6665 }
6666 if !wkt::internal::is_default(&self.validate_only) {
6667 state.serialize_entry("validateOnly", &self.validate_only)?;
6668 }
6669 if !self._unknown_fields.is_empty() {
6670 for (key, value) in self._unknown_fields.iter() {
6671 state.serialize_entry(key, &value)?;
6672 }
6673 }
6674 state.end()
6675 }
6676}
6677
6678#[derive(Clone, Debug, Default, PartialEq)]
6680#[non_exhaustive]
6681pub struct FetchReadWriteTokenRequest {
6682 pub repository: std::string::String,
6685
6686 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6687}
6688
6689impl FetchReadWriteTokenRequest {
6690 pub fn new() -> Self {
6691 std::default::Default::default()
6692 }
6693
6694 pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6696 self.repository = v.into();
6697 self
6698 }
6699}
6700
6701impl wkt::message::Message for FetchReadWriteTokenRequest {
6702 fn typename() -> &'static str {
6703 "type.googleapis.com/google.devtools.cloudbuild.v2.FetchReadWriteTokenRequest"
6704 }
6705}
6706
6707#[doc(hidden)]
6708impl<'de> serde::de::Deserialize<'de> for FetchReadWriteTokenRequest {
6709 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6710 where
6711 D: serde::Deserializer<'de>,
6712 {
6713 #[allow(non_camel_case_types)]
6714 #[doc(hidden)]
6715 #[derive(PartialEq, Eq, Hash)]
6716 enum __FieldTag {
6717 __repository,
6718 Unknown(std::string::String),
6719 }
6720 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6721 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6722 where
6723 D: serde::Deserializer<'de>,
6724 {
6725 struct Visitor;
6726 impl<'de> serde::de::Visitor<'de> for Visitor {
6727 type Value = __FieldTag;
6728 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6729 formatter.write_str("a field name for FetchReadWriteTokenRequest")
6730 }
6731 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6732 where
6733 E: serde::de::Error,
6734 {
6735 use std::result::Result::Ok;
6736 use std::string::ToString;
6737 match value {
6738 "repository" => Ok(__FieldTag::__repository),
6739 _ => Ok(__FieldTag::Unknown(value.to_string())),
6740 }
6741 }
6742 }
6743 deserializer.deserialize_identifier(Visitor)
6744 }
6745 }
6746 struct Visitor;
6747 impl<'de> serde::de::Visitor<'de> for Visitor {
6748 type Value = FetchReadWriteTokenRequest;
6749 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6750 formatter.write_str("struct FetchReadWriteTokenRequest")
6751 }
6752 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6753 where
6754 A: serde::de::MapAccess<'de>,
6755 {
6756 #[allow(unused_imports)]
6757 use serde::de::Error;
6758 use std::option::Option::Some;
6759 let mut fields = std::collections::HashSet::new();
6760 let mut result = Self::Value::new();
6761 while let Some(tag) = map.next_key::<__FieldTag>()? {
6762 #[allow(clippy::match_single_binding)]
6763 match tag {
6764 __FieldTag::__repository => {
6765 if !fields.insert(__FieldTag::__repository) {
6766 return std::result::Result::Err(A::Error::duplicate_field(
6767 "multiple values for repository",
6768 ));
6769 }
6770 result.repository = map
6771 .next_value::<std::option::Option<std::string::String>>()?
6772 .unwrap_or_default();
6773 }
6774 __FieldTag::Unknown(key) => {
6775 let value = map.next_value::<serde_json::Value>()?;
6776 result._unknown_fields.insert(key, value);
6777 }
6778 }
6779 }
6780 std::result::Result::Ok(result)
6781 }
6782 }
6783 deserializer.deserialize_any(Visitor)
6784 }
6785}
6786
6787#[doc(hidden)]
6788impl serde::ser::Serialize for FetchReadWriteTokenRequest {
6789 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6790 where
6791 S: serde::ser::Serializer,
6792 {
6793 use serde::ser::SerializeMap;
6794 #[allow(unused_imports)]
6795 use std::option::Option::Some;
6796 let mut state = serializer.serialize_map(std::option::Option::None)?;
6797 if !self.repository.is_empty() {
6798 state.serialize_entry("repository", &self.repository)?;
6799 }
6800 if !self._unknown_fields.is_empty() {
6801 for (key, value) in self._unknown_fields.iter() {
6802 state.serialize_entry(key, &value)?;
6803 }
6804 }
6805 state.end()
6806 }
6807}
6808
6809#[derive(Clone, Debug, Default, PartialEq)]
6811#[non_exhaustive]
6812pub struct FetchReadTokenRequest {
6813 pub repository: std::string::String,
6816
6817 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6818}
6819
6820impl FetchReadTokenRequest {
6821 pub fn new() -> Self {
6822 std::default::Default::default()
6823 }
6824
6825 pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6827 self.repository = v.into();
6828 self
6829 }
6830}
6831
6832impl wkt::message::Message for FetchReadTokenRequest {
6833 fn typename() -> &'static str {
6834 "type.googleapis.com/google.devtools.cloudbuild.v2.FetchReadTokenRequest"
6835 }
6836}
6837
6838#[doc(hidden)]
6839impl<'de> serde::de::Deserialize<'de> for FetchReadTokenRequest {
6840 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6841 where
6842 D: serde::Deserializer<'de>,
6843 {
6844 #[allow(non_camel_case_types)]
6845 #[doc(hidden)]
6846 #[derive(PartialEq, Eq, Hash)]
6847 enum __FieldTag {
6848 __repository,
6849 Unknown(std::string::String),
6850 }
6851 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6852 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6853 where
6854 D: serde::Deserializer<'de>,
6855 {
6856 struct Visitor;
6857 impl<'de> serde::de::Visitor<'de> for Visitor {
6858 type Value = __FieldTag;
6859 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6860 formatter.write_str("a field name for FetchReadTokenRequest")
6861 }
6862 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6863 where
6864 E: serde::de::Error,
6865 {
6866 use std::result::Result::Ok;
6867 use std::string::ToString;
6868 match value {
6869 "repository" => Ok(__FieldTag::__repository),
6870 _ => Ok(__FieldTag::Unknown(value.to_string())),
6871 }
6872 }
6873 }
6874 deserializer.deserialize_identifier(Visitor)
6875 }
6876 }
6877 struct Visitor;
6878 impl<'de> serde::de::Visitor<'de> for Visitor {
6879 type Value = FetchReadTokenRequest;
6880 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6881 formatter.write_str("struct FetchReadTokenRequest")
6882 }
6883 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6884 where
6885 A: serde::de::MapAccess<'de>,
6886 {
6887 #[allow(unused_imports)]
6888 use serde::de::Error;
6889 use std::option::Option::Some;
6890 let mut fields = std::collections::HashSet::new();
6891 let mut result = Self::Value::new();
6892 while let Some(tag) = map.next_key::<__FieldTag>()? {
6893 #[allow(clippy::match_single_binding)]
6894 match tag {
6895 __FieldTag::__repository => {
6896 if !fields.insert(__FieldTag::__repository) {
6897 return std::result::Result::Err(A::Error::duplicate_field(
6898 "multiple values for repository",
6899 ));
6900 }
6901 result.repository = map
6902 .next_value::<std::option::Option<std::string::String>>()?
6903 .unwrap_or_default();
6904 }
6905 __FieldTag::Unknown(key) => {
6906 let value = map.next_value::<serde_json::Value>()?;
6907 result._unknown_fields.insert(key, value);
6908 }
6909 }
6910 }
6911 std::result::Result::Ok(result)
6912 }
6913 }
6914 deserializer.deserialize_any(Visitor)
6915 }
6916}
6917
6918#[doc(hidden)]
6919impl serde::ser::Serialize for FetchReadTokenRequest {
6920 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6921 where
6922 S: serde::ser::Serializer,
6923 {
6924 use serde::ser::SerializeMap;
6925 #[allow(unused_imports)]
6926 use std::option::Option::Some;
6927 let mut state = serializer.serialize_map(std::option::Option::None)?;
6928 if !self.repository.is_empty() {
6929 state.serialize_entry("repository", &self.repository)?;
6930 }
6931 if !self._unknown_fields.is_empty() {
6932 for (key, value) in self._unknown_fields.iter() {
6933 state.serialize_entry(key, &value)?;
6934 }
6935 }
6936 state.end()
6937 }
6938}
6939
6940#[derive(Clone, Debug, Default, PartialEq)]
6942#[non_exhaustive]
6943pub struct FetchReadTokenResponse {
6944 pub token: std::string::String,
6946
6947 pub expiration_time: std::option::Option<wkt::Timestamp>,
6949
6950 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6951}
6952
6953impl FetchReadTokenResponse {
6954 pub fn new() -> Self {
6955 std::default::Default::default()
6956 }
6957
6958 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6960 self.token = v.into();
6961 self
6962 }
6963
6964 pub fn set_expiration_time<T>(mut self, v: T) -> Self
6966 where
6967 T: std::convert::Into<wkt::Timestamp>,
6968 {
6969 self.expiration_time = std::option::Option::Some(v.into());
6970 self
6971 }
6972
6973 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
6975 where
6976 T: std::convert::Into<wkt::Timestamp>,
6977 {
6978 self.expiration_time = v.map(|x| x.into());
6979 self
6980 }
6981}
6982
6983impl wkt::message::Message for FetchReadTokenResponse {
6984 fn typename() -> &'static str {
6985 "type.googleapis.com/google.devtools.cloudbuild.v2.FetchReadTokenResponse"
6986 }
6987}
6988
6989#[doc(hidden)]
6990impl<'de> serde::de::Deserialize<'de> for FetchReadTokenResponse {
6991 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6992 where
6993 D: serde::Deserializer<'de>,
6994 {
6995 #[allow(non_camel_case_types)]
6996 #[doc(hidden)]
6997 #[derive(PartialEq, Eq, Hash)]
6998 enum __FieldTag {
6999 __token,
7000 __expiration_time,
7001 Unknown(std::string::String),
7002 }
7003 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7004 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7005 where
7006 D: serde::Deserializer<'de>,
7007 {
7008 struct Visitor;
7009 impl<'de> serde::de::Visitor<'de> for Visitor {
7010 type Value = __FieldTag;
7011 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7012 formatter.write_str("a field name for FetchReadTokenResponse")
7013 }
7014 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7015 where
7016 E: serde::de::Error,
7017 {
7018 use std::result::Result::Ok;
7019 use std::string::ToString;
7020 match value {
7021 "token" => Ok(__FieldTag::__token),
7022 "expirationTime" => Ok(__FieldTag::__expiration_time),
7023 "expiration_time" => Ok(__FieldTag::__expiration_time),
7024 _ => Ok(__FieldTag::Unknown(value.to_string())),
7025 }
7026 }
7027 }
7028 deserializer.deserialize_identifier(Visitor)
7029 }
7030 }
7031 struct Visitor;
7032 impl<'de> serde::de::Visitor<'de> for Visitor {
7033 type Value = FetchReadTokenResponse;
7034 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7035 formatter.write_str("struct FetchReadTokenResponse")
7036 }
7037 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7038 where
7039 A: serde::de::MapAccess<'de>,
7040 {
7041 #[allow(unused_imports)]
7042 use serde::de::Error;
7043 use std::option::Option::Some;
7044 let mut fields = std::collections::HashSet::new();
7045 let mut result = Self::Value::new();
7046 while let Some(tag) = map.next_key::<__FieldTag>()? {
7047 #[allow(clippy::match_single_binding)]
7048 match tag {
7049 __FieldTag::__token => {
7050 if !fields.insert(__FieldTag::__token) {
7051 return std::result::Result::Err(A::Error::duplicate_field(
7052 "multiple values for token",
7053 ));
7054 }
7055 result.token = map
7056 .next_value::<std::option::Option<std::string::String>>()?
7057 .unwrap_or_default();
7058 }
7059 __FieldTag::__expiration_time => {
7060 if !fields.insert(__FieldTag::__expiration_time) {
7061 return std::result::Result::Err(A::Error::duplicate_field(
7062 "multiple values for expiration_time",
7063 ));
7064 }
7065 result.expiration_time =
7066 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
7067 }
7068 __FieldTag::Unknown(key) => {
7069 let value = map.next_value::<serde_json::Value>()?;
7070 result._unknown_fields.insert(key, value);
7071 }
7072 }
7073 }
7074 std::result::Result::Ok(result)
7075 }
7076 }
7077 deserializer.deserialize_any(Visitor)
7078 }
7079}
7080
7081#[doc(hidden)]
7082impl serde::ser::Serialize for FetchReadTokenResponse {
7083 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7084 where
7085 S: serde::ser::Serializer,
7086 {
7087 use serde::ser::SerializeMap;
7088 #[allow(unused_imports)]
7089 use std::option::Option::Some;
7090 let mut state = serializer.serialize_map(std::option::Option::None)?;
7091 if !self.token.is_empty() {
7092 state.serialize_entry("token", &self.token)?;
7093 }
7094 if self.expiration_time.is_some() {
7095 state.serialize_entry("expirationTime", &self.expiration_time)?;
7096 }
7097 if !self._unknown_fields.is_empty() {
7098 for (key, value) in self._unknown_fields.iter() {
7099 state.serialize_entry(key, &value)?;
7100 }
7101 }
7102 state.end()
7103 }
7104}
7105
7106#[derive(Clone, Debug, Default, PartialEq)]
7108#[non_exhaustive]
7109pub struct FetchReadWriteTokenResponse {
7110 pub token: std::string::String,
7112
7113 pub expiration_time: std::option::Option<wkt::Timestamp>,
7115
7116 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7117}
7118
7119impl FetchReadWriteTokenResponse {
7120 pub fn new() -> Self {
7121 std::default::Default::default()
7122 }
7123
7124 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7126 self.token = v.into();
7127 self
7128 }
7129
7130 pub fn set_expiration_time<T>(mut self, v: T) -> Self
7132 where
7133 T: std::convert::Into<wkt::Timestamp>,
7134 {
7135 self.expiration_time = std::option::Option::Some(v.into());
7136 self
7137 }
7138
7139 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
7141 where
7142 T: std::convert::Into<wkt::Timestamp>,
7143 {
7144 self.expiration_time = v.map(|x| x.into());
7145 self
7146 }
7147}
7148
7149impl wkt::message::Message for FetchReadWriteTokenResponse {
7150 fn typename() -> &'static str {
7151 "type.googleapis.com/google.devtools.cloudbuild.v2.FetchReadWriteTokenResponse"
7152 }
7153}
7154
7155#[doc(hidden)]
7156impl<'de> serde::de::Deserialize<'de> for FetchReadWriteTokenResponse {
7157 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7158 where
7159 D: serde::Deserializer<'de>,
7160 {
7161 #[allow(non_camel_case_types)]
7162 #[doc(hidden)]
7163 #[derive(PartialEq, Eq, Hash)]
7164 enum __FieldTag {
7165 __token,
7166 __expiration_time,
7167 Unknown(std::string::String),
7168 }
7169 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7170 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7171 where
7172 D: serde::Deserializer<'de>,
7173 {
7174 struct Visitor;
7175 impl<'de> serde::de::Visitor<'de> for Visitor {
7176 type Value = __FieldTag;
7177 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7178 formatter.write_str("a field name for FetchReadWriteTokenResponse")
7179 }
7180 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7181 where
7182 E: serde::de::Error,
7183 {
7184 use std::result::Result::Ok;
7185 use std::string::ToString;
7186 match value {
7187 "token" => Ok(__FieldTag::__token),
7188 "expirationTime" => Ok(__FieldTag::__expiration_time),
7189 "expiration_time" => Ok(__FieldTag::__expiration_time),
7190 _ => Ok(__FieldTag::Unknown(value.to_string())),
7191 }
7192 }
7193 }
7194 deserializer.deserialize_identifier(Visitor)
7195 }
7196 }
7197 struct Visitor;
7198 impl<'de> serde::de::Visitor<'de> for Visitor {
7199 type Value = FetchReadWriteTokenResponse;
7200 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7201 formatter.write_str("struct FetchReadWriteTokenResponse")
7202 }
7203 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7204 where
7205 A: serde::de::MapAccess<'de>,
7206 {
7207 #[allow(unused_imports)]
7208 use serde::de::Error;
7209 use std::option::Option::Some;
7210 let mut fields = std::collections::HashSet::new();
7211 let mut result = Self::Value::new();
7212 while let Some(tag) = map.next_key::<__FieldTag>()? {
7213 #[allow(clippy::match_single_binding)]
7214 match tag {
7215 __FieldTag::__token => {
7216 if !fields.insert(__FieldTag::__token) {
7217 return std::result::Result::Err(A::Error::duplicate_field(
7218 "multiple values for token",
7219 ));
7220 }
7221 result.token = map
7222 .next_value::<std::option::Option<std::string::String>>()?
7223 .unwrap_or_default();
7224 }
7225 __FieldTag::__expiration_time => {
7226 if !fields.insert(__FieldTag::__expiration_time) {
7227 return std::result::Result::Err(A::Error::duplicate_field(
7228 "multiple values for expiration_time",
7229 ));
7230 }
7231 result.expiration_time =
7232 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
7233 }
7234 __FieldTag::Unknown(key) => {
7235 let value = map.next_value::<serde_json::Value>()?;
7236 result._unknown_fields.insert(key, value);
7237 }
7238 }
7239 }
7240 std::result::Result::Ok(result)
7241 }
7242 }
7243 deserializer.deserialize_any(Visitor)
7244 }
7245}
7246
7247#[doc(hidden)]
7248impl serde::ser::Serialize for FetchReadWriteTokenResponse {
7249 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7250 where
7251 S: serde::ser::Serializer,
7252 {
7253 use serde::ser::SerializeMap;
7254 #[allow(unused_imports)]
7255 use std::option::Option::Some;
7256 let mut state = serializer.serialize_map(std::option::Option::None)?;
7257 if !self.token.is_empty() {
7258 state.serialize_entry("token", &self.token)?;
7259 }
7260 if self.expiration_time.is_some() {
7261 state.serialize_entry("expirationTime", &self.expiration_time)?;
7262 }
7263 if !self._unknown_fields.is_empty() {
7264 for (key, value) in self._unknown_fields.iter() {
7265 state.serialize_entry(key, &value)?;
7266 }
7267 }
7268 state.end()
7269 }
7270}
7271
7272#[derive(Clone, Debug, Default, PartialEq)]
7274#[non_exhaustive]
7275pub struct ProcessWebhookRequest {
7276 pub parent: std::string::String,
7279
7280 pub body: std::option::Option<api::model::HttpBody>,
7282
7283 pub webhook_key: std::string::String,
7286
7287 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7288}
7289
7290impl ProcessWebhookRequest {
7291 pub fn new() -> Self {
7292 std::default::Default::default()
7293 }
7294
7295 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7297 self.parent = v.into();
7298 self
7299 }
7300
7301 pub fn set_body<T>(mut self, v: T) -> Self
7303 where
7304 T: std::convert::Into<api::model::HttpBody>,
7305 {
7306 self.body = std::option::Option::Some(v.into());
7307 self
7308 }
7309
7310 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7312 where
7313 T: std::convert::Into<api::model::HttpBody>,
7314 {
7315 self.body = v.map(|x| x.into());
7316 self
7317 }
7318
7319 pub fn set_webhook_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7321 self.webhook_key = v.into();
7322 self
7323 }
7324}
7325
7326impl wkt::message::Message for ProcessWebhookRequest {
7327 fn typename() -> &'static str {
7328 "type.googleapis.com/google.devtools.cloudbuild.v2.ProcessWebhookRequest"
7329 }
7330}
7331
7332#[doc(hidden)]
7333impl<'de> serde::de::Deserialize<'de> for ProcessWebhookRequest {
7334 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7335 where
7336 D: serde::Deserializer<'de>,
7337 {
7338 #[allow(non_camel_case_types)]
7339 #[doc(hidden)]
7340 #[derive(PartialEq, Eq, Hash)]
7341 enum __FieldTag {
7342 __parent,
7343 __body,
7344 __webhook_key,
7345 Unknown(std::string::String),
7346 }
7347 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7348 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7349 where
7350 D: serde::Deserializer<'de>,
7351 {
7352 struct Visitor;
7353 impl<'de> serde::de::Visitor<'de> for Visitor {
7354 type Value = __FieldTag;
7355 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7356 formatter.write_str("a field name for ProcessWebhookRequest")
7357 }
7358 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7359 where
7360 E: serde::de::Error,
7361 {
7362 use std::result::Result::Ok;
7363 use std::string::ToString;
7364 match value {
7365 "parent" => Ok(__FieldTag::__parent),
7366 "body" => Ok(__FieldTag::__body),
7367 "webhookKey" => Ok(__FieldTag::__webhook_key),
7368 "webhook_key" => Ok(__FieldTag::__webhook_key),
7369 _ => Ok(__FieldTag::Unknown(value.to_string())),
7370 }
7371 }
7372 }
7373 deserializer.deserialize_identifier(Visitor)
7374 }
7375 }
7376 struct Visitor;
7377 impl<'de> serde::de::Visitor<'de> for Visitor {
7378 type Value = ProcessWebhookRequest;
7379 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7380 formatter.write_str("struct ProcessWebhookRequest")
7381 }
7382 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7383 where
7384 A: serde::de::MapAccess<'de>,
7385 {
7386 #[allow(unused_imports)]
7387 use serde::de::Error;
7388 use std::option::Option::Some;
7389 let mut fields = std::collections::HashSet::new();
7390 let mut result = Self::Value::new();
7391 while let Some(tag) = map.next_key::<__FieldTag>()? {
7392 #[allow(clippy::match_single_binding)]
7393 match tag {
7394 __FieldTag::__parent => {
7395 if !fields.insert(__FieldTag::__parent) {
7396 return std::result::Result::Err(A::Error::duplicate_field(
7397 "multiple values for parent",
7398 ));
7399 }
7400 result.parent = map
7401 .next_value::<std::option::Option<std::string::String>>()?
7402 .unwrap_or_default();
7403 }
7404 __FieldTag::__body => {
7405 if !fields.insert(__FieldTag::__body) {
7406 return std::result::Result::Err(A::Error::duplicate_field(
7407 "multiple values for body",
7408 ));
7409 }
7410 result.body =
7411 map.next_value::<std::option::Option<api::model::HttpBody>>()?;
7412 }
7413 __FieldTag::__webhook_key => {
7414 if !fields.insert(__FieldTag::__webhook_key) {
7415 return std::result::Result::Err(A::Error::duplicate_field(
7416 "multiple values for webhook_key",
7417 ));
7418 }
7419 result.webhook_key = map
7420 .next_value::<std::option::Option<std::string::String>>()?
7421 .unwrap_or_default();
7422 }
7423 __FieldTag::Unknown(key) => {
7424 let value = map.next_value::<serde_json::Value>()?;
7425 result._unknown_fields.insert(key, value);
7426 }
7427 }
7428 }
7429 std::result::Result::Ok(result)
7430 }
7431 }
7432 deserializer.deserialize_any(Visitor)
7433 }
7434}
7435
7436#[doc(hidden)]
7437impl serde::ser::Serialize for ProcessWebhookRequest {
7438 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7439 where
7440 S: serde::ser::Serializer,
7441 {
7442 use serde::ser::SerializeMap;
7443 #[allow(unused_imports)]
7444 use std::option::Option::Some;
7445 let mut state = serializer.serialize_map(std::option::Option::None)?;
7446 if !self.parent.is_empty() {
7447 state.serialize_entry("parent", &self.parent)?;
7448 }
7449 if self.body.is_some() {
7450 state.serialize_entry("body", &self.body)?;
7451 }
7452 if !self.webhook_key.is_empty() {
7453 state.serialize_entry("webhookKey", &self.webhook_key)?;
7454 }
7455 if !self._unknown_fields.is_empty() {
7456 for (key, value) in self._unknown_fields.iter() {
7457 state.serialize_entry(key, &value)?;
7458 }
7459 }
7460 state.end()
7461 }
7462}
7463
7464#[derive(Clone, Debug, Default, PartialEq)]
7466#[non_exhaustive]
7467pub struct FetchGitRefsRequest {
7468 pub repository: std::string::String,
7471
7472 pub ref_type: crate::model::fetch_git_refs_request::RefType,
7474
7475 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7476}
7477
7478impl FetchGitRefsRequest {
7479 pub fn new() -> Self {
7480 std::default::Default::default()
7481 }
7482
7483 pub fn set_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7485 self.repository = v.into();
7486 self
7487 }
7488
7489 pub fn set_ref_type<T: std::convert::Into<crate::model::fetch_git_refs_request::RefType>>(
7491 mut self,
7492 v: T,
7493 ) -> Self {
7494 self.ref_type = v.into();
7495 self
7496 }
7497}
7498
7499impl wkt::message::Message for FetchGitRefsRequest {
7500 fn typename() -> &'static str {
7501 "type.googleapis.com/google.devtools.cloudbuild.v2.FetchGitRefsRequest"
7502 }
7503}
7504
7505#[doc(hidden)]
7506impl<'de> serde::de::Deserialize<'de> for FetchGitRefsRequest {
7507 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7508 where
7509 D: serde::Deserializer<'de>,
7510 {
7511 #[allow(non_camel_case_types)]
7512 #[doc(hidden)]
7513 #[derive(PartialEq, Eq, Hash)]
7514 enum __FieldTag {
7515 __repository,
7516 __ref_type,
7517 Unknown(std::string::String),
7518 }
7519 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7520 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7521 where
7522 D: serde::Deserializer<'de>,
7523 {
7524 struct Visitor;
7525 impl<'de> serde::de::Visitor<'de> for Visitor {
7526 type Value = __FieldTag;
7527 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7528 formatter.write_str("a field name for FetchGitRefsRequest")
7529 }
7530 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7531 where
7532 E: serde::de::Error,
7533 {
7534 use std::result::Result::Ok;
7535 use std::string::ToString;
7536 match value {
7537 "repository" => Ok(__FieldTag::__repository),
7538 "refType" => Ok(__FieldTag::__ref_type),
7539 "ref_type" => Ok(__FieldTag::__ref_type),
7540 _ => Ok(__FieldTag::Unknown(value.to_string())),
7541 }
7542 }
7543 }
7544 deserializer.deserialize_identifier(Visitor)
7545 }
7546 }
7547 struct Visitor;
7548 impl<'de> serde::de::Visitor<'de> for Visitor {
7549 type Value = FetchGitRefsRequest;
7550 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7551 formatter.write_str("struct FetchGitRefsRequest")
7552 }
7553 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7554 where
7555 A: serde::de::MapAccess<'de>,
7556 {
7557 #[allow(unused_imports)]
7558 use serde::de::Error;
7559 use std::option::Option::Some;
7560 let mut fields = std::collections::HashSet::new();
7561 let mut result = Self::Value::new();
7562 while let Some(tag) = map.next_key::<__FieldTag>()? {
7563 #[allow(clippy::match_single_binding)]
7564 match tag {
7565 __FieldTag::__repository => {
7566 if !fields.insert(__FieldTag::__repository) {
7567 return std::result::Result::Err(A::Error::duplicate_field(
7568 "multiple values for repository",
7569 ));
7570 }
7571 result.repository = map
7572 .next_value::<std::option::Option<std::string::String>>()?
7573 .unwrap_or_default();
7574 }
7575 __FieldTag::__ref_type => {
7576 if !fields.insert(__FieldTag::__ref_type) {
7577 return std::result::Result::Err(A::Error::duplicate_field(
7578 "multiple values for ref_type",
7579 ));
7580 }
7581 result.ref_type =
7582 map.next_value::<std::option::Option<
7583 crate::model::fetch_git_refs_request::RefType,
7584 >>()?
7585 .unwrap_or_default();
7586 }
7587 __FieldTag::Unknown(key) => {
7588 let value = map.next_value::<serde_json::Value>()?;
7589 result._unknown_fields.insert(key, value);
7590 }
7591 }
7592 }
7593 std::result::Result::Ok(result)
7594 }
7595 }
7596 deserializer.deserialize_any(Visitor)
7597 }
7598}
7599
7600#[doc(hidden)]
7601impl serde::ser::Serialize for FetchGitRefsRequest {
7602 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7603 where
7604 S: serde::ser::Serializer,
7605 {
7606 use serde::ser::SerializeMap;
7607 #[allow(unused_imports)]
7608 use std::option::Option::Some;
7609 let mut state = serializer.serialize_map(std::option::Option::None)?;
7610 if !self.repository.is_empty() {
7611 state.serialize_entry("repository", &self.repository)?;
7612 }
7613 if !wkt::internal::is_default(&self.ref_type) {
7614 state.serialize_entry("refType", &self.ref_type)?;
7615 }
7616 if !self._unknown_fields.is_empty() {
7617 for (key, value) in self._unknown_fields.iter() {
7618 state.serialize_entry(key, &value)?;
7619 }
7620 }
7621 state.end()
7622 }
7623}
7624
7625pub mod fetch_git_refs_request {
7627 #[allow(unused_imports)]
7628 use super::*;
7629
7630 #[derive(Clone, Debug, PartialEq)]
7646 #[non_exhaustive]
7647 pub enum RefType {
7648 Unspecified,
7650 Tag,
7652 Branch,
7654 UnknownValue(ref_type::UnknownValue),
7659 }
7660
7661 #[doc(hidden)]
7662 pub mod ref_type {
7663 #[allow(unused_imports)]
7664 use super::*;
7665 #[derive(Clone, Debug, PartialEq)]
7666 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7667 }
7668
7669 impl RefType {
7670 pub fn value(&self) -> std::option::Option<i32> {
7675 match self {
7676 Self::Unspecified => std::option::Option::Some(0),
7677 Self::Tag => std::option::Option::Some(1),
7678 Self::Branch => std::option::Option::Some(2),
7679 Self::UnknownValue(u) => u.0.value(),
7680 }
7681 }
7682
7683 pub fn name(&self) -> std::option::Option<&str> {
7688 match self {
7689 Self::Unspecified => std::option::Option::Some("REF_TYPE_UNSPECIFIED"),
7690 Self::Tag => std::option::Option::Some("TAG"),
7691 Self::Branch => std::option::Option::Some("BRANCH"),
7692 Self::UnknownValue(u) => u.0.name(),
7693 }
7694 }
7695 }
7696
7697 impl std::default::Default for RefType {
7698 fn default() -> Self {
7699 use std::convert::From;
7700 Self::from(0)
7701 }
7702 }
7703
7704 impl std::fmt::Display for RefType {
7705 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7706 wkt::internal::display_enum(f, self.name(), self.value())
7707 }
7708 }
7709
7710 impl std::convert::From<i32> for RefType {
7711 fn from(value: i32) -> Self {
7712 match value {
7713 0 => Self::Unspecified,
7714 1 => Self::Tag,
7715 2 => Self::Branch,
7716 _ => Self::UnknownValue(ref_type::UnknownValue(
7717 wkt::internal::UnknownEnumValue::Integer(value),
7718 )),
7719 }
7720 }
7721 }
7722
7723 impl std::convert::From<&str> for RefType {
7724 fn from(value: &str) -> Self {
7725 use std::string::ToString;
7726 match value {
7727 "REF_TYPE_UNSPECIFIED" => Self::Unspecified,
7728 "TAG" => Self::Tag,
7729 "BRANCH" => Self::Branch,
7730 _ => Self::UnknownValue(ref_type::UnknownValue(
7731 wkt::internal::UnknownEnumValue::String(value.to_string()),
7732 )),
7733 }
7734 }
7735 }
7736
7737 impl serde::ser::Serialize for RefType {
7738 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7739 where
7740 S: serde::Serializer,
7741 {
7742 match self {
7743 Self::Unspecified => serializer.serialize_i32(0),
7744 Self::Tag => serializer.serialize_i32(1),
7745 Self::Branch => serializer.serialize_i32(2),
7746 Self::UnknownValue(u) => u.0.serialize(serializer),
7747 }
7748 }
7749 }
7750
7751 impl<'de> serde::de::Deserialize<'de> for RefType {
7752 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7753 where
7754 D: serde::Deserializer<'de>,
7755 {
7756 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RefType>::new(
7757 ".google.devtools.cloudbuild.v2.FetchGitRefsRequest.RefType",
7758 ))
7759 }
7760 }
7761}
7762
7763#[derive(Clone, Debug, Default, PartialEq)]
7765#[non_exhaustive]
7766pub struct FetchGitRefsResponse {
7767 pub ref_names: std::vec::Vec<std::string::String>,
7769
7770 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7771}
7772
7773impl FetchGitRefsResponse {
7774 pub fn new() -> Self {
7775 std::default::Default::default()
7776 }
7777
7778 pub fn set_ref_names<T, V>(mut self, v: T) -> Self
7780 where
7781 T: std::iter::IntoIterator<Item = V>,
7782 V: std::convert::Into<std::string::String>,
7783 {
7784 use std::iter::Iterator;
7785 self.ref_names = v.into_iter().map(|i| i.into()).collect();
7786 self
7787 }
7788}
7789
7790impl wkt::message::Message for FetchGitRefsResponse {
7791 fn typename() -> &'static str {
7792 "type.googleapis.com/google.devtools.cloudbuild.v2.FetchGitRefsResponse"
7793 }
7794}
7795
7796#[doc(hidden)]
7797impl<'de> serde::de::Deserialize<'de> for FetchGitRefsResponse {
7798 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7799 where
7800 D: serde::Deserializer<'de>,
7801 {
7802 #[allow(non_camel_case_types)]
7803 #[doc(hidden)]
7804 #[derive(PartialEq, Eq, Hash)]
7805 enum __FieldTag {
7806 __ref_names,
7807 Unknown(std::string::String),
7808 }
7809 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7810 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7811 where
7812 D: serde::Deserializer<'de>,
7813 {
7814 struct Visitor;
7815 impl<'de> serde::de::Visitor<'de> for Visitor {
7816 type Value = __FieldTag;
7817 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7818 formatter.write_str("a field name for FetchGitRefsResponse")
7819 }
7820 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7821 where
7822 E: serde::de::Error,
7823 {
7824 use std::result::Result::Ok;
7825 use std::string::ToString;
7826 match value {
7827 "refNames" => Ok(__FieldTag::__ref_names),
7828 "ref_names" => Ok(__FieldTag::__ref_names),
7829 _ => Ok(__FieldTag::Unknown(value.to_string())),
7830 }
7831 }
7832 }
7833 deserializer.deserialize_identifier(Visitor)
7834 }
7835 }
7836 struct Visitor;
7837 impl<'de> serde::de::Visitor<'de> for Visitor {
7838 type Value = FetchGitRefsResponse;
7839 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7840 formatter.write_str("struct FetchGitRefsResponse")
7841 }
7842 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7843 where
7844 A: serde::de::MapAccess<'de>,
7845 {
7846 #[allow(unused_imports)]
7847 use serde::de::Error;
7848 use std::option::Option::Some;
7849 let mut fields = std::collections::HashSet::new();
7850 let mut result = Self::Value::new();
7851 while let Some(tag) = map.next_key::<__FieldTag>()? {
7852 #[allow(clippy::match_single_binding)]
7853 match tag {
7854 __FieldTag::__ref_names => {
7855 if !fields.insert(__FieldTag::__ref_names) {
7856 return std::result::Result::Err(A::Error::duplicate_field(
7857 "multiple values for ref_names",
7858 ));
7859 }
7860 result.ref_names = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
7861 }
7862 __FieldTag::Unknown(key) => {
7863 let value = map.next_value::<serde_json::Value>()?;
7864 result._unknown_fields.insert(key, value);
7865 }
7866 }
7867 }
7868 std::result::Result::Ok(result)
7869 }
7870 }
7871 deserializer.deserialize_any(Visitor)
7872 }
7873}
7874
7875#[doc(hidden)]
7876impl serde::ser::Serialize for FetchGitRefsResponse {
7877 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7878 where
7879 S: serde::ser::Serializer,
7880 {
7881 use serde::ser::SerializeMap;
7882 #[allow(unused_imports)]
7883 use std::option::Option::Some;
7884 let mut state = serializer.serialize_map(std::option::Option::None)?;
7885 if !self.ref_names.is_empty() {
7886 state.serialize_entry("refNames", &self.ref_names)?;
7887 }
7888 if !self._unknown_fields.is_empty() {
7889 for (key, value) in self._unknown_fields.iter() {
7890 state.serialize_entry(key, &value)?;
7891 }
7892 }
7893 state.end()
7894 }
7895}