1#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate location;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate rpc;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37#[derive(Clone, Default, PartialEq)]
39#[non_exhaustive]
40pub struct ListUsersRequest {
41 pub parent: std::string::String,
43
44 pub page_size: i32,
47
48 pub page_token: std::string::String,
50
51 pub filter: std::string::String,
53
54 pub order_by: std::string::String,
56
57 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
58}
59
60impl ListUsersRequest {
61 pub fn new() -> Self {
62 std::default::Default::default()
63 }
64
65 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
67 self.parent = v.into();
68 self
69 }
70
71 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
73 self.page_size = v.into();
74 self
75 }
76
77 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
79 self.page_token = v.into();
80 self
81 }
82
83 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
85 self.filter = v.into();
86 self
87 }
88
89 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
91 self.order_by = v.into();
92 self
93 }
94}
95
96impl wkt::message::Message for ListUsersRequest {
97 fn typename() -> &'static str {
98 "type.googleapis.com/google.cloud.developerconnect.v1.ListUsersRequest"
99 }
100}
101
102#[doc(hidden)]
103impl<'de> serde::de::Deserialize<'de> for ListUsersRequest {
104 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
105 where
106 D: serde::Deserializer<'de>,
107 {
108 #[allow(non_camel_case_types)]
109 #[doc(hidden)]
110 #[derive(PartialEq, Eq, Hash)]
111 enum __FieldTag {
112 __parent,
113 __page_size,
114 __page_token,
115 __filter,
116 __order_by,
117 Unknown(std::string::String),
118 }
119 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
120 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
121 where
122 D: serde::Deserializer<'de>,
123 {
124 struct Visitor;
125 impl<'de> serde::de::Visitor<'de> for Visitor {
126 type Value = __FieldTag;
127 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
128 formatter.write_str("a field name for ListUsersRequest")
129 }
130 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
131 where
132 E: serde::de::Error,
133 {
134 use std::result::Result::Ok;
135 use std::string::ToString;
136 match value {
137 "parent" => Ok(__FieldTag::__parent),
138 "pageSize" => Ok(__FieldTag::__page_size),
139 "page_size" => Ok(__FieldTag::__page_size),
140 "pageToken" => Ok(__FieldTag::__page_token),
141 "page_token" => Ok(__FieldTag::__page_token),
142 "filter" => Ok(__FieldTag::__filter),
143 "orderBy" => Ok(__FieldTag::__order_by),
144 "order_by" => Ok(__FieldTag::__order_by),
145 _ => Ok(__FieldTag::Unknown(value.to_string())),
146 }
147 }
148 }
149 deserializer.deserialize_identifier(Visitor)
150 }
151 }
152 struct Visitor;
153 impl<'de> serde::de::Visitor<'de> for Visitor {
154 type Value = ListUsersRequest;
155 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
156 formatter.write_str("struct ListUsersRequest")
157 }
158 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
159 where
160 A: serde::de::MapAccess<'de>,
161 {
162 #[allow(unused_imports)]
163 use serde::de::Error;
164 use std::option::Option::Some;
165 let mut fields = std::collections::HashSet::new();
166 let mut result = Self::Value::new();
167 while let Some(tag) = map.next_key::<__FieldTag>()? {
168 #[allow(clippy::match_single_binding)]
169 match tag {
170 __FieldTag::__parent => {
171 if !fields.insert(__FieldTag::__parent) {
172 return std::result::Result::Err(A::Error::duplicate_field(
173 "multiple values for parent",
174 ));
175 }
176 result.parent = map
177 .next_value::<std::option::Option<std::string::String>>()?
178 .unwrap_or_default();
179 }
180 __FieldTag::__page_size => {
181 if !fields.insert(__FieldTag::__page_size) {
182 return std::result::Result::Err(A::Error::duplicate_field(
183 "multiple values for page_size",
184 ));
185 }
186 struct __With(std::option::Option<i32>);
187 impl<'de> serde::de::Deserialize<'de> for __With {
188 fn deserialize<D>(
189 deserializer: D,
190 ) -> std::result::Result<Self, D::Error>
191 where
192 D: serde::de::Deserializer<'de>,
193 {
194 serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
195 }
196 }
197 result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
198 }
199 __FieldTag::__page_token => {
200 if !fields.insert(__FieldTag::__page_token) {
201 return std::result::Result::Err(A::Error::duplicate_field(
202 "multiple values for page_token",
203 ));
204 }
205 result.page_token = map
206 .next_value::<std::option::Option<std::string::String>>()?
207 .unwrap_or_default();
208 }
209 __FieldTag::__filter => {
210 if !fields.insert(__FieldTag::__filter) {
211 return std::result::Result::Err(A::Error::duplicate_field(
212 "multiple values for filter",
213 ));
214 }
215 result.filter = map
216 .next_value::<std::option::Option<std::string::String>>()?
217 .unwrap_or_default();
218 }
219 __FieldTag::__order_by => {
220 if !fields.insert(__FieldTag::__order_by) {
221 return std::result::Result::Err(A::Error::duplicate_field(
222 "multiple values for order_by",
223 ));
224 }
225 result.order_by = map
226 .next_value::<std::option::Option<std::string::String>>()?
227 .unwrap_or_default();
228 }
229 __FieldTag::Unknown(key) => {
230 let value = map.next_value::<serde_json::Value>()?;
231 result._unknown_fields.insert(key, value);
232 }
233 }
234 }
235 std::result::Result::Ok(result)
236 }
237 }
238 deserializer.deserialize_any(Visitor)
239 }
240}
241
242#[doc(hidden)]
243impl serde::ser::Serialize for ListUsersRequest {
244 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
245 where
246 S: serde::ser::Serializer,
247 {
248 use serde::ser::SerializeMap;
249 #[allow(unused_imports)]
250 use std::option::Option::Some;
251 let mut state = serializer.serialize_map(std::option::Option::None)?;
252 if !self.parent.is_empty() {
253 state.serialize_entry("parent", &self.parent)?;
254 }
255 if !wkt::internal::is_default(&self.page_size) {
256 struct __With<'a>(&'a i32);
257 impl<'a> serde::ser::Serialize for __With<'a> {
258 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
259 where
260 S: serde::ser::Serializer,
261 {
262 serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
263 }
264 }
265 state.serialize_entry("pageSize", &__With(&self.page_size))?;
266 }
267 if !self.page_token.is_empty() {
268 state.serialize_entry("pageToken", &self.page_token)?;
269 }
270 if !self.filter.is_empty() {
271 state.serialize_entry("filter", &self.filter)?;
272 }
273 if !self.order_by.is_empty() {
274 state.serialize_entry("orderBy", &self.order_by)?;
275 }
276 if !self._unknown_fields.is_empty() {
277 for (key, value) in self._unknown_fields.iter() {
278 state.serialize_entry(key, &value)?;
279 }
280 }
281 state.end()
282 }
283}
284
285impl std::fmt::Debug for ListUsersRequest {
286 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
287 let mut debug_struct = f.debug_struct("ListUsersRequest");
288 debug_struct.field("parent", &self.parent);
289 debug_struct.field("page_size", &self.page_size);
290 debug_struct.field("page_token", &self.page_token);
291 debug_struct.field("filter", &self.filter);
292 debug_struct.field("order_by", &self.order_by);
293 if !self._unknown_fields.is_empty() {
294 debug_struct.field("_unknown_fields", &self._unknown_fields);
295 }
296 debug_struct.finish()
297 }
298}
299
300#[derive(Clone, Default, PartialEq)]
302#[non_exhaustive]
303pub struct ListUsersResponse {
304 pub users: std::vec::Vec<crate::model::User>,
306
307 pub next_page_token: std::string::String,
309
310 pub unreachable: std::vec::Vec<std::string::String>,
312
313 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
314}
315
316impl ListUsersResponse {
317 pub fn new() -> Self {
318 std::default::Default::default()
319 }
320
321 pub fn set_users<T, V>(mut self, v: T) -> Self
323 where
324 T: std::iter::IntoIterator<Item = V>,
325 V: std::convert::Into<crate::model::User>,
326 {
327 use std::iter::Iterator;
328 self.users = v.into_iter().map(|i| i.into()).collect();
329 self
330 }
331
332 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
334 self.next_page_token = v.into();
335 self
336 }
337
338 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
340 where
341 T: std::iter::IntoIterator<Item = V>,
342 V: std::convert::Into<std::string::String>,
343 {
344 use std::iter::Iterator;
345 self.unreachable = v.into_iter().map(|i| i.into()).collect();
346 self
347 }
348}
349
350impl wkt::message::Message for ListUsersResponse {
351 fn typename() -> &'static str {
352 "type.googleapis.com/google.cloud.developerconnect.v1.ListUsersResponse"
353 }
354}
355
356#[doc(hidden)]
357impl gax::paginator::internal::PageableResponse for ListUsersResponse {
358 type PageItem = crate::model::User;
359
360 fn items(self) -> std::vec::Vec<Self::PageItem> {
361 self.users
362 }
363
364 fn next_page_token(&self) -> std::string::String {
365 use std::clone::Clone;
366 self.next_page_token.clone()
367 }
368}
369
370#[doc(hidden)]
371impl<'de> serde::de::Deserialize<'de> for ListUsersResponse {
372 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
373 where
374 D: serde::Deserializer<'de>,
375 {
376 #[allow(non_camel_case_types)]
377 #[doc(hidden)]
378 #[derive(PartialEq, Eq, Hash)]
379 enum __FieldTag {
380 __users,
381 __next_page_token,
382 __unreachable,
383 Unknown(std::string::String),
384 }
385 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
386 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
387 where
388 D: serde::Deserializer<'de>,
389 {
390 struct Visitor;
391 impl<'de> serde::de::Visitor<'de> for Visitor {
392 type Value = __FieldTag;
393 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
394 formatter.write_str("a field name for ListUsersResponse")
395 }
396 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
397 where
398 E: serde::de::Error,
399 {
400 use std::result::Result::Ok;
401 use std::string::ToString;
402 match value {
403 "users" => Ok(__FieldTag::__users),
404 "nextPageToken" => Ok(__FieldTag::__next_page_token),
405 "next_page_token" => Ok(__FieldTag::__next_page_token),
406 "unreachable" => Ok(__FieldTag::__unreachable),
407 _ => Ok(__FieldTag::Unknown(value.to_string())),
408 }
409 }
410 }
411 deserializer.deserialize_identifier(Visitor)
412 }
413 }
414 struct Visitor;
415 impl<'de> serde::de::Visitor<'de> for Visitor {
416 type Value = ListUsersResponse;
417 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
418 formatter.write_str("struct ListUsersResponse")
419 }
420 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
421 where
422 A: serde::de::MapAccess<'de>,
423 {
424 #[allow(unused_imports)]
425 use serde::de::Error;
426 use std::option::Option::Some;
427 let mut fields = std::collections::HashSet::new();
428 let mut result = Self::Value::new();
429 while let Some(tag) = map.next_key::<__FieldTag>()? {
430 #[allow(clippy::match_single_binding)]
431 match tag {
432 __FieldTag::__users => {
433 if !fields.insert(__FieldTag::__users) {
434 return std::result::Result::Err(A::Error::duplicate_field(
435 "multiple values for users",
436 ));
437 }
438 result.users = map.next_value::<std::option::Option<std::vec::Vec<crate::model::User>>>()?.unwrap_or_default();
439 }
440 __FieldTag::__next_page_token => {
441 if !fields.insert(__FieldTag::__next_page_token) {
442 return std::result::Result::Err(A::Error::duplicate_field(
443 "multiple values for next_page_token",
444 ));
445 }
446 result.next_page_token = map
447 .next_value::<std::option::Option<std::string::String>>()?
448 .unwrap_or_default();
449 }
450 __FieldTag::__unreachable => {
451 if !fields.insert(__FieldTag::__unreachable) {
452 return std::result::Result::Err(A::Error::duplicate_field(
453 "multiple values for unreachable",
454 ));
455 }
456 result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
457 }
458 __FieldTag::Unknown(key) => {
459 let value = map.next_value::<serde_json::Value>()?;
460 result._unknown_fields.insert(key, value);
461 }
462 }
463 }
464 std::result::Result::Ok(result)
465 }
466 }
467 deserializer.deserialize_any(Visitor)
468 }
469}
470
471#[doc(hidden)]
472impl serde::ser::Serialize for ListUsersResponse {
473 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
474 where
475 S: serde::ser::Serializer,
476 {
477 use serde::ser::SerializeMap;
478 #[allow(unused_imports)]
479 use std::option::Option::Some;
480 let mut state = serializer.serialize_map(std::option::Option::None)?;
481 if !self.users.is_empty() {
482 state.serialize_entry("users", &self.users)?;
483 }
484 if !self.next_page_token.is_empty() {
485 state.serialize_entry("nextPageToken", &self.next_page_token)?;
486 }
487 if !self.unreachable.is_empty() {
488 state.serialize_entry("unreachable", &self.unreachable)?;
489 }
490 if !self._unknown_fields.is_empty() {
491 for (key, value) in self._unknown_fields.iter() {
492 state.serialize_entry(key, &value)?;
493 }
494 }
495 state.end()
496 }
497}
498
499impl std::fmt::Debug for ListUsersResponse {
500 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
501 let mut debug_struct = f.debug_struct("ListUsersResponse");
502 debug_struct.field("users", &self.users);
503 debug_struct.field("next_page_token", &self.next_page_token);
504 debug_struct.field("unreachable", &self.unreachable);
505 if !self._unknown_fields.is_empty() {
506 debug_struct.field("_unknown_fields", &self._unknown_fields);
507 }
508 debug_struct.finish()
509 }
510}
511
512#[derive(Clone, Default, PartialEq)]
514#[non_exhaustive]
515pub struct Connection {
516 pub name: std::string::String,
519
520 pub create_time: std::option::Option<wkt::Timestamp>,
522
523 pub update_time: std::option::Option<wkt::Timestamp>,
525
526 pub delete_time: std::option::Option<wkt::Timestamp>,
528
529 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
531
532 pub installation_state: std::option::Option<crate::model::InstallationState>,
534
535 pub disabled: bool,
539
540 pub reconciling: bool,
543
544 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
546
547 pub etag: std::string::String,
551
552 pub uid: std::string::String,
554
555 pub crypto_key_config: std::option::Option<crate::model::CryptoKeyConfig>,
558
559 pub git_proxy_config: std::option::Option<crate::model::GitProxyConfig>,
563
564 pub connection_config: std::option::Option<crate::model::connection::ConnectionConfig>,
566
567 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
568}
569
570impl Connection {
571 pub fn new() -> Self {
572 std::default::Default::default()
573 }
574
575 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
577 self.name = v.into();
578 self
579 }
580
581 pub fn set_create_time<T>(mut self, v: T) -> Self
583 where
584 T: std::convert::Into<wkt::Timestamp>,
585 {
586 self.create_time = std::option::Option::Some(v.into());
587 self
588 }
589
590 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
592 where
593 T: std::convert::Into<wkt::Timestamp>,
594 {
595 self.create_time = v.map(|x| x.into());
596 self
597 }
598
599 pub fn set_update_time<T>(mut self, v: T) -> Self
601 where
602 T: std::convert::Into<wkt::Timestamp>,
603 {
604 self.update_time = std::option::Option::Some(v.into());
605 self
606 }
607
608 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
610 where
611 T: std::convert::Into<wkt::Timestamp>,
612 {
613 self.update_time = v.map(|x| x.into());
614 self
615 }
616
617 pub fn set_delete_time<T>(mut self, v: T) -> Self
619 where
620 T: std::convert::Into<wkt::Timestamp>,
621 {
622 self.delete_time = std::option::Option::Some(v.into());
623 self
624 }
625
626 pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
628 where
629 T: std::convert::Into<wkt::Timestamp>,
630 {
631 self.delete_time = v.map(|x| x.into());
632 self
633 }
634
635 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
637 where
638 T: std::iter::IntoIterator<Item = (K, V)>,
639 K: std::convert::Into<std::string::String>,
640 V: std::convert::Into<std::string::String>,
641 {
642 use std::iter::Iterator;
643 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
644 self
645 }
646
647 pub fn set_installation_state<T>(mut self, v: T) -> Self
649 where
650 T: std::convert::Into<crate::model::InstallationState>,
651 {
652 self.installation_state = std::option::Option::Some(v.into());
653 self
654 }
655
656 pub fn set_or_clear_installation_state<T>(mut self, v: std::option::Option<T>) -> Self
658 where
659 T: std::convert::Into<crate::model::InstallationState>,
660 {
661 self.installation_state = v.map(|x| x.into());
662 self
663 }
664
665 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
667 self.disabled = v.into();
668 self
669 }
670
671 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
673 self.reconciling = v.into();
674 self
675 }
676
677 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
679 where
680 T: std::iter::IntoIterator<Item = (K, V)>,
681 K: std::convert::Into<std::string::String>,
682 V: std::convert::Into<std::string::String>,
683 {
684 use std::iter::Iterator;
685 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
686 self
687 }
688
689 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
691 self.etag = v.into();
692 self
693 }
694
695 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
697 self.uid = v.into();
698 self
699 }
700
701 pub fn set_crypto_key_config<T>(mut self, v: T) -> Self
703 where
704 T: std::convert::Into<crate::model::CryptoKeyConfig>,
705 {
706 self.crypto_key_config = std::option::Option::Some(v.into());
707 self
708 }
709
710 pub fn set_or_clear_crypto_key_config<T>(mut self, v: std::option::Option<T>) -> Self
712 where
713 T: std::convert::Into<crate::model::CryptoKeyConfig>,
714 {
715 self.crypto_key_config = v.map(|x| x.into());
716 self
717 }
718
719 pub fn set_git_proxy_config<T>(mut self, v: T) -> Self
721 where
722 T: std::convert::Into<crate::model::GitProxyConfig>,
723 {
724 self.git_proxy_config = std::option::Option::Some(v.into());
725 self
726 }
727
728 pub fn set_or_clear_git_proxy_config<T>(mut self, v: std::option::Option<T>) -> Self
730 where
731 T: std::convert::Into<crate::model::GitProxyConfig>,
732 {
733 self.git_proxy_config = v.map(|x| x.into());
734 self
735 }
736
737 pub fn set_connection_config<
742 T: std::convert::Into<std::option::Option<crate::model::connection::ConnectionConfig>>,
743 >(
744 mut self,
745 v: T,
746 ) -> Self {
747 self.connection_config = v.into();
748 self
749 }
750
751 pub fn github_config(
755 &self,
756 ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubConfig>> {
757 #[allow(unreachable_patterns)]
758 self.connection_config.as_ref().and_then(|v| match v {
759 crate::model::connection::ConnectionConfig::GithubConfig(v) => {
760 std::option::Option::Some(v)
761 }
762 _ => std::option::Option::None,
763 })
764 }
765
766 pub fn set_github_config<T: std::convert::Into<std::boxed::Box<crate::model::GitHubConfig>>>(
772 mut self,
773 v: T,
774 ) -> Self {
775 self.connection_config = std::option::Option::Some(
776 crate::model::connection::ConnectionConfig::GithubConfig(v.into()),
777 );
778 self
779 }
780
781 pub fn github_enterprise_config(
785 &self,
786 ) -> std::option::Option<&std::boxed::Box<crate::model::GitHubEnterpriseConfig>> {
787 #[allow(unreachable_patterns)]
788 self.connection_config.as_ref().and_then(|v| match v {
789 crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v) => {
790 std::option::Option::Some(v)
791 }
792 _ => std::option::Option::None,
793 })
794 }
795
796 pub fn set_github_enterprise_config<
802 T: std::convert::Into<std::boxed::Box<crate::model::GitHubEnterpriseConfig>>,
803 >(
804 mut self,
805 v: T,
806 ) -> Self {
807 self.connection_config = std::option::Option::Some(
808 crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(v.into()),
809 );
810 self
811 }
812
813 pub fn gitlab_config(
817 &self,
818 ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabConfig>> {
819 #[allow(unreachable_patterns)]
820 self.connection_config.as_ref().and_then(|v| match v {
821 crate::model::connection::ConnectionConfig::GitlabConfig(v) => {
822 std::option::Option::Some(v)
823 }
824 _ => std::option::Option::None,
825 })
826 }
827
828 pub fn set_gitlab_config<T: std::convert::Into<std::boxed::Box<crate::model::GitLabConfig>>>(
834 mut self,
835 v: T,
836 ) -> Self {
837 self.connection_config = std::option::Option::Some(
838 crate::model::connection::ConnectionConfig::GitlabConfig(v.into()),
839 );
840 self
841 }
842
843 pub fn gitlab_enterprise_config(
847 &self,
848 ) -> std::option::Option<&std::boxed::Box<crate::model::GitLabEnterpriseConfig>> {
849 #[allow(unreachable_patterns)]
850 self.connection_config.as_ref().and_then(|v| match v {
851 crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(v) => {
852 std::option::Option::Some(v)
853 }
854 _ => std::option::Option::None,
855 })
856 }
857
858 pub fn set_gitlab_enterprise_config<
864 T: std::convert::Into<std::boxed::Box<crate::model::GitLabEnterpriseConfig>>,
865 >(
866 mut self,
867 v: T,
868 ) -> Self {
869 self.connection_config = std::option::Option::Some(
870 crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(v.into()),
871 );
872 self
873 }
874
875 pub fn bitbucket_data_center_config(
879 &self,
880 ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketDataCenterConfig>> {
881 #[allow(unreachable_patterns)]
882 self.connection_config.as_ref().and_then(|v| match v {
883 crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v) => {
884 std::option::Option::Some(v)
885 }
886 _ => std::option::Option::None,
887 })
888 }
889
890 pub fn set_bitbucket_data_center_config<
896 T: std::convert::Into<std::boxed::Box<crate::model::BitbucketDataCenterConfig>>,
897 >(
898 mut self,
899 v: T,
900 ) -> Self {
901 self.connection_config = std::option::Option::Some(
902 crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(v.into()),
903 );
904 self
905 }
906
907 pub fn bitbucket_cloud_config(
911 &self,
912 ) -> std::option::Option<&std::boxed::Box<crate::model::BitbucketCloudConfig>> {
913 #[allow(unreachable_patterns)]
914 self.connection_config.as_ref().and_then(|v| match v {
915 crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v) => {
916 std::option::Option::Some(v)
917 }
918 _ => std::option::Option::None,
919 })
920 }
921
922 pub fn set_bitbucket_cloud_config<
928 T: std::convert::Into<std::boxed::Box<crate::model::BitbucketCloudConfig>>,
929 >(
930 mut self,
931 v: T,
932 ) -> Self {
933 self.connection_config = std::option::Option::Some(
934 crate::model::connection::ConnectionConfig::BitbucketCloudConfig(v.into()),
935 );
936 self
937 }
938}
939
940impl wkt::message::Message for Connection {
941 fn typename() -> &'static str {
942 "type.googleapis.com/google.cloud.developerconnect.v1.Connection"
943 }
944}
945
946#[doc(hidden)]
947impl<'de> serde::de::Deserialize<'de> for Connection {
948 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
949 where
950 D: serde::Deserializer<'de>,
951 {
952 #[allow(non_camel_case_types)]
953 #[doc(hidden)]
954 #[derive(PartialEq, Eq, Hash)]
955 enum __FieldTag {
956 __github_config,
957 __github_enterprise_config,
958 __gitlab_config,
959 __gitlab_enterprise_config,
960 __bitbucket_data_center_config,
961 __bitbucket_cloud_config,
962 __name,
963 __create_time,
964 __update_time,
965 __delete_time,
966 __labels,
967 __installation_state,
968 __disabled,
969 __reconciling,
970 __annotations,
971 __etag,
972 __uid,
973 __crypto_key_config,
974 __git_proxy_config,
975 Unknown(std::string::String),
976 }
977 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
978 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
979 where
980 D: serde::Deserializer<'de>,
981 {
982 struct Visitor;
983 impl<'de> serde::de::Visitor<'de> for Visitor {
984 type Value = __FieldTag;
985 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
986 formatter.write_str("a field name for Connection")
987 }
988 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
989 where
990 E: serde::de::Error,
991 {
992 use std::result::Result::Ok;
993 use std::string::ToString;
994 match value {
995 "githubConfig" => Ok(__FieldTag::__github_config),
996 "github_config" => Ok(__FieldTag::__github_config),
997 "githubEnterpriseConfig" => Ok(__FieldTag::__github_enterprise_config),
998 "github_enterprise_config" => {
999 Ok(__FieldTag::__github_enterprise_config)
1000 }
1001 "gitlabConfig" => Ok(__FieldTag::__gitlab_config),
1002 "gitlab_config" => Ok(__FieldTag::__gitlab_config),
1003 "gitlabEnterpriseConfig" => Ok(__FieldTag::__gitlab_enterprise_config),
1004 "gitlab_enterprise_config" => {
1005 Ok(__FieldTag::__gitlab_enterprise_config)
1006 }
1007 "bitbucketDataCenterConfig" => {
1008 Ok(__FieldTag::__bitbucket_data_center_config)
1009 }
1010 "bitbucket_data_center_config" => {
1011 Ok(__FieldTag::__bitbucket_data_center_config)
1012 }
1013 "bitbucketCloudConfig" => Ok(__FieldTag::__bitbucket_cloud_config),
1014 "bitbucket_cloud_config" => Ok(__FieldTag::__bitbucket_cloud_config),
1015 "name" => Ok(__FieldTag::__name),
1016 "createTime" => Ok(__FieldTag::__create_time),
1017 "create_time" => Ok(__FieldTag::__create_time),
1018 "updateTime" => Ok(__FieldTag::__update_time),
1019 "update_time" => Ok(__FieldTag::__update_time),
1020 "deleteTime" => Ok(__FieldTag::__delete_time),
1021 "delete_time" => Ok(__FieldTag::__delete_time),
1022 "labels" => Ok(__FieldTag::__labels),
1023 "installationState" => Ok(__FieldTag::__installation_state),
1024 "installation_state" => Ok(__FieldTag::__installation_state),
1025 "disabled" => Ok(__FieldTag::__disabled),
1026 "reconciling" => Ok(__FieldTag::__reconciling),
1027 "annotations" => Ok(__FieldTag::__annotations),
1028 "etag" => Ok(__FieldTag::__etag),
1029 "uid" => Ok(__FieldTag::__uid),
1030 "cryptoKeyConfig" => Ok(__FieldTag::__crypto_key_config),
1031 "crypto_key_config" => Ok(__FieldTag::__crypto_key_config),
1032 "gitProxyConfig" => Ok(__FieldTag::__git_proxy_config),
1033 "git_proxy_config" => Ok(__FieldTag::__git_proxy_config),
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::__github_config => {
1060 if !fields.insert(__FieldTag::__github_config) {
1061 return std::result::Result::Err(A::Error::duplicate_field(
1062 "multiple values for github_config",
1063 ));
1064 }
1065 if result.connection_config.is_some() {
1066 return std::result::Result::Err(A::Error::duplicate_field(
1067 "multiple values for `connection_config`, a oneof with full ID .google.cloud.developerconnect.v1.Connection.github_config, latest field was githubConfig",
1068 ));
1069 }
1070 result.connection_config = std::option::Option::Some(
1071 crate::model::connection::ConnectionConfig::GithubConfig(
1072 map.next_value::<std::option::Option<
1073 std::boxed::Box<crate::model::GitHubConfig>,
1074 >>()?
1075 .unwrap_or_default(),
1076 ),
1077 );
1078 }
1079 __FieldTag::__github_enterprise_config => {
1080 if !fields.insert(__FieldTag::__github_enterprise_config) {
1081 return std::result::Result::Err(A::Error::duplicate_field(
1082 "multiple values for github_enterprise_config",
1083 ));
1084 }
1085 if result.connection_config.is_some() {
1086 return std::result::Result::Err(A::Error::duplicate_field(
1087 "multiple values for `connection_config`, a oneof with full ID .google.cloud.developerconnect.v1.Connection.github_enterprise_config, latest field was githubEnterpriseConfig",
1088 ));
1089 }
1090 result.connection_config = std::option::Option::Some(
1091 crate::model::connection::ConnectionConfig::GithubEnterpriseConfig(
1092 map.next_value::<std::option::Option<
1093 std::boxed::Box<crate::model::GitHubEnterpriseConfig>,
1094 >>()?
1095 .unwrap_or_default(),
1096 ),
1097 );
1098 }
1099 __FieldTag::__gitlab_config => {
1100 if !fields.insert(__FieldTag::__gitlab_config) {
1101 return std::result::Result::Err(A::Error::duplicate_field(
1102 "multiple values for gitlab_config",
1103 ));
1104 }
1105 if result.connection_config.is_some() {
1106 return std::result::Result::Err(A::Error::duplicate_field(
1107 "multiple values for `connection_config`, a oneof with full ID .google.cloud.developerconnect.v1.Connection.gitlab_config, latest field was gitlabConfig",
1108 ));
1109 }
1110 result.connection_config = std::option::Option::Some(
1111 crate::model::connection::ConnectionConfig::GitlabConfig(
1112 map.next_value::<std::option::Option<
1113 std::boxed::Box<crate::model::GitLabConfig>,
1114 >>()?
1115 .unwrap_or_default(),
1116 ),
1117 );
1118 }
1119 __FieldTag::__gitlab_enterprise_config => {
1120 if !fields.insert(__FieldTag::__gitlab_enterprise_config) {
1121 return std::result::Result::Err(A::Error::duplicate_field(
1122 "multiple values for gitlab_enterprise_config",
1123 ));
1124 }
1125 if result.connection_config.is_some() {
1126 return std::result::Result::Err(A::Error::duplicate_field(
1127 "multiple values for `connection_config`, a oneof with full ID .google.cloud.developerconnect.v1.Connection.gitlab_enterprise_config, latest field was gitlabEnterpriseConfig",
1128 ));
1129 }
1130 result.connection_config = std::option::Option::Some(
1131 crate::model::connection::ConnectionConfig::GitlabEnterpriseConfig(
1132 map.next_value::<std::option::Option<
1133 std::boxed::Box<crate::model::GitLabEnterpriseConfig>,
1134 >>()?
1135 .unwrap_or_default(),
1136 ),
1137 );
1138 }
1139 __FieldTag::__bitbucket_data_center_config => {
1140 if !fields.insert(__FieldTag::__bitbucket_data_center_config) {
1141 return std::result::Result::Err(A::Error::duplicate_field(
1142 "multiple values for bitbucket_data_center_config",
1143 ));
1144 }
1145 if result.connection_config.is_some() {
1146 return std::result::Result::Err(A::Error::duplicate_field(
1147 "multiple values for `connection_config`, a oneof with full ID .google.cloud.developerconnect.v1.Connection.bitbucket_data_center_config, latest field was bitbucketDataCenterConfig",
1148 ));
1149 }
1150 result.connection_config = std::option::Option::Some(
1151 crate::model::connection::ConnectionConfig::BitbucketDataCenterConfig(
1152 map.next_value::<std::option::Option<std::boxed::Box<crate::model::BitbucketDataCenterConfig>>>()?.unwrap_or_default()
1153 ),
1154 );
1155 }
1156 __FieldTag::__bitbucket_cloud_config => {
1157 if !fields.insert(__FieldTag::__bitbucket_cloud_config) {
1158 return std::result::Result::Err(A::Error::duplicate_field(
1159 "multiple values for bitbucket_cloud_config",
1160 ));
1161 }
1162 if result.connection_config.is_some() {
1163 return std::result::Result::Err(A::Error::duplicate_field(
1164 "multiple values for `connection_config`, a oneof with full ID .google.cloud.developerconnect.v1.Connection.bitbucket_cloud_config, latest field was bitbucketCloudConfig",
1165 ));
1166 }
1167 result.connection_config = std::option::Option::Some(
1168 crate::model::connection::ConnectionConfig::BitbucketCloudConfig(
1169 map.next_value::<std::option::Option<
1170 std::boxed::Box<crate::model::BitbucketCloudConfig>,
1171 >>()?
1172 .unwrap_or_default(),
1173 ),
1174 );
1175 }
1176 __FieldTag::__name => {
1177 if !fields.insert(__FieldTag::__name) {
1178 return std::result::Result::Err(A::Error::duplicate_field(
1179 "multiple values for name",
1180 ));
1181 }
1182 result.name = map
1183 .next_value::<std::option::Option<std::string::String>>()?
1184 .unwrap_or_default();
1185 }
1186 __FieldTag::__create_time => {
1187 if !fields.insert(__FieldTag::__create_time) {
1188 return std::result::Result::Err(A::Error::duplicate_field(
1189 "multiple values for create_time",
1190 ));
1191 }
1192 result.create_time =
1193 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
1194 }
1195 __FieldTag::__update_time => {
1196 if !fields.insert(__FieldTag::__update_time) {
1197 return std::result::Result::Err(A::Error::duplicate_field(
1198 "multiple values for update_time",
1199 ));
1200 }
1201 result.update_time =
1202 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
1203 }
1204 __FieldTag::__delete_time => {
1205 if !fields.insert(__FieldTag::__delete_time) {
1206 return std::result::Result::Err(A::Error::duplicate_field(
1207 "multiple values for delete_time",
1208 ));
1209 }
1210 result.delete_time =
1211 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
1212 }
1213 __FieldTag::__labels => {
1214 if !fields.insert(__FieldTag::__labels) {
1215 return std::result::Result::Err(A::Error::duplicate_field(
1216 "multiple values for labels",
1217 ));
1218 }
1219 result.labels = map
1220 .next_value::<std::option::Option<
1221 std::collections::HashMap<
1222 std::string::String,
1223 std::string::String,
1224 >,
1225 >>()?
1226 .unwrap_or_default();
1227 }
1228 __FieldTag::__installation_state => {
1229 if !fields.insert(__FieldTag::__installation_state) {
1230 return std::result::Result::Err(A::Error::duplicate_field(
1231 "multiple values for installation_state",
1232 ));
1233 }
1234 result.installation_state = map
1235 .next_value::<std::option::Option<crate::model::InstallationState>>(
1236 )?;
1237 }
1238 __FieldTag::__disabled => {
1239 if !fields.insert(__FieldTag::__disabled) {
1240 return std::result::Result::Err(A::Error::duplicate_field(
1241 "multiple values for disabled",
1242 ));
1243 }
1244 result.disabled = map
1245 .next_value::<std::option::Option<bool>>()?
1246 .unwrap_or_default();
1247 }
1248 __FieldTag::__reconciling => {
1249 if !fields.insert(__FieldTag::__reconciling) {
1250 return std::result::Result::Err(A::Error::duplicate_field(
1251 "multiple values for reconciling",
1252 ));
1253 }
1254 result.reconciling = map
1255 .next_value::<std::option::Option<bool>>()?
1256 .unwrap_or_default();
1257 }
1258 __FieldTag::__annotations => {
1259 if !fields.insert(__FieldTag::__annotations) {
1260 return std::result::Result::Err(A::Error::duplicate_field(
1261 "multiple values for annotations",
1262 ));
1263 }
1264 result.annotations = map
1265 .next_value::<std::option::Option<
1266 std::collections::HashMap<
1267 std::string::String,
1268 std::string::String,
1269 >,
1270 >>()?
1271 .unwrap_or_default();
1272 }
1273 __FieldTag::__etag => {
1274 if !fields.insert(__FieldTag::__etag) {
1275 return std::result::Result::Err(A::Error::duplicate_field(
1276 "multiple values for etag",
1277 ));
1278 }
1279 result.etag = map
1280 .next_value::<std::option::Option<std::string::String>>()?
1281 .unwrap_or_default();
1282 }
1283 __FieldTag::__uid => {
1284 if !fields.insert(__FieldTag::__uid) {
1285 return std::result::Result::Err(A::Error::duplicate_field(
1286 "multiple values for uid",
1287 ));
1288 }
1289 result.uid = map
1290 .next_value::<std::option::Option<std::string::String>>()?
1291 .unwrap_or_default();
1292 }
1293 __FieldTag::__crypto_key_config => {
1294 if !fields.insert(__FieldTag::__crypto_key_config) {
1295 return std::result::Result::Err(A::Error::duplicate_field(
1296 "multiple values for crypto_key_config",
1297 ));
1298 }
1299 result.crypto_key_config = map
1300 .next_value::<std::option::Option<crate::model::CryptoKeyConfig>>(
1301 )?;
1302 }
1303 __FieldTag::__git_proxy_config => {
1304 if !fields.insert(__FieldTag::__git_proxy_config) {
1305 return std::result::Result::Err(A::Error::duplicate_field(
1306 "multiple values for git_proxy_config",
1307 ));
1308 }
1309 result.git_proxy_config = map
1310 .next_value::<std::option::Option<crate::model::GitProxyConfig>>(
1311 )?;
1312 }
1313 __FieldTag::Unknown(key) => {
1314 let value = map.next_value::<serde_json::Value>()?;
1315 result._unknown_fields.insert(key, value);
1316 }
1317 }
1318 }
1319 std::result::Result::Ok(result)
1320 }
1321 }
1322 deserializer.deserialize_any(Visitor)
1323 }
1324}
1325
1326#[doc(hidden)]
1327impl serde::ser::Serialize for Connection {
1328 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1329 where
1330 S: serde::ser::Serializer,
1331 {
1332 use serde::ser::SerializeMap;
1333 #[allow(unused_imports)]
1334 use std::option::Option::Some;
1335 let mut state = serializer.serialize_map(std::option::Option::None)?;
1336 if let Some(value) = self.github_config() {
1337 state.serialize_entry("githubConfig", value)?;
1338 }
1339 if let Some(value) = self.github_enterprise_config() {
1340 state.serialize_entry("githubEnterpriseConfig", value)?;
1341 }
1342 if let Some(value) = self.gitlab_config() {
1343 state.serialize_entry("gitlabConfig", value)?;
1344 }
1345 if let Some(value) = self.gitlab_enterprise_config() {
1346 state.serialize_entry("gitlabEnterpriseConfig", value)?;
1347 }
1348 if let Some(value) = self.bitbucket_data_center_config() {
1349 state.serialize_entry("bitbucketDataCenterConfig", value)?;
1350 }
1351 if let Some(value) = self.bitbucket_cloud_config() {
1352 state.serialize_entry("bitbucketCloudConfig", value)?;
1353 }
1354 if !self.name.is_empty() {
1355 state.serialize_entry("name", &self.name)?;
1356 }
1357 if self.create_time.is_some() {
1358 state.serialize_entry("createTime", &self.create_time)?;
1359 }
1360 if self.update_time.is_some() {
1361 state.serialize_entry("updateTime", &self.update_time)?;
1362 }
1363 if self.delete_time.is_some() {
1364 state.serialize_entry("deleteTime", &self.delete_time)?;
1365 }
1366 if !self.labels.is_empty() {
1367 state.serialize_entry("labels", &self.labels)?;
1368 }
1369 if self.installation_state.is_some() {
1370 state.serialize_entry("installationState", &self.installation_state)?;
1371 }
1372 if !wkt::internal::is_default(&self.disabled) {
1373 state.serialize_entry("disabled", &self.disabled)?;
1374 }
1375 if !wkt::internal::is_default(&self.reconciling) {
1376 state.serialize_entry("reconciling", &self.reconciling)?;
1377 }
1378 if !self.annotations.is_empty() {
1379 state.serialize_entry("annotations", &self.annotations)?;
1380 }
1381 if !self.etag.is_empty() {
1382 state.serialize_entry("etag", &self.etag)?;
1383 }
1384 if !self.uid.is_empty() {
1385 state.serialize_entry("uid", &self.uid)?;
1386 }
1387 if self.crypto_key_config.is_some() {
1388 state.serialize_entry("cryptoKeyConfig", &self.crypto_key_config)?;
1389 }
1390 if self.git_proxy_config.is_some() {
1391 state.serialize_entry("gitProxyConfig", &self.git_proxy_config)?;
1392 }
1393 if !self._unknown_fields.is_empty() {
1394 for (key, value) in self._unknown_fields.iter() {
1395 state.serialize_entry(key, &value)?;
1396 }
1397 }
1398 state.end()
1399 }
1400}
1401
1402impl std::fmt::Debug for Connection {
1403 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1404 let mut debug_struct = f.debug_struct("Connection");
1405 debug_struct.field("name", &self.name);
1406 debug_struct.field("create_time", &self.create_time);
1407 debug_struct.field("update_time", &self.update_time);
1408 debug_struct.field("delete_time", &self.delete_time);
1409 debug_struct.field("labels", &self.labels);
1410 debug_struct.field("installation_state", &self.installation_state);
1411 debug_struct.field("disabled", &self.disabled);
1412 debug_struct.field("reconciling", &self.reconciling);
1413 debug_struct.field("annotations", &self.annotations);
1414 debug_struct.field("etag", &self.etag);
1415 debug_struct.field("uid", &self.uid);
1416 debug_struct.field("crypto_key_config", &self.crypto_key_config);
1417 debug_struct.field("git_proxy_config", &self.git_proxy_config);
1418 debug_struct.field("connection_config", &self.connection_config);
1419 if !self._unknown_fields.is_empty() {
1420 debug_struct.field("_unknown_fields", &self._unknown_fields);
1421 }
1422 debug_struct.finish()
1423 }
1424}
1425
1426pub mod connection {
1428 #[allow(unused_imports)]
1429 use super::*;
1430
1431 #[derive(Clone, Debug, PartialEq)]
1433 #[non_exhaustive]
1434 pub enum ConnectionConfig {
1435 GithubConfig(std::boxed::Box<crate::model::GitHubConfig>),
1437 GithubEnterpriseConfig(std::boxed::Box<crate::model::GitHubEnterpriseConfig>),
1439 GitlabConfig(std::boxed::Box<crate::model::GitLabConfig>),
1441 GitlabEnterpriseConfig(std::boxed::Box<crate::model::GitLabEnterpriseConfig>),
1443 BitbucketDataCenterConfig(std::boxed::Box<crate::model::BitbucketDataCenterConfig>),
1445 BitbucketCloudConfig(std::boxed::Box<crate::model::BitbucketCloudConfig>),
1447 }
1448}
1449
1450#[derive(Clone, Default, PartialEq)]
1453#[non_exhaustive]
1454pub struct CryptoKeyConfig {
1455 pub key_reference: std::string::String,
1459
1460 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1461}
1462
1463impl CryptoKeyConfig {
1464 pub fn new() -> Self {
1465 std::default::Default::default()
1466 }
1467
1468 pub fn set_key_reference<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1470 self.key_reference = v.into();
1471 self
1472 }
1473}
1474
1475impl wkt::message::Message for CryptoKeyConfig {
1476 fn typename() -> &'static str {
1477 "type.googleapis.com/google.cloud.developerconnect.v1.CryptoKeyConfig"
1478 }
1479}
1480
1481#[doc(hidden)]
1482impl<'de> serde::de::Deserialize<'de> for CryptoKeyConfig {
1483 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1484 where
1485 D: serde::Deserializer<'de>,
1486 {
1487 #[allow(non_camel_case_types)]
1488 #[doc(hidden)]
1489 #[derive(PartialEq, Eq, Hash)]
1490 enum __FieldTag {
1491 __key_reference,
1492 Unknown(std::string::String),
1493 }
1494 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1495 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1496 where
1497 D: serde::Deserializer<'de>,
1498 {
1499 struct Visitor;
1500 impl<'de> serde::de::Visitor<'de> for Visitor {
1501 type Value = __FieldTag;
1502 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1503 formatter.write_str("a field name for CryptoKeyConfig")
1504 }
1505 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1506 where
1507 E: serde::de::Error,
1508 {
1509 use std::result::Result::Ok;
1510 use std::string::ToString;
1511 match value {
1512 "keyReference" => Ok(__FieldTag::__key_reference),
1513 "key_reference" => Ok(__FieldTag::__key_reference),
1514 _ => Ok(__FieldTag::Unknown(value.to_string())),
1515 }
1516 }
1517 }
1518 deserializer.deserialize_identifier(Visitor)
1519 }
1520 }
1521 struct Visitor;
1522 impl<'de> serde::de::Visitor<'de> for Visitor {
1523 type Value = CryptoKeyConfig;
1524 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1525 formatter.write_str("struct CryptoKeyConfig")
1526 }
1527 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1528 where
1529 A: serde::de::MapAccess<'de>,
1530 {
1531 #[allow(unused_imports)]
1532 use serde::de::Error;
1533 use std::option::Option::Some;
1534 let mut fields = std::collections::HashSet::new();
1535 let mut result = Self::Value::new();
1536 while let Some(tag) = map.next_key::<__FieldTag>()? {
1537 #[allow(clippy::match_single_binding)]
1538 match tag {
1539 __FieldTag::__key_reference => {
1540 if !fields.insert(__FieldTag::__key_reference) {
1541 return std::result::Result::Err(A::Error::duplicate_field(
1542 "multiple values for key_reference",
1543 ));
1544 }
1545 result.key_reference = map
1546 .next_value::<std::option::Option<std::string::String>>()?
1547 .unwrap_or_default();
1548 }
1549 __FieldTag::Unknown(key) => {
1550 let value = map.next_value::<serde_json::Value>()?;
1551 result._unknown_fields.insert(key, value);
1552 }
1553 }
1554 }
1555 std::result::Result::Ok(result)
1556 }
1557 }
1558 deserializer.deserialize_any(Visitor)
1559 }
1560}
1561
1562#[doc(hidden)]
1563impl serde::ser::Serialize for CryptoKeyConfig {
1564 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1565 where
1566 S: serde::ser::Serializer,
1567 {
1568 use serde::ser::SerializeMap;
1569 #[allow(unused_imports)]
1570 use std::option::Option::Some;
1571 let mut state = serializer.serialize_map(std::option::Option::None)?;
1572 if !self.key_reference.is_empty() {
1573 state.serialize_entry("keyReference", &self.key_reference)?;
1574 }
1575 if !self._unknown_fields.is_empty() {
1576 for (key, value) in self._unknown_fields.iter() {
1577 state.serialize_entry(key, &value)?;
1578 }
1579 }
1580 state.end()
1581 }
1582}
1583
1584impl std::fmt::Debug for CryptoKeyConfig {
1585 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1586 let mut debug_struct = f.debug_struct("CryptoKeyConfig");
1587 debug_struct.field("key_reference", &self.key_reference);
1588 if !self._unknown_fields.is_empty() {
1589 debug_struct.field("_unknown_fields", &self._unknown_fields);
1590 }
1591 debug_struct.finish()
1592 }
1593}
1594
1595#[derive(Clone, Default, PartialEq)]
1597#[non_exhaustive]
1598pub struct GitProxyConfig {
1599 pub enabled: bool,
1602
1603 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1604}
1605
1606impl GitProxyConfig {
1607 pub fn new() -> Self {
1608 std::default::Default::default()
1609 }
1610
1611 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1613 self.enabled = v.into();
1614 self
1615 }
1616}
1617
1618impl wkt::message::Message for GitProxyConfig {
1619 fn typename() -> &'static str {
1620 "type.googleapis.com/google.cloud.developerconnect.v1.GitProxyConfig"
1621 }
1622}
1623
1624#[doc(hidden)]
1625impl<'de> serde::de::Deserialize<'de> for GitProxyConfig {
1626 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1627 where
1628 D: serde::Deserializer<'de>,
1629 {
1630 #[allow(non_camel_case_types)]
1631 #[doc(hidden)]
1632 #[derive(PartialEq, Eq, Hash)]
1633 enum __FieldTag {
1634 __enabled,
1635 Unknown(std::string::String),
1636 }
1637 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1638 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1639 where
1640 D: serde::Deserializer<'de>,
1641 {
1642 struct Visitor;
1643 impl<'de> serde::de::Visitor<'de> for Visitor {
1644 type Value = __FieldTag;
1645 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1646 formatter.write_str("a field name for GitProxyConfig")
1647 }
1648 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1649 where
1650 E: serde::de::Error,
1651 {
1652 use std::result::Result::Ok;
1653 use std::string::ToString;
1654 match value {
1655 "enabled" => Ok(__FieldTag::__enabled),
1656 _ => Ok(__FieldTag::Unknown(value.to_string())),
1657 }
1658 }
1659 }
1660 deserializer.deserialize_identifier(Visitor)
1661 }
1662 }
1663 struct Visitor;
1664 impl<'de> serde::de::Visitor<'de> for Visitor {
1665 type Value = GitProxyConfig;
1666 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1667 formatter.write_str("struct GitProxyConfig")
1668 }
1669 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1670 where
1671 A: serde::de::MapAccess<'de>,
1672 {
1673 #[allow(unused_imports)]
1674 use serde::de::Error;
1675 use std::option::Option::Some;
1676 let mut fields = std::collections::HashSet::new();
1677 let mut result = Self::Value::new();
1678 while let Some(tag) = map.next_key::<__FieldTag>()? {
1679 #[allow(clippy::match_single_binding)]
1680 match tag {
1681 __FieldTag::__enabled => {
1682 if !fields.insert(__FieldTag::__enabled) {
1683 return std::result::Result::Err(A::Error::duplicate_field(
1684 "multiple values for enabled",
1685 ));
1686 }
1687 result.enabled = map
1688 .next_value::<std::option::Option<bool>>()?
1689 .unwrap_or_default();
1690 }
1691 __FieldTag::Unknown(key) => {
1692 let value = map.next_value::<serde_json::Value>()?;
1693 result._unknown_fields.insert(key, value);
1694 }
1695 }
1696 }
1697 std::result::Result::Ok(result)
1698 }
1699 }
1700 deserializer.deserialize_any(Visitor)
1701 }
1702}
1703
1704#[doc(hidden)]
1705impl serde::ser::Serialize for GitProxyConfig {
1706 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1707 where
1708 S: serde::ser::Serializer,
1709 {
1710 use serde::ser::SerializeMap;
1711 #[allow(unused_imports)]
1712 use std::option::Option::Some;
1713 let mut state = serializer.serialize_map(std::option::Option::None)?;
1714 if !wkt::internal::is_default(&self.enabled) {
1715 state.serialize_entry("enabled", &self.enabled)?;
1716 }
1717 if !self._unknown_fields.is_empty() {
1718 for (key, value) in self._unknown_fields.iter() {
1719 state.serialize_entry(key, &value)?;
1720 }
1721 }
1722 state.end()
1723 }
1724}
1725
1726impl std::fmt::Debug for GitProxyConfig {
1727 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1728 let mut debug_struct = f.debug_struct("GitProxyConfig");
1729 debug_struct.field("enabled", &self.enabled);
1730 if !self._unknown_fields.is_empty() {
1731 debug_struct.field("_unknown_fields", &self._unknown_fields);
1732 }
1733 debug_struct.finish()
1734 }
1735}
1736
1737#[derive(Clone, Default, PartialEq)]
1741#[non_exhaustive]
1742pub struct InstallationState {
1743 pub stage: crate::model::installation_state::Stage,
1745
1746 pub message: std::string::String,
1749
1750 pub action_uri: std::string::String,
1753
1754 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1755}
1756
1757impl InstallationState {
1758 pub fn new() -> Self {
1759 std::default::Default::default()
1760 }
1761
1762 pub fn set_stage<T: std::convert::Into<crate::model::installation_state::Stage>>(
1764 mut self,
1765 v: T,
1766 ) -> Self {
1767 self.stage = v.into();
1768 self
1769 }
1770
1771 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1773 self.message = v.into();
1774 self
1775 }
1776
1777 pub fn set_action_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1779 self.action_uri = v.into();
1780 self
1781 }
1782}
1783
1784impl wkt::message::Message for InstallationState {
1785 fn typename() -> &'static str {
1786 "type.googleapis.com/google.cloud.developerconnect.v1.InstallationState"
1787 }
1788}
1789
1790#[doc(hidden)]
1791impl<'de> serde::de::Deserialize<'de> for InstallationState {
1792 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1793 where
1794 D: serde::Deserializer<'de>,
1795 {
1796 #[allow(non_camel_case_types)]
1797 #[doc(hidden)]
1798 #[derive(PartialEq, Eq, Hash)]
1799 enum __FieldTag {
1800 __stage,
1801 __message,
1802 __action_uri,
1803 Unknown(std::string::String),
1804 }
1805 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1806 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1807 where
1808 D: serde::Deserializer<'de>,
1809 {
1810 struct Visitor;
1811 impl<'de> serde::de::Visitor<'de> for Visitor {
1812 type Value = __FieldTag;
1813 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1814 formatter.write_str("a field name for InstallationState")
1815 }
1816 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1817 where
1818 E: serde::de::Error,
1819 {
1820 use std::result::Result::Ok;
1821 use std::string::ToString;
1822 match value {
1823 "stage" => Ok(__FieldTag::__stage),
1824 "message" => Ok(__FieldTag::__message),
1825 "actionUri" => Ok(__FieldTag::__action_uri),
1826 "action_uri" => Ok(__FieldTag::__action_uri),
1827 _ => Ok(__FieldTag::Unknown(value.to_string())),
1828 }
1829 }
1830 }
1831 deserializer.deserialize_identifier(Visitor)
1832 }
1833 }
1834 struct Visitor;
1835 impl<'de> serde::de::Visitor<'de> for Visitor {
1836 type Value = InstallationState;
1837 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1838 formatter.write_str("struct InstallationState")
1839 }
1840 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1841 where
1842 A: serde::de::MapAccess<'de>,
1843 {
1844 #[allow(unused_imports)]
1845 use serde::de::Error;
1846 use std::option::Option::Some;
1847 let mut fields = std::collections::HashSet::new();
1848 let mut result = Self::Value::new();
1849 while let Some(tag) = map.next_key::<__FieldTag>()? {
1850 #[allow(clippy::match_single_binding)]
1851 match tag {
1852 __FieldTag::__stage => {
1853 if !fields.insert(__FieldTag::__stage) {
1854 return std::result::Result::Err(A::Error::duplicate_field(
1855 "multiple values for stage",
1856 ));
1857 }
1858 result.stage = map.next_value::<std::option::Option<crate::model::installation_state::Stage>>()?.unwrap_or_default();
1859 }
1860 __FieldTag::__message => {
1861 if !fields.insert(__FieldTag::__message) {
1862 return std::result::Result::Err(A::Error::duplicate_field(
1863 "multiple values for message",
1864 ));
1865 }
1866 result.message = map
1867 .next_value::<std::option::Option<std::string::String>>()?
1868 .unwrap_or_default();
1869 }
1870 __FieldTag::__action_uri => {
1871 if !fields.insert(__FieldTag::__action_uri) {
1872 return std::result::Result::Err(A::Error::duplicate_field(
1873 "multiple values for action_uri",
1874 ));
1875 }
1876 result.action_uri = map
1877 .next_value::<std::option::Option<std::string::String>>()?
1878 .unwrap_or_default();
1879 }
1880 __FieldTag::Unknown(key) => {
1881 let value = map.next_value::<serde_json::Value>()?;
1882 result._unknown_fields.insert(key, value);
1883 }
1884 }
1885 }
1886 std::result::Result::Ok(result)
1887 }
1888 }
1889 deserializer.deserialize_any(Visitor)
1890 }
1891}
1892
1893#[doc(hidden)]
1894impl serde::ser::Serialize for InstallationState {
1895 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1896 where
1897 S: serde::ser::Serializer,
1898 {
1899 use serde::ser::SerializeMap;
1900 #[allow(unused_imports)]
1901 use std::option::Option::Some;
1902 let mut state = serializer.serialize_map(std::option::Option::None)?;
1903 if !wkt::internal::is_default(&self.stage) {
1904 state.serialize_entry("stage", &self.stage)?;
1905 }
1906 if !self.message.is_empty() {
1907 state.serialize_entry("message", &self.message)?;
1908 }
1909 if !self.action_uri.is_empty() {
1910 state.serialize_entry("actionUri", &self.action_uri)?;
1911 }
1912 if !self._unknown_fields.is_empty() {
1913 for (key, value) in self._unknown_fields.iter() {
1914 state.serialize_entry(key, &value)?;
1915 }
1916 }
1917 state.end()
1918 }
1919}
1920
1921impl std::fmt::Debug for InstallationState {
1922 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1923 let mut debug_struct = f.debug_struct("InstallationState");
1924 debug_struct.field("stage", &self.stage);
1925 debug_struct.field("message", &self.message);
1926 debug_struct.field("action_uri", &self.action_uri);
1927 if !self._unknown_fields.is_empty() {
1928 debug_struct.field("_unknown_fields", &self._unknown_fields);
1929 }
1930 debug_struct.finish()
1931 }
1932}
1933
1934pub mod installation_state {
1936 #[allow(unused_imports)]
1937 use super::*;
1938
1939 #[derive(Clone, Debug, PartialEq)]
1955 #[non_exhaustive]
1956 pub enum Stage {
1957 Unspecified,
1959 PendingCreateApp,
1962 PendingUserOauth,
1964 PendingInstallApp,
1966 Complete,
1968 UnknownValue(stage::UnknownValue),
1973 }
1974
1975 #[doc(hidden)]
1976 pub mod stage {
1977 #[allow(unused_imports)]
1978 use super::*;
1979 #[derive(Clone, Debug, PartialEq)]
1980 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1981 }
1982
1983 impl Stage {
1984 pub fn value(&self) -> std::option::Option<i32> {
1989 match self {
1990 Self::Unspecified => std::option::Option::Some(0),
1991 Self::PendingCreateApp => std::option::Option::Some(1),
1992 Self::PendingUserOauth => std::option::Option::Some(2),
1993 Self::PendingInstallApp => std::option::Option::Some(3),
1994 Self::Complete => std::option::Option::Some(10),
1995 Self::UnknownValue(u) => u.0.value(),
1996 }
1997 }
1998
1999 pub fn name(&self) -> std::option::Option<&str> {
2004 match self {
2005 Self::Unspecified => std::option::Option::Some("STAGE_UNSPECIFIED"),
2006 Self::PendingCreateApp => std::option::Option::Some("PENDING_CREATE_APP"),
2007 Self::PendingUserOauth => std::option::Option::Some("PENDING_USER_OAUTH"),
2008 Self::PendingInstallApp => std::option::Option::Some("PENDING_INSTALL_APP"),
2009 Self::Complete => std::option::Option::Some("COMPLETE"),
2010 Self::UnknownValue(u) => u.0.name(),
2011 }
2012 }
2013 }
2014
2015 impl std::default::Default for Stage {
2016 fn default() -> Self {
2017 use std::convert::From;
2018 Self::from(0)
2019 }
2020 }
2021
2022 impl std::fmt::Display for Stage {
2023 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2024 wkt::internal::display_enum(f, self.name(), self.value())
2025 }
2026 }
2027
2028 impl std::convert::From<i32> for Stage {
2029 fn from(value: i32) -> Self {
2030 match value {
2031 0 => Self::Unspecified,
2032 1 => Self::PendingCreateApp,
2033 2 => Self::PendingUserOauth,
2034 3 => Self::PendingInstallApp,
2035 10 => Self::Complete,
2036 _ => Self::UnknownValue(stage::UnknownValue(
2037 wkt::internal::UnknownEnumValue::Integer(value),
2038 )),
2039 }
2040 }
2041 }
2042
2043 impl std::convert::From<&str> for Stage {
2044 fn from(value: &str) -> Self {
2045 use std::string::ToString;
2046 match value {
2047 "STAGE_UNSPECIFIED" => Self::Unspecified,
2048 "PENDING_CREATE_APP" => Self::PendingCreateApp,
2049 "PENDING_USER_OAUTH" => Self::PendingUserOauth,
2050 "PENDING_INSTALL_APP" => Self::PendingInstallApp,
2051 "COMPLETE" => Self::Complete,
2052 _ => Self::UnknownValue(stage::UnknownValue(
2053 wkt::internal::UnknownEnumValue::String(value.to_string()),
2054 )),
2055 }
2056 }
2057 }
2058
2059 impl serde::ser::Serialize for Stage {
2060 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2061 where
2062 S: serde::Serializer,
2063 {
2064 match self {
2065 Self::Unspecified => serializer.serialize_i32(0),
2066 Self::PendingCreateApp => serializer.serialize_i32(1),
2067 Self::PendingUserOauth => serializer.serialize_i32(2),
2068 Self::PendingInstallApp => serializer.serialize_i32(3),
2069 Self::Complete => serializer.serialize_i32(10),
2070 Self::UnknownValue(u) => u.0.serialize(serializer),
2071 }
2072 }
2073 }
2074
2075 impl<'de> serde::de::Deserialize<'de> for Stage {
2076 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2077 where
2078 D: serde::Deserializer<'de>,
2079 {
2080 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Stage>::new(
2081 ".google.cloud.developerconnect.v1.InstallationState.Stage",
2082 ))
2083 }
2084 }
2085}
2086
2087#[derive(Clone, Default, PartialEq)]
2089#[non_exhaustive]
2090pub struct GitHubConfig {
2091 pub github_app: crate::model::git_hub_config::GitHubApp,
2094
2095 pub authorizer_credential: std::option::Option<crate::model::OAuthCredential>,
2099
2100 pub app_installation_id: i64,
2102
2103 pub installation_uri: std::string::String,
2106
2107 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2108}
2109
2110impl GitHubConfig {
2111 pub fn new() -> Self {
2112 std::default::Default::default()
2113 }
2114
2115 pub fn set_github_app<T: std::convert::Into<crate::model::git_hub_config::GitHubApp>>(
2117 mut self,
2118 v: T,
2119 ) -> Self {
2120 self.github_app = v.into();
2121 self
2122 }
2123
2124 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
2126 where
2127 T: std::convert::Into<crate::model::OAuthCredential>,
2128 {
2129 self.authorizer_credential = std::option::Option::Some(v.into());
2130 self
2131 }
2132
2133 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
2135 where
2136 T: std::convert::Into<crate::model::OAuthCredential>,
2137 {
2138 self.authorizer_credential = v.map(|x| x.into());
2139 self
2140 }
2141
2142 pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2144 self.app_installation_id = v.into();
2145 self
2146 }
2147
2148 pub fn set_installation_uri<T: std::convert::Into<std::string::String>>(
2150 mut self,
2151 v: T,
2152 ) -> Self {
2153 self.installation_uri = v.into();
2154 self
2155 }
2156}
2157
2158impl wkt::message::Message for GitHubConfig {
2159 fn typename() -> &'static str {
2160 "type.googleapis.com/google.cloud.developerconnect.v1.GitHubConfig"
2161 }
2162}
2163
2164#[doc(hidden)]
2165impl<'de> serde::de::Deserialize<'de> for GitHubConfig {
2166 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2167 where
2168 D: serde::Deserializer<'de>,
2169 {
2170 #[allow(non_camel_case_types)]
2171 #[doc(hidden)]
2172 #[derive(PartialEq, Eq, Hash)]
2173 enum __FieldTag {
2174 __github_app,
2175 __authorizer_credential,
2176 __app_installation_id,
2177 __installation_uri,
2178 Unknown(std::string::String),
2179 }
2180 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2181 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2182 where
2183 D: serde::Deserializer<'de>,
2184 {
2185 struct Visitor;
2186 impl<'de> serde::de::Visitor<'de> for Visitor {
2187 type Value = __FieldTag;
2188 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2189 formatter.write_str("a field name for GitHubConfig")
2190 }
2191 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2192 where
2193 E: serde::de::Error,
2194 {
2195 use std::result::Result::Ok;
2196 use std::string::ToString;
2197 match value {
2198 "githubApp" => Ok(__FieldTag::__github_app),
2199 "github_app" => Ok(__FieldTag::__github_app),
2200 "authorizerCredential" => Ok(__FieldTag::__authorizer_credential),
2201 "authorizer_credential" => Ok(__FieldTag::__authorizer_credential),
2202 "appInstallationId" => Ok(__FieldTag::__app_installation_id),
2203 "app_installation_id" => Ok(__FieldTag::__app_installation_id),
2204 "installationUri" => Ok(__FieldTag::__installation_uri),
2205 "installation_uri" => Ok(__FieldTag::__installation_uri),
2206 _ => Ok(__FieldTag::Unknown(value.to_string())),
2207 }
2208 }
2209 }
2210 deserializer.deserialize_identifier(Visitor)
2211 }
2212 }
2213 struct Visitor;
2214 impl<'de> serde::de::Visitor<'de> for Visitor {
2215 type Value = GitHubConfig;
2216 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2217 formatter.write_str("struct GitHubConfig")
2218 }
2219 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2220 where
2221 A: serde::de::MapAccess<'de>,
2222 {
2223 #[allow(unused_imports)]
2224 use serde::de::Error;
2225 use std::option::Option::Some;
2226 let mut fields = std::collections::HashSet::new();
2227 let mut result = Self::Value::new();
2228 while let Some(tag) = map.next_key::<__FieldTag>()? {
2229 #[allow(clippy::match_single_binding)]
2230 match tag {
2231 __FieldTag::__github_app => {
2232 if !fields.insert(__FieldTag::__github_app) {
2233 return std::result::Result::Err(A::Error::duplicate_field(
2234 "multiple values for github_app",
2235 ));
2236 }
2237 result.github_app = map.next_value::<std::option::Option<crate::model::git_hub_config::GitHubApp>>()?.unwrap_or_default();
2238 }
2239 __FieldTag::__authorizer_credential => {
2240 if !fields.insert(__FieldTag::__authorizer_credential) {
2241 return std::result::Result::Err(A::Error::duplicate_field(
2242 "multiple values for authorizer_credential",
2243 ));
2244 }
2245 result.authorizer_credential = map
2246 .next_value::<std::option::Option<crate::model::OAuthCredential>>(
2247 )?;
2248 }
2249 __FieldTag::__app_installation_id => {
2250 if !fields.insert(__FieldTag::__app_installation_id) {
2251 return std::result::Result::Err(A::Error::duplicate_field(
2252 "multiple values for app_installation_id",
2253 ));
2254 }
2255 struct __With(std::option::Option<i64>);
2256 impl<'de> serde::de::Deserialize<'de> for __With {
2257 fn deserialize<D>(
2258 deserializer: D,
2259 ) -> std::result::Result<Self, D::Error>
2260 where
2261 D: serde::de::Deserializer<'de>,
2262 {
2263 serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
2264 }
2265 }
2266 result.app_installation_id =
2267 map.next_value::<__With>()?.0.unwrap_or_default();
2268 }
2269 __FieldTag::__installation_uri => {
2270 if !fields.insert(__FieldTag::__installation_uri) {
2271 return std::result::Result::Err(A::Error::duplicate_field(
2272 "multiple values for installation_uri",
2273 ));
2274 }
2275 result.installation_uri = map
2276 .next_value::<std::option::Option<std::string::String>>()?
2277 .unwrap_or_default();
2278 }
2279 __FieldTag::Unknown(key) => {
2280 let value = map.next_value::<serde_json::Value>()?;
2281 result._unknown_fields.insert(key, value);
2282 }
2283 }
2284 }
2285 std::result::Result::Ok(result)
2286 }
2287 }
2288 deserializer.deserialize_any(Visitor)
2289 }
2290}
2291
2292#[doc(hidden)]
2293impl serde::ser::Serialize for GitHubConfig {
2294 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2295 where
2296 S: serde::ser::Serializer,
2297 {
2298 use serde::ser::SerializeMap;
2299 #[allow(unused_imports)]
2300 use std::option::Option::Some;
2301 let mut state = serializer.serialize_map(std::option::Option::None)?;
2302 if !wkt::internal::is_default(&self.github_app) {
2303 state.serialize_entry("githubApp", &self.github_app)?;
2304 }
2305 if self.authorizer_credential.is_some() {
2306 state.serialize_entry("authorizerCredential", &self.authorizer_credential)?;
2307 }
2308 if !wkt::internal::is_default(&self.app_installation_id) {
2309 struct __With<'a>(&'a i64);
2310 impl<'a> serde::ser::Serialize for __With<'a> {
2311 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2312 where
2313 S: serde::ser::Serializer,
2314 {
2315 serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
2316 }
2317 }
2318 state.serialize_entry("appInstallationId", &__With(&self.app_installation_id))?;
2319 }
2320 if !self.installation_uri.is_empty() {
2321 state.serialize_entry("installationUri", &self.installation_uri)?;
2322 }
2323 if !self._unknown_fields.is_empty() {
2324 for (key, value) in self._unknown_fields.iter() {
2325 state.serialize_entry(key, &value)?;
2326 }
2327 }
2328 state.end()
2329 }
2330}
2331
2332impl std::fmt::Debug for GitHubConfig {
2333 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2334 let mut debug_struct = f.debug_struct("GitHubConfig");
2335 debug_struct.field("github_app", &self.github_app);
2336 debug_struct.field("authorizer_credential", &self.authorizer_credential);
2337 debug_struct.field("app_installation_id", &self.app_installation_id);
2338 debug_struct.field("installation_uri", &self.installation_uri);
2339 if !self._unknown_fields.is_empty() {
2340 debug_struct.field("_unknown_fields", &self._unknown_fields);
2341 }
2342 debug_struct.finish()
2343 }
2344}
2345
2346pub mod git_hub_config {
2348 #[allow(unused_imports)]
2349 use super::*;
2350
2351 #[derive(Clone, Debug, PartialEq)]
2368 #[non_exhaustive]
2369 pub enum GitHubApp {
2370 Unspecified,
2372 DeveloperConnect,
2374 Firebase,
2376 UnknownValue(git_hub_app::UnknownValue),
2381 }
2382
2383 #[doc(hidden)]
2384 pub mod git_hub_app {
2385 #[allow(unused_imports)]
2386 use super::*;
2387 #[derive(Clone, Debug, PartialEq)]
2388 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2389 }
2390
2391 impl GitHubApp {
2392 pub fn value(&self) -> std::option::Option<i32> {
2397 match self {
2398 Self::Unspecified => std::option::Option::Some(0),
2399 Self::DeveloperConnect => std::option::Option::Some(1),
2400 Self::Firebase => std::option::Option::Some(2),
2401 Self::UnknownValue(u) => u.0.value(),
2402 }
2403 }
2404
2405 pub fn name(&self) -> std::option::Option<&str> {
2410 match self {
2411 Self::Unspecified => std::option::Option::Some("GIT_HUB_APP_UNSPECIFIED"),
2412 Self::DeveloperConnect => std::option::Option::Some("DEVELOPER_CONNECT"),
2413 Self::Firebase => std::option::Option::Some("FIREBASE"),
2414 Self::UnknownValue(u) => u.0.name(),
2415 }
2416 }
2417 }
2418
2419 impl std::default::Default for GitHubApp {
2420 fn default() -> Self {
2421 use std::convert::From;
2422 Self::from(0)
2423 }
2424 }
2425
2426 impl std::fmt::Display for GitHubApp {
2427 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2428 wkt::internal::display_enum(f, self.name(), self.value())
2429 }
2430 }
2431
2432 impl std::convert::From<i32> for GitHubApp {
2433 fn from(value: i32) -> Self {
2434 match value {
2435 0 => Self::Unspecified,
2436 1 => Self::DeveloperConnect,
2437 2 => Self::Firebase,
2438 _ => Self::UnknownValue(git_hub_app::UnknownValue(
2439 wkt::internal::UnknownEnumValue::Integer(value),
2440 )),
2441 }
2442 }
2443 }
2444
2445 impl std::convert::From<&str> for GitHubApp {
2446 fn from(value: &str) -> Self {
2447 use std::string::ToString;
2448 match value {
2449 "GIT_HUB_APP_UNSPECIFIED" => Self::Unspecified,
2450 "DEVELOPER_CONNECT" => Self::DeveloperConnect,
2451 "FIREBASE" => Self::Firebase,
2452 _ => Self::UnknownValue(git_hub_app::UnknownValue(
2453 wkt::internal::UnknownEnumValue::String(value.to_string()),
2454 )),
2455 }
2456 }
2457 }
2458
2459 impl serde::ser::Serialize for GitHubApp {
2460 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2461 where
2462 S: serde::Serializer,
2463 {
2464 match self {
2465 Self::Unspecified => serializer.serialize_i32(0),
2466 Self::DeveloperConnect => serializer.serialize_i32(1),
2467 Self::Firebase => serializer.serialize_i32(2),
2468 Self::UnknownValue(u) => u.0.serialize(serializer),
2469 }
2470 }
2471 }
2472
2473 impl<'de> serde::de::Deserialize<'de> for GitHubApp {
2474 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2475 where
2476 D: serde::Deserializer<'de>,
2477 {
2478 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GitHubApp>::new(
2479 ".google.cloud.developerconnect.v1.GitHubConfig.GitHubApp",
2480 ))
2481 }
2482 }
2483}
2484
2485#[derive(Clone, Default, PartialEq)]
2487#[non_exhaustive]
2488pub struct GitHubEnterpriseConfig {
2489 pub host_uri: std::string::String,
2491
2492 pub app_id: i64,
2494
2495 pub app_slug: std::string::String,
2497
2498 pub private_key_secret_version: std::string::String,
2501
2502 pub webhook_secret_secret_version: std::string::String,
2505
2506 pub app_installation_id: i64,
2508
2509 pub installation_uri: std::string::String,
2512
2513 pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
2519
2520 pub server_version: std::string::String,
2522
2523 pub ssl_ca_certificate: std::string::String,
2525
2526 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2527}
2528
2529impl GitHubEnterpriseConfig {
2530 pub fn new() -> Self {
2531 std::default::Default::default()
2532 }
2533
2534 pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2536 self.host_uri = v.into();
2537 self
2538 }
2539
2540 pub fn set_app_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2542 self.app_id = v.into();
2543 self
2544 }
2545
2546 pub fn set_app_slug<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2548 self.app_slug = v.into();
2549 self
2550 }
2551
2552 pub fn set_private_key_secret_version<T: std::convert::Into<std::string::String>>(
2554 mut self,
2555 v: T,
2556 ) -> Self {
2557 self.private_key_secret_version = v.into();
2558 self
2559 }
2560
2561 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
2563 mut self,
2564 v: T,
2565 ) -> Self {
2566 self.webhook_secret_secret_version = v.into();
2567 self
2568 }
2569
2570 pub fn set_app_installation_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2572 self.app_installation_id = v.into();
2573 self
2574 }
2575
2576 pub fn set_installation_uri<T: std::convert::Into<std::string::String>>(
2578 mut self,
2579 v: T,
2580 ) -> Self {
2581 self.installation_uri = v.into();
2582 self
2583 }
2584
2585 pub fn set_service_directory_config<T>(mut self, v: T) -> Self
2587 where
2588 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2589 {
2590 self.service_directory_config = std::option::Option::Some(v.into());
2591 self
2592 }
2593
2594 pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
2596 where
2597 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
2598 {
2599 self.service_directory_config = v.map(|x| x.into());
2600 self
2601 }
2602
2603 pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2605 self.server_version = v.into();
2606 self
2607 }
2608
2609 pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
2611 mut self,
2612 v: T,
2613 ) -> Self {
2614 self.ssl_ca_certificate = v.into();
2615 self
2616 }
2617}
2618
2619impl wkt::message::Message for GitHubEnterpriseConfig {
2620 fn typename() -> &'static str {
2621 "type.googleapis.com/google.cloud.developerconnect.v1.GitHubEnterpriseConfig"
2622 }
2623}
2624
2625#[doc(hidden)]
2626impl<'de> serde::de::Deserialize<'de> for GitHubEnterpriseConfig {
2627 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2628 where
2629 D: serde::Deserializer<'de>,
2630 {
2631 #[allow(non_camel_case_types)]
2632 #[doc(hidden)]
2633 #[derive(PartialEq, Eq, Hash)]
2634 enum __FieldTag {
2635 __host_uri,
2636 __app_id,
2637 __app_slug,
2638 __private_key_secret_version,
2639 __webhook_secret_secret_version,
2640 __app_installation_id,
2641 __installation_uri,
2642 __service_directory_config,
2643 __server_version,
2644 __ssl_ca_certificate,
2645 Unknown(std::string::String),
2646 }
2647 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2648 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2649 where
2650 D: serde::Deserializer<'de>,
2651 {
2652 struct Visitor;
2653 impl<'de> serde::de::Visitor<'de> for Visitor {
2654 type Value = __FieldTag;
2655 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2656 formatter.write_str("a field name for GitHubEnterpriseConfig")
2657 }
2658 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2659 where
2660 E: serde::de::Error,
2661 {
2662 use std::result::Result::Ok;
2663 use std::string::ToString;
2664 match value {
2665 "hostUri" => Ok(__FieldTag::__host_uri),
2666 "host_uri" => Ok(__FieldTag::__host_uri),
2667 "appId" => Ok(__FieldTag::__app_id),
2668 "app_id" => Ok(__FieldTag::__app_id),
2669 "appSlug" => Ok(__FieldTag::__app_slug),
2670 "app_slug" => Ok(__FieldTag::__app_slug),
2671 "privateKeySecretVersion" => {
2672 Ok(__FieldTag::__private_key_secret_version)
2673 }
2674 "private_key_secret_version" => {
2675 Ok(__FieldTag::__private_key_secret_version)
2676 }
2677 "webhookSecretSecretVersion" => {
2678 Ok(__FieldTag::__webhook_secret_secret_version)
2679 }
2680 "webhook_secret_secret_version" => {
2681 Ok(__FieldTag::__webhook_secret_secret_version)
2682 }
2683 "appInstallationId" => Ok(__FieldTag::__app_installation_id),
2684 "app_installation_id" => Ok(__FieldTag::__app_installation_id),
2685 "installationUri" => Ok(__FieldTag::__installation_uri),
2686 "installation_uri" => Ok(__FieldTag::__installation_uri),
2687 "serviceDirectoryConfig" => Ok(__FieldTag::__service_directory_config),
2688 "service_directory_config" => {
2689 Ok(__FieldTag::__service_directory_config)
2690 }
2691 "serverVersion" => Ok(__FieldTag::__server_version),
2692 "server_version" => Ok(__FieldTag::__server_version),
2693 "sslCaCertificate" => Ok(__FieldTag::__ssl_ca_certificate),
2694 "ssl_ca_certificate" => Ok(__FieldTag::__ssl_ca_certificate),
2695 _ => Ok(__FieldTag::Unknown(value.to_string())),
2696 }
2697 }
2698 }
2699 deserializer.deserialize_identifier(Visitor)
2700 }
2701 }
2702 struct Visitor;
2703 impl<'de> serde::de::Visitor<'de> for Visitor {
2704 type Value = GitHubEnterpriseConfig;
2705 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2706 formatter.write_str("struct GitHubEnterpriseConfig")
2707 }
2708 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2709 where
2710 A: serde::de::MapAccess<'de>,
2711 {
2712 #[allow(unused_imports)]
2713 use serde::de::Error;
2714 use std::option::Option::Some;
2715 let mut fields = std::collections::HashSet::new();
2716 let mut result = Self::Value::new();
2717 while let Some(tag) = map.next_key::<__FieldTag>()? {
2718 #[allow(clippy::match_single_binding)]
2719 match tag {
2720 __FieldTag::__host_uri => {
2721 if !fields.insert(__FieldTag::__host_uri) {
2722 return std::result::Result::Err(A::Error::duplicate_field(
2723 "multiple values for host_uri",
2724 ));
2725 }
2726 result.host_uri = map
2727 .next_value::<std::option::Option<std::string::String>>()?
2728 .unwrap_or_default();
2729 }
2730 __FieldTag::__app_id => {
2731 if !fields.insert(__FieldTag::__app_id) {
2732 return std::result::Result::Err(A::Error::duplicate_field(
2733 "multiple values for app_id",
2734 ));
2735 }
2736 struct __With(std::option::Option<i64>);
2737 impl<'de> serde::de::Deserialize<'de> for __With {
2738 fn deserialize<D>(
2739 deserializer: D,
2740 ) -> std::result::Result<Self, D::Error>
2741 where
2742 D: serde::de::Deserializer<'de>,
2743 {
2744 serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
2745 }
2746 }
2747 result.app_id = map.next_value::<__With>()?.0.unwrap_or_default();
2748 }
2749 __FieldTag::__app_slug => {
2750 if !fields.insert(__FieldTag::__app_slug) {
2751 return std::result::Result::Err(A::Error::duplicate_field(
2752 "multiple values for app_slug",
2753 ));
2754 }
2755 result.app_slug = map
2756 .next_value::<std::option::Option<std::string::String>>()?
2757 .unwrap_or_default();
2758 }
2759 __FieldTag::__private_key_secret_version => {
2760 if !fields.insert(__FieldTag::__private_key_secret_version) {
2761 return std::result::Result::Err(A::Error::duplicate_field(
2762 "multiple values for private_key_secret_version",
2763 ));
2764 }
2765 result.private_key_secret_version = map
2766 .next_value::<std::option::Option<std::string::String>>()?
2767 .unwrap_or_default();
2768 }
2769 __FieldTag::__webhook_secret_secret_version => {
2770 if !fields.insert(__FieldTag::__webhook_secret_secret_version) {
2771 return std::result::Result::Err(A::Error::duplicate_field(
2772 "multiple values for webhook_secret_secret_version",
2773 ));
2774 }
2775 result.webhook_secret_secret_version = map
2776 .next_value::<std::option::Option<std::string::String>>()?
2777 .unwrap_or_default();
2778 }
2779 __FieldTag::__app_installation_id => {
2780 if !fields.insert(__FieldTag::__app_installation_id) {
2781 return std::result::Result::Err(A::Error::duplicate_field(
2782 "multiple values for app_installation_id",
2783 ));
2784 }
2785 struct __With(std::option::Option<i64>);
2786 impl<'de> serde::de::Deserialize<'de> for __With {
2787 fn deserialize<D>(
2788 deserializer: D,
2789 ) -> std::result::Result<Self, D::Error>
2790 where
2791 D: serde::de::Deserializer<'de>,
2792 {
2793 serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
2794 }
2795 }
2796 result.app_installation_id =
2797 map.next_value::<__With>()?.0.unwrap_or_default();
2798 }
2799 __FieldTag::__installation_uri => {
2800 if !fields.insert(__FieldTag::__installation_uri) {
2801 return std::result::Result::Err(A::Error::duplicate_field(
2802 "multiple values for installation_uri",
2803 ));
2804 }
2805 result.installation_uri = map
2806 .next_value::<std::option::Option<std::string::String>>()?
2807 .unwrap_or_default();
2808 }
2809 __FieldTag::__service_directory_config => {
2810 if !fields.insert(__FieldTag::__service_directory_config) {
2811 return std::result::Result::Err(A::Error::duplicate_field(
2812 "multiple values for service_directory_config",
2813 ));
2814 }
2815 result.service_directory_config = map.next_value::<std::option::Option<crate::model::ServiceDirectoryConfig>>()?
2816 ;
2817 }
2818 __FieldTag::__server_version => {
2819 if !fields.insert(__FieldTag::__server_version) {
2820 return std::result::Result::Err(A::Error::duplicate_field(
2821 "multiple values for server_version",
2822 ));
2823 }
2824 result.server_version = map
2825 .next_value::<std::option::Option<std::string::String>>()?
2826 .unwrap_or_default();
2827 }
2828 __FieldTag::__ssl_ca_certificate => {
2829 if !fields.insert(__FieldTag::__ssl_ca_certificate) {
2830 return std::result::Result::Err(A::Error::duplicate_field(
2831 "multiple values for ssl_ca_certificate",
2832 ));
2833 }
2834 result.ssl_ca_certificate = map
2835 .next_value::<std::option::Option<std::string::String>>()?
2836 .unwrap_or_default();
2837 }
2838 __FieldTag::Unknown(key) => {
2839 let value = map.next_value::<serde_json::Value>()?;
2840 result._unknown_fields.insert(key, value);
2841 }
2842 }
2843 }
2844 std::result::Result::Ok(result)
2845 }
2846 }
2847 deserializer.deserialize_any(Visitor)
2848 }
2849}
2850
2851#[doc(hidden)]
2852impl serde::ser::Serialize for GitHubEnterpriseConfig {
2853 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2854 where
2855 S: serde::ser::Serializer,
2856 {
2857 use serde::ser::SerializeMap;
2858 #[allow(unused_imports)]
2859 use std::option::Option::Some;
2860 let mut state = serializer.serialize_map(std::option::Option::None)?;
2861 if !self.host_uri.is_empty() {
2862 state.serialize_entry("hostUri", &self.host_uri)?;
2863 }
2864 if !wkt::internal::is_default(&self.app_id) {
2865 struct __With<'a>(&'a i64);
2866 impl<'a> serde::ser::Serialize for __With<'a> {
2867 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2868 where
2869 S: serde::ser::Serializer,
2870 {
2871 serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
2872 }
2873 }
2874 state.serialize_entry("appId", &__With(&self.app_id))?;
2875 }
2876 if !self.app_slug.is_empty() {
2877 state.serialize_entry("appSlug", &self.app_slug)?;
2878 }
2879 if !self.private_key_secret_version.is_empty() {
2880 state.serialize_entry("privateKeySecretVersion", &self.private_key_secret_version)?;
2881 }
2882 if !self.webhook_secret_secret_version.is_empty() {
2883 state.serialize_entry(
2884 "webhookSecretSecretVersion",
2885 &self.webhook_secret_secret_version,
2886 )?;
2887 }
2888 if !wkt::internal::is_default(&self.app_installation_id) {
2889 struct __With<'a>(&'a i64);
2890 impl<'a> serde::ser::Serialize for __With<'a> {
2891 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2892 where
2893 S: serde::ser::Serializer,
2894 {
2895 serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
2896 }
2897 }
2898 state.serialize_entry("appInstallationId", &__With(&self.app_installation_id))?;
2899 }
2900 if !self.installation_uri.is_empty() {
2901 state.serialize_entry("installationUri", &self.installation_uri)?;
2902 }
2903 if self.service_directory_config.is_some() {
2904 state.serialize_entry("serviceDirectoryConfig", &self.service_directory_config)?;
2905 }
2906 if !self.server_version.is_empty() {
2907 state.serialize_entry("serverVersion", &self.server_version)?;
2908 }
2909 if !self.ssl_ca_certificate.is_empty() {
2910 state.serialize_entry("sslCaCertificate", &self.ssl_ca_certificate)?;
2911 }
2912 if !self._unknown_fields.is_empty() {
2913 for (key, value) in self._unknown_fields.iter() {
2914 state.serialize_entry(key, &value)?;
2915 }
2916 }
2917 state.end()
2918 }
2919}
2920
2921impl std::fmt::Debug for GitHubEnterpriseConfig {
2922 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2923 let mut debug_struct = f.debug_struct("GitHubEnterpriseConfig");
2924 debug_struct.field("host_uri", &self.host_uri);
2925 debug_struct.field("app_id", &self.app_id);
2926 debug_struct.field("app_slug", &self.app_slug);
2927 debug_struct.field(
2928 "private_key_secret_version",
2929 &self.private_key_secret_version,
2930 );
2931 debug_struct.field(
2932 "webhook_secret_secret_version",
2933 &self.webhook_secret_secret_version,
2934 );
2935 debug_struct.field("app_installation_id", &self.app_installation_id);
2936 debug_struct.field("installation_uri", &self.installation_uri);
2937 debug_struct.field("service_directory_config", &self.service_directory_config);
2938 debug_struct.field("server_version", &self.server_version);
2939 debug_struct.field("ssl_ca_certificate", &self.ssl_ca_certificate);
2940 if !self._unknown_fields.is_empty() {
2941 debug_struct.field("_unknown_fields", &self._unknown_fields);
2942 }
2943 debug_struct.finish()
2944 }
2945}
2946
2947#[derive(Clone, Default, PartialEq)]
2950#[non_exhaustive]
2951pub struct ServiceDirectoryConfig {
2952 pub service: std::string::String,
2956
2957 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2958}
2959
2960impl ServiceDirectoryConfig {
2961 pub fn new() -> Self {
2962 std::default::Default::default()
2963 }
2964
2965 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2967 self.service = v.into();
2968 self
2969 }
2970}
2971
2972impl wkt::message::Message for ServiceDirectoryConfig {
2973 fn typename() -> &'static str {
2974 "type.googleapis.com/google.cloud.developerconnect.v1.ServiceDirectoryConfig"
2975 }
2976}
2977
2978#[doc(hidden)]
2979impl<'de> serde::de::Deserialize<'de> for ServiceDirectoryConfig {
2980 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2981 where
2982 D: serde::Deserializer<'de>,
2983 {
2984 #[allow(non_camel_case_types)]
2985 #[doc(hidden)]
2986 #[derive(PartialEq, Eq, Hash)]
2987 enum __FieldTag {
2988 __service,
2989 Unknown(std::string::String),
2990 }
2991 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2992 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2993 where
2994 D: serde::Deserializer<'de>,
2995 {
2996 struct Visitor;
2997 impl<'de> serde::de::Visitor<'de> for Visitor {
2998 type Value = __FieldTag;
2999 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3000 formatter.write_str("a field name for ServiceDirectoryConfig")
3001 }
3002 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3003 where
3004 E: serde::de::Error,
3005 {
3006 use std::result::Result::Ok;
3007 use std::string::ToString;
3008 match value {
3009 "service" => Ok(__FieldTag::__service),
3010 _ => Ok(__FieldTag::Unknown(value.to_string())),
3011 }
3012 }
3013 }
3014 deserializer.deserialize_identifier(Visitor)
3015 }
3016 }
3017 struct Visitor;
3018 impl<'de> serde::de::Visitor<'de> for Visitor {
3019 type Value = ServiceDirectoryConfig;
3020 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3021 formatter.write_str("struct ServiceDirectoryConfig")
3022 }
3023 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3024 where
3025 A: serde::de::MapAccess<'de>,
3026 {
3027 #[allow(unused_imports)]
3028 use serde::de::Error;
3029 use std::option::Option::Some;
3030 let mut fields = std::collections::HashSet::new();
3031 let mut result = Self::Value::new();
3032 while let Some(tag) = map.next_key::<__FieldTag>()? {
3033 #[allow(clippy::match_single_binding)]
3034 match tag {
3035 __FieldTag::__service => {
3036 if !fields.insert(__FieldTag::__service) {
3037 return std::result::Result::Err(A::Error::duplicate_field(
3038 "multiple values for service",
3039 ));
3040 }
3041 result.service = map
3042 .next_value::<std::option::Option<std::string::String>>()?
3043 .unwrap_or_default();
3044 }
3045 __FieldTag::Unknown(key) => {
3046 let value = map.next_value::<serde_json::Value>()?;
3047 result._unknown_fields.insert(key, value);
3048 }
3049 }
3050 }
3051 std::result::Result::Ok(result)
3052 }
3053 }
3054 deserializer.deserialize_any(Visitor)
3055 }
3056}
3057
3058#[doc(hidden)]
3059impl serde::ser::Serialize for ServiceDirectoryConfig {
3060 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3061 where
3062 S: serde::ser::Serializer,
3063 {
3064 use serde::ser::SerializeMap;
3065 #[allow(unused_imports)]
3066 use std::option::Option::Some;
3067 let mut state = serializer.serialize_map(std::option::Option::None)?;
3068 if !self.service.is_empty() {
3069 state.serialize_entry("service", &self.service)?;
3070 }
3071 if !self._unknown_fields.is_empty() {
3072 for (key, value) in self._unknown_fields.iter() {
3073 state.serialize_entry(key, &value)?;
3074 }
3075 }
3076 state.end()
3077 }
3078}
3079
3080impl std::fmt::Debug for ServiceDirectoryConfig {
3081 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3082 let mut debug_struct = f.debug_struct("ServiceDirectoryConfig");
3083 debug_struct.field("service", &self.service);
3084 if !self._unknown_fields.is_empty() {
3085 debug_struct.field("_unknown_fields", &self._unknown_fields);
3086 }
3087 debug_struct.finish()
3088 }
3089}
3090
3091#[derive(Clone, Default, PartialEq)]
3094#[non_exhaustive]
3095pub struct OAuthCredential {
3096 pub oauth_token_secret_version: std::string::String,
3099
3100 pub username: std::string::String,
3102
3103 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3104}
3105
3106impl OAuthCredential {
3107 pub fn new() -> Self {
3108 std::default::Default::default()
3109 }
3110
3111 pub fn set_oauth_token_secret_version<T: std::convert::Into<std::string::String>>(
3113 mut self,
3114 v: T,
3115 ) -> Self {
3116 self.oauth_token_secret_version = v.into();
3117 self
3118 }
3119
3120 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3122 self.username = v.into();
3123 self
3124 }
3125}
3126
3127impl wkt::message::Message for OAuthCredential {
3128 fn typename() -> &'static str {
3129 "type.googleapis.com/google.cloud.developerconnect.v1.OAuthCredential"
3130 }
3131}
3132
3133#[doc(hidden)]
3134impl<'de> serde::de::Deserialize<'de> for OAuthCredential {
3135 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3136 where
3137 D: serde::Deserializer<'de>,
3138 {
3139 #[allow(non_camel_case_types)]
3140 #[doc(hidden)]
3141 #[derive(PartialEq, Eq, Hash)]
3142 enum __FieldTag {
3143 __oauth_token_secret_version,
3144 __username,
3145 Unknown(std::string::String),
3146 }
3147 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3148 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3149 where
3150 D: serde::Deserializer<'de>,
3151 {
3152 struct Visitor;
3153 impl<'de> serde::de::Visitor<'de> for Visitor {
3154 type Value = __FieldTag;
3155 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3156 formatter.write_str("a field name for OAuthCredential")
3157 }
3158 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3159 where
3160 E: serde::de::Error,
3161 {
3162 use std::result::Result::Ok;
3163 use std::string::ToString;
3164 match value {
3165 "oauthTokenSecretVersion" => {
3166 Ok(__FieldTag::__oauth_token_secret_version)
3167 }
3168 "oauth_token_secret_version" => {
3169 Ok(__FieldTag::__oauth_token_secret_version)
3170 }
3171 "username" => Ok(__FieldTag::__username),
3172 _ => Ok(__FieldTag::Unknown(value.to_string())),
3173 }
3174 }
3175 }
3176 deserializer.deserialize_identifier(Visitor)
3177 }
3178 }
3179 struct Visitor;
3180 impl<'de> serde::de::Visitor<'de> for Visitor {
3181 type Value = OAuthCredential;
3182 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3183 formatter.write_str("struct OAuthCredential")
3184 }
3185 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3186 where
3187 A: serde::de::MapAccess<'de>,
3188 {
3189 #[allow(unused_imports)]
3190 use serde::de::Error;
3191 use std::option::Option::Some;
3192 let mut fields = std::collections::HashSet::new();
3193 let mut result = Self::Value::new();
3194 while let Some(tag) = map.next_key::<__FieldTag>()? {
3195 #[allow(clippy::match_single_binding)]
3196 match tag {
3197 __FieldTag::__oauth_token_secret_version => {
3198 if !fields.insert(__FieldTag::__oauth_token_secret_version) {
3199 return std::result::Result::Err(A::Error::duplicate_field(
3200 "multiple values for oauth_token_secret_version",
3201 ));
3202 }
3203 result.oauth_token_secret_version = map
3204 .next_value::<std::option::Option<std::string::String>>()?
3205 .unwrap_or_default();
3206 }
3207 __FieldTag::__username => {
3208 if !fields.insert(__FieldTag::__username) {
3209 return std::result::Result::Err(A::Error::duplicate_field(
3210 "multiple values for username",
3211 ));
3212 }
3213 result.username = map
3214 .next_value::<std::option::Option<std::string::String>>()?
3215 .unwrap_or_default();
3216 }
3217 __FieldTag::Unknown(key) => {
3218 let value = map.next_value::<serde_json::Value>()?;
3219 result._unknown_fields.insert(key, value);
3220 }
3221 }
3222 }
3223 std::result::Result::Ok(result)
3224 }
3225 }
3226 deserializer.deserialize_any(Visitor)
3227 }
3228}
3229
3230#[doc(hidden)]
3231impl serde::ser::Serialize for OAuthCredential {
3232 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3233 where
3234 S: serde::ser::Serializer,
3235 {
3236 use serde::ser::SerializeMap;
3237 #[allow(unused_imports)]
3238 use std::option::Option::Some;
3239 let mut state = serializer.serialize_map(std::option::Option::None)?;
3240 if !self.oauth_token_secret_version.is_empty() {
3241 state.serialize_entry("oauthTokenSecretVersion", &self.oauth_token_secret_version)?;
3242 }
3243 if !self.username.is_empty() {
3244 state.serialize_entry("username", &self.username)?;
3245 }
3246 if !self._unknown_fields.is_empty() {
3247 for (key, value) in self._unknown_fields.iter() {
3248 state.serialize_entry(key, &value)?;
3249 }
3250 }
3251 state.end()
3252 }
3253}
3254
3255impl std::fmt::Debug for OAuthCredential {
3256 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3257 let mut debug_struct = f.debug_struct("OAuthCredential");
3258 debug_struct.field(
3259 "oauth_token_secret_version",
3260 &self.oauth_token_secret_version,
3261 );
3262 debug_struct.field("username", &self.username);
3263 if !self._unknown_fields.is_empty() {
3264 debug_struct.field("_unknown_fields", &self._unknown_fields);
3265 }
3266 debug_struct.finish()
3267 }
3268}
3269
3270#[derive(Clone, Default, PartialEq)]
3272#[non_exhaustive]
3273pub struct GitLabConfig {
3274 pub webhook_secret_secret_version: std::string::String,
3278
3279 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
3284
3285 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
3290
3291 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3292}
3293
3294impl GitLabConfig {
3295 pub fn new() -> Self {
3296 std::default::Default::default()
3297 }
3298
3299 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
3301 mut self,
3302 v: T,
3303 ) -> Self {
3304 self.webhook_secret_secret_version = v.into();
3305 self
3306 }
3307
3308 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
3310 where
3311 T: std::convert::Into<crate::model::UserCredential>,
3312 {
3313 self.read_authorizer_credential = std::option::Option::Some(v.into());
3314 self
3315 }
3316
3317 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3319 where
3320 T: std::convert::Into<crate::model::UserCredential>,
3321 {
3322 self.read_authorizer_credential = v.map(|x| x.into());
3323 self
3324 }
3325
3326 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
3328 where
3329 T: std::convert::Into<crate::model::UserCredential>,
3330 {
3331 self.authorizer_credential = std::option::Option::Some(v.into());
3332 self
3333 }
3334
3335 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3337 where
3338 T: std::convert::Into<crate::model::UserCredential>,
3339 {
3340 self.authorizer_credential = v.map(|x| x.into());
3341 self
3342 }
3343}
3344
3345impl wkt::message::Message for GitLabConfig {
3346 fn typename() -> &'static str {
3347 "type.googleapis.com/google.cloud.developerconnect.v1.GitLabConfig"
3348 }
3349}
3350
3351#[doc(hidden)]
3352impl<'de> serde::de::Deserialize<'de> for GitLabConfig {
3353 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3354 where
3355 D: serde::Deserializer<'de>,
3356 {
3357 #[allow(non_camel_case_types)]
3358 #[doc(hidden)]
3359 #[derive(PartialEq, Eq, Hash)]
3360 enum __FieldTag {
3361 __webhook_secret_secret_version,
3362 __read_authorizer_credential,
3363 __authorizer_credential,
3364 Unknown(std::string::String),
3365 }
3366 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3367 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3368 where
3369 D: serde::Deserializer<'de>,
3370 {
3371 struct Visitor;
3372 impl<'de> serde::de::Visitor<'de> for Visitor {
3373 type Value = __FieldTag;
3374 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3375 formatter.write_str("a field name for GitLabConfig")
3376 }
3377 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3378 where
3379 E: serde::de::Error,
3380 {
3381 use std::result::Result::Ok;
3382 use std::string::ToString;
3383 match value {
3384 "webhookSecretSecretVersion" => {
3385 Ok(__FieldTag::__webhook_secret_secret_version)
3386 }
3387 "webhook_secret_secret_version" => {
3388 Ok(__FieldTag::__webhook_secret_secret_version)
3389 }
3390 "readAuthorizerCredential" => {
3391 Ok(__FieldTag::__read_authorizer_credential)
3392 }
3393 "read_authorizer_credential" => {
3394 Ok(__FieldTag::__read_authorizer_credential)
3395 }
3396 "authorizerCredential" => Ok(__FieldTag::__authorizer_credential),
3397 "authorizer_credential" => Ok(__FieldTag::__authorizer_credential),
3398 _ => Ok(__FieldTag::Unknown(value.to_string())),
3399 }
3400 }
3401 }
3402 deserializer.deserialize_identifier(Visitor)
3403 }
3404 }
3405 struct Visitor;
3406 impl<'de> serde::de::Visitor<'de> for Visitor {
3407 type Value = GitLabConfig;
3408 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3409 formatter.write_str("struct GitLabConfig")
3410 }
3411 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3412 where
3413 A: serde::de::MapAccess<'de>,
3414 {
3415 #[allow(unused_imports)]
3416 use serde::de::Error;
3417 use std::option::Option::Some;
3418 let mut fields = std::collections::HashSet::new();
3419 let mut result = Self::Value::new();
3420 while let Some(tag) = map.next_key::<__FieldTag>()? {
3421 #[allow(clippy::match_single_binding)]
3422 match tag {
3423 __FieldTag::__webhook_secret_secret_version => {
3424 if !fields.insert(__FieldTag::__webhook_secret_secret_version) {
3425 return std::result::Result::Err(A::Error::duplicate_field(
3426 "multiple values for webhook_secret_secret_version",
3427 ));
3428 }
3429 result.webhook_secret_secret_version = map
3430 .next_value::<std::option::Option<std::string::String>>()?
3431 .unwrap_or_default();
3432 }
3433 __FieldTag::__read_authorizer_credential => {
3434 if !fields.insert(__FieldTag::__read_authorizer_credential) {
3435 return std::result::Result::Err(A::Error::duplicate_field(
3436 "multiple values for read_authorizer_credential",
3437 ));
3438 }
3439 result.read_authorizer_credential = map
3440 .next_value::<std::option::Option<crate::model::UserCredential>>(
3441 )?;
3442 }
3443 __FieldTag::__authorizer_credential => {
3444 if !fields.insert(__FieldTag::__authorizer_credential) {
3445 return std::result::Result::Err(A::Error::duplicate_field(
3446 "multiple values for authorizer_credential",
3447 ));
3448 }
3449 result.authorizer_credential = map
3450 .next_value::<std::option::Option<crate::model::UserCredential>>(
3451 )?;
3452 }
3453 __FieldTag::Unknown(key) => {
3454 let value = map.next_value::<serde_json::Value>()?;
3455 result._unknown_fields.insert(key, value);
3456 }
3457 }
3458 }
3459 std::result::Result::Ok(result)
3460 }
3461 }
3462 deserializer.deserialize_any(Visitor)
3463 }
3464}
3465
3466#[doc(hidden)]
3467impl serde::ser::Serialize for GitLabConfig {
3468 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3469 where
3470 S: serde::ser::Serializer,
3471 {
3472 use serde::ser::SerializeMap;
3473 #[allow(unused_imports)]
3474 use std::option::Option::Some;
3475 let mut state = serializer.serialize_map(std::option::Option::None)?;
3476 if !self.webhook_secret_secret_version.is_empty() {
3477 state.serialize_entry(
3478 "webhookSecretSecretVersion",
3479 &self.webhook_secret_secret_version,
3480 )?;
3481 }
3482 if self.read_authorizer_credential.is_some() {
3483 state.serialize_entry("readAuthorizerCredential", &self.read_authorizer_credential)?;
3484 }
3485 if self.authorizer_credential.is_some() {
3486 state.serialize_entry("authorizerCredential", &self.authorizer_credential)?;
3487 }
3488 if !self._unknown_fields.is_empty() {
3489 for (key, value) in self._unknown_fields.iter() {
3490 state.serialize_entry(key, &value)?;
3491 }
3492 }
3493 state.end()
3494 }
3495}
3496
3497impl std::fmt::Debug for GitLabConfig {
3498 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3499 let mut debug_struct = f.debug_struct("GitLabConfig");
3500 debug_struct.field(
3501 "webhook_secret_secret_version",
3502 &self.webhook_secret_secret_version,
3503 );
3504 debug_struct.field(
3505 "read_authorizer_credential",
3506 &self.read_authorizer_credential,
3507 );
3508 debug_struct.field("authorizer_credential", &self.authorizer_credential);
3509 if !self._unknown_fields.is_empty() {
3510 debug_struct.field("_unknown_fields", &self._unknown_fields);
3511 }
3512 debug_struct.finish()
3513 }
3514}
3515
3516#[derive(Clone, Default, PartialEq)]
3519#[non_exhaustive]
3520pub struct UserCredential {
3521 pub user_token_secret_version: std::string::String,
3525
3526 pub username: std::string::String,
3528
3529 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3530}
3531
3532impl UserCredential {
3533 pub fn new() -> Self {
3534 std::default::Default::default()
3535 }
3536
3537 pub fn set_user_token_secret_version<T: std::convert::Into<std::string::String>>(
3539 mut self,
3540 v: T,
3541 ) -> Self {
3542 self.user_token_secret_version = v.into();
3543 self
3544 }
3545
3546 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3548 self.username = v.into();
3549 self
3550 }
3551}
3552
3553impl wkt::message::Message for UserCredential {
3554 fn typename() -> &'static str {
3555 "type.googleapis.com/google.cloud.developerconnect.v1.UserCredential"
3556 }
3557}
3558
3559#[doc(hidden)]
3560impl<'de> serde::de::Deserialize<'de> for UserCredential {
3561 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3562 where
3563 D: serde::Deserializer<'de>,
3564 {
3565 #[allow(non_camel_case_types)]
3566 #[doc(hidden)]
3567 #[derive(PartialEq, Eq, Hash)]
3568 enum __FieldTag {
3569 __user_token_secret_version,
3570 __username,
3571 Unknown(std::string::String),
3572 }
3573 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3574 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3575 where
3576 D: serde::Deserializer<'de>,
3577 {
3578 struct Visitor;
3579 impl<'de> serde::de::Visitor<'de> for Visitor {
3580 type Value = __FieldTag;
3581 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3582 formatter.write_str("a field name for UserCredential")
3583 }
3584 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3585 where
3586 E: serde::de::Error,
3587 {
3588 use std::result::Result::Ok;
3589 use std::string::ToString;
3590 match value {
3591 "userTokenSecretVersion" => Ok(__FieldTag::__user_token_secret_version),
3592 "user_token_secret_version" => {
3593 Ok(__FieldTag::__user_token_secret_version)
3594 }
3595 "username" => Ok(__FieldTag::__username),
3596 _ => Ok(__FieldTag::Unknown(value.to_string())),
3597 }
3598 }
3599 }
3600 deserializer.deserialize_identifier(Visitor)
3601 }
3602 }
3603 struct Visitor;
3604 impl<'de> serde::de::Visitor<'de> for Visitor {
3605 type Value = UserCredential;
3606 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3607 formatter.write_str("struct UserCredential")
3608 }
3609 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3610 where
3611 A: serde::de::MapAccess<'de>,
3612 {
3613 #[allow(unused_imports)]
3614 use serde::de::Error;
3615 use std::option::Option::Some;
3616 let mut fields = std::collections::HashSet::new();
3617 let mut result = Self::Value::new();
3618 while let Some(tag) = map.next_key::<__FieldTag>()? {
3619 #[allow(clippy::match_single_binding)]
3620 match tag {
3621 __FieldTag::__user_token_secret_version => {
3622 if !fields.insert(__FieldTag::__user_token_secret_version) {
3623 return std::result::Result::Err(A::Error::duplicate_field(
3624 "multiple values for user_token_secret_version",
3625 ));
3626 }
3627 result.user_token_secret_version = map
3628 .next_value::<std::option::Option<std::string::String>>()?
3629 .unwrap_or_default();
3630 }
3631 __FieldTag::__username => {
3632 if !fields.insert(__FieldTag::__username) {
3633 return std::result::Result::Err(A::Error::duplicate_field(
3634 "multiple values for username",
3635 ));
3636 }
3637 result.username = map
3638 .next_value::<std::option::Option<std::string::String>>()?
3639 .unwrap_or_default();
3640 }
3641 __FieldTag::Unknown(key) => {
3642 let value = map.next_value::<serde_json::Value>()?;
3643 result._unknown_fields.insert(key, value);
3644 }
3645 }
3646 }
3647 std::result::Result::Ok(result)
3648 }
3649 }
3650 deserializer.deserialize_any(Visitor)
3651 }
3652}
3653
3654#[doc(hidden)]
3655impl serde::ser::Serialize for UserCredential {
3656 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3657 where
3658 S: serde::ser::Serializer,
3659 {
3660 use serde::ser::SerializeMap;
3661 #[allow(unused_imports)]
3662 use std::option::Option::Some;
3663 let mut state = serializer.serialize_map(std::option::Option::None)?;
3664 if !self.user_token_secret_version.is_empty() {
3665 state.serialize_entry("userTokenSecretVersion", &self.user_token_secret_version)?;
3666 }
3667 if !self.username.is_empty() {
3668 state.serialize_entry("username", &self.username)?;
3669 }
3670 if !self._unknown_fields.is_empty() {
3671 for (key, value) in self._unknown_fields.iter() {
3672 state.serialize_entry(key, &value)?;
3673 }
3674 }
3675 state.end()
3676 }
3677}
3678
3679impl std::fmt::Debug for UserCredential {
3680 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3681 let mut debug_struct = f.debug_struct("UserCredential");
3682 debug_struct.field("user_token_secret_version", &self.user_token_secret_version);
3683 debug_struct.field("username", &self.username);
3684 if !self._unknown_fields.is_empty() {
3685 debug_struct.field("_unknown_fields", &self._unknown_fields);
3686 }
3687 debug_struct.finish()
3688 }
3689}
3690
3691#[derive(Clone, Default, PartialEq)]
3693#[non_exhaustive]
3694pub struct GitLabEnterpriseConfig {
3695 pub host_uri: std::string::String,
3697
3698 pub webhook_secret_secret_version: std::string::String,
3702
3703 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
3708
3709 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
3714
3715 pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
3721
3722 pub ssl_ca_certificate: std::string::String,
3725
3726 pub server_version: std::string::String,
3729
3730 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3731}
3732
3733impl GitLabEnterpriseConfig {
3734 pub fn new() -> Self {
3735 std::default::Default::default()
3736 }
3737
3738 pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3740 self.host_uri = v.into();
3741 self
3742 }
3743
3744 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
3746 mut self,
3747 v: T,
3748 ) -> Self {
3749 self.webhook_secret_secret_version = v.into();
3750 self
3751 }
3752
3753 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
3755 where
3756 T: std::convert::Into<crate::model::UserCredential>,
3757 {
3758 self.read_authorizer_credential = std::option::Option::Some(v.into());
3759 self
3760 }
3761
3762 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3764 where
3765 T: std::convert::Into<crate::model::UserCredential>,
3766 {
3767 self.read_authorizer_credential = v.map(|x| x.into());
3768 self
3769 }
3770
3771 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
3773 where
3774 T: std::convert::Into<crate::model::UserCredential>,
3775 {
3776 self.authorizer_credential = std::option::Option::Some(v.into());
3777 self
3778 }
3779
3780 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
3782 where
3783 T: std::convert::Into<crate::model::UserCredential>,
3784 {
3785 self.authorizer_credential = v.map(|x| x.into());
3786 self
3787 }
3788
3789 pub fn set_service_directory_config<T>(mut self, v: T) -> Self
3791 where
3792 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
3793 {
3794 self.service_directory_config = std::option::Option::Some(v.into());
3795 self
3796 }
3797
3798 pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
3800 where
3801 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
3802 {
3803 self.service_directory_config = v.map(|x| x.into());
3804 self
3805 }
3806
3807 pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
3809 mut self,
3810 v: T,
3811 ) -> Self {
3812 self.ssl_ca_certificate = v.into();
3813 self
3814 }
3815
3816 pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3818 self.server_version = v.into();
3819 self
3820 }
3821}
3822
3823impl wkt::message::Message for GitLabEnterpriseConfig {
3824 fn typename() -> &'static str {
3825 "type.googleapis.com/google.cloud.developerconnect.v1.GitLabEnterpriseConfig"
3826 }
3827}
3828
3829#[doc(hidden)]
3830impl<'de> serde::de::Deserialize<'de> for GitLabEnterpriseConfig {
3831 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3832 where
3833 D: serde::Deserializer<'de>,
3834 {
3835 #[allow(non_camel_case_types)]
3836 #[doc(hidden)]
3837 #[derive(PartialEq, Eq, Hash)]
3838 enum __FieldTag {
3839 __host_uri,
3840 __webhook_secret_secret_version,
3841 __read_authorizer_credential,
3842 __authorizer_credential,
3843 __service_directory_config,
3844 __ssl_ca_certificate,
3845 __server_version,
3846 Unknown(std::string::String),
3847 }
3848 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3849 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3850 where
3851 D: serde::Deserializer<'de>,
3852 {
3853 struct Visitor;
3854 impl<'de> serde::de::Visitor<'de> for Visitor {
3855 type Value = __FieldTag;
3856 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3857 formatter.write_str("a field name for GitLabEnterpriseConfig")
3858 }
3859 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3860 where
3861 E: serde::de::Error,
3862 {
3863 use std::result::Result::Ok;
3864 use std::string::ToString;
3865 match value {
3866 "hostUri" => Ok(__FieldTag::__host_uri),
3867 "host_uri" => Ok(__FieldTag::__host_uri),
3868 "webhookSecretSecretVersion" => {
3869 Ok(__FieldTag::__webhook_secret_secret_version)
3870 }
3871 "webhook_secret_secret_version" => {
3872 Ok(__FieldTag::__webhook_secret_secret_version)
3873 }
3874 "readAuthorizerCredential" => {
3875 Ok(__FieldTag::__read_authorizer_credential)
3876 }
3877 "read_authorizer_credential" => {
3878 Ok(__FieldTag::__read_authorizer_credential)
3879 }
3880 "authorizerCredential" => Ok(__FieldTag::__authorizer_credential),
3881 "authorizer_credential" => Ok(__FieldTag::__authorizer_credential),
3882 "serviceDirectoryConfig" => Ok(__FieldTag::__service_directory_config),
3883 "service_directory_config" => {
3884 Ok(__FieldTag::__service_directory_config)
3885 }
3886 "sslCaCertificate" => Ok(__FieldTag::__ssl_ca_certificate),
3887 "ssl_ca_certificate" => Ok(__FieldTag::__ssl_ca_certificate),
3888 "serverVersion" => Ok(__FieldTag::__server_version),
3889 "server_version" => Ok(__FieldTag::__server_version),
3890 _ => Ok(__FieldTag::Unknown(value.to_string())),
3891 }
3892 }
3893 }
3894 deserializer.deserialize_identifier(Visitor)
3895 }
3896 }
3897 struct Visitor;
3898 impl<'de> serde::de::Visitor<'de> for Visitor {
3899 type Value = GitLabEnterpriseConfig;
3900 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3901 formatter.write_str("struct GitLabEnterpriseConfig")
3902 }
3903 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3904 where
3905 A: serde::de::MapAccess<'de>,
3906 {
3907 #[allow(unused_imports)]
3908 use serde::de::Error;
3909 use std::option::Option::Some;
3910 let mut fields = std::collections::HashSet::new();
3911 let mut result = Self::Value::new();
3912 while let Some(tag) = map.next_key::<__FieldTag>()? {
3913 #[allow(clippy::match_single_binding)]
3914 match tag {
3915 __FieldTag::__host_uri => {
3916 if !fields.insert(__FieldTag::__host_uri) {
3917 return std::result::Result::Err(A::Error::duplicate_field(
3918 "multiple values for host_uri",
3919 ));
3920 }
3921 result.host_uri = map
3922 .next_value::<std::option::Option<std::string::String>>()?
3923 .unwrap_or_default();
3924 }
3925 __FieldTag::__webhook_secret_secret_version => {
3926 if !fields.insert(__FieldTag::__webhook_secret_secret_version) {
3927 return std::result::Result::Err(A::Error::duplicate_field(
3928 "multiple values for webhook_secret_secret_version",
3929 ));
3930 }
3931 result.webhook_secret_secret_version = map
3932 .next_value::<std::option::Option<std::string::String>>()?
3933 .unwrap_or_default();
3934 }
3935 __FieldTag::__read_authorizer_credential => {
3936 if !fields.insert(__FieldTag::__read_authorizer_credential) {
3937 return std::result::Result::Err(A::Error::duplicate_field(
3938 "multiple values for read_authorizer_credential",
3939 ));
3940 }
3941 result.read_authorizer_credential = map
3942 .next_value::<std::option::Option<crate::model::UserCredential>>(
3943 )?;
3944 }
3945 __FieldTag::__authorizer_credential => {
3946 if !fields.insert(__FieldTag::__authorizer_credential) {
3947 return std::result::Result::Err(A::Error::duplicate_field(
3948 "multiple values for authorizer_credential",
3949 ));
3950 }
3951 result.authorizer_credential = map
3952 .next_value::<std::option::Option<crate::model::UserCredential>>(
3953 )?;
3954 }
3955 __FieldTag::__service_directory_config => {
3956 if !fields.insert(__FieldTag::__service_directory_config) {
3957 return std::result::Result::Err(A::Error::duplicate_field(
3958 "multiple values for service_directory_config",
3959 ));
3960 }
3961 result.service_directory_config = map.next_value::<std::option::Option<crate::model::ServiceDirectoryConfig>>()?
3962 ;
3963 }
3964 __FieldTag::__ssl_ca_certificate => {
3965 if !fields.insert(__FieldTag::__ssl_ca_certificate) {
3966 return std::result::Result::Err(A::Error::duplicate_field(
3967 "multiple values for ssl_ca_certificate",
3968 ));
3969 }
3970 result.ssl_ca_certificate = map
3971 .next_value::<std::option::Option<std::string::String>>()?
3972 .unwrap_or_default();
3973 }
3974 __FieldTag::__server_version => {
3975 if !fields.insert(__FieldTag::__server_version) {
3976 return std::result::Result::Err(A::Error::duplicate_field(
3977 "multiple values for server_version",
3978 ));
3979 }
3980 result.server_version = map
3981 .next_value::<std::option::Option<std::string::String>>()?
3982 .unwrap_or_default();
3983 }
3984 __FieldTag::Unknown(key) => {
3985 let value = map.next_value::<serde_json::Value>()?;
3986 result._unknown_fields.insert(key, value);
3987 }
3988 }
3989 }
3990 std::result::Result::Ok(result)
3991 }
3992 }
3993 deserializer.deserialize_any(Visitor)
3994 }
3995}
3996
3997#[doc(hidden)]
3998impl serde::ser::Serialize for GitLabEnterpriseConfig {
3999 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4000 where
4001 S: serde::ser::Serializer,
4002 {
4003 use serde::ser::SerializeMap;
4004 #[allow(unused_imports)]
4005 use std::option::Option::Some;
4006 let mut state = serializer.serialize_map(std::option::Option::None)?;
4007 if !self.host_uri.is_empty() {
4008 state.serialize_entry("hostUri", &self.host_uri)?;
4009 }
4010 if !self.webhook_secret_secret_version.is_empty() {
4011 state.serialize_entry(
4012 "webhookSecretSecretVersion",
4013 &self.webhook_secret_secret_version,
4014 )?;
4015 }
4016 if self.read_authorizer_credential.is_some() {
4017 state.serialize_entry("readAuthorizerCredential", &self.read_authorizer_credential)?;
4018 }
4019 if self.authorizer_credential.is_some() {
4020 state.serialize_entry("authorizerCredential", &self.authorizer_credential)?;
4021 }
4022 if self.service_directory_config.is_some() {
4023 state.serialize_entry("serviceDirectoryConfig", &self.service_directory_config)?;
4024 }
4025 if !self.ssl_ca_certificate.is_empty() {
4026 state.serialize_entry("sslCaCertificate", &self.ssl_ca_certificate)?;
4027 }
4028 if !self.server_version.is_empty() {
4029 state.serialize_entry("serverVersion", &self.server_version)?;
4030 }
4031 if !self._unknown_fields.is_empty() {
4032 for (key, value) in self._unknown_fields.iter() {
4033 state.serialize_entry(key, &value)?;
4034 }
4035 }
4036 state.end()
4037 }
4038}
4039
4040impl std::fmt::Debug for GitLabEnterpriseConfig {
4041 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4042 let mut debug_struct = f.debug_struct("GitLabEnterpriseConfig");
4043 debug_struct.field("host_uri", &self.host_uri);
4044 debug_struct.field(
4045 "webhook_secret_secret_version",
4046 &self.webhook_secret_secret_version,
4047 );
4048 debug_struct.field(
4049 "read_authorizer_credential",
4050 &self.read_authorizer_credential,
4051 );
4052 debug_struct.field("authorizer_credential", &self.authorizer_credential);
4053 debug_struct.field("service_directory_config", &self.service_directory_config);
4054 debug_struct.field("ssl_ca_certificate", &self.ssl_ca_certificate);
4055 debug_struct.field("server_version", &self.server_version);
4056 if !self._unknown_fields.is_empty() {
4057 debug_struct.field("_unknown_fields", &self._unknown_fields);
4058 }
4059 debug_struct.finish()
4060 }
4061}
4062
4063#[derive(Clone, Default, PartialEq)]
4065#[non_exhaustive]
4066pub struct BitbucketDataCenterConfig {
4067 pub host_uri: std::string::String,
4069
4070 pub webhook_secret_secret_version: std::string::String,
4074
4075 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
4078
4079 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
4083
4084 pub service_directory_config: std::option::Option<crate::model::ServiceDirectoryConfig>,
4090
4091 pub ssl_ca_certificate: std::string::String,
4094
4095 pub server_version: std::string::String,
4098
4099 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4100}
4101
4102impl BitbucketDataCenterConfig {
4103 pub fn new() -> Self {
4104 std::default::Default::default()
4105 }
4106
4107 pub fn set_host_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4109 self.host_uri = v.into();
4110 self
4111 }
4112
4113 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
4115 mut self,
4116 v: T,
4117 ) -> Self {
4118 self.webhook_secret_secret_version = v.into();
4119 self
4120 }
4121
4122 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
4124 where
4125 T: std::convert::Into<crate::model::UserCredential>,
4126 {
4127 self.read_authorizer_credential = std::option::Option::Some(v.into());
4128 self
4129 }
4130
4131 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
4133 where
4134 T: std::convert::Into<crate::model::UserCredential>,
4135 {
4136 self.read_authorizer_credential = v.map(|x| x.into());
4137 self
4138 }
4139
4140 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
4142 where
4143 T: std::convert::Into<crate::model::UserCredential>,
4144 {
4145 self.authorizer_credential = std::option::Option::Some(v.into());
4146 self
4147 }
4148
4149 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
4151 where
4152 T: std::convert::Into<crate::model::UserCredential>,
4153 {
4154 self.authorizer_credential = v.map(|x| x.into());
4155 self
4156 }
4157
4158 pub fn set_service_directory_config<T>(mut self, v: T) -> Self
4160 where
4161 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
4162 {
4163 self.service_directory_config = std::option::Option::Some(v.into());
4164 self
4165 }
4166
4167 pub fn set_or_clear_service_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
4169 where
4170 T: std::convert::Into<crate::model::ServiceDirectoryConfig>,
4171 {
4172 self.service_directory_config = v.map(|x| x.into());
4173 self
4174 }
4175
4176 pub fn set_ssl_ca_certificate<T: std::convert::Into<std::string::String>>(
4178 mut self,
4179 v: T,
4180 ) -> Self {
4181 self.ssl_ca_certificate = v.into();
4182 self
4183 }
4184
4185 pub fn set_server_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4187 self.server_version = v.into();
4188 self
4189 }
4190}
4191
4192impl wkt::message::Message for BitbucketDataCenterConfig {
4193 fn typename() -> &'static str {
4194 "type.googleapis.com/google.cloud.developerconnect.v1.BitbucketDataCenterConfig"
4195 }
4196}
4197
4198#[doc(hidden)]
4199impl<'de> serde::de::Deserialize<'de> for BitbucketDataCenterConfig {
4200 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4201 where
4202 D: serde::Deserializer<'de>,
4203 {
4204 #[allow(non_camel_case_types)]
4205 #[doc(hidden)]
4206 #[derive(PartialEq, Eq, Hash)]
4207 enum __FieldTag {
4208 __host_uri,
4209 __webhook_secret_secret_version,
4210 __read_authorizer_credential,
4211 __authorizer_credential,
4212 __service_directory_config,
4213 __ssl_ca_certificate,
4214 __server_version,
4215 Unknown(std::string::String),
4216 }
4217 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4218 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4219 where
4220 D: serde::Deserializer<'de>,
4221 {
4222 struct Visitor;
4223 impl<'de> serde::de::Visitor<'de> for Visitor {
4224 type Value = __FieldTag;
4225 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4226 formatter.write_str("a field name for BitbucketDataCenterConfig")
4227 }
4228 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4229 where
4230 E: serde::de::Error,
4231 {
4232 use std::result::Result::Ok;
4233 use std::string::ToString;
4234 match value {
4235 "hostUri" => Ok(__FieldTag::__host_uri),
4236 "host_uri" => Ok(__FieldTag::__host_uri),
4237 "webhookSecretSecretVersion" => {
4238 Ok(__FieldTag::__webhook_secret_secret_version)
4239 }
4240 "webhook_secret_secret_version" => {
4241 Ok(__FieldTag::__webhook_secret_secret_version)
4242 }
4243 "readAuthorizerCredential" => {
4244 Ok(__FieldTag::__read_authorizer_credential)
4245 }
4246 "read_authorizer_credential" => {
4247 Ok(__FieldTag::__read_authorizer_credential)
4248 }
4249 "authorizerCredential" => Ok(__FieldTag::__authorizer_credential),
4250 "authorizer_credential" => Ok(__FieldTag::__authorizer_credential),
4251 "serviceDirectoryConfig" => Ok(__FieldTag::__service_directory_config),
4252 "service_directory_config" => {
4253 Ok(__FieldTag::__service_directory_config)
4254 }
4255 "sslCaCertificate" => Ok(__FieldTag::__ssl_ca_certificate),
4256 "ssl_ca_certificate" => Ok(__FieldTag::__ssl_ca_certificate),
4257 "serverVersion" => Ok(__FieldTag::__server_version),
4258 "server_version" => Ok(__FieldTag::__server_version),
4259 _ => Ok(__FieldTag::Unknown(value.to_string())),
4260 }
4261 }
4262 }
4263 deserializer.deserialize_identifier(Visitor)
4264 }
4265 }
4266 struct Visitor;
4267 impl<'de> serde::de::Visitor<'de> for Visitor {
4268 type Value = BitbucketDataCenterConfig;
4269 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4270 formatter.write_str("struct BitbucketDataCenterConfig")
4271 }
4272 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4273 where
4274 A: serde::de::MapAccess<'de>,
4275 {
4276 #[allow(unused_imports)]
4277 use serde::de::Error;
4278 use std::option::Option::Some;
4279 let mut fields = std::collections::HashSet::new();
4280 let mut result = Self::Value::new();
4281 while let Some(tag) = map.next_key::<__FieldTag>()? {
4282 #[allow(clippy::match_single_binding)]
4283 match tag {
4284 __FieldTag::__host_uri => {
4285 if !fields.insert(__FieldTag::__host_uri) {
4286 return std::result::Result::Err(A::Error::duplicate_field(
4287 "multiple values for host_uri",
4288 ));
4289 }
4290 result.host_uri = map
4291 .next_value::<std::option::Option<std::string::String>>()?
4292 .unwrap_or_default();
4293 }
4294 __FieldTag::__webhook_secret_secret_version => {
4295 if !fields.insert(__FieldTag::__webhook_secret_secret_version) {
4296 return std::result::Result::Err(A::Error::duplicate_field(
4297 "multiple values for webhook_secret_secret_version",
4298 ));
4299 }
4300 result.webhook_secret_secret_version = map
4301 .next_value::<std::option::Option<std::string::String>>()?
4302 .unwrap_or_default();
4303 }
4304 __FieldTag::__read_authorizer_credential => {
4305 if !fields.insert(__FieldTag::__read_authorizer_credential) {
4306 return std::result::Result::Err(A::Error::duplicate_field(
4307 "multiple values for read_authorizer_credential",
4308 ));
4309 }
4310 result.read_authorizer_credential = map
4311 .next_value::<std::option::Option<crate::model::UserCredential>>(
4312 )?;
4313 }
4314 __FieldTag::__authorizer_credential => {
4315 if !fields.insert(__FieldTag::__authorizer_credential) {
4316 return std::result::Result::Err(A::Error::duplicate_field(
4317 "multiple values for authorizer_credential",
4318 ));
4319 }
4320 result.authorizer_credential = map
4321 .next_value::<std::option::Option<crate::model::UserCredential>>(
4322 )?;
4323 }
4324 __FieldTag::__service_directory_config => {
4325 if !fields.insert(__FieldTag::__service_directory_config) {
4326 return std::result::Result::Err(A::Error::duplicate_field(
4327 "multiple values for service_directory_config",
4328 ));
4329 }
4330 result.service_directory_config = map.next_value::<std::option::Option<crate::model::ServiceDirectoryConfig>>()?
4331 ;
4332 }
4333 __FieldTag::__ssl_ca_certificate => {
4334 if !fields.insert(__FieldTag::__ssl_ca_certificate) {
4335 return std::result::Result::Err(A::Error::duplicate_field(
4336 "multiple values for ssl_ca_certificate",
4337 ));
4338 }
4339 result.ssl_ca_certificate = map
4340 .next_value::<std::option::Option<std::string::String>>()?
4341 .unwrap_or_default();
4342 }
4343 __FieldTag::__server_version => {
4344 if !fields.insert(__FieldTag::__server_version) {
4345 return std::result::Result::Err(A::Error::duplicate_field(
4346 "multiple values for server_version",
4347 ));
4348 }
4349 result.server_version = map
4350 .next_value::<std::option::Option<std::string::String>>()?
4351 .unwrap_or_default();
4352 }
4353 __FieldTag::Unknown(key) => {
4354 let value = map.next_value::<serde_json::Value>()?;
4355 result._unknown_fields.insert(key, value);
4356 }
4357 }
4358 }
4359 std::result::Result::Ok(result)
4360 }
4361 }
4362 deserializer.deserialize_any(Visitor)
4363 }
4364}
4365
4366#[doc(hidden)]
4367impl serde::ser::Serialize for BitbucketDataCenterConfig {
4368 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4369 where
4370 S: serde::ser::Serializer,
4371 {
4372 use serde::ser::SerializeMap;
4373 #[allow(unused_imports)]
4374 use std::option::Option::Some;
4375 let mut state = serializer.serialize_map(std::option::Option::None)?;
4376 if !self.host_uri.is_empty() {
4377 state.serialize_entry("hostUri", &self.host_uri)?;
4378 }
4379 if !self.webhook_secret_secret_version.is_empty() {
4380 state.serialize_entry(
4381 "webhookSecretSecretVersion",
4382 &self.webhook_secret_secret_version,
4383 )?;
4384 }
4385 if self.read_authorizer_credential.is_some() {
4386 state.serialize_entry("readAuthorizerCredential", &self.read_authorizer_credential)?;
4387 }
4388 if self.authorizer_credential.is_some() {
4389 state.serialize_entry("authorizerCredential", &self.authorizer_credential)?;
4390 }
4391 if self.service_directory_config.is_some() {
4392 state.serialize_entry("serviceDirectoryConfig", &self.service_directory_config)?;
4393 }
4394 if !self.ssl_ca_certificate.is_empty() {
4395 state.serialize_entry("sslCaCertificate", &self.ssl_ca_certificate)?;
4396 }
4397 if !self.server_version.is_empty() {
4398 state.serialize_entry("serverVersion", &self.server_version)?;
4399 }
4400 if !self._unknown_fields.is_empty() {
4401 for (key, value) in self._unknown_fields.iter() {
4402 state.serialize_entry(key, &value)?;
4403 }
4404 }
4405 state.end()
4406 }
4407}
4408
4409impl std::fmt::Debug for BitbucketDataCenterConfig {
4410 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4411 let mut debug_struct = f.debug_struct("BitbucketDataCenterConfig");
4412 debug_struct.field("host_uri", &self.host_uri);
4413 debug_struct.field(
4414 "webhook_secret_secret_version",
4415 &self.webhook_secret_secret_version,
4416 );
4417 debug_struct.field(
4418 "read_authorizer_credential",
4419 &self.read_authorizer_credential,
4420 );
4421 debug_struct.field("authorizer_credential", &self.authorizer_credential);
4422 debug_struct.field("service_directory_config", &self.service_directory_config);
4423 debug_struct.field("ssl_ca_certificate", &self.ssl_ca_certificate);
4424 debug_struct.field("server_version", &self.server_version);
4425 if !self._unknown_fields.is_empty() {
4426 debug_struct.field("_unknown_fields", &self._unknown_fields);
4427 }
4428 debug_struct.finish()
4429 }
4430}
4431
4432#[derive(Clone, Default, PartialEq)]
4434#[non_exhaustive]
4435pub struct BitbucketCloudConfig {
4436 pub workspace: std::string::String,
4439
4440 pub webhook_secret_secret_version: std::string::String,
4445
4446 pub read_authorizer_credential: std::option::Option<crate::model::UserCredential>,
4450
4451 pub authorizer_credential: std::option::Option<crate::model::UserCredential>,
4456
4457 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4458}
4459
4460impl BitbucketCloudConfig {
4461 pub fn new() -> Self {
4462 std::default::Default::default()
4463 }
4464
4465 pub fn set_workspace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4467 self.workspace = v.into();
4468 self
4469 }
4470
4471 pub fn set_webhook_secret_secret_version<T: std::convert::Into<std::string::String>>(
4473 mut self,
4474 v: T,
4475 ) -> Self {
4476 self.webhook_secret_secret_version = v.into();
4477 self
4478 }
4479
4480 pub fn set_read_authorizer_credential<T>(mut self, v: T) -> Self
4482 where
4483 T: std::convert::Into<crate::model::UserCredential>,
4484 {
4485 self.read_authorizer_credential = std::option::Option::Some(v.into());
4486 self
4487 }
4488
4489 pub fn set_or_clear_read_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
4491 where
4492 T: std::convert::Into<crate::model::UserCredential>,
4493 {
4494 self.read_authorizer_credential = v.map(|x| x.into());
4495 self
4496 }
4497
4498 pub fn set_authorizer_credential<T>(mut self, v: T) -> Self
4500 where
4501 T: std::convert::Into<crate::model::UserCredential>,
4502 {
4503 self.authorizer_credential = std::option::Option::Some(v.into());
4504 self
4505 }
4506
4507 pub fn set_or_clear_authorizer_credential<T>(mut self, v: std::option::Option<T>) -> Self
4509 where
4510 T: std::convert::Into<crate::model::UserCredential>,
4511 {
4512 self.authorizer_credential = v.map(|x| x.into());
4513 self
4514 }
4515}
4516
4517impl wkt::message::Message for BitbucketCloudConfig {
4518 fn typename() -> &'static str {
4519 "type.googleapis.com/google.cloud.developerconnect.v1.BitbucketCloudConfig"
4520 }
4521}
4522
4523#[doc(hidden)]
4524impl<'de> serde::de::Deserialize<'de> for BitbucketCloudConfig {
4525 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4526 where
4527 D: serde::Deserializer<'de>,
4528 {
4529 #[allow(non_camel_case_types)]
4530 #[doc(hidden)]
4531 #[derive(PartialEq, Eq, Hash)]
4532 enum __FieldTag {
4533 __workspace,
4534 __webhook_secret_secret_version,
4535 __read_authorizer_credential,
4536 __authorizer_credential,
4537 Unknown(std::string::String),
4538 }
4539 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4540 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4541 where
4542 D: serde::Deserializer<'de>,
4543 {
4544 struct Visitor;
4545 impl<'de> serde::de::Visitor<'de> for Visitor {
4546 type Value = __FieldTag;
4547 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4548 formatter.write_str("a field name for BitbucketCloudConfig")
4549 }
4550 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4551 where
4552 E: serde::de::Error,
4553 {
4554 use std::result::Result::Ok;
4555 use std::string::ToString;
4556 match value {
4557 "workspace" => Ok(__FieldTag::__workspace),
4558 "webhookSecretSecretVersion" => {
4559 Ok(__FieldTag::__webhook_secret_secret_version)
4560 }
4561 "webhook_secret_secret_version" => {
4562 Ok(__FieldTag::__webhook_secret_secret_version)
4563 }
4564 "readAuthorizerCredential" => {
4565 Ok(__FieldTag::__read_authorizer_credential)
4566 }
4567 "read_authorizer_credential" => {
4568 Ok(__FieldTag::__read_authorizer_credential)
4569 }
4570 "authorizerCredential" => Ok(__FieldTag::__authorizer_credential),
4571 "authorizer_credential" => Ok(__FieldTag::__authorizer_credential),
4572 _ => Ok(__FieldTag::Unknown(value.to_string())),
4573 }
4574 }
4575 }
4576 deserializer.deserialize_identifier(Visitor)
4577 }
4578 }
4579 struct Visitor;
4580 impl<'de> serde::de::Visitor<'de> for Visitor {
4581 type Value = BitbucketCloudConfig;
4582 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4583 formatter.write_str("struct BitbucketCloudConfig")
4584 }
4585 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4586 where
4587 A: serde::de::MapAccess<'de>,
4588 {
4589 #[allow(unused_imports)]
4590 use serde::de::Error;
4591 use std::option::Option::Some;
4592 let mut fields = std::collections::HashSet::new();
4593 let mut result = Self::Value::new();
4594 while let Some(tag) = map.next_key::<__FieldTag>()? {
4595 #[allow(clippy::match_single_binding)]
4596 match tag {
4597 __FieldTag::__workspace => {
4598 if !fields.insert(__FieldTag::__workspace) {
4599 return std::result::Result::Err(A::Error::duplicate_field(
4600 "multiple values for workspace",
4601 ));
4602 }
4603 result.workspace = map
4604 .next_value::<std::option::Option<std::string::String>>()?
4605 .unwrap_or_default();
4606 }
4607 __FieldTag::__webhook_secret_secret_version => {
4608 if !fields.insert(__FieldTag::__webhook_secret_secret_version) {
4609 return std::result::Result::Err(A::Error::duplicate_field(
4610 "multiple values for webhook_secret_secret_version",
4611 ));
4612 }
4613 result.webhook_secret_secret_version = map
4614 .next_value::<std::option::Option<std::string::String>>()?
4615 .unwrap_or_default();
4616 }
4617 __FieldTag::__read_authorizer_credential => {
4618 if !fields.insert(__FieldTag::__read_authorizer_credential) {
4619 return std::result::Result::Err(A::Error::duplicate_field(
4620 "multiple values for read_authorizer_credential",
4621 ));
4622 }
4623 result.read_authorizer_credential = map
4624 .next_value::<std::option::Option<crate::model::UserCredential>>(
4625 )?;
4626 }
4627 __FieldTag::__authorizer_credential => {
4628 if !fields.insert(__FieldTag::__authorizer_credential) {
4629 return std::result::Result::Err(A::Error::duplicate_field(
4630 "multiple values for authorizer_credential",
4631 ));
4632 }
4633 result.authorizer_credential = map
4634 .next_value::<std::option::Option<crate::model::UserCredential>>(
4635 )?;
4636 }
4637 __FieldTag::Unknown(key) => {
4638 let value = map.next_value::<serde_json::Value>()?;
4639 result._unknown_fields.insert(key, value);
4640 }
4641 }
4642 }
4643 std::result::Result::Ok(result)
4644 }
4645 }
4646 deserializer.deserialize_any(Visitor)
4647 }
4648}
4649
4650#[doc(hidden)]
4651impl serde::ser::Serialize for BitbucketCloudConfig {
4652 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4653 where
4654 S: serde::ser::Serializer,
4655 {
4656 use serde::ser::SerializeMap;
4657 #[allow(unused_imports)]
4658 use std::option::Option::Some;
4659 let mut state = serializer.serialize_map(std::option::Option::None)?;
4660 if !self.workspace.is_empty() {
4661 state.serialize_entry("workspace", &self.workspace)?;
4662 }
4663 if !self.webhook_secret_secret_version.is_empty() {
4664 state.serialize_entry(
4665 "webhookSecretSecretVersion",
4666 &self.webhook_secret_secret_version,
4667 )?;
4668 }
4669 if self.read_authorizer_credential.is_some() {
4670 state.serialize_entry("readAuthorizerCredential", &self.read_authorizer_credential)?;
4671 }
4672 if self.authorizer_credential.is_some() {
4673 state.serialize_entry("authorizerCredential", &self.authorizer_credential)?;
4674 }
4675 if !self._unknown_fields.is_empty() {
4676 for (key, value) in self._unknown_fields.iter() {
4677 state.serialize_entry(key, &value)?;
4678 }
4679 }
4680 state.end()
4681 }
4682}
4683
4684impl std::fmt::Debug for BitbucketCloudConfig {
4685 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4686 let mut debug_struct = f.debug_struct("BitbucketCloudConfig");
4687 debug_struct.field("workspace", &self.workspace);
4688 debug_struct.field(
4689 "webhook_secret_secret_version",
4690 &self.webhook_secret_secret_version,
4691 );
4692 debug_struct.field(
4693 "read_authorizer_credential",
4694 &self.read_authorizer_credential,
4695 );
4696 debug_struct.field("authorizer_credential", &self.authorizer_credential);
4697 if !self._unknown_fields.is_empty() {
4698 debug_struct.field("_unknown_fields", &self._unknown_fields);
4699 }
4700 debug_struct.finish()
4701 }
4702}
4703
4704#[derive(Clone, Default, PartialEq)]
4706#[non_exhaustive]
4707pub struct ListConnectionsRequest {
4708 pub parent: std::string::String,
4710
4711 pub page_size: i32,
4714
4715 pub page_token: std::string::String,
4717
4718 pub filter: std::string::String,
4720
4721 pub order_by: std::string::String,
4723
4724 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4725}
4726
4727impl ListConnectionsRequest {
4728 pub fn new() -> Self {
4729 std::default::Default::default()
4730 }
4731
4732 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4734 self.parent = v.into();
4735 self
4736 }
4737
4738 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4740 self.page_size = v.into();
4741 self
4742 }
4743
4744 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4746 self.page_token = v.into();
4747 self
4748 }
4749
4750 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4752 self.filter = v.into();
4753 self
4754 }
4755
4756 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4758 self.order_by = v.into();
4759 self
4760 }
4761}
4762
4763impl wkt::message::Message for ListConnectionsRequest {
4764 fn typename() -> &'static str {
4765 "type.googleapis.com/google.cloud.developerconnect.v1.ListConnectionsRequest"
4766 }
4767}
4768
4769#[doc(hidden)]
4770impl<'de> serde::de::Deserialize<'de> for ListConnectionsRequest {
4771 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4772 where
4773 D: serde::Deserializer<'de>,
4774 {
4775 #[allow(non_camel_case_types)]
4776 #[doc(hidden)]
4777 #[derive(PartialEq, Eq, Hash)]
4778 enum __FieldTag {
4779 __parent,
4780 __page_size,
4781 __page_token,
4782 __filter,
4783 __order_by,
4784 Unknown(std::string::String),
4785 }
4786 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4787 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4788 where
4789 D: serde::Deserializer<'de>,
4790 {
4791 struct Visitor;
4792 impl<'de> serde::de::Visitor<'de> for Visitor {
4793 type Value = __FieldTag;
4794 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4795 formatter.write_str("a field name for ListConnectionsRequest")
4796 }
4797 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4798 where
4799 E: serde::de::Error,
4800 {
4801 use std::result::Result::Ok;
4802 use std::string::ToString;
4803 match value {
4804 "parent" => Ok(__FieldTag::__parent),
4805 "pageSize" => Ok(__FieldTag::__page_size),
4806 "page_size" => Ok(__FieldTag::__page_size),
4807 "pageToken" => Ok(__FieldTag::__page_token),
4808 "page_token" => Ok(__FieldTag::__page_token),
4809 "filter" => Ok(__FieldTag::__filter),
4810 "orderBy" => Ok(__FieldTag::__order_by),
4811 "order_by" => Ok(__FieldTag::__order_by),
4812 _ => Ok(__FieldTag::Unknown(value.to_string())),
4813 }
4814 }
4815 }
4816 deserializer.deserialize_identifier(Visitor)
4817 }
4818 }
4819 struct Visitor;
4820 impl<'de> serde::de::Visitor<'de> for Visitor {
4821 type Value = ListConnectionsRequest;
4822 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4823 formatter.write_str("struct ListConnectionsRequest")
4824 }
4825 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4826 where
4827 A: serde::de::MapAccess<'de>,
4828 {
4829 #[allow(unused_imports)]
4830 use serde::de::Error;
4831 use std::option::Option::Some;
4832 let mut fields = std::collections::HashSet::new();
4833 let mut result = Self::Value::new();
4834 while let Some(tag) = map.next_key::<__FieldTag>()? {
4835 #[allow(clippy::match_single_binding)]
4836 match tag {
4837 __FieldTag::__parent => {
4838 if !fields.insert(__FieldTag::__parent) {
4839 return std::result::Result::Err(A::Error::duplicate_field(
4840 "multiple values for parent",
4841 ));
4842 }
4843 result.parent = map
4844 .next_value::<std::option::Option<std::string::String>>()?
4845 .unwrap_or_default();
4846 }
4847 __FieldTag::__page_size => {
4848 if !fields.insert(__FieldTag::__page_size) {
4849 return std::result::Result::Err(A::Error::duplicate_field(
4850 "multiple values for page_size",
4851 ));
4852 }
4853 struct __With(std::option::Option<i32>);
4854 impl<'de> serde::de::Deserialize<'de> for __With {
4855 fn deserialize<D>(
4856 deserializer: D,
4857 ) -> std::result::Result<Self, D::Error>
4858 where
4859 D: serde::de::Deserializer<'de>,
4860 {
4861 serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4862 }
4863 }
4864 result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
4865 }
4866 __FieldTag::__page_token => {
4867 if !fields.insert(__FieldTag::__page_token) {
4868 return std::result::Result::Err(A::Error::duplicate_field(
4869 "multiple values for page_token",
4870 ));
4871 }
4872 result.page_token = map
4873 .next_value::<std::option::Option<std::string::String>>()?
4874 .unwrap_or_default();
4875 }
4876 __FieldTag::__filter => {
4877 if !fields.insert(__FieldTag::__filter) {
4878 return std::result::Result::Err(A::Error::duplicate_field(
4879 "multiple values for filter",
4880 ));
4881 }
4882 result.filter = map
4883 .next_value::<std::option::Option<std::string::String>>()?
4884 .unwrap_or_default();
4885 }
4886 __FieldTag::__order_by => {
4887 if !fields.insert(__FieldTag::__order_by) {
4888 return std::result::Result::Err(A::Error::duplicate_field(
4889 "multiple values for order_by",
4890 ));
4891 }
4892 result.order_by = map
4893 .next_value::<std::option::Option<std::string::String>>()?
4894 .unwrap_or_default();
4895 }
4896 __FieldTag::Unknown(key) => {
4897 let value = map.next_value::<serde_json::Value>()?;
4898 result._unknown_fields.insert(key, value);
4899 }
4900 }
4901 }
4902 std::result::Result::Ok(result)
4903 }
4904 }
4905 deserializer.deserialize_any(Visitor)
4906 }
4907}
4908
4909#[doc(hidden)]
4910impl serde::ser::Serialize for ListConnectionsRequest {
4911 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4912 where
4913 S: serde::ser::Serializer,
4914 {
4915 use serde::ser::SerializeMap;
4916 #[allow(unused_imports)]
4917 use std::option::Option::Some;
4918 let mut state = serializer.serialize_map(std::option::Option::None)?;
4919 if !self.parent.is_empty() {
4920 state.serialize_entry("parent", &self.parent)?;
4921 }
4922 if !wkt::internal::is_default(&self.page_size) {
4923 struct __With<'a>(&'a i32);
4924 impl<'a> serde::ser::Serialize for __With<'a> {
4925 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4926 where
4927 S: serde::ser::Serializer,
4928 {
4929 serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
4930 }
4931 }
4932 state.serialize_entry("pageSize", &__With(&self.page_size))?;
4933 }
4934 if !self.page_token.is_empty() {
4935 state.serialize_entry("pageToken", &self.page_token)?;
4936 }
4937 if !self.filter.is_empty() {
4938 state.serialize_entry("filter", &self.filter)?;
4939 }
4940 if !self.order_by.is_empty() {
4941 state.serialize_entry("orderBy", &self.order_by)?;
4942 }
4943 if !self._unknown_fields.is_empty() {
4944 for (key, value) in self._unknown_fields.iter() {
4945 state.serialize_entry(key, &value)?;
4946 }
4947 }
4948 state.end()
4949 }
4950}
4951
4952impl std::fmt::Debug for ListConnectionsRequest {
4953 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4954 let mut debug_struct = f.debug_struct("ListConnectionsRequest");
4955 debug_struct.field("parent", &self.parent);
4956 debug_struct.field("page_size", &self.page_size);
4957 debug_struct.field("page_token", &self.page_token);
4958 debug_struct.field("filter", &self.filter);
4959 debug_struct.field("order_by", &self.order_by);
4960 if !self._unknown_fields.is_empty() {
4961 debug_struct.field("_unknown_fields", &self._unknown_fields);
4962 }
4963 debug_struct.finish()
4964 }
4965}
4966
4967#[derive(Clone, Default, PartialEq)]
4969#[non_exhaustive]
4970pub struct ListConnectionsResponse {
4971 pub connections: std::vec::Vec<crate::model::Connection>,
4973
4974 pub next_page_token: std::string::String,
4976
4977 pub unreachable: std::vec::Vec<std::string::String>,
4979
4980 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4981}
4982
4983impl ListConnectionsResponse {
4984 pub fn new() -> Self {
4985 std::default::Default::default()
4986 }
4987
4988 pub fn set_connections<T, V>(mut self, v: T) -> Self
4990 where
4991 T: std::iter::IntoIterator<Item = V>,
4992 V: std::convert::Into<crate::model::Connection>,
4993 {
4994 use std::iter::Iterator;
4995 self.connections = v.into_iter().map(|i| i.into()).collect();
4996 self
4997 }
4998
4999 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5001 self.next_page_token = v.into();
5002 self
5003 }
5004
5005 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5007 where
5008 T: std::iter::IntoIterator<Item = V>,
5009 V: std::convert::Into<std::string::String>,
5010 {
5011 use std::iter::Iterator;
5012 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5013 self
5014 }
5015}
5016
5017impl wkt::message::Message for ListConnectionsResponse {
5018 fn typename() -> &'static str {
5019 "type.googleapis.com/google.cloud.developerconnect.v1.ListConnectionsResponse"
5020 }
5021}
5022
5023#[doc(hidden)]
5024impl gax::paginator::internal::PageableResponse for ListConnectionsResponse {
5025 type PageItem = crate::model::Connection;
5026
5027 fn items(self) -> std::vec::Vec<Self::PageItem> {
5028 self.connections
5029 }
5030
5031 fn next_page_token(&self) -> std::string::String {
5032 use std::clone::Clone;
5033 self.next_page_token.clone()
5034 }
5035}
5036
5037#[doc(hidden)]
5038impl<'de> serde::de::Deserialize<'de> for ListConnectionsResponse {
5039 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5040 where
5041 D: serde::Deserializer<'de>,
5042 {
5043 #[allow(non_camel_case_types)]
5044 #[doc(hidden)]
5045 #[derive(PartialEq, Eq, Hash)]
5046 enum __FieldTag {
5047 __connections,
5048 __next_page_token,
5049 __unreachable,
5050 Unknown(std::string::String),
5051 }
5052 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5053 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5054 where
5055 D: serde::Deserializer<'de>,
5056 {
5057 struct Visitor;
5058 impl<'de> serde::de::Visitor<'de> for Visitor {
5059 type Value = __FieldTag;
5060 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5061 formatter.write_str("a field name for ListConnectionsResponse")
5062 }
5063 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5064 where
5065 E: serde::de::Error,
5066 {
5067 use std::result::Result::Ok;
5068 use std::string::ToString;
5069 match value {
5070 "connections" => Ok(__FieldTag::__connections),
5071 "nextPageToken" => Ok(__FieldTag::__next_page_token),
5072 "next_page_token" => Ok(__FieldTag::__next_page_token),
5073 "unreachable" => Ok(__FieldTag::__unreachable),
5074 _ => Ok(__FieldTag::Unknown(value.to_string())),
5075 }
5076 }
5077 }
5078 deserializer.deserialize_identifier(Visitor)
5079 }
5080 }
5081 struct Visitor;
5082 impl<'de> serde::de::Visitor<'de> for Visitor {
5083 type Value = ListConnectionsResponse;
5084 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5085 formatter.write_str("struct ListConnectionsResponse")
5086 }
5087 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5088 where
5089 A: serde::de::MapAccess<'de>,
5090 {
5091 #[allow(unused_imports)]
5092 use serde::de::Error;
5093 use std::option::Option::Some;
5094 let mut fields = std::collections::HashSet::new();
5095 let mut result = Self::Value::new();
5096 while let Some(tag) = map.next_key::<__FieldTag>()? {
5097 #[allow(clippy::match_single_binding)]
5098 match tag {
5099 __FieldTag::__connections => {
5100 if !fields.insert(__FieldTag::__connections) {
5101 return std::result::Result::Err(A::Error::duplicate_field(
5102 "multiple values for connections",
5103 ));
5104 }
5105 result.connections = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Connection>>>()?.unwrap_or_default();
5106 }
5107 __FieldTag::__next_page_token => {
5108 if !fields.insert(__FieldTag::__next_page_token) {
5109 return std::result::Result::Err(A::Error::duplicate_field(
5110 "multiple values for next_page_token",
5111 ));
5112 }
5113 result.next_page_token = map
5114 .next_value::<std::option::Option<std::string::String>>()?
5115 .unwrap_or_default();
5116 }
5117 __FieldTag::__unreachable => {
5118 if !fields.insert(__FieldTag::__unreachable) {
5119 return std::result::Result::Err(A::Error::duplicate_field(
5120 "multiple values for unreachable",
5121 ));
5122 }
5123 result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
5124 }
5125 __FieldTag::Unknown(key) => {
5126 let value = map.next_value::<serde_json::Value>()?;
5127 result._unknown_fields.insert(key, value);
5128 }
5129 }
5130 }
5131 std::result::Result::Ok(result)
5132 }
5133 }
5134 deserializer.deserialize_any(Visitor)
5135 }
5136}
5137
5138#[doc(hidden)]
5139impl serde::ser::Serialize for ListConnectionsResponse {
5140 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5141 where
5142 S: serde::ser::Serializer,
5143 {
5144 use serde::ser::SerializeMap;
5145 #[allow(unused_imports)]
5146 use std::option::Option::Some;
5147 let mut state = serializer.serialize_map(std::option::Option::None)?;
5148 if !self.connections.is_empty() {
5149 state.serialize_entry("connections", &self.connections)?;
5150 }
5151 if !self.next_page_token.is_empty() {
5152 state.serialize_entry("nextPageToken", &self.next_page_token)?;
5153 }
5154 if !self.unreachable.is_empty() {
5155 state.serialize_entry("unreachable", &self.unreachable)?;
5156 }
5157 if !self._unknown_fields.is_empty() {
5158 for (key, value) in self._unknown_fields.iter() {
5159 state.serialize_entry(key, &value)?;
5160 }
5161 }
5162 state.end()
5163 }
5164}
5165
5166impl std::fmt::Debug for ListConnectionsResponse {
5167 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5168 let mut debug_struct = f.debug_struct("ListConnectionsResponse");
5169 debug_struct.field("connections", &self.connections);
5170 debug_struct.field("next_page_token", &self.next_page_token);
5171 debug_struct.field("unreachable", &self.unreachable);
5172 if !self._unknown_fields.is_empty() {
5173 debug_struct.field("_unknown_fields", &self._unknown_fields);
5174 }
5175 debug_struct.finish()
5176 }
5177}
5178
5179#[derive(Clone, Default, PartialEq)]
5181#[non_exhaustive]
5182pub struct GetConnectionRequest {
5183 pub name: std::string::String,
5185
5186 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5187}
5188
5189impl GetConnectionRequest {
5190 pub fn new() -> Self {
5191 std::default::Default::default()
5192 }
5193
5194 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5196 self.name = v.into();
5197 self
5198 }
5199}
5200
5201impl wkt::message::Message for GetConnectionRequest {
5202 fn typename() -> &'static str {
5203 "type.googleapis.com/google.cloud.developerconnect.v1.GetConnectionRequest"
5204 }
5205}
5206
5207#[doc(hidden)]
5208impl<'de> serde::de::Deserialize<'de> for GetConnectionRequest {
5209 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5210 where
5211 D: serde::Deserializer<'de>,
5212 {
5213 #[allow(non_camel_case_types)]
5214 #[doc(hidden)]
5215 #[derive(PartialEq, Eq, Hash)]
5216 enum __FieldTag {
5217 __name,
5218 Unknown(std::string::String),
5219 }
5220 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5221 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5222 where
5223 D: serde::Deserializer<'de>,
5224 {
5225 struct Visitor;
5226 impl<'de> serde::de::Visitor<'de> for Visitor {
5227 type Value = __FieldTag;
5228 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5229 formatter.write_str("a field name for GetConnectionRequest")
5230 }
5231 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5232 where
5233 E: serde::de::Error,
5234 {
5235 use std::result::Result::Ok;
5236 use std::string::ToString;
5237 match value {
5238 "name" => Ok(__FieldTag::__name),
5239 _ => Ok(__FieldTag::Unknown(value.to_string())),
5240 }
5241 }
5242 }
5243 deserializer.deserialize_identifier(Visitor)
5244 }
5245 }
5246 struct Visitor;
5247 impl<'de> serde::de::Visitor<'de> for Visitor {
5248 type Value = GetConnectionRequest;
5249 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5250 formatter.write_str("struct GetConnectionRequest")
5251 }
5252 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5253 where
5254 A: serde::de::MapAccess<'de>,
5255 {
5256 #[allow(unused_imports)]
5257 use serde::de::Error;
5258 use std::option::Option::Some;
5259 let mut fields = std::collections::HashSet::new();
5260 let mut result = Self::Value::new();
5261 while let Some(tag) = map.next_key::<__FieldTag>()? {
5262 #[allow(clippy::match_single_binding)]
5263 match tag {
5264 __FieldTag::__name => {
5265 if !fields.insert(__FieldTag::__name) {
5266 return std::result::Result::Err(A::Error::duplicate_field(
5267 "multiple values for name",
5268 ));
5269 }
5270 result.name = map
5271 .next_value::<std::option::Option<std::string::String>>()?
5272 .unwrap_or_default();
5273 }
5274 __FieldTag::Unknown(key) => {
5275 let value = map.next_value::<serde_json::Value>()?;
5276 result._unknown_fields.insert(key, value);
5277 }
5278 }
5279 }
5280 std::result::Result::Ok(result)
5281 }
5282 }
5283 deserializer.deserialize_any(Visitor)
5284 }
5285}
5286
5287#[doc(hidden)]
5288impl serde::ser::Serialize for GetConnectionRequest {
5289 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5290 where
5291 S: serde::ser::Serializer,
5292 {
5293 use serde::ser::SerializeMap;
5294 #[allow(unused_imports)]
5295 use std::option::Option::Some;
5296 let mut state = serializer.serialize_map(std::option::Option::None)?;
5297 if !self.name.is_empty() {
5298 state.serialize_entry("name", &self.name)?;
5299 }
5300 if !self._unknown_fields.is_empty() {
5301 for (key, value) in self._unknown_fields.iter() {
5302 state.serialize_entry(key, &value)?;
5303 }
5304 }
5305 state.end()
5306 }
5307}
5308
5309impl std::fmt::Debug for GetConnectionRequest {
5310 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5311 let mut debug_struct = f.debug_struct("GetConnectionRequest");
5312 debug_struct.field("name", &self.name);
5313 if !self._unknown_fields.is_empty() {
5314 debug_struct.field("_unknown_fields", &self._unknown_fields);
5315 }
5316 debug_struct.finish()
5317 }
5318}
5319
5320#[derive(Clone, Default, PartialEq)]
5322#[non_exhaustive]
5323pub struct CreateConnectionRequest {
5324 pub parent: std::string::String,
5326
5327 pub connection_id: std::string::String,
5331
5332 pub connection: std::option::Option<crate::model::Connection>,
5334
5335 pub request_id: std::string::String,
5349
5350 pub validate_only: bool,
5352
5353 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5354}
5355
5356impl CreateConnectionRequest {
5357 pub fn new() -> Self {
5358 std::default::Default::default()
5359 }
5360
5361 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5363 self.parent = v.into();
5364 self
5365 }
5366
5367 pub fn set_connection_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5369 self.connection_id = v.into();
5370 self
5371 }
5372
5373 pub fn set_connection<T>(mut self, v: T) -> Self
5375 where
5376 T: std::convert::Into<crate::model::Connection>,
5377 {
5378 self.connection = std::option::Option::Some(v.into());
5379 self
5380 }
5381
5382 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
5384 where
5385 T: std::convert::Into<crate::model::Connection>,
5386 {
5387 self.connection = v.map(|x| x.into());
5388 self
5389 }
5390
5391 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5393 self.request_id = v.into();
5394 self
5395 }
5396
5397 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5399 self.validate_only = v.into();
5400 self
5401 }
5402}
5403
5404impl wkt::message::Message for CreateConnectionRequest {
5405 fn typename() -> &'static str {
5406 "type.googleapis.com/google.cloud.developerconnect.v1.CreateConnectionRequest"
5407 }
5408}
5409
5410#[doc(hidden)]
5411impl<'de> serde::de::Deserialize<'de> for CreateConnectionRequest {
5412 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5413 where
5414 D: serde::Deserializer<'de>,
5415 {
5416 #[allow(non_camel_case_types)]
5417 #[doc(hidden)]
5418 #[derive(PartialEq, Eq, Hash)]
5419 enum __FieldTag {
5420 __parent,
5421 __connection_id,
5422 __connection,
5423 __request_id,
5424 __validate_only,
5425 Unknown(std::string::String),
5426 }
5427 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5428 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5429 where
5430 D: serde::Deserializer<'de>,
5431 {
5432 struct Visitor;
5433 impl<'de> serde::de::Visitor<'de> for Visitor {
5434 type Value = __FieldTag;
5435 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5436 formatter.write_str("a field name for CreateConnectionRequest")
5437 }
5438 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5439 where
5440 E: serde::de::Error,
5441 {
5442 use std::result::Result::Ok;
5443 use std::string::ToString;
5444 match value {
5445 "parent" => Ok(__FieldTag::__parent),
5446 "connectionId" => Ok(__FieldTag::__connection_id),
5447 "connection_id" => Ok(__FieldTag::__connection_id),
5448 "connection" => Ok(__FieldTag::__connection),
5449 "requestId" => Ok(__FieldTag::__request_id),
5450 "request_id" => Ok(__FieldTag::__request_id),
5451 "validateOnly" => Ok(__FieldTag::__validate_only),
5452 "validate_only" => Ok(__FieldTag::__validate_only),
5453 _ => Ok(__FieldTag::Unknown(value.to_string())),
5454 }
5455 }
5456 }
5457 deserializer.deserialize_identifier(Visitor)
5458 }
5459 }
5460 struct Visitor;
5461 impl<'de> serde::de::Visitor<'de> for Visitor {
5462 type Value = CreateConnectionRequest;
5463 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5464 formatter.write_str("struct CreateConnectionRequest")
5465 }
5466 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5467 where
5468 A: serde::de::MapAccess<'de>,
5469 {
5470 #[allow(unused_imports)]
5471 use serde::de::Error;
5472 use std::option::Option::Some;
5473 let mut fields = std::collections::HashSet::new();
5474 let mut result = Self::Value::new();
5475 while let Some(tag) = map.next_key::<__FieldTag>()? {
5476 #[allow(clippy::match_single_binding)]
5477 match tag {
5478 __FieldTag::__parent => {
5479 if !fields.insert(__FieldTag::__parent) {
5480 return std::result::Result::Err(A::Error::duplicate_field(
5481 "multiple values for parent",
5482 ));
5483 }
5484 result.parent = map
5485 .next_value::<std::option::Option<std::string::String>>()?
5486 .unwrap_or_default();
5487 }
5488 __FieldTag::__connection_id => {
5489 if !fields.insert(__FieldTag::__connection_id) {
5490 return std::result::Result::Err(A::Error::duplicate_field(
5491 "multiple values for connection_id",
5492 ));
5493 }
5494 result.connection_id = map
5495 .next_value::<std::option::Option<std::string::String>>()?
5496 .unwrap_or_default();
5497 }
5498 __FieldTag::__connection => {
5499 if !fields.insert(__FieldTag::__connection) {
5500 return std::result::Result::Err(A::Error::duplicate_field(
5501 "multiple values for connection",
5502 ));
5503 }
5504 result.connection =
5505 map.next_value::<std::option::Option<crate::model::Connection>>()?;
5506 }
5507 __FieldTag::__request_id => {
5508 if !fields.insert(__FieldTag::__request_id) {
5509 return std::result::Result::Err(A::Error::duplicate_field(
5510 "multiple values for request_id",
5511 ));
5512 }
5513 result.request_id = map
5514 .next_value::<std::option::Option<std::string::String>>()?
5515 .unwrap_or_default();
5516 }
5517 __FieldTag::__validate_only => {
5518 if !fields.insert(__FieldTag::__validate_only) {
5519 return std::result::Result::Err(A::Error::duplicate_field(
5520 "multiple values for validate_only",
5521 ));
5522 }
5523 result.validate_only = map
5524 .next_value::<std::option::Option<bool>>()?
5525 .unwrap_or_default();
5526 }
5527 __FieldTag::Unknown(key) => {
5528 let value = map.next_value::<serde_json::Value>()?;
5529 result._unknown_fields.insert(key, value);
5530 }
5531 }
5532 }
5533 std::result::Result::Ok(result)
5534 }
5535 }
5536 deserializer.deserialize_any(Visitor)
5537 }
5538}
5539
5540#[doc(hidden)]
5541impl serde::ser::Serialize for CreateConnectionRequest {
5542 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5543 where
5544 S: serde::ser::Serializer,
5545 {
5546 use serde::ser::SerializeMap;
5547 #[allow(unused_imports)]
5548 use std::option::Option::Some;
5549 let mut state = serializer.serialize_map(std::option::Option::None)?;
5550 if !self.parent.is_empty() {
5551 state.serialize_entry("parent", &self.parent)?;
5552 }
5553 if !self.connection_id.is_empty() {
5554 state.serialize_entry("connectionId", &self.connection_id)?;
5555 }
5556 if self.connection.is_some() {
5557 state.serialize_entry("connection", &self.connection)?;
5558 }
5559 if !self.request_id.is_empty() {
5560 state.serialize_entry("requestId", &self.request_id)?;
5561 }
5562 if !wkt::internal::is_default(&self.validate_only) {
5563 state.serialize_entry("validateOnly", &self.validate_only)?;
5564 }
5565 if !self._unknown_fields.is_empty() {
5566 for (key, value) in self._unknown_fields.iter() {
5567 state.serialize_entry(key, &value)?;
5568 }
5569 }
5570 state.end()
5571 }
5572}
5573
5574impl std::fmt::Debug for CreateConnectionRequest {
5575 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5576 let mut debug_struct = f.debug_struct("CreateConnectionRequest");
5577 debug_struct.field("parent", &self.parent);
5578 debug_struct.field("connection_id", &self.connection_id);
5579 debug_struct.field("connection", &self.connection);
5580 debug_struct.field("request_id", &self.request_id);
5581 debug_struct.field("validate_only", &self.validate_only);
5582 if !self._unknown_fields.is_empty() {
5583 debug_struct.field("_unknown_fields", &self._unknown_fields);
5584 }
5585 debug_struct.finish()
5586 }
5587}
5588
5589#[derive(Clone, Default, PartialEq)]
5591#[non_exhaustive]
5592pub struct UpdateConnectionRequest {
5593 pub update_mask: std::option::Option<wkt::FieldMask>,
5599
5600 pub connection: std::option::Option<crate::model::Connection>,
5602
5603 pub request_id: std::string::String,
5617
5618 pub allow_missing: bool,
5624
5625 pub validate_only: bool,
5627
5628 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5629}
5630
5631impl UpdateConnectionRequest {
5632 pub fn new() -> Self {
5633 std::default::Default::default()
5634 }
5635
5636 pub fn set_update_mask<T>(mut self, v: T) -> Self
5638 where
5639 T: std::convert::Into<wkt::FieldMask>,
5640 {
5641 self.update_mask = std::option::Option::Some(v.into());
5642 self
5643 }
5644
5645 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5647 where
5648 T: std::convert::Into<wkt::FieldMask>,
5649 {
5650 self.update_mask = v.map(|x| x.into());
5651 self
5652 }
5653
5654 pub fn set_connection<T>(mut self, v: T) -> Self
5656 where
5657 T: std::convert::Into<crate::model::Connection>,
5658 {
5659 self.connection = std::option::Option::Some(v.into());
5660 self
5661 }
5662
5663 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
5665 where
5666 T: std::convert::Into<crate::model::Connection>,
5667 {
5668 self.connection = v.map(|x| x.into());
5669 self
5670 }
5671
5672 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5674 self.request_id = v.into();
5675 self
5676 }
5677
5678 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5680 self.allow_missing = v.into();
5681 self
5682 }
5683
5684 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5686 self.validate_only = v.into();
5687 self
5688 }
5689}
5690
5691impl wkt::message::Message for UpdateConnectionRequest {
5692 fn typename() -> &'static str {
5693 "type.googleapis.com/google.cloud.developerconnect.v1.UpdateConnectionRequest"
5694 }
5695}
5696
5697#[doc(hidden)]
5698impl<'de> serde::de::Deserialize<'de> for UpdateConnectionRequest {
5699 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5700 where
5701 D: serde::Deserializer<'de>,
5702 {
5703 #[allow(non_camel_case_types)]
5704 #[doc(hidden)]
5705 #[derive(PartialEq, Eq, Hash)]
5706 enum __FieldTag {
5707 __update_mask,
5708 __connection,
5709 __request_id,
5710 __allow_missing,
5711 __validate_only,
5712 Unknown(std::string::String),
5713 }
5714 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5715 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5716 where
5717 D: serde::Deserializer<'de>,
5718 {
5719 struct Visitor;
5720 impl<'de> serde::de::Visitor<'de> for Visitor {
5721 type Value = __FieldTag;
5722 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5723 formatter.write_str("a field name for UpdateConnectionRequest")
5724 }
5725 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5726 where
5727 E: serde::de::Error,
5728 {
5729 use std::result::Result::Ok;
5730 use std::string::ToString;
5731 match value {
5732 "updateMask" => Ok(__FieldTag::__update_mask),
5733 "update_mask" => Ok(__FieldTag::__update_mask),
5734 "connection" => Ok(__FieldTag::__connection),
5735 "requestId" => Ok(__FieldTag::__request_id),
5736 "request_id" => Ok(__FieldTag::__request_id),
5737 "allowMissing" => Ok(__FieldTag::__allow_missing),
5738 "allow_missing" => Ok(__FieldTag::__allow_missing),
5739 "validateOnly" => Ok(__FieldTag::__validate_only),
5740 "validate_only" => Ok(__FieldTag::__validate_only),
5741 _ => Ok(__FieldTag::Unknown(value.to_string())),
5742 }
5743 }
5744 }
5745 deserializer.deserialize_identifier(Visitor)
5746 }
5747 }
5748 struct Visitor;
5749 impl<'de> serde::de::Visitor<'de> for Visitor {
5750 type Value = UpdateConnectionRequest;
5751 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5752 formatter.write_str("struct UpdateConnectionRequest")
5753 }
5754 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5755 where
5756 A: serde::de::MapAccess<'de>,
5757 {
5758 #[allow(unused_imports)]
5759 use serde::de::Error;
5760 use std::option::Option::Some;
5761 let mut fields = std::collections::HashSet::new();
5762 let mut result = Self::Value::new();
5763 while let Some(tag) = map.next_key::<__FieldTag>()? {
5764 #[allow(clippy::match_single_binding)]
5765 match tag {
5766 __FieldTag::__update_mask => {
5767 if !fields.insert(__FieldTag::__update_mask) {
5768 return std::result::Result::Err(A::Error::duplicate_field(
5769 "multiple values for update_mask",
5770 ));
5771 }
5772 result.update_mask =
5773 map.next_value::<std::option::Option<wkt::FieldMask>>()?;
5774 }
5775 __FieldTag::__connection => {
5776 if !fields.insert(__FieldTag::__connection) {
5777 return std::result::Result::Err(A::Error::duplicate_field(
5778 "multiple values for connection",
5779 ));
5780 }
5781 result.connection =
5782 map.next_value::<std::option::Option<crate::model::Connection>>()?;
5783 }
5784 __FieldTag::__request_id => {
5785 if !fields.insert(__FieldTag::__request_id) {
5786 return std::result::Result::Err(A::Error::duplicate_field(
5787 "multiple values for request_id",
5788 ));
5789 }
5790 result.request_id = map
5791 .next_value::<std::option::Option<std::string::String>>()?
5792 .unwrap_or_default();
5793 }
5794 __FieldTag::__allow_missing => {
5795 if !fields.insert(__FieldTag::__allow_missing) {
5796 return std::result::Result::Err(A::Error::duplicate_field(
5797 "multiple values for allow_missing",
5798 ));
5799 }
5800 result.allow_missing = map
5801 .next_value::<std::option::Option<bool>>()?
5802 .unwrap_or_default();
5803 }
5804 __FieldTag::__validate_only => {
5805 if !fields.insert(__FieldTag::__validate_only) {
5806 return std::result::Result::Err(A::Error::duplicate_field(
5807 "multiple values for validate_only",
5808 ));
5809 }
5810 result.validate_only = map
5811 .next_value::<std::option::Option<bool>>()?
5812 .unwrap_or_default();
5813 }
5814 __FieldTag::Unknown(key) => {
5815 let value = map.next_value::<serde_json::Value>()?;
5816 result._unknown_fields.insert(key, value);
5817 }
5818 }
5819 }
5820 std::result::Result::Ok(result)
5821 }
5822 }
5823 deserializer.deserialize_any(Visitor)
5824 }
5825}
5826
5827#[doc(hidden)]
5828impl serde::ser::Serialize for UpdateConnectionRequest {
5829 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5830 where
5831 S: serde::ser::Serializer,
5832 {
5833 use serde::ser::SerializeMap;
5834 #[allow(unused_imports)]
5835 use std::option::Option::Some;
5836 let mut state = serializer.serialize_map(std::option::Option::None)?;
5837 if self.update_mask.is_some() {
5838 state.serialize_entry("updateMask", &self.update_mask)?;
5839 }
5840 if self.connection.is_some() {
5841 state.serialize_entry("connection", &self.connection)?;
5842 }
5843 if !self.request_id.is_empty() {
5844 state.serialize_entry("requestId", &self.request_id)?;
5845 }
5846 if !wkt::internal::is_default(&self.allow_missing) {
5847 state.serialize_entry("allowMissing", &self.allow_missing)?;
5848 }
5849 if !wkt::internal::is_default(&self.validate_only) {
5850 state.serialize_entry("validateOnly", &self.validate_only)?;
5851 }
5852 if !self._unknown_fields.is_empty() {
5853 for (key, value) in self._unknown_fields.iter() {
5854 state.serialize_entry(key, &value)?;
5855 }
5856 }
5857 state.end()
5858 }
5859}
5860
5861impl std::fmt::Debug for UpdateConnectionRequest {
5862 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5863 let mut debug_struct = f.debug_struct("UpdateConnectionRequest");
5864 debug_struct.field("update_mask", &self.update_mask);
5865 debug_struct.field("connection", &self.connection);
5866 debug_struct.field("request_id", &self.request_id);
5867 debug_struct.field("allow_missing", &self.allow_missing);
5868 debug_struct.field("validate_only", &self.validate_only);
5869 if !self._unknown_fields.is_empty() {
5870 debug_struct.field("_unknown_fields", &self._unknown_fields);
5871 }
5872 debug_struct.finish()
5873 }
5874}
5875
5876#[derive(Clone, Default, PartialEq)]
5878#[non_exhaustive]
5879pub struct DeleteConnectionRequest {
5880 pub name: std::string::String,
5882
5883 pub request_id: std::string::String,
5897
5898 pub validate_only: bool,
5900
5901 pub etag: std::string::String,
5905
5906 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5907}
5908
5909impl DeleteConnectionRequest {
5910 pub fn new() -> Self {
5911 std::default::Default::default()
5912 }
5913
5914 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5916 self.name = v.into();
5917 self
5918 }
5919
5920 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5922 self.request_id = v.into();
5923 self
5924 }
5925
5926 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5928 self.validate_only = v.into();
5929 self
5930 }
5931
5932 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5934 self.etag = v.into();
5935 self
5936 }
5937}
5938
5939impl wkt::message::Message for DeleteConnectionRequest {
5940 fn typename() -> &'static str {
5941 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteConnectionRequest"
5942 }
5943}
5944
5945#[doc(hidden)]
5946impl<'de> serde::de::Deserialize<'de> for DeleteConnectionRequest {
5947 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5948 where
5949 D: serde::Deserializer<'de>,
5950 {
5951 #[allow(non_camel_case_types)]
5952 #[doc(hidden)]
5953 #[derive(PartialEq, Eq, Hash)]
5954 enum __FieldTag {
5955 __name,
5956 __request_id,
5957 __validate_only,
5958 __etag,
5959 Unknown(std::string::String),
5960 }
5961 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5962 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5963 where
5964 D: serde::Deserializer<'de>,
5965 {
5966 struct Visitor;
5967 impl<'de> serde::de::Visitor<'de> for Visitor {
5968 type Value = __FieldTag;
5969 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5970 formatter.write_str("a field name for DeleteConnectionRequest")
5971 }
5972 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5973 where
5974 E: serde::de::Error,
5975 {
5976 use std::result::Result::Ok;
5977 use std::string::ToString;
5978 match value {
5979 "name" => Ok(__FieldTag::__name),
5980 "requestId" => Ok(__FieldTag::__request_id),
5981 "request_id" => Ok(__FieldTag::__request_id),
5982 "validateOnly" => Ok(__FieldTag::__validate_only),
5983 "validate_only" => Ok(__FieldTag::__validate_only),
5984 "etag" => Ok(__FieldTag::__etag),
5985 _ => Ok(__FieldTag::Unknown(value.to_string())),
5986 }
5987 }
5988 }
5989 deserializer.deserialize_identifier(Visitor)
5990 }
5991 }
5992 struct Visitor;
5993 impl<'de> serde::de::Visitor<'de> for Visitor {
5994 type Value = DeleteConnectionRequest;
5995 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5996 formatter.write_str("struct DeleteConnectionRequest")
5997 }
5998 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5999 where
6000 A: serde::de::MapAccess<'de>,
6001 {
6002 #[allow(unused_imports)]
6003 use serde::de::Error;
6004 use std::option::Option::Some;
6005 let mut fields = std::collections::HashSet::new();
6006 let mut result = Self::Value::new();
6007 while let Some(tag) = map.next_key::<__FieldTag>()? {
6008 #[allow(clippy::match_single_binding)]
6009 match tag {
6010 __FieldTag::__name => {
6011 if !fields.insert(__FieldTag::__name) {
6012 return std::result::Result::Err(A::Error::duplicate_field(
6013 "multiple values for name",
6014 ));
6015 }
6016 result.name = map
6017 .next_value::<std::option::Option<std::string::String>>()?
6018 .unwrap_or_default();
6019 }
6020 __FieldTag::__request_id => {
6021 if !fields.insert(__FieldTag::__request_id) {
6022 return std::result::Result::Err(A::Error::duplicate_field(
6023 "multiple values for request_id",
6024 ));
6025 }
6026 result.request_id = map
6027 .next_value::<std::option::Option<std::string::String>>()?
6028 .unwrap_or_default();
6029 }
6030 __FieldTag::__validate_only => {
6031 if !fields.insert(__FieldTag::__validate_only) {
6032 return std::result::Result::Err(A::Error::duplicate_field(
6033 "multiple values for validate_only",
6034 ));
6035 }
6036 result.validate_only = map
6037 .next_value::<std::option::Option<bool>>()?
6038 .unwrap_or_default();
6039 }
6040 __FieldTag::__etag => {
6041 if !fields.insert(__FieldTag::__etag) {
6042 return std::result::Result::Err(A::Error::duplicate_field(
6043 "multiple values for etag",
6044 ));
6045 }
6046 result.etag = map
6047 .next_value::<std::option::Option<std::string::String>>()?
6048 .unwrap_or_default();
6049 }
6050 __FieldTag::Unknown(key) => {
6051 let value = map.next_value::<serde_json::Value>()?;
6052 result._unknown_fields.insert(key, value);
6053 }
6054 }
6055 }
6056 std::result::Result::Ok(result)
6057 }
6058 }
6059 deserializer.deserialize_any(Visitor)
6060 }
6061}
6062
6063#[doc(hidden)]
6064impl serde::ser::Serialize for DeleteConnectionRequest {
6065 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6066 where
6067 S: serde::ser::Serializer,
6068 {
6069 use serde::ser::SerializeMap;
6070 #[allow(unused_imports)]
6071 use std::option::Option::Some;
6072 let mut state = serializer.serialize_map(std::option::Option::None)?;
6073 if !self.name.is_empty() {
6074 state.serialize_entry("name", &self.name)?;
6075 }
6076 if !self.request_id.is_empty() {
6077 state.serialize_entry("requestId", &self.request_id)?;
6078 }
6079 if !wkt::internal::is_default(&self.validate_only) {
6080 state.serialize_entry("validateOnly", &self.validate_only)?;
6081 }
6082 if !self.etag.is_empty() {
6083 state.serialize_entry("etag", &self.etag)?;
6084 }
6085 if !self._unknown_fields.is_empty() {
6086 for (key, value) in self._unknown_fields.iter() {
6087 state.serialize_entry(key, &value)?;
6088 }
6089 }
6090 state.end()
6091 }
6092}
6093
6094impl std::fmt::Debug for DeleteConnectionRequest {
6095 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6096 let mut debug_struct = f.debug_struct("DeleteConnectionRequest");
6097 debug_struct.field("name", &self.name);
6098 debug_struct.field("request_id", &self.request_id);
6099 debug_struct.field("validate_only", &self.validate_only);
6100 debug_struct.field("etag", &self.etag);
6101 if !self._unknown_fields.is_empty() {
6102 debug_struct.field("_unknown_fields", &self._unknown_fields);
6103 }
6104 debug_struct.finish()
6105 }
6106}
6107
6108#[derive(Clone, Default, PartialEq)]
6110#[non_exhaustive]
6111pub struct ListAccountConnectorsRequest {
6112 pub parent: std::string::String,
6114
6115 pub page_size: i32,
6118
6119 pub page_token: std::string::String,
6121
6122 pub filter: std::string::String,
6124
6125 pub order_by: std::string::String,
6127
6128 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6129}
6130
6131impl ListAccountConnectorsRequest {
6132 pub fn new() -> Self {
6133 std::default::Default::default()
6134 }
6135
6136 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6138 self.parent = v.into();
6139 self
6140 }
6141
6142 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6144 self.page_size = v.into();
6145 self
6146 }
6147
6148 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6150 self.page_token = v.into();
6151 self
6152 }
6153
6154 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6156 self.filter = v.into();
6157 self
6158 }
6159
6160 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6162 self.order_by = v.into();
6163 self
6164 }
6165}
6166
6167impl wkt::message::Message for ListAccountConnectorsRequest {
6168 fn typename() -> &'static str {
6169 "type.googleapis.com/google.cloud.developerconnect.v1.ListAccountConnectorsRequest"
6170 }
6171}
6172
6173#[doc(hidden)]
6174impl<'de> serde::de::Deserialize<'de> for ListAccountConnectorsRequest {
6175 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6176 where
6177 D: serde::Deserializer<'de>,
6178 {
6179 #[allow(non_camel_case_types)]
6180 #[doc(hidden)]
6181 #[derive(PartialEq, Eq, Hash)]
6182 enum __FieldTag {
6183 __parent,
6184 __page_size,
6185 __page_token,
6186 __filter,
6187 __order_by,
6188 Unknown(std::string::String),
6189 }
6190 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6191 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6192 where
6193 D: serde::Deserializer<'de>,
6194 {
6195 struct Visitor;
6196 impl<'de> serde::de::Visitor<'de> for Visitor {
6197 type Value = __FieldTag;
6198 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6199 formatter.write_str("a field name for ListAccountConnectorsRequest")
6200 }
6201 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6202 where
6203 E: serde::de::Error,
6204 {
6205 use std::result::Result::Ok;
6206 use std::string::ToString;
6207 match value {
6208 "parent" => Ok(__FieldTag::__parent),
6209 "pageSize" => Ok(__FieldTag::__page_size),
6210 "page_size" => Ok(__FieldTag::__page_size),
6211 "pageToken" => Ok(__FieldTag::__page_token),
6212 "page_token" => Ok(__FieldTag::__page_token),
6213 "filter" => Ok(__FieldTag::__filter),
6214 "orderBy" => Ok(__FieldTag::__order_by),
6215 "order_by" => Ok(__FieldTag::__order_by),
6216 _ => Ok(__FieldTag::Unknown(value.to_string())),
6217 }
6218 }
6219 }
6220 deserializer.deserialize_identifier(Visitor)
6221 }
6222 }
6223 struct Visitor;
6224 impl<'de> serde::de::Visitor<'de> for Visitor {
6225 type Value = ListAccountConnectorsRequest;
6226 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6227 formatter.write_str("struct ListAccountConnectorsRequest")
6228 }
6229 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6230 where
6231 A: serde::de::MapAccess<'de>,
6232 {
6233 #[allow(unused_imports)]
6234 use serde::de::Error;
6235 use std::option::Option::Some;
6236 let mut fields = std::collections::HashSet::new();
6237 let mut result = Self::Value::new();
6238 while let Some(tag) = map.next_key::<__FieldTag>()? {
6239 #[allow(clippy::match_single_binding)]
6240 match tag {
6241 __FieldTag::__parent => {
6242 if !fields.insert(__FieldTag::__parent) {
6243 return std::result::Result::Err(A::Error::duplicate_field(
6244 "multiple values for parent",
6245 ));
6246 }
6247 result.parent = map
6248 .next_value::<std::option::Option<std::string::String>>()?
6249 .unwrap_or_default();
6250 }
6251 __FieldTag::__page_size => {
6252 if !fields.insert(__FieldTag::__page_size) {
6253 return std::result::Result::Err(A::Error::duplicate_field(
6254 "multiple values for page_size",
6255 ));
6256 }
6257 struct __With(std::option::Option<i32>);
6258 impl<'de> serde::de::Deserialize<'de> for __With {
6259 fn deserialize<D>(
6260 deserializer: D,
6261 ) -> std::result::Result<Self, D::Error>
6262 where
6263 D: serde::de::Deserializer<'de>,
6264 {
6265 serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
6266 }
6267 }
6268 result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
6269 }
6270 __FieldTag::__page_token => {
6271 if !fields.insert(__FieldTag::__page_token) {
6272 return std::result::Result::Err(A::Error::duplicate_field(
6273 "multiple values for page_token",
6274 ));
6275 }
6276 result.page_token = map
6277 .next_value::<std::option::Option<std::string::String>>()?
6278 .unwrap_or_default();
6279 }
6280 __FieldTag::__filter => {
6281 if !fields.insert(__FieldTag::__filter) {
6282 return std::result::Result::Err(A::Error::duplicate_field(
6283 "multiple values for filter",
6284 ));
6285 }
6286 result.filter = map
6287 .next_value::<std::option::Option<std::string::String>>()?
6288 .unwrap_or_default();
6289 }
6290 __FieldTag::__order_by => {
6291 if !fields.insert(__FieldTag::__order_by) {
6292 return std::result::Result::Err(A::Error::duplicate_field(
6293 "multiple values for order_by",
6294 ));
6295 }
6296 result.order_by = map
6297 .next_value::<std::option::Option<std::string::String>>()?
6298 .unwrap_or_default();
6299 }
6300 __FieldTag::Unknown(key) => {
6301 let value = map.next_value::<serde_json::Value>()?;
6302 result._unknown_fields.insert(key, value);
6303 }
6304 }
6305 }
6306 std::result::Result::Ok(result)
6307 }
6308 }
6309 deserializer.deserialize_any(Visitor)
6310 }
6311}
6312
6313#[doc(hidden)]
6314impl serde::ser::Serialize for ListAccountConnectorsRequest {
6315 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6316 where
6317 S: serde::ser::Serializer,
6318 {
6319 use serde::ser::SerializeMap;
6320 #[allow(unused_imports)]
6321 use std::option::Option::Some;
6322 let mut state = serializer.serialize_map(std::option::Option::None)?;
6323 if !self.parent.is_empty() {
6324 state.serialize_entry("parent", &self.parent)?;
6325 }
6326 if !wkt::internal::is_default(&self.page_size) {
6327 struct __With<'a>(&'a i32);
6328 impl<'a> serde::ser::Serialize for __With<'a> {
6329 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6330 where
6331 S: serde::ser::Serializer,
6332 {
6333 serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
6334 }
6335 }
6336 state.serialize_entry("pageSize", &__With(&self.page_size))?;
6337 }
6338 if !self.page_token.is_empty() {
6339 state.serialize_entry("pageToken", &self.page_token)?;
6340 }
6341 if !self.filter.is_empty() {
6342 state.serialize_entry("filter", &self.filter)?;
6343 }
6344 if !self.order_by.is_empty() {
6345 state.serialize_entry("orderBy", &self.order_by)?;
6346 }
6347 if !self._unknown_fields.is_empty() {
6348 for (key, value) in self._unknown_fields.iter() {
6349 state.serialize_entry(key, &value)?;
6350 }
6351 }
6352 state.end()
6353 }
6354}
6355
6356impl std::fmt::Debug for ListAccountConnectorsRequest {
6357 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6358 let mut debug_struct = f.debug_struct("ListAccountConnectorsRequest");
6359 debug_struct.field("parent", &self.parent);
6360 debug_struct.field("page_size", &self.page_size);
6361 debug_struct.field("page_token", &self.page_token);
6362 debug_struct.field("filter", &self.filter);
6363 debug_struct.field("order_by", &self.order_by);
6364 if !self._unknown_fields.is_empty() {
6365 debug_struct.field("_unknown_fields", &self._unknown_fields);
6366 }
6367 debug_struct.finish()
6368 }
6369}
6370
6371#[derive(Clone, Default, PartialEq)]
6373#[non_exhaustive]
6374pub struct ListAccountConnectorsResponse {
6375 pub account_connectors: std::vec::Vec<crate::model::AccountConnector>,
6377
6378 pub next_page_token: std::string::String,
6380
6381 pub unreachable: std::vec::Vec<std::string::String>,
6383
6384 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6385}
6386
6387impl ListAccountConnectorsResponse {
6388 pub fn new() -> Self {
6389 std::default::Default::default()
6390 }
6391
6392 pub fn set_account_connectors<T, V>(mut self, v: T) -> Self
6394 where
6395 T: std::iter::IntoIterator<Item = V>,
6396 V: std::convert::Into<crate::model::AccountConnector>,
6397 {
6398 use std::iter::Iterator;
6399 self.account_connectors = v.into_iter().map(|i| i.into()).collect();
6400 self
6401 }
6402
6403 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6405 self.next_page_token = v.into();
6406 self
6407 }
6408
6409 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6411 where
6412 T: std::iter::IntoIterator<Item = V>,
6413 V: std::convert::Into<std::string::String>,
6414 {
6415 use std::iter::Iterator;
6416 self.unreachable = v.into_iter().map(|i| i.into()).collect();
6417 self
6418 }
6419}
6420
6421impl wkt::message::Message for ListAccountConnectorsResponse {
6422 fn typename() -> &'static str {
6423 "type.googleapis.com/google.cloud.developerconnect.v1.ListAccountConnectorsResponse"
6424 }
6425}
6426
6427#[doc(hidden)]
6428impl gax::paginator::internal::PageableResponse for ListAccountConnectorsResponse {
6429 type PageItem = crate::model::AccountConnector;
6430
6431 fn items(self) -> std::vec::Vec<Self::PageItem> {
6432 self.account_connectors
6433 }
6434
6435 fn next_page_token(&self) -> std::string::String {
6436 use std::clone::Clone;
6437 self.next_page_token.clone()
6438 }
6439}
6440
6441#[doc(hidden)]
6442impl<'de> serde::de::Deserialize<'de> for ListAccountConnectorsResponse {
6443 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6444 where
6445 D: serde::Deserializer<'de>,
6446 {
6447 #[allow(non_camel_case_types)]
6448 #[doc(hidden)]
6449 #[derive(PartialEq, Eq, Hash)]
6450 enum __FieldTag {
6451 __account_connectors,
6452 __next_page_token,
6453 __unreachable,
6454 Unknown(std::string::String),
6455 }
6456 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6457 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6458 where
6459 D: serde::Deserializer<'de>,
6460 {
6461 struct Visitor;
6462 impl<'de> serde::de::Visitor<'de> for Visitor {
6463 type Value = __FieldTag;
6464 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6465 formatter.write_str("a field name for ListAccountConnectorsResponse")
6466 }
6467 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6468 where
6469 E: serde::de::Error,
6470 {
6471 use std::result::Result::Ok;
6472 use std::string::ToString;
6473 match value {
6474 "accountConnectors" => Ok(__FieldTag::__account_connectors),
6475 "account_connectors" => Ok(__FieldTag::__account_connectors),
6476 "nextPageToken" => Ok(__FieldTag::__next_page_token),
6477 "next_page_token" => Ok(__FieldTag::__next_page_token),
6478 "unreachable" => Ok(__FieldTag::__unreachable),
6479 _ => Ok(__FieldTag::Unknown(value.to_string())),
6480 }
6481 }
6482 }
6483 deserializer.deserialize_identifier(Visitor)
6484 }
6485 }
6486 struct Visitor;
6487 impl<'de> serde::de::Visitor<'de> for Visitor {
6488 type Value = ListAccountConnectorsResponse;
6489 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6490 formatter.write_str("struct ListAccountConnectorsResponse")
6491 }
6492 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6493 where
6494 A: serde::de::MapAccess<'de>,
6495 {
6496 #[allow(unused_imports)]
6497 use serde::de::Error;
6498 use std::option::Option::Some;
6499 let mut fields = std::collections::HashSet::new();
6500 let mut result = Self::Value::new();
6501 while let Some(tag) = map.next_key::<__FieldTag>()? {
6502 #[allow(clippy::match_single_binding)]
6503 match tag {
6504 __FieldTag::__account_connectors => {
6505 if !fields.insert(__FieldTag::__account_connectors) {
6506 return std::result::Result::Err(A::Error::duplicate_field(
6507 "multiple values for account_connectors",
6508 ));
6509 }
6510 result.account_connectors =
6511 map.next_value::<std::option::Option<
6512 std::vec::Vec<crate::model::AccountConnector>,
6513 >>()?
6514 .unwrap_or_default();
6515 }
6516 __FieldTag::__next_page_token => {
6517 if !fields.insert(__FieldTag::__next_page_token) {
6518 return std::result::Result::Err(A::Error::duplicate_field(
6519 "multiple values for next_page_token",
6520 ));
6521 }
6522 result.next_page_token = map
6523 .next_value::<std::option::Option<std::string::String>>()?
6524 .unwrap_or_default();
6525 }
6526 __FieldTag::__unreachable => {
6527 if !fields.insert(__FieldTag::__unreachable) {
6528 return std::result::Result::Err(A::Error::duplicate_field(
6529 "multiple values for unreachable",
6530 ));
6531 }
6532 result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
6533 }
6534 __FieldTag::Unknown(key) => {
6535 let value = map.next_value::<serde_json::Value>()?;
6536 result._unknown_fields.insert(key, value);
6537 }
6538 }
6539 }
6540 std::result::Result::Ok(result)
6541 }
6542 }
6543 deserializer.deserialize_any(Visitor)
6544 }
6545}
6546
6547#[doc(hidden)]
6548impl serde::ser::Serialize for ListAccountConnectorsResponse {
6549 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6550 where
6551 S: serde::ser::Serializer,
6552 {
6553 use serde::ser::SerializeMap;
6554 #[allow(unused_imports)]
6555 use std::option::Option::Some;
6556 let mut state = serializer.serialize_map(std::option::Option::None)?;
6557 if !self.account_connectors.is_empty() {
6558 state.serialize_entry("accountConnectors", &self.account_connectors)?;
6559 }
6560 if !self.next_page_token.is_empty() {
6561 state.serialize_entry("nextPageToken", &self.next_page_token)?;
6562 }
6563 if !self.unreachable.is_empty() {
6564 state.serialize_entry("unreachable", &self.unreachable)?;
6565 }
6566 if !self._unknown_fields.is_empty() {
6567 for (key, value) in self._unknown_fields.iter() {
6568 state.serialize_entry(key, &value)?;
6569 }
6570 }
6571 state.end()
6572 }
6573}
6574
6575impl std::fmt::Debug for ListAccountConnectorsResponse {
6576 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6577 let mut debug_struct = f.debug_struct("ListAccountConnectorsResponse");
6578 debug_struct.field("account_connectors", &self.account_connectors);
6579 debug_struct.field("next_page_token", &self.next_page_token);
6580 debug_struct.field("unreachable", &self.unreachable);
6581 if !self._unknown_fields.is_empty() {
6582 debug_struct.field("_unknown_fields", &self._unknown_fields);
6583 }
6584 debug_struct.finish()
6585 }
6586}
6587
6588#[derive(Clone, Default, PartialEq)]
6590#[non_exhaustive]
6591pub struct GetAccountConnectorRequest {
6592 pub name: std::string::String,
6594
6595 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6596}
6597
6598impl GetAccountConnectorRequest {
6599 pub fn new() -> Self {
6600 std::default::Default::default()
6601 }
6602
6603 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6605 self.name = v.into();
6606 self
6607 }
6608}
6609
6610impl wkt::message::Message for GetAccountConnectorRequest {
6611 fn typename() -> &'static str {
6612 "type.googleapis.com/google.cloud.developerconnect.v1.GetAccountConnectorRequest"
6613 }
6614}
6615
6616#[doc(hidden)]
6617impl<'de> serde::de::Deserialize<'de> for GetAccountConnectorRequest {
6618 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6619 where
6620 D: serde::Deserializer<'de>,
6621 {
6622 #[allow(non_camel_case_types)]
6623 #[doc(hidden)]
6624 #[derive(PartialEq, Eq, Hash)]
6625 enum __FieldTag {
6626 __name,
6627 Unknown(std::string::String),
6628 }
6629 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6630 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6631 where
6632 D: serde::Deserializer<'de>,
6633 {
6634 struct Visitor;
6635 impl<'de> serde::de::Visitor<'de> for Visitor {
6636 type Value = __FieldTag;
6637 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6638 formatter.write_str("a field name for GetAccountConnectorRequest")
6639 }
6640 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6641 where
6642 E: serde::de::Error,
6643 {
6644 use std::result::Result::Ok;
6645 use std::string::ToString;
6646 match value {
6647 "name" => Ok(__FieldTag::__name),
6648 _ => Ok(__FieldTag::Unknown(value.to_string())),
6649 }
6650 }
6651 }
6652 deserializer.deserialize_identifier(Visitor)
6653 }
6654 }
6655 struct Visitor;
6656 impl<'de> serde::de::Visitor<'de> for Visitor {
6657 type Value = GetAccountConnectorRequest;
6658 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6659 formatter.write_str("struct GetAccountConnectorRequest")
6660 }
6661 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6662 where
6663 A: serde::de::MapAccess<'de>,
6664 {
6665 #[allow(unused_imports)]
6666 use serde::de::Error;
6667 use std::option::Option::Some;
6668 let mut fields = std::collections::HashSet::new();
6669 let mut result = Self::Value::new();
6670 while let Some(tag) = map.next_key::<__FieldTag>()? {
6671 #[allow(clippy::match_single_binding)]
6672 match tag {
6673 __FieldTag::__name => {
6674 if !fields.insert(__FieldTag::__name) {
6675 return std::result::Result::Err(A::Error::duplicate_field(
6676 "multiple values for name",
6677 ));
6678 }
6679 result.name = map
6680 .next_value::<std::option::Option<std::string::String>>()?
6681 .unwrap_or_default();
6682 }
6683 __FieldTag::Unknown(key) => {
6684 let value = map.next_value::<serde_json::Value>()?;
6685 result._unknown_fields.insert(key, value);
6686 }
6687 }
6688 }
6689 std::result::Result::Ok(result)
6690 }
6691 }
6692 deserializer.deserialize_any(Visitor)
6693 }
6694}
6695
6696#[doc(hidden)]
6697impl serde::ser::Serialize for GetAccountConnectorRequest {
6698 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6699 where
6700 S: serde::ser::Serializer,
6701 {
6702 use serde::ser::SerializeMap;
6703 #[allow(unused_imports)]
6704 use std::option::Option::Some;
6705 let mut state = serializer.serialize_map(std::option::Option::None)?;
6706 if !self.name.is_empty() {
6707 state.serialize_entry("name", &self.name)?;
6708 }
6709 if !self._unknown_fields.is_empty() {
6710 for (key, value) in self._unknown_fields.iter() {
6711 state.serialize_entry(key, &value)?;
6712 }
6713 }
6714 state.end()
6715 }
6716}
6717
6718impl std::fmt::Debug for GetAccountConnectorRequest {
6719 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6720 let mut debug_struct = f.debug_struct("GetAccountConnectorRequest");
6721 debug_struct.field("name", &self.name);
6722 if !self._unknown_fields.is_empty() {
6723 debug_struct.field("_unknown_fields", &self._unknown_fields);
6724 }
6725 debug_struct.finish()
6726 }
6727}
6728
6729#[derive(Clone, Default, PartialEq)]
6730#[non_exhaustive]
6731pub struct CreateAccountConnectorRequest {
6732 pub parent: std::string::String,
6734
6735 pub account_connector_id: std::string::String,
6740
6741 pub account_connector: std::option::Option<crate::model::AccountConnector>,
6743
6744 pub request_id: std::string::String,
6758
6759 pub validate_only: bool,
6761
6762 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6763}
6764
6765impl CreateAccountConnectorRequest {
6766 pub fn new() -> Self {
6767 std::default::Default::default()
6768 }
6769
6770 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6772 self.parent = v.into();
6773 self
6774 }
6775
6776 pub fn set_account_connector_id<T: std::convert::Into<std::string::String>>(
6778 mut self,
6779 v: T,
6780 ) -> Self {
6781 self.account_connector_id = v.into();
6782 self
6783 }
6784
6785 pub fn set_account_connector<T>(mut self, v: T) -> Self
6787 where
6788 T: std::convert::Into<crate::model::AccountConnector>,
6789 {
6790 self.account_connector = std::option::Option::Some(v.into());
6791 self
6792 }
6793
6794 pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
6796 where
6797 T: std::convert::Into<crate::model::AccountConnector>,
6798 {
6799 self.account_connector = v.map(|x| x.into());
6800 self
6801 }
6802
6803 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6805 self.request_id = v.into();
6806 self
6807 }
6808
6809 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6811 self.validate_only = v.into();
6812 self
6813 }
6814}
6815
6816impl wkt::message::Message for CreateAccountConnectorRequest {
6817 fn typename() -> &'static str {
6818 "type.googleapis.com/google.cloud.developerconnect.v1.CreateAccountConnectorRequest"
6819 }
6820}
6821
6822#[doc(hidden)]
6823impl<'de> serde::de::Deserialize<'de> for CreateAccountConnectorRequest {
6824 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6825 where
6826 D: serde::Deserializer<'de>,
6827 {
6828 #[allow(non_camel_case_types)]
6829 #[doc(hidden)]
6830 #[derive(PartialEq, Eq, Hash)]
6831 enum __FieldTag {
6832 __parent,
6833 __account_connector_id,
6834 __account_connector,
6835 __request_id,
6836 __validate_only,
6837 Unknown(std::string::String),
6838 }
6839 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6840 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6841 where
6842 D: serde::Deserializer<'de>,
6843 {
6844 struct Visitor;
6845 impl<'de> serde::de::Visitor<'de> for Visitor {
6846 type Value = __FieldTag;
6847 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6848 formatter.write_str("a field name for CreateAccountConnectorRequest")
6849 }
6850 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6851 where
6852 E: serde::de::Error,
6853 {
6854 use std::result::Result::Ok;
6855 use std::string::ToString;
6856 match value {
6857 "parent" => Ok(__FieldTag::__parent),
6858 "accountConnectorId" => Ok(__FieldTag::__account_connector_id),
6859 "account_connector_id" => Ok(__FieldTag::__account_connector_id),
6860 "accountConnector" => Ok(__FieldTag::__account_connector),
6861 "account_connector" => Ok(__FieldTag::__account_connector),
6862 "requestId" => Ok(__FieldTag::__request_id),
6863 "request_id" => Ok(__FieldTag::__request_id),
6864 "validateOnly" => Ok(__FieldTag::__validate_only),
6865 "validate_only" => Ok(__FieldTag::__validate_only),
6866 _ => Ok(__FieldTag::Unknown(value.to_string())),
6867 }
6868 }
6869 }
6870 deserializer.deserialize_identifier(Visitor)
6871 }
6872 }
6873 struct Visitor;
6874 impl<'de> serde::de::Visitor<'de> for Visitor {
6875 type Value = CreateAccountConnectorRequest;
6876 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6877 formatter.write_str("struct CreateAccountConnectorRequest")
6878 }
6879 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6880 where
6881 A: serde::de::MapAccess<'de>,
6882 {
6883 #[allow(unused_imports)]
6884 use serde::de::Error;
6885 use std::option::Option::Some;
6886 let mut fields = std::collections::HashSet::new();
6887 let mut result = Self::Value::new();
6888 while let Some(tag) = map.next_key::<__FieldTag>()? {
6889 #[allow(clippy::match_single_binding)]
6890 match tag {
6891 __FieldTag::__parent => {
6892 if !fields.insert(__FieldTag::__parent) {
6893 return std::result::Result::Err(A::Error::duplicate_field(
6894 "multiple values for parent",
6895 ));
6896 }
6897 result.parent = map
6898 .next_value::<std::option::Option<std::string::String>>()?
6899 .unwrap_or_default();
6900 }
6901 __FieldTag::__account_connector_id => {
6902 if !fields.insert(__FieldTag::__account_connector_id) {
6903 return std::result::Result::Err(A::Error::duplicate_field(
6904 "multiple values for account_connector_id",
6905 ));
6906 }
6907 result.account_connector_id = map
6908 .next_value::<std::option::Option<std::string::String>>()?
6909 .unwrap_or_default();
6910 }
6911 __FieldTag::__account_connector => {
6912 if !fields.insert(__FieldTag::__account_connector) {
6913 return std::result::Result::Err(A::Error::duplicate_field(
6914 "multiple values for account_connector",
6915 ));
6916 }
6917 result.account_connector = map
6918 .next_value::<std::option::Option<crate::model::AccountConnector>>(
6919 )?;
6920 }
6921 __FieldTag::__request_id => {
6922 if !fields.insert(__FieldTag::__request_id) {
6923 return std::result::Result::Err(A::Error::duplicate_field(
6924 "multiple values for request_id",
6925 ));
6926 }
6927 result.request_id = map
6928 .next_value::<std::option::Option<std::string::String>>()?
6929 .unwrap_or_default();
6930 }
6931 __FieldTag::__validate_only => {
6932 if !fields.insert(__FieldTag::__validate_only) {
6933 return std::result::Result::Err(A::Error::duplicate_field(
6934 "multiple values for validate_only",
6935 ));
6936 }
6937 result.validate_only = map
6938 .next_value::<std::option::Option<bool>>()?
6939 .unwrap_or_default();
6940 }
6941 __FieldTag::Unknown(key) => {
6942 let value = map.next_value::<serde_json::Value>()?;
6943 result._unknown_fields.insert(key, value);
6944 }
6945 }
6946 }
6947 std::result::Result::Ok(result)
6948 }
6949 }
6950 deserializer.deserialize_any(Visitor)
6951 }
6952}
6953
6954#[doc(hidden)]
6955impl serde::ser::Serialize for CreateAccountConnectorRequest {
6956 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6957 where
6958 S: serde::ser::Serializer,
6959 {
6960 use serde::ser::SerializeMap;
6961 #[allow(unused_imports)]
6962 use std::option::Option::Some;
6963 let mut state = serializer.serialize_map(std::option::Option::None)?;
6964 if !self.parent.is_empty() {
6965 state.serialize_entry("parent", &self.parent)?;
6966 }
6967 if !self.account_connector_id.is_empty() {
6968 state.serialize_entry("accountConnectorId", &self.account_connector_id)?;
6969 }
6970 if self.account_connector.is_some() {
6971 state.serialize_entry("accountConnector", &self.account_connector)?;
6972 }
6973 if !self.request_id.is_empty() {
6974 state.serialize_entry("requestId", &self.request_id)?;
6975 }
6976 if !wkt::internal::is_default(&self.validate_only) {
6977 state.serialize_entry("validateOnly", &self.validate_only)?;
6978 }
6979 if !self._unknown_fields.is_empty() {
6980 for (key, value) in self._unknown_fields.iter() {
6981 state.serialize_entry(key, &value)?;
6982 }
6983 }
6984 state.end()
6985 }
6986}
6987
6988impl std::fmt::Debug for CreateAccountConnectorRequest {
6989 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6990 let mut debug_struct = f.debug_struct("CreateAccountConnectorRequest");
6991 debug_struct.field("parent", &self.parent);
6992 debug_struct.field("account_connector_id", &self.account_connector_id);
6993 debug_struct.field("account_connector", &self.account_connector);
6994 debug_struct.field("request_id", &self.request_id);
6995 debug_struct.field("validate_only", &self.validate_only);
6996 if !self._unknown_fields.is_empty() {
6997 debug_struct.field("_unknown_fields", &self._unknown_fields);
6998 }
6999 debug_struct.finish()
7000 }
7001}
7002
7003#[derive(Clone, Default, PartialEq)]
7005#[non_exhaustive]
7006pub struct UpdateAccountConnectorRequest {
7007 pub update_mask: std::option::Option<wkt::FieldMask>,
7009
7010 pub account_connector: std::option::Option<crate::model::AccountConnector>,
7012
7013 pub request_id: std::string::String,
7027
7028 pub allow_missing: bool,
7033
7034 pub validate_only: bool,
7036
7037 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7038}
7039
7040impl UpdateAccountConnectorRequest {
7041 pub fn new() -> Self {
7042 std::default::Default::default()
7043 }
7044
7045 pub fn set_update_mask<T>(mut self, v: T) -> Self
7047 where
7048 T: std::convert::Into<wkt::FieldMask>,
7049 {
7050 self.update_mask = std::option::Option::Some(v.into());
7051 self
7052 }
7053
7054 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7056 where
7057 T: std::convert::Into<wkt::FieldMask>,
7058 {
7059 self.update_mask = v.map(|x| x.into());
7060 self
7061 }
7062
7063 pub fn set_account_connector<T>(mut self, v: T) -> Self
7065 where
7066 T: std::convert::Into<crate::model::AccountConnector>,
7067 {
7068 self.account_connector = std::option::Option::Some(v.into());
7069 self
7070 }
7071
7072 pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
7074 where
7075 T: std::convert::Into<crate::model::AccountConnector>,
7076 {
7077 self.account_connector = v.map(|x| x.into());
7078 self
7079 }
7080
7081 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7083 self.request_id = v.into();
7084 self
7085 }
7086
7087 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7089 self.allow_missing = v.into();
7090 self
7091 }
7092
7093 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7095 self.validate_only = v.into();
7096 self
7097 }
7098}
7099
7100impl wkt::message::Message for UpdateAccountConnectorRequest {
7101 fn typename() -> &'static str {
7102 "type.googleapis.com/google.cloud.developerconnect.v1.UpdateAccountConnectorRequest"
7103 }
7104}
7105
7106#[doc(hidden)]
7107impl<'de> serde::de::Deserialize<'de> for UpdateAccountConnectorRequest {
7108 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7109 where
7110 D: serde::Deserializer<'de>,
7111 {
7112 #[allow(non_camel_case_types)]
7113 #[doc(hidden)]
7114 #[derive(PartialEq, Eq, Hash)]
7115 enum __FieldTag {
7116 __update_mask,
7117 __account_connector,
7118 __request_id,
7119 __allow_missing,
7120 __validate_only,
7121 Unknown(std::string::String),
7122 }
7123 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7124 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7125 where
7126 D: serde::Deserializer<'de>,
7127 {
7128 struct Visitor;
7129 impl<'de> serde::de::Visitor<'de> for Visitor {
7130 type Value = __FieldTag;
7131 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7132 formatter.write_str("a field name for UpdateAccountConnectorRequest")
7133 }
7134 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7135 where
7136 E: serde::de::Error,
7137 {
7138 use std::result::Result::Ok;
7139 use std::string::ToString;
7140 match value {
7141 "updateMask" => Ok(__FieldTag::__update_mask),
7142 "update_mask" => Ok(__FieldTag::__update_mask),
7143 "accountConnector" => Ok(__FieldTag::__account_connector),
7144 "account_connector" => Ok(__FieldTag::__account_connector),
7145 "requestId" => Ok(__FieldTag::__request_id),
7146 "request_id" => Ok(__FieldTag::__request_id),
7147 "allowMissing" => Ok(__FieldTag::__allow_missing),
7148 "allow_missing" => Ok(__FieldTag::__allow_missing),
7149 "validateOnly" => Ok(__FieldTag::__validate_only),
7150 "validate_only" => Ok(__FieldTag::__validate_only),
7151 _ => Ok(__FieldTag::Unknown(value.to_string())),
7152 }
7153 }
7154 }
7155 deserializer.deserialize_identifier(Visitor)
7156 }
7157 }
7158 struct Visitor;
7159 impl<'de> serde::de::Visitor<'de> for Visitor {
7160 type Value = UpdateAccountConnectorRequest;
7161 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7162 formatter.write_str("struct UpdateAccountConnectorRequest")
7163 }
7164 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7165 where
7166 A: serde::de::MapAccess<'de>,
7167 {
7168 #[allow(unused_imports)]
7169 use serde::de::Error;
7170 use std::option::Option::Some;
7171 let mut fields = std::collections::HashSet::new();
7172 let mut result = Self::Value::new();
7173 while let Some(tag) = map.next_key::<__FieldTag>()? {
7174 #[allow(clippy::match_single_binding)]
7175 match tag {
7176 __FieldTag::__update_mask => {
7177 if !fields.insert(__FieldTag::__update_mask) {
7178 return std::result::Result::Err(A::Error::duplicate_field(
7179 "multiple values for update_mask",
7180 ));
7181 }
7182 result.update_mask =
7183 map.next_value::<std::option::Option<wkt::FieldMask>>()?;
7184 }
7185 __FieldTag::__account_connector => {
7186 if !fields.insert(__FieldTag::__account_connector) {
7187 return std::result::Result::Err(A::Error::duplicate_field(
7188 "multiple values for account_connector",
7189 ));
7190 }
7191 result.account_connector = map
7192 .next_value::<std::option::Option<crate::model::AccountConnector>>(
7193 )?;
7194 }
7195 __FieldTag::__request_id => {
7196 if !fields.insert(__FieldTag::__request_id) {
7197 return std::result::Result::Err(A::Error::duplicate_field(
7198 "multiple values for request_id",
7199 ));
7200 }
7201 result.request_id = map
7202 .next_value::<std::option::Option<std::string::String>>()?
7203 .unwrap_or_default();
7204 }
7205 __FieldTag::__allow_missing => {
7206 if !fields.insert(__FieldTag::__allow_missing) {
7207 return std::result::Result::Err(A::Error::duplicate_field(
7208 "multiple values for allow_missing",
7209 ));
7210 }
7211 result.allow_missing = map
7212 .next_value::<std::option::Option<bool>>()?
7213 .unwrap_or_default();
7214 }
7215 __FieldTag::__validate_only => {
7216 if !fields.insert(__FieldTag::__validate_only) {
7217 return std::result::Result::Err(A::Error::duplicate_field(
7218 "multiple values for validate_only",
7219 ));
7220 }
7221 result.validate_only = map
7222 .next_value::<std::option::Option<bool>>()?
7223 .unwrap_or_default();
7224 }
7225 __FieldTag::Unknown(key) => {
7226 let value = map.next_value::<serde_json::Value>()?;
7227 result._unknown_fields.insert(key, value);
7228 }
7229 }
7230 }
7231 std::result::Result::Ok(result)
7232 }
7233 }
7234 deserializer.deserialize_any(Visitor)
7235 }
7236}
7237
7238#[doc(hidden)]
7239impl serde::ser::Serialize for UpdateAccountConnectorRequest {
7240 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7241 where
7242 S: serde::ser::Serializer,
7243 {
7244 use serde::ser::SerializeMap;
7245 #[allow(unused_imports)]
7246 use std::option::Option::Some;
7247 let mut state = serializer.serialize_map(std::option::Option::None)?;
7248 if self.update_mask.is_some() {
7249 state.serialize_entry("updateMask", &self.update_mask)?;
7250 }
7251 if self.account_connector.is_some() {
7252 state.serialize_entry("accountConnector", &self.account_connector)?;
7253 }
7254 if !self.request_id.is_empty() {
7255 state.serialize_entry("requestId", &self.request_id)?;
7256 }
7257 if !wkt::internal::is_default(&self.allow_missing) {
7258 state.serialize_entry("allowMissing", &self.allow_missing)?;
7259 }
7260 if !wkt::internal::is_default(&self.validate_only) {
7261 state.serialize_entry("validateOnly", &self.validate_only)?;
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
7272impl std::fmt::Debug for UpdateAccountConnectorRequest {
7273 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7274 let mut debug_struct = f.debug_struct("UpdateAccountConnectorRequest");
7275 debug_struct.field("update_mask", &self.update_mask);
7276 debug_struct.field("account_connector", &self.account_connector);
7277 debug_struct.field("request_id", &self.request_id);
7278 debug_struct.field("allow_missing", &self.allow_missing);
7279 debug_struct.field("validate_only", &self.validate_only);
7280 if !self._unknown_fields.is_empty() {
7281 debug_struct.field("_unknown_fields", &self._unknown_fields);
7282 }
7283 debug_struct.finish()
7284 }
7285}
7286
7287#[derive(Clone, Default, PartialEq)]
7289#[non_exhaustive]
7290pub struct DeleteAccountConnectorRequest {
7291 pub name: std::string::String,
7293
7294 pub request_id: std::string::String,
7308
7309 pub validate_only: bool,
7311
7312 pub etag: std::string::String,
7317
7318 pub force: bool,
7322
7323 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7324}
7325
7326impl DeleteAccountConnectorRequest {
7327 pub fn new() -> Self {
7328 std::default::Default::default()
7329 }
7330
7331 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7333 self.name = v.into();
7334 self
7335 }
7336
7337 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7339 self.request_id = v.into();
7340 self
7341 }
7342
7343 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7345 self.validate_only = v.into();
7346 self
7347 }
7348
7349 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7351 self.etag = v.into();
7352 self
7353 }
7354
7355 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7357 self.force = v.into();
7358 self
7359 }
7360}
7361
7362impl wkt::message::Message for DeleteAccountConnectorRequest {
7363 fn typename() -> &'static str {
7364 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteAccountConnectorRequest"
7365 }
7366}
7367
7368#[doc(hidden)]
7369impl<'de> serde::de::Deserialize<'de> for DeleteAccountConnectorRequest {
7370 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7371 where
7372 D: serde::Deserializer<'de>,
7373 {
7374 #[allow(non_camel_case_types)]
7375 #[doc(hidden)]
7376 #[derive(PartialEq, Eq, Hash)]
7377 enum __FieldTag {
7378 __name,
7379 __request_id,
7380 __validate_only,
7381 __etag,
7382 __force,
7383 Unknown(std::string::String),
7384 }
7385 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7386 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7387 where
7388 D: serde::Deserializer<'de>,
7389 {
7390 struct Visitor;
7391 impl<'de> serde::de::Visitor<'de> for Visitor {
7392 type Value = __FieldTag;
7393 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7394 formatter.write_str("a field name for DeleteAccountConnectorRequest")
7395 }
7396 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7397 where
7398 E: serde::de::Error,
7399 {
7400 use std::result::Result::Ok;
7401 use std::string::ToString;
7402 match value {
7403 "name" => Ok(__FieldTag::__name),
7404 "requestId" => Ok(__FieldTag::__request_id),
7405 "request_id" => Ok(__FieldTag::__request_id),
7406 "validateOnly" => Ok(__FieldTag::__validate_only),
7407 "validate_only" => Ok(__FieldTag::__validate_only),
7408 "etag" => Ok(__FieldTag::__etag),
7409 "force" => Ok(__FieldTag::__force),
7410 _ => Ok(__FieldTag::Unknown(value.to_string())),
7411 }
7412 }
7413 }
7414 deserializer.deserialize_identifier(Visitor)
7415 }
7416 }
7417 struct Visitor;
7418 impl<'de> serde::de::Visitor<'de> for Visitor {
7419 type Value = DeleteAccountConnectorRequest;
7420 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7421 formatter.write_str("struct DeleteAccountConnectorRequest")
7422 }
7423 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7424 where
7425 A: serde::de::MapAccess<'de>,
7426 {
7427 #[allow(unused_imports)]
7428 use serde::de::Error;
7429 use std::option::Option::Some;
7430 let mut fields = std::collections::HashSet::new();
7431 let mut result = Self::Value::new();
7432 while let Some(tag) = map.next_key::<__FieldTag>()? {
7433 #[allow(clippy::match_single_binding)]
7434 match tag {
7435 __FieldTag::__name => {
7436 if !fields.insert(__FieldTag::__name) {
7437 return std::result::Result::Err(A::Error::duplicate_field(
7438 "multiple values for name",
7439 ));
7440 }
7441 result.name = map
7442 .next_value::<std::option::Option<std::string::String>>()?
7443 .unwrap_or_default();
7444 }
7445 __FieldTag::__request_id => {
7446 if !fields.insert(__FieldTag::__request_id) {
7447 return std::result::Result::Err(A::Error::duplicate_field(
7448 "multiple values for request_id",
7449 ));
7450 }
7451 result.request_id = map
7452 .next_value::<std::option::Option<std::string::String>>()?
7453 .unwrap_or_default();
7454 }
7455 __FieldTag::__validate_only => {
7456 if !fields.insert(__FieldTag::__validate_only) {
7457 return std::result::Result::Err(A::Error::duplicate_field(
7458 "multiple values for validate_only",
7459 ));
7460 }
7461 result.validate_only = map
7462 .next_value::<std::option::Option<bool>>()?
7463 .unwrap_or_default();
7464 }
7465 __FieldTag::__etag => {
7466 if !fields.insert(__FieldTag::__etag) {
7467 return std::result::Result::Err(A::Error::duplicate_field(
7468 "multiple values for etag",
7469 ));
7470 }
7471 result.etag = map
7472 .next_value::<std::option::Option<std::string::String>>()?
7473 .unwrap_or_default();
7474 }
7475 __FieldTag::__force => {
7476 if !fields.insert(__FieldTag::__force) {
7477 return std::result::Result::Err(A::Error::duplicate_field(
7478 "multiple values for force",
7479 ));
7480 }
7481 result.force = map
7482 .next_value::<std::option::Option<bool>>()?
7483 .unwrap_or_default();
7484 }
7485 __FieldTag::Unknown(key) => {
7486 let value = map.next_value::<serde_json::Value>()?;
7487 result._unknown_fields.insert(key, value);
7488 }
7489 }
7490 }
7491 std::result::Result::Ok(result)
7492 }
7493 }
7494 deserializer.deserialize_any(Visitor)
7495 }
7496}
7497
7498#[doc(hidden)]
7499impl serde::ser::Serialize for DeleteAccountConnectorRequest {
7500 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7501 where
7502 S: serde::ser::Serializer,
7503 {
7504 use serde::ser::SerializeMap;
7505 #[allow(unused_imports)]
7506 use std::option::Option::Some;
7507 let mut state = serializer.serialize_map(std::option::Option::None)?;
7508 if !self.name.is_empty() {
7509 state.serialize_entry("name", &self.name)?;
7510 }
7511 if !self.request_id.is_empty() {
7512 state.serialize_entry("requestId", &self.request_id)?;
7513 }
7514 if !wkt::internal::is_default(&self.validate_only) {
7515 state.serialize_entry("validateOnly", &self.validate_only)?;
7516 }
7517 if !self.etag.is_empty() {
7518 state.serialize_entry("etag", &self.etag)?;
7519 }
7520 if !wkt::internal::is_default(&self.force) {
7521 state.serialize_entry("force", &self.force)?;
7522 }
7523 if !self._unknown_fields.is_empty() {
7524 for (key, value) in self._unknown_fields.iter() {
7525 state.serialize_entry(key, &value)?;
7526 }
7527 }
7528 state.end()
7529 }
7530}
7531
7532impl std::fmt::Debug for DeleteAccountConnectorRequest {
7533 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7534 let mut debug_struct = f.debug_struct("DeleteAccountConnectorRequest");
7535 debug_struct.field("name", &self.name);
7536 debug_struct.field("request_id", &self.request_id);
7537 debug_struct.field("validate_only", &self.validate_only);
7538 debug_struct.field("etag", &self.etag);
7539 debug_struct.field("force", &self.force);
7540 if !self._unknown_fields.is_empty() {
7541 debug_struct.field("_unknown_fields", &self._unknown_fields);
7542 }
7543 debug_struct.finish()
7544 }
7545}
7546
7547#[derive(Clone, Default, PartialEq)]
7549#[non_exhaustive]
7550pub struct DeleteUserRequest {
7551 pub name: std::string::String,
7553
7554 pub request_id: std::string::String,
7568
7569 pub validate_only: bool,
7571
7572 pub etag: std::string::String,
7576
7577 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7578}
7579
7580impl DeleteUserRequest {
7581 pub fn new() -> Self {
7582 std::default::Default::default()
7583 }
7584
7585 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7587 self.name = v.into();
7588 self
7589 }
7590
7591 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7593 self.request_id = v.into();
7594 self
7595 }
7596
7597 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7599 self.validate_only = v.into();
7600 self
7601 }
7602
7603 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7605 self.etag = v.into();
7606 self
7607 }
7608}
7609
7610impl wkt::message::Message for DeleteUserRequest {
7611 fn typename() -> &'static str {
7612 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteUserRequest"
7613 }
7614}
7615
7616#[doc(hidden)]
7617impl<'de> serde::de::Deserialize<'de> for DeleteUserRequest {
7618 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7619 where
7620 D: serde::Deserializer<'de>,
7621 {
7622 #[allow(non_camel_case_types)]
7623 #[doc(hidden)]
7624 #[derive(PartialEq, Eq, Hash)]
7625 enum __FieldTag {
7626 __name,
7627 __request_id,
7628 __validate_only,
7629 __etag,
7630 Unknown(std::string::String),
7631 }
7632 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7633 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7634 where
7635 D: serde::Deserializer<'de>,
7636 {
7637 struct Visitor;
7638 impl<'de> serde::de::Visitor<'de> for Visitor {
7639 type Value = __FieldTag;
7640 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7641 formatter.write_str("a field name for DeleteUserRequest")
7642 }
7643 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7644 where
7645 E: serde::de::Error,
7646 {
7647 use std::result::Result::Ok;
7648 use std::string::ToString;
7649 match value {
7650 "name" => Ok(__FieldTag::__name),
7651 "requestId" => Ok(__FieldTag::__request_id),
7652 "request_id" => Ok(__FieldTag::__request_id),
7653 "validateOnly" => Ok(__FieldTag::__validate_only),
7654 "validate_only" => Ok(__FieldTag::__validate_only),
7655 "etag" => Ok(__FieldTag::__etag),
7656 _ => Ok(__FieldTag::Unknown(value.to_string())),
7657 }
7658 }
7659 }
7660 deserializer.deserialize_identifier(Visitor)
7661 }
7662 }
7663 struct Visitor;
7664 impl<'de> serde::de::Visitor<'de> for Visitor {
7665 type Value = DeleteUserRequest;
7666 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7667 formatter.write_str("struct DeleteUserRequest")
7668 }
7669 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7670 where
7671 A: serde::de::MapAccess<'de>,
7672 {
7673 #[allow(unused_imports)]
7674 use serde::de::Error;
7675 use std::option::Option::Some;
7676 let mut fields = std::collections::HashSet::new();
7677 let mut result = Self::Value::new();
7678 while let Some(tag) = map.next_key::<__FieldTag>()? {
7679 #[allow(clippy::match_single_binding)]
7680 match tag {
7681 __FieldTag::__name => {
7682 if !fields.insert(__FieldTag::__name) {
7683 return std::result::Result::Err(A::Error::duplicate_field(
7684 "multiple values for name",
7685 ));
7686 }
7687 result.name = map
7688 .next_value::<std::option::Option<std::string::String>>()?
7689 .unwrap_or_default();
7690 }
7691 __FieldTag::__request_id => {
7692 if !fields.insert(__FieldTag::__request_id) {
7693 return std::result::Result::Err(A::Error::duplicate_field(
7694 "multiple values for request_id",
7695 ));
7696 }
7697 result.request_id = map
7698 .next_value::<std::option::Option<std::string::String>>()?
7699 .unwrap_or_default();
7700 }
7701 __FieldTag::__validate_only => {
7702 if !fields.insert(__FieldTag::__validate_only) {
7703 return std::result::Result::Err(A::Error::duplicate_field(
7704 "multiple values for validate_only",
7705 ));
7706 }
7707 result.validate_only = map
7708 .next_value::<std::option::Option<bool>>()?
7709 .unwrap_or_default();
7710 }
7711 __FieldTag::__etag => {
7712 if !fields.insert(__FieldTag::__etag) {
7713 return std::result::Result::Err(A::Error::duplicate_field(
7714 "multiple values for etag",
7715 ));
7716 }
7717 result.etag = map
7718 .next_value::<std::option::Option<std::string::String>>()?
7719 .unwrap_or_default();
7720 }
7721 __FieldTag::Unknown(key) => {
7722 let value = map.next_value::<serde_json::Value>()?;
7723 result._unknown_fields.insert(key, value);
7724 }
7725 }
7726 }
7727 std::result::Result::Ok(result)
7728 }
7729 }
7730 deserializer.deserialize_any(Visitor)
7731 }
7732}
7733
7734#[doc(hidden)]
7735impl serde::ser::Serialize for DeleteUserRequest {
7736 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7737 where
7738 S: serde::ser::Serializer,
7739 {
7740 use serde::ser::SerializeMap;
7741 #[allow(unused_imports)]
7742 use std::option::Option::Some;
7743 let mut state = serializer.serialize_map(std::option::Option::None)?;
7744 if !self.name.is_empty() {
7745 state.serialize_entry("name", &self.name)?;
7746 }
7747 if !self.request_id.is_empty() {
7748 state.serialize_entry("requestId", &self.request_id)?;
7749 }
7750 if !wkt::internal::is_default(&self.validate_only) {
7751 state.serialize_entry("validateOnly", &self.validate_only)?;
7752 }
7753 if !self.etag.is_empty() {
7754 state.serialize_entry("etag", &self.etag)?;
7755 }
7756 if !self._unknown_fields.is_empty() {
7757 for (key, value) in self._unknown_fields.iter() {
7758 state.serialize_entry(key, &value)?;
7759 }
7760 }
7761 state.end()
7762 }
7763}
7764
7765impl std::fmt::Debug for DeleteUserRequest {
7766 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7767 let mut debug_struct = f.debug_struct("DeleteUserRequest");
7768 debug_struct.field("name", &self.name);
7769 debug_struct.field("request_id", &self.request_id);
7770 debug_struct.field("validate_only", &self.validate_only);
7771 debug_struct.field("etag", &self.etag);
7772 if !self._unknown_fields.is_empty() {
7773 debug_struct.field("_unknown_fields", &self._unknown_fields);
7774 }
7775 debug_struct.finish()
7776 }
7777}
7778
7779#[derive(Clone, Default, PartialEq)]
7781#[non_exhaustive]
7782pub struct OperationMetadata {
7783 pub create_time: std::option::Option<wkt::Timestamp>,
7785
7786 pub end_time: std::option::Option<wkt::Timestamp>,
7788
7789 pub target: std::string::String,
7791
7792 pub verb: std::string::String,
7794
7795 pub status_message: std::string::String,
7797
7798 pub requested_cancellation: bool,
7808
7809 pub api_version: std::string::String,
7811
7812 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7813}
7814
7815impl OperationMetadata {
7816 pub fn new() -> Self {
7817 std::default::Default::default()
7818 }
7819
7820 pub fn set_create_time<T>(mut self, v: T) -> Self
7822 where
7823 T: std::convert::Into<wkt::Timestamp>,
7824 {
7825 self.create_time = std::option::Option::Some(v.into());
7826 self
7827 }
7828
7829 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7831 where
7832 T: std::convert::Into<wkt::Timestamp>,
7833 {
7834 self.create_time = v.map(|x| x.into());
7835 self
7836 }
7837
7838 pub fn set_end_time<T>(mut self, v: T) -> Self
7840 where
7841 T: std::convert::Into<wkt::Timestamp>,
7842 {
7843 self.end_time = std::option::Option::Some(v.into());
7844 self
7845 }
7846
7847 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7849 where
7850 T: std::convert::Into<wkt::Timestamp>,
7851 {
7852 self.end_time = v.map(|x| x.into());
7853 self
7854 }
7855
7856 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7858 self.target = v.into();
7859 self
7860 }
7861
7862 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7864 self.verb = v.into();
7865 self
7866 }
7867
7868 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7870 self.status_message = v.into();
7871 self
7872 }
7873
7874 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7876 self.requested_cancellation = v.into();
7877 self
7878 }
7879
7880 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7882 self.api_version = v.into();
7883 self
7884 }
7885}
7886
7887impl wkt::message::Message for OperationMetadata {
7888 fn typename() -> &'static str {
7889 "type.googleapis.com/google.cloud.developerconnect.v1.OperationMetadata"
7890 }
7891}
7892
7893#[doc(hidden)]
7894impl<'de> serde::de::Deserialize<'de> for OperationMetadata {
7895 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7896 where
7897 D: serde::Deserializer<'de>,
7898 {
7899 #[allow(non_camel_case_types)]
7900 #[doc(hidden)]
7901 #[derive(PartialEq, Eq, Hash)]
7902 enum __FieldTag {
7903 __create_time,
7904 __end_time,
7905 __target,
7906 __verb,
7907 __status_message,
7908 __requested_cancellation,
7909 __api_version,
7910 Unknown(std::string::String),
7911 }
7912 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7913 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7914 where
7915 D: serde::Deserializer<'de>,
7916 {
7917 struct Visitor;
7918 impl<'de> serde::de::Visitor<'de> for Visitor {
7919 type Value = __FieldTag;
7920 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7921 formatter.write_str("a field name for OperationMetadata")
7922 }
7923 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7924 where
7925 E: serde::de::Error,
7926 {
7927 use std::result::Result::Ok;
7928 use std::string::ToString;
7929 match value {
7930 "createTime" => Ok(__FieldTag::__create_time),
7931 "create_time" => Ok(__FieldTag::__create_time),
7932 "endTime" => Ok(__FieldTag::__end_time),
7933 "end_time" => Ok(__FieldTag::__end_time),
7934 "target" => Ok(__FieldTag::__target),
7935 "verb" => Ok(__FieldTag::__verb),
7936 "statusMessage" => Ok(__FieldTag::__status_message),
7937 "status_message" => Ok(__FieldTag::__status_message),
7938 "requestedCancellation" => Ok(__FieldTag::__requested_cancellation),
7939 "requested_cancellation" => Ok(__FieldTag::__requested_cancellation),
7940 "apiVersion" => Ok(__FieldTag::__api_version),
7941 "api_version" => Ok(__FieldTag::__api_version),
7942 _ => Ok(__FieldTag::Unknown(value.to_string())),
7943 }
7944 }
7945 }
7946 deserializer.deserialize_identifier(Visitor)
7947 }
7948 }
7949 struct Visitor;
7950 impl<'de> serde::de::Visitor<'de> for Visitor {
7951 type Value = OperationMetadata;
7952 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7953 formatter.write_str("struct OperationMetadata")
7954 }
7955 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7956 where
7957 A: serde::de::MapAccess<'de>,
7958 {
7959 #[allow(unused_imports)]
7960 use serde::de::Error;
7961 use std::option::Option::Some;
7962 let mut fields = std::collections::HashSet::new();
7963 let mut result = Self::Value::new();
7964 while let Some(tag) = map.next_key::<__FieldTag>()? {
7965 #[allow(clippy::match_single_binding)]
7966 match tag {
7967 __FieldTag::__create_time => {
7968 if !fields.insert(__FieldTag::__create_time) {
7969 return std::result::Result::Err(A::Error::duplicate_field(
7970 "multiple values for create_time",
7971 ));
7972 }
7973 result.create_time =
7974 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
7975 }
7976 __FieldTag::__end_time => {
7977 if !fields.insert(__FieldTag::__end_time) {
7978 return std::result::Result::Err(A::Error::duplicate_field(
7979 "multiple values for end_time",
7980 ));
7981 }
7982 result.end_time =
7983 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
7984 }
7985 __FieldTag::__target => {
7986 if !fields.insert(__FieldTag::__target) {
7987 return std::result::Result::Err(A::Error::duplicate_field(
7988 "multiple values for target",
7989 ));
7990 }
7991 result.target = map
7992 .next_value::<std::option::Option<std::string::String>>()?
7993 .unwrap_or_default();
7994 }
7995 __FieldTag::__verb => {
7996 if !fields.insert(__FieldTag::__verb) {
7997 return std::result::Result::Err(A::Error::duplicate_field(
7998 "multiple values for verb",
7999 ));
8000 }
8001 result.verb = map
8002 .next_value::<std::option::Option<std::string::String>>()?
8003 .unwrap_or_default();
8004 }
8005 __FieldTag::__status_message => {
8006 if !fields.insert(__FieldTag::__status_message) {
8007 return std::result::Result::Err(A::Error::duplicate_field(
8008 "multiple values for status_message",
8009 ));
8010 }
8011 result.status_message = map
8012 .next_value::<std::option::Option<std::string::String>>()?
8013 .unwrap_or_default();
8014 }
8015 __FieldTag::__requested_cancellation => {
8016 if !fields.insert(__FieldTag::__requested_cancellation) {
8017 return std::result::Result::Err(A::Error::duplicate_field(
8018 "multiple values for requested_cancellation",
8019 ));
8020 }
8021 result.requested_cancellation = map
8022 .next_value::<std::option::Option<bool>>()?
8023 .unwrap_or_default();
8024 }
8025 __FieldTag::__api_version => {
8026 if !fields.insert(__FieldTag::__api_version) {
8027 return std::result::Result::Err(A::Error::duplicate_field(
8028 "multiple values for api_version",
8029 ));
8030 }
8031 result.api_version = map
8032 .next_value::<std::option::Option<std::string::String>>()?
8033 .unwrap_or_default();
8034 }
8035 __FieldTag::Unknown(key) => {
8036 let value = map.next_value::<serde_json::Value>()?;
8037 result._unknown_fields.insert(key, value);
8038 }
8039 }
8040 }
8041 std::result::Result::Ok(result)
8042 }
8043 }
8044 deserializer.deserialize_any(Visitor)
8045 }
8046}
8047
8048#[doc(hidden)]
8049impl serde::ser::Serialize for OperationMetadata {
8050 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8051 where
8052 S: serde::ser::Serializer,
8053 {
8054 use serde::ser::SerializeMap;
8055 #[allow(unused_imports)]
8056 use std::option::Option::Some;
8057 let mut state = serializer.serialize_map(std::option::Option::None)?;
8058 if self.create_time.is_some() {
8059 state.serialize_entry("createTime", &self.create_time)?;
8060 }
8061 if self.end_time.is_some() {
8062 state.serialize_entry("endTime", &self.end_time)?;
8063 }
8064 if !self.target.is_empty() {
8065 state.serialize_entry("target", &self.target)?;
8066 }
8067 if !self.verb.is_empty() {
8068 state.serialize_entry("verb", &self.verb)?;
8069 }
8070 if !self.status_message.is_empty() {
8071 state.serialize_entry("statusMessage", &self.status_message)?;
8072 }
8073 if !wkt::internal::is_default(&self.requested_cancellation) {
8074 state.serialize_entry("requestedCancellation", &self.requested_cancellation)?;
8075 }
8076 if !self.api_version.is_empty() {
8077 state.serialize_entry("apiVersion", &self.api_version)?;
8078 }
8079 if !self._unknown_fields.is_empty() {
8080 for (key, value) in self._unknown_fields.iter() {
8081 state.serialize_entry(key, &value)?;
8082 }
8083 }
8084 state.end()
8085 }
8086}
8087
8088impl std::fmt::Debug for OperationMetadata {
8089 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8090 let mut debug_struct = f.debug_struct("OperationMetadata");
8091 debug_struct.field("create_time", &self.create_time);
8092 debug_struct.field("end_time", &self.end_time);
8093 debug_struct.field("target", &self.target);
8094 debug_struct.field("verb", &self.verb);
8095 debug_struct.field("status_message", &self.status_message);
8096 debug_struct.field("requested_cancellation", &self.requested_cancellation);
8097 debug_struct.field("api_version", &self.api_version);
8098 if !self._unknown_fields.is_empty() {
8099 debug_struct.field("_unknown_fields", &self._unknown_fields);
8100 }
8101 debug_struct.finish()
8102 }
8103}
8104
8105#[derive(Clone, Default, PartialEq)]
8107#[non_exhaustive]
8108pub struct FetchSelfRequest {
8109 pub name: std::string::String,
8111
8112 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8113}
8114
8115impl FetchSelfRequest {
8116 pub fn new() -> Self {
8117 std::default::Default::default()
8118 }
8119
8120 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8122 self.name = v.into();
8123 self
8124 }
8125}
8126
8127impl wkt::message::Message for FetchSelfRequest {
8128 fn typename() -> &'static str {
8129 "type.googleapis.com/google.cloud.developerconnect.v1.FetchSelfRequest"
8130 }
8131}
8132
8133#[doc(hidden)]
8134impl<'de> serde::de::Deserialize<'de> for FetchSelfRequest {
8135 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8136 where
8137 D: serde::Deserializer<'de>,
8138 {
8139 #[allow(non_camel_case_types)]
8140 #[doc(hidden)]
8141 #[derive(PartialEq, Eq, Hash)]
8142 enum __FieldTag {
8143 __name,
8144 Unknown(std::string::String),
8145 }
8146 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8147 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8148 where
8149 D: serde::Deserializer<'de>,
8150 {
8151 struct Visitor;
8152 impl<'de> serde::de::Visitor<'de> for Visitor {
8153 type Value = __FieldTag;
8154 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8155 formatter.write_str("a field name for FetchSelfRequest")
8156 }
8157 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8158 where
8159 E: serde::de::Error,
8160 {
8161 use std::result::Result::Ok;
8162 use std::string::ToString;
8163 match value {
8164 "name" => Ok(__FieldTag::__name),
8165 _ => Ok(__FieldTag::Unknown(value.to_string())),
8166 }
8167 }
8168 }
8169 deserializer.deserialize_identifier(Visitor)
8170 }
8171 }
8172 struct Visitor;
8173 impl<'de> serde::de::Visitor<'de> for Visitor {
8174 type Value = FetchSelfRequest;
8175 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8176 formatter.write_str("struct FetchSelfRequest")
8177 }
8178 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8179 where
8180 A: serde::de::MapAccess<'de>,
8181 {
8182 #[allow(unused_imports)]
8183 use serde::de::Error;
8184 use std::option::Option::Some;
8185 let mut fields = std::collections::HashSet::new();
8186 let mut result = Self::Value::new();
8187 while let Some(tag) = map.next_key::<__FieldTag>()? {
8188 #[allow(clippy::match_single_binding)]
8189 match tag {
8190 __FieldTag::__name => {
8191 if !fields.insert(__FieldTag::__name) {
8192 return std::result::Result::Err(A::Error::duplicate_field(
8193 "multiple values for name",
8194 ));
8195 }
8196 result.name = map
8197 .next_value::<std::option::Option<std::string::String>>()?
8198 .unwrap_or_default();
8199 }
8200 __FieldTag::Unknown(key) => {
8201 let value = map.next_value::<serde_json::Value>()?;
8202 result._unknown_fields.insert(key, value);
8203 }
8204 }
8205 }
8206 std::result::Result::Ok(result)
8207 }
8208 }
8209 deserializer.deserialize_any(Visitor)
8210 }
8211}
8212
8213#[doc(hidden)]
8214impl serde::ser::Serialize for FetchSelfRequest {
8215 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8216 where
8217 S: serde::ser::Serializer,
8218 {
8219 use serde::ser::SerializeMap;
8220 #[allow(unused_imports)]
8221 use std::option::Option::Some;
8222 let mut state = serializer.serialize_map(std::option::Option::None)?;
8223 if !self.name.is_empty() {
8224 state.serialize_entry("name", &self.name)?;
8225 }
8226 if !self._unknown_fields.is_empty() {
8227 for (key, value) in self._unknown_fields.iter() {
8228 state.serialize_entry(key, &value)?;
8229 }
8230 }
8231 state.end()
8232 }
8233}
8234
8235impl std::fmt::Debug for FetchSelfRequest {
8236 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8237 let mut debug_struct = f.debug_struct("FetchSelfRequest");
8238 debug_struct.field("name", &self.name);
8239 if !self._unknown_fields.is_empty() {
8240 debug_struct.field("_unknown_fields", &self._unknown_fields);
8241 }
8242 debug_struct.finish()
8243 }
8244}
8245
8246#[derive(Clone, Default, PartialEq)]
8248#[non_exhaustive]
8249pub struct DeleteSelfRequest {
8250 pub name: std::string::String,
8252
8253 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8254}
8255
8256impl DeleteSelfRequest {
8257 pub fn new() -> Self {
8258 std::default::Default::default()
8259 }
8260
8261 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8263 self.name = v.into();
8264 self
8265 }
8266}
8267
8268impl wkt::message::Message for DeleteSelfRequest {
8269 fn typename() -> &'static str {
8270 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteSelfRequest"
8271 }
8272}
8273
8274#[doc(hidden)]
8275impl<'de> serde::de::Deserialize<'de> for DeleteSelfRequest {
8276 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8277 where
8278 D: serde::Deserializer<'de>,
8279 {
8280 #[allow(non_camel_case_types)]
8281 #[doc(hidden)]
8282 #[derive(PartialEq, Eq, Hash)]
8283 enum __FieldTag {
8284 __name,
8285 Unknown(std::string::String),
8286 }
8287 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8288 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8289 where
8290 D: serde::Deserializer<'de>,
8291 {
8292 struct Visitor;
8293 impl<'de> serde::de::Visitor<'de> for Visitor {
8294 type Value = __FieldTag;
8295 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8296 formatter.write_str("a field name for DeleteSelfRequest")
8297 }
8298 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8299 where
8300 E: serde::de::Error,
8301 {
8302 use std::result::Result::Ok;
8303 use std::string::ToString;
8304 match value {
8305 "name" => Ok(__FieldTag::__name),
8306 _ => Ok(__FieldTag::Unknown(value.to_string())),
8307 }
8308 }
8309 }
8310 deserializer.deserialize_identifier(Visitor)
8311 }
8312 }
8313 struct Visitor;
8314 impl<'de> serde::de::Visitor<'de> for Visitor {
8315 type Value = DeleteSelfRequest;
8316 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8317 formatter.write_str("struct DeleteSelfRequest")
8318 }
8319 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8320 where
8321 A: serde::de::MapAccess<'de>,
8322 {
8323 #[allow(unused_imports)]
8324 use serde::de::Error;
8325 use std::option::Option::Some;
8326 let mut fields = std::collections::HashSet::new();
8327 let mut result = Self::Value::new();
8328 while let Some(tag) = map.next_key::<__FieldTag>()? {
8329 #[allow(clippy::match_single_binding)]
8330 match tag {
8331 __FieldTag::__name => {
8332 if !fields.insert(__FieldTag::__name) {
8333 return std::result::Result::Err(A::Error::duplicate_field(
8334 "multiple values for name",
8335 ));
8336 }
8337 result.name = map
8338 .next_value::<std::option::Option<std::string::String>>()?
8339 .unwrap_or_default();
8340 }
8341 __FieldTag::Unknown(key) => {
8342 let value = map.next_value::<serde_json::Value>()?;
8343 result._unknown_fields.insert(key, value);
8344 }
8345 }
8346 }
8347 std::result::Result::Ok(result)
8348 }
8349 }
8350 deserializer.deserialize_any(Visitor)
8351 }
8352}
8353
8354#[doc(hidden)]
8355impl serde::ser::Serialize for DeleteSelfRequest {
8356 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8357 where
8358 S: serde::ser::Serializer,
8359 {
8360 use serde::ser::SerializeMap;
8361 #[allow(unused_imports)]
8362 use std::option::Option::Some;
8363 let mut state = serializer.serialize_map(std::option::Option::None)?;
8364 if !self.name.is_empty() {
8365 state.serialize_entry("name", &self.name)?;
8366 }
8367 if !self._unknown_fields.is_empty() {
8368 for (key, value) in self._unknown_fields.iter() {
8369 state.serialize_entry(key, &value)?;
8370 }
8371 }
8372 state.end()
8373 }
8374}
8375
8376impl std::fmt::Debug for DeleteSelfRequest {
8377 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8378 let mut debug_struct = f.debug_struct("DeleteSelfRequest");
8379 debug_struct.field("name", &self.name);
8380 if !self._unknown_fields.is_empty() {
8381 debug_struct.field("_unknown_fields", &self._unknown_fields);
8382 }
8383 debug_struct.finish()
8384 }
8385}
8386
8387#[derive(Clone, Default, PartialEq)]
8389#[non_exhaustive]
8390pub struct FetchAccessTokenRequest {
8391 pub account_connector: std::string::String,
8394
8395 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8396}
8397
8398impl FetchAccessTokenRequest {
8399 pub fn new() -> Self {
8400 std::default::Default::default()
8401 }
8402
8403 pub fn set_account_connector<T: std::convert::Into<std::string::String>>(
8405 mut self,
8406 v: T,
8407 ) -> Self {
8408 self.account_connector = v.into();
8409 self
8410 }
8411}
8412
8413impl wkt::message::Message for FetchAccessTokenRequest {
8414 fn typename() -> &'static str {
8415 "type.googleapis.com/google.cloud.developerconnect.v1.FetchAccessTokenRequest"
8416 }
8417}
8418
8419#[doc(hidden)]
8420impl<'de> serde::de::Deserialize<'de> for FetchAccessTokenRequest {
8421 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8422 where
8423 D: serde::Deserializer<'de>,
8424 {
8425 #[allow(non_camel_case_types)]
8426 #[doc(hidden)]
8427 #[derive(PartialEq, Eq, Hash)]
8428 enum __FieldTag {
8429 __account_connector,
8430 Unknown(std::string::String),
8431 }
8432 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8433 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8434 where
8435 D: serde::Deserializer<'de>,
8436 {
8437 struct Visitor;
8438 impl<'de> serde::de::Visitor<'de> for Visitor {
8439 type Value = __FieldTag;
8440 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8441 formatter.write_str("a field name for FetchAccessTokenRequest")
8442 }
8443 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8444 where
8445 E: serde::de::Error,
8446 {
8447 use std::result::Result::Ok;
8448 use std::string::ToString;
8449 match value {
8450 "accountConnector" => Ok(__FieldTag::__account_connector),
8451 "account_connector" => Ok(__FieldTag::__account_connector),
8452 _ => Ok(__FieldTag::Unknown(value.to_string())),
8453 }
8454 }
8455 }
8456 deserializer.deserialize_identifier(Visitor)
8457 }
8458 }
8459 struct Visitor;
8460 impl<'de> serde::de::Visitor<'de> for Visitor {
8461 type Value = FetchAccessTokenRequest;
8462 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8463 formatter.write_str("struct FetchAccessTokenRequest")
8464 }
8465 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8466 where
8467 A: serde::de::MapAccess<'de>,
8468 {
8469 #[allow(unused_imports)]
8470 use serde::de::Error;
8471 use std::option::Option::Some;
8472 let mut fields = std::collections::HashSet::new();
8473 let mut result = Self::Value::new();
8474 while let Some(tag) = map.next_key::<__FieldTag>()? {
8475 #[allow(clippy::match_single_binding)]
8476 match tag {
8477 __FieldTag::__account_connector => {
8478 if !fields.insert(__FieldTag::__account_connector) {
8479 return std::result::Result::Err(A::Error::duplicate_field(
8480 "multiple values for account_connector",
8481 ));
8482 }
8483 result.account_connector = map
8484 .next_value::<std::option::Option<std::string::String>>()?
8485 .unwrap_or_default();
8486 }
8487 __FieldTag::Unknown(key) => {
8488 let value = map.next_value::<serde_json::Value>()?;
8489 result._unknown_fields.insert(key, value);
8490 }
8491 }
8492 }
8493 std::result::Result::Ok(result)
8494 }
8495 }
8496 deserializer.deserialize_any(Visitor)
8497 }
8498}
8499
8500#[doc(hidden)]
8501impl serde::ser::Serialize for FetchAccessTokenRequest {
8502 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8503 where
8504 S: serde::ser::Serializer,
8505 {
8506 use serde::ser::SerializeMap;
8507 #[allow(unused_imports)]
8508 use std::option::Option::Some;
8509 let mut state = serializer.serialize_map(std::option::Option::None)?;
8510 if !self.account_connector.is_empty() {
8511 state.serialize_entry("accountConnector", &self.account_connector)?;
8512 }
8513 if !self._unknown_fields.is_empty() {
8514 for (key, value) in self._unknown_fields.iter() {
8515 state.serialize_entry(key, &value)?;
8516 }
8517 }
8518 state.end()
8519 }
8520}
8521
8522impl std::fmt::Debug for FetchAccessTokenRequest {
8523 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8524 let mut debug_struct = f.debug_struct("FetchAccessTokenRequest");
8525 debug_struct.field("account_connector", &self.account_connector);
8526 if !self._unknown_fields.is_empty() {
8527 debug_struct.field("_unknown_fields", &self._unknown_fields);
8528 }
8529 debug_struct.finish()
8530 }
8531}
8532
8533#[derive(Clone, Default, PartialEq)]
8535#[non_exhaustive]
8536pub struct FetchAccessTokenResponse {
8537 pub token: std::string::String,
8539
8540 pub expiration_time: std::option::Option<wkt::Timestamp>,
8542
8543 pub scopes: std::vec::Vec<std::string::String>,
8545
8546 pub exchange_error: std::option::Option<crate::model::ExchangeError>,
8548
8549 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8550}
8551
8552impl FetchAccessTokenResponse {
8553 pub fn new() -> Self {
8554 std::default::Default::default()
8555 }
8556
8557 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8559 self.token = v.into();
8560 self
8561 }
8562
8563 pub fn set_expiration_time<T>(mut self, v: T) -> Self
8565 where
8566 T: std::convert::Into<wkt::Timestamp>,
8567 {
8568 self.expiration_time = std::option::Option::Some(v.into());
8569 self
8570 }
8571
8572 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
8574 where
8575 T: std::convert::Into<wkt::Timestamp>,
8576 {
8577 self.expiration_time = v.map(|x| x.into());
8578 self
8579 }
8580
8581 pub fn set_scopes<T, V>(mut self, v: T) -> Self
8583 where
8584 T: std::iter::IntoIterator<Item = V>,
8585 V: std::convert::Into<std::string::String>,
8586 {
8587 use std::iter::Iterator;
8588 self.scopes = v.into_iter().map(|i| i.into()).collect();
8589 self
8590 }
8591
8592 pub fn set_exchange_error<T>(mut self, v: T) -> Self
8594 where
8595 T: std::convert::Into<crate::model::ExchangeError>,
8596 {
8597 self.exchange_error = std::option::Option::Some(v.into());
8598 self
8599 }
8600
8601 pub fn set_or_clear_exchange_error<T>(mut self, v: std::option::Option<T>) -> Self
8603 where
8604 T: std::convert::Into<crate::model::ExchangeError>,
8605 {
8606 self.exchange_error = v.map(|x| x.into());
8607 self
8608 }
8609}
8610
8611impl wkt::message::Message for FetchAccessTokenResponse {
8612 fn typename() -> &'static str {
8613 "type.googleapis.com/google.cloud.developerconnect.v1.FetchAccessTokenResponse"
8614 }
8615}
8616
8617#[doc(hidden)]
8618impl<'de> serde::de::Deserialize<'de> for FetchAccessTokenResponse {
8619 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8620 where
8621 D: serde::Deserializer<'de>,
8622 {
8623 #[allow(non_camel_case_types)]
8624 #[doc(hidden)]
8625 #[derive(PartialEq, Eq, Hash)]
8626 enum __FieldTag {
8627 __token,
8628 __expiration_time,
8629 __scopes,
8630 __exchange_error,
8631 Unknown(std::string::String),
8632 }
8633 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8634 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8635 where
8636 D: serde::Deserializer<'de>,
8637 {
8638 struct Visitor;
8639 impl<'de> serde::de::Visitor<'de> for Visitor {
8640 type Value = __FieldTag;
8641 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8642 formatter.write_str("a field name for FetchAccessTokenResponse")
8643 }
8644 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8645 where
8646 E: serde::de::Error,
8647 {
8648 use std::result::Result::Ok;
8649 use std::string::ToString;
8650 match value {
8651 "token" => Ok(__FieldTag::__token),
8652 "expirationTime" => Ok(__FieldTag::__expiration_time),
8653 "expiration_time" => Ok(__FieldTag::__expiration_time),
8654 "scopes" => Ok(__FieldTag::__scopes),
8655 "exchangeError" => Ok(__FieldTag::__exchange_error),
8656 "exchange_error" => Ok(__FieldTag::__exchange_error),
8657 _ => Ok(__FieldTag::Unknown(value.to_string())),
8658 }
8659 }
8660 }
8661 deserializer.deserialize_identifier(Visitor)
8662 }
8663 }
8664 struct Visitor;
8665 impl<'de> serde::de::Visitor<'de> for Visitor {
8666 type Value = FetchAccessTokenResponse;
8667 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8668 formatter.write_str("struct FetchAccessTokenResponse")
8669 }
8670 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8671 where
8672 A: serde::de::MapAccess<'de>,
8673 {
8674 #[allow(unused_imports)]
8675 use serde::de::Error;
8676 use std::option::Option::Some;
8677 let mut fields = std::collections::HashSet::new();
8678 let mut result = Self::Value::new();
8679 while let Some(tag) = map.next_key::<__FieldTag>()? {
8680 #[allow(clippy::match_single_binding)]
8681 match tag {
8682 __FieldTag::__token => {
8683 if !fields.insert(__FieldTag::__token) {
8684 return std::result::Result::Err(A::Error::duplicate_field(
8685 "multiple values for token",
8686 ));
8687 }
8688 result.token = map
8689 .next_value::<std::option::Option<std::string::String>>()?
8690 .unwrap_or_default();
8691 }
8692 __FieldTag::__expiration_time => {
8693 if !fields.insert(__FieldTag::__expiration_time) {
8694 return std::result::Result::Err(A::Error::duplicate_field(
8695 "multiple values for expiration_time",
8696 ));
8697 }
8698 result.expiration_time =
8699 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
8700 }
8701 __FieldTag::__scopes => {
8702 if !fields.insert(__FieldTag::__scopes) {
8703 return std::result::Result::Err(A::Error::duplicate_field(
8704 "multiple values for scopes",
8705 ));
8706 }
8707 result.scopes = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
8708 }
8709 __FieldTag::__exchange_error => {
8710 if !fields.insert(__FieldTag::__exchange_error) {
8711 return std::result::Result::Err(A::Error::duplicate_field(
8712 "multiple values for exchange_error",
8713 ));
8714 }
8715 result.exchange_error = map
8716 .next_value::<std::option::Option<crate::model::ExchangeError>>()?;
8717 }
8718 __FieldTag::Unknown(key) => {
8719 let value = map.next_value::<serde_json::Value>()?;
8720 result._unknown_fields.insert(key, value);
8721 }
8722 }
8723 }
8724 std::result::Result::Ok(result)
8725 }
8726 }
8727 deserializer.deserialize_any(Visitor)
8728 }
8729}
8730
8731#[doc(hidden)]
8732impl serde::ser::Serialize for FetchAccessTokenResponse {
8733 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8734 where
8735 S: serde::ser::Serializer,
8736 {
8737 use serde::ser::SerializeMap;
8738 #[allow(unused_imports)]
8739 use std::option::Option::Some;
8740 let mut state = serializer.serialize_map(std::option::Option::None)?;
8741 if !self.token.is_empty() {
8742 state.serialize_entry("token", &self.token)?;
8743 }
8744 if self.expiration_time.is_some() {
8745 state.serialize_entry("expirationTime", &self.expiration_time)?;
8746 }
8747 if !self.scopes.is_empty() {
8748 state.serialize_entry("scopes", &self.scopes)?;
8749 }
8750 if self.exchange_error.is_some() {
8751 state.serialize_entry("exchangeError", &self.exchange_error)?;
8752 }
8753 if !self._unknown_fields.is_empty() {
8754 for (key, value) in self._unknown_fields.iter() {
8755 state.serialize_entry(key, &value)?;
8756 }
8757 }
8758 state.end()
8759 }
8760}
8761
8762impl std::fmt::Debug for FetchAccessTokenResponse {
8763 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8764 let mut debug_struct = f.debug_struct("FetchAccessTokenResponse");
8765 debug_struct.field("token", &self.token);
8766 debug_struct.field("expiration_time", &self.expiration_time);
8767 debug_struct.field("scopes", &self.scopes);
8768 debug_struct.field("exchange_error", &self.exchange_error);
8769 if !self._unknown_fields.is_empty() {
8770 debug_struct.field("_unknown_fields", &self._unknown_fields);
8771 }
8772 debug_struct.finish()
8773 }
8774}
8775
8776#[derive(Clone, Default, PartialEq)]
8778#[non_exhaustive]
8779pub struct ExchangeError {
8780 pub code: std::string::String,
8782
8783 pub description: std::string::String,
8786
8787 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8788}
8789
8790impl ExchangeError {
8791 pub fn new() -> Self {
8792 std::default::Default::default()
8793 }
8794
8795 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8797 self.code = v.into();
8798 self
8799 }
8800
8801 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8803 self.description = v.into();
8804 self
8805 }
8806}
8807
8808impl wkt::message::Message for ExchangeError {
8809 fn typename() -> &'static str {
8810 "type.googleapis.com/google.cloud.developerconnect.v1.ExchangeError"
8811 }
8812}
8813
8814#[doc(hidden)]
8815impl<'de> serde::de::Deserialize<'de> for ExchangeError {
8816 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8817 where
8818 D: serde::Deserializer<'de>,
8819 {
8820 #[allow(non_camel_case_types)]
8821 #[doc(hidden)]
8822 #[derive(PartialEq, Eq, Hash)]
8823 enum __FieldTag {
8824 __code,
8825 __description,
8826 Unknown(std::string::String),
8827 }
8828 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8829 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8830 where
8831 D: serde::Deserializer<'de>,
8832 {
8833 struct Visitor;
8834 impl<'de> serde::de::Visitor<'de> for Visitor {
8835 type Value = __FieldTag;
8836 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8837 formatter.write_str("a field name for ExchangeError")
8838 }
8839 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8840 where
8841 E: serde::de::Error,
8842 {
8843 use std::result::Result::Ok;
8844 use std::string::ToString;
8845 match value {
8846 "code" => Ok(__FieldTag::__code),
8847 "description" => Ok(__FieldTag::__description),
8848 _ => Ok(__FieldTag::Unknown(value.to_string())),
8849 }
8850 }
8851 }
8852 deserializer.deserialize_identifier(Visitor)
8853 }
8854 }
8855 struct Visitor;
8856 impl<'de> serde::de::Visitor<'de> for Visitor {
8857 type Value = ExchangeError;
8858 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8859 formatter.write_str("struct ExchangeError")
8860 }
8861 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8862 where
8863 A: serde::de::MapAccess<'de>,
8864 {
8865 #[allow(unused_imports)]
8866 use serde::de::Error;
8867 use std::option::Option::Some;
8868 let mut fields = std::collections::HashSet::new();
8869 let mut result = Self::Value::new();
8870 while let Some(tag) = map.next_key::<__FieldTag>()? {
8871 #[allow(clippy::match_single_binding)]
8872 match tag {
8873 __FieldTag::__code => {
8874 if !fields.insert(__FieldTag::__code) {
8875 return std::result::Result::Err(A::Error::duplicate_field(
8876 "multiple values for code",
8877 ));
8878 }
8879 result.code = map
8880 .next_value::<std::option::Option<std::string::String>>()?
8881 .unwrap_or_default();
8882 }
8883 __FieldTag::__description => {
8884 if !fields.insert(__FieldTag::__description) {
8885 return std::result::Result::Err(A::Error::duplicate_field(
8886 "multiple values for description",
8887 ));
8888 }
8889 result.description = map
8890 .next_value::<std::option::Option<std::string::String>>()?
8891 .unwrap_or_default();
8892 }
8893 __FieldTag::Unknown(key) => {
8894 let value = map.next_value::<serde_json::Value>()?;
8895 result._unknown_fields.insert(key, value);
8896 }
8897 }
8898 }
8899 std::result::Result::Ok(result)
8900 }
8901 }
8902 deserializer.deserialize_any(Visitor)
8903 }
8904}
8905
8906#[doc(hidden)]
8907impl serde::ser::Serialize for ExchangeError {
8908 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8909 where
8910 S: serde::ser::Serializer,
8911 {
8912 use serde::ser::SerializeMap;
8913 #[allow(unused_imports)]
8914 use std::option::Option::Some;
8915 let mut state = serializer.serialize_map(std::option::Option::None)?;
8916 if !self.code.is_empty() {
8917 state.serialize_entry("code", &self.code)?;
8918 }
8919 if !self.description.is_empty() {
8920 state.serialize_entry("description", &self.description)?;
8921 }
8922 if !self._unknown_fields.is_empty() {
8923 for (key, value) in self._unknown_fields.iter() {
8924 state.serialize_entry(key, &value)?;
8925 }
8926 }
8927 state.end()
8928 }
8929}
8930
8931impl std::fmt::Debug for ExchangeError {
8932 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8933 let mut debug_struct = f.debug_struct("ExchangeError");
8934 debug_struct.field("code", &self.code);
8935 debug_struct.field("description", &self.description);
8936 if !self._unknown_fields.is_empty() {
8937 debug_struct.field("_unknown_fields", &self._unknown_fields);
8938 }
8939 debug_struct.finish()
8940 }
8941}
8942
8943#[derive(Clone, Default, PartialEq)]
8945#[non_exhaustive]
8946pub struct GitRepositoryLink {
8947 pub name: std::string::String,
8950
8951 pub clone_uri: std::string::String,
8953
8954 pub create_time: std::option::Option<wkt::Timestamp>,
8956
8957 pub update_time: std::option::Option<wkt::Timestamp>,
8959
8960 pub delete_time: std::option::Option<wkt::Timestamp>,
8962
8963 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8965
8966 pub etag: std::string::String,
8970
8971 pub reconciling: bool,
8974
8975 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
8977
8978 pub uid: std::string::String,
8980
8981 pub webhook_id: std::string::String,
8983
8984 pub git_proxy_uri: std::string::String,
8988
8989 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8990}
8991
8992impl GitRepositoryLink {
8993 pub fn new() -> Self {
8994 std::default::Default::default()
8995 }
8996
8997 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8999 self.name = v.into();
9000 self
9001 }
9002
9003 pub fn set_clone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9005 self.clone_uri = v.into();
9006 self
9007 }
9008
9009 pub fn set_create_time<T>(mut self, v: T) -> Self
9011 where
9012 T: std::convert::Into<wkt::Timestamp>,
9013 {
9014 self.create_time = std::option::Option::Some(v.into());
9015 self
9016 }
9017
9018 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9020 where
9021 T: std::convert::Into<wkt::Timestamp>,
9022 {
9023 self.create_time = v.map(|x| x.into());
9024 self
9025 }
9026
9027 pub fn set_update_time<T>(mut self, v: T) -> Self
9029 where
9030 T: std::convert::Into<wkt::Timestamp>,
9031 {
9032 self.update_time = std::option::Option::Some(v.into());
9033 self
9034 }
9035
9036 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9038 where
9039 T: std::convert::Into<wkt::Timestamp>,
9040 {
9041 self.update_time = v.map(|x| x.into());
9042 self
9043 }
9044
9045 pub fn set_delete_time<T>(mut self, v: T) -> Self
9047 where
9048 T: std::convert::Into<wkt::Timestamp>,
9049 {
9050 self.delete_time = std::option::Option::Some(v.into());
9051 self
9052 }
9053
9054 pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
9056 where
9057 T: std::convert::Into<wkt::Timestamp>,
9058 {
9059 self.delete_time = v.map(|x| x.into());
9060 self
9061 }
9062
9063 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9065 where
9066 T: std::iter::IntoIterator<Item = (K, V)>,
9067 K: std::convert::Into<std::string::String>,
9068 V: std::convert::Into<std::string::String>,
9069 {
9070 use std::iter::Iterator;
9071 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9072 self
9073 }
9074
9075 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9077 self.etag = v.into();
9078 self
9079 }
9080
9081 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9083 self.reconciling = v.into();
9084 self
9085 }
9086
9087 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
9089 where
9090 T: std::iter::IntoIterator<Item = (K, V)>,
9091 K: std::convert::Into<std::string::String>,
9092 V: std::convert::Into<std::string::String>,
9093 {
9094 use std::iter::Iterator;
9095 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9096 self
9097 }
9098
9099 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9101 self.uid = v.into();
9102 self
9103 }
9104
9105 pub fn set_webhook_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9107 self.webhook_id = v.into();
9108 self
9109 }
9110
9111 pub fn set_git_proxy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9113 self.git_proxy_uri = v.into();
9114 self
9115 }
9116}
9117
9118impl wkt::message::Message for GitRepositoryLink {
9119 fn typename() -> &'static str {
9120 "type.googleapis.com/google.cloud.developerconnect.v1.GitRepositoryLink"
9121 }
9122}
9123
9124#[doc(hidden)]
9125impl<'de> serde::de::Deserialize<'de> for GitRepositoryLink {
9126 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9127 where
9128 D: serde::Deserializer<'de>,
9129 {
9130 #[allow(non_camel_case_types)]
9131 #[doc(hidden)]
9132 #[derive(PartialEq, Eq, Hash)]
9133 enum __FieldTag {
9134 __name,
9135 __clone_uri,
9136 __create_time,
9137 __update_time,
9138 __delete_time,
9139 __labels,
9140 __etag,
9141 __reconciling,
9142 __annotations,
9143 __uid,
9144 __webhook_id,
9145 __git_proxy_uri,
9146 Unknown(std::string::String),
9147 }
9148 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9149 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9150 where
9151 D: serde::Deserializer<'de>,
9152 {
9153 struct Visitor;
9154 impl<'de> serde::de::Visitor<'de> for Visitor {
9155 type Value = __FieldTag;
9156 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9157 formatter.write_str("a field name for GitRepositoryLink")
9158 }
9159 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9160 where
9161 E: serde::de::Error,
9162 {
9163 use std::result::Result::Ok;
9164 use std::string::ToString;
9165 match value {
9166 "name" => Ok(__FieldTag::__name),
9167 "cloneUri" => Ok(__FieldTag::__clone_uri),
9168 "clone_uri" => Ok(__FieldTag::__clone_uri),
9169 "createTime" => Ok(__FieldTag::__create_time),
9170 "create_time" => Ok(__FieldTag::__create_time),
9171 "updateTime" => Ok(__FieldTag::__update_time),
9172 "update_time" => Ok(__FieldTag::__update_time),
9173 "deleteTime" => Ok(__FieldTag::__delete_time),
9174 "delete_time" => Ok(__FieldTag::__delete_time),
9175 "labels" => Ok(__FieldTag::__labels),
9176 "etag" => Ok(__FieldTag::__etag),
9177 "reconciling" => Ok(__FieldTag::__reconciling),
9178 "annotations" => Ok(__FieldTag::__annotations),
9179 "uid" => Ok(__FieldTag::__uid),
9180 "webhookId" => Ok(__FieldTag::__webhook_id),
9181 "webhook_id" => Ok(__FieldTag::__webhook_id),
9182 "gitProxyUri" => Ok(__FieldTag::__git_proxy_uri),
9183 "git_proxy_uri" => Ok(__FieldTag::__git_proxy_uri),
9184 _ => Ok(__FieldTag::Unknown(value.to_string())),
9185 }
9186 }
9187 }
9188 deserializer.deserialize_identifier(Visitor)
9189 }
9190 }
9191 struct Visitor;
9192 impl<'de> serde::de::Visitor<'de> for Visitor {
9193 type Value = GitRepositoryLink;
9194 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9195 formatter.write_str("struct GitRepositoryLink")
9196 }
9197 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9198 where
9199 A: serde::de::MapAccess<'de>,
9200 {
9201 #[allow(unused_imports)]
9202 use serde::de::Error;
9203 use std::option::Option::Some;
9204 let mut fields = std::collections::HashSet::new();
9205 let mut result = Self::Value::new();
9206 while let Some(tag) = map.next_key::<__FieldTag>()? {
9207 #[allow(clippy::match_single_binding)]
9208 match tag {
9209 __FieldTag::__name => {
9210 if !fields.insert(__FieldTag::__name) {
9211 return std::result::Result::Err(A::Error::duplicate_field(
9212 "multiple values for name",
9213 ));
9214 }
9215 result.name = map
9216 .next_value::<std::option::Option<std::string::String>>()?
9217 .unwrap_or_default();
9218 }
9219 __FieldTag::__clone_uri => {
9220 if !fields.insert(__FieldTag::__clone_uri) {
9221 return std::result::Result::Err(A::Error::duplicate_field(
9222 "multiple values for clone_uri",
9223 ));
9224 }
9225 result.clone_uri = map
9226 .next_value::<std::option::Option<std::string::String>>()?
9227 .unwrap_or_default();
9228 }
9229 __FieldTag::__create_time => {
9230 if !fields.insert(__FieldTag::__create_time) {
9231 return std::result::Result::Err(A::Error::duplicate_field(
9232 "multiple values for create_time",
9233 ));
9234 }
9235 result.create_time =
9236 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
9237 }
9238 __FieldTag::__update_time => {
9239 if !fields.insert(__FieldTag::__update_time) {
9240 return std::result::Result::Err(A::Error::duplicate_field(
9241 "multiple values for update_time",
9242 ));
9243 }
9244 result.update_time =
9245 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
9246 }
9247 __FieldTag::__delete_time => {
9248 if !fields.insert(__FieldTag::__delete_time) {
9249 return std::result::Result::Err(A::Error::duplicate_field(
9250 "multiple values for delete_time",
9251 ));
9252 }
9253 result.delete_time =
9254 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
9255 }
9256 __FieldTag::__labels => {
9257 if !fields.insert(__FieldTag::__labels) {
9258 return std::result::Result::Err(A::Error::duplicate_field(
9259 "multiple values for labels",
9260 ));
9261 }
9262 result.labels = map
9263 .next_value::<std::option::Option<
9264 std::collections::HashMap<
9265 std::string::String,
9266 std::string::String,
9267 >,
9268 >>()?
9269 .unwrap_or_default();
9270 }
9271 __FieldTag::__etag => {
9272 if !fields.insert(__FieldTag::__etag) {
9273 return std::result::Result::Err(A::Error::duplicate_field(
9274 "multiple values for etag",
9275 ));
9276 }
9277 result.etag = map
9278 .next_value::<std::option::Option<std::string::String>>()?
9279 .unwrap_or_default();
9280 }
9281 __FieldTag::__reconciling => {
9282 if !fields.insert(__FieldTag::__reconciling) {
9283 return std::result::Result::Err(A::Error::duplicate_field(
9284 "multiple values for reconciling",
9285 ));
9286 }
9287 result.reconciling = map
9288 .next_value::<std::option::Option<bool>>()?
9289 .unwrap_or_default();
9290 }
9291 __FieldTag::__annotations => {
9292 if !fields.insert(__FieldTag::__annotations) {
9293 return std::result::Result::Err(A::Error::duplicate_field(
9294 "multiple values for annotations",
9295 ));
9296 }
9297 result.annotations = map
9298 .next_value::<std::option::Option<
9299 std::collections::HashMap<
9300 std::string::String,
9301 std::string::String,
9302 >,
9303 >>()?
9304 .unwrap_or_default();
9305 }
9306 __FieldTag::__uid => {
9307 if !fields.insert(__FieldTag::__uid) {
9308 return std::result::Result::Err(A::Error::duplicate_field(
9309 "multiple values for uid",
9310 ));
9311 }
9312 result.uid = map
9313 .next_value::<std::option::Option<std::string::String>>()?
9314 .unwrap_or_default();
9315 }
9316 __FieldTag::__webhook_id => {
9317 if !fields.insert(__FieldTag::__webhook_id) {
9318 return std::result::Result::Err(A::Error::duplicate_field(
9319 "multiple values for webhook_id",
9320 ));
9321 }
9322 result.webhook_id = map
9323 .next_value::<std::option::Option<std::string::String>>()?
9324 .unwrap_or_default();
9325 }
9326 __FieldTag::__git_proxy_uri => {
9327 if !fields.insert(__FieldTag::__git_proxy_uri) {
9328 return std::result::Result::Err(A::Error::duplicate_field(
9329 "multiple values for git_proxy_uri",
9330 ));
9331 }
9332 result.git_proxy_uri = map
9333 .next_value::<std::option::Option<std::string::String>>()?
9334 .unwrap_or_default();
9335 }
9336 __FieldTag::Unknown(key) => {
9337 let value = map.next_value::<serde_json::Value>()?;
9338 result._unknown_fields.insert(key, value);
9339 }
9340 }
9341 }
9342 std::result::Result::Ok(result)
9343 }
9344 }
9345 deserializer.deserialize_any(Visitor)
9346 }
9347}
9348
9349#[doc(hidden)]
9350impl serde::ser::Serialize for GitRepositoryLink {
9351 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9352 where
9353 S: serde::ser::Serializer,
9354 {
9355 use serde::ser::SerializeMap;
9356 #[allow(unused_imports)]
9357 use std::option::Option::Some;
9358 let mut state = serializer.serialize_map(std::option::Option::None)?;
9359 if !self.name.is_empty() {
9360 state.serialize_entry("name", &self.name)?;
9361 }
9362 if !self.clone_uri.is_empty() {
9363 state.serialize_entry("cloneUri", &self.clone_uri)?;
9364 }
9365 if self.create_time.is_some() {
9366 state.serialize_entry("createTime", &self.create_time)?;
9367 }
9368 if self.update_time.is_some() {
9369 state.serialize_entry("updateTime", &self.update_time)?;
9370 }
9371 if self.delete_time.is_some() {
9372 state.serialize_entry("deleteTime", &self.delete_time)?;
9373 }
9374 if !self.labels.is_empty() {
9375 state.serialize_entry("labels", &self.labels)?;
9376 }
9377 if !self.etag.is_empty() {
9378 state.serialize_entry("etag", &self.etag)?;
9379 }
9380 if !wkt::internal::is_default(&self.reconciling) {
9381 state.serialize_entry("reconciling", &self.reconciling)?;
9382 }
9383 if !self.annotations.is_empty() {
9384 state.serialize_entry("annotations", &self.annotations)?;
9385 }
9386 if !self.uid.is_empty() {
9387 state.serialize_entry("uid", &self.uid)?;
9388 }
9389 if !self.webhook_id.is_empty() {
9390 state.serialize_entry("webhookId", &self.webhook_id)?;
9391 }
9392 if !self.git_proxy_uri.is_empty() {
9393 state.serialize_entry("gitProxyUri", &self.git_proxy_uri)?;
9394 }
9395 if !self._unknown_fields.is_empty() {
9396 for (key, value) in self._unknown_fields.iter() {
9397 state.serialize_entry(key, &value)?;
9398 }
9399 }
9400 state.end()
9401 }
9402}
9403
9404impl std::fmt::Debug for GitRepositoryLink {
9405 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9406 let mut debug_struct = f.debug_struct("GitRepositoryLink");
9407 debug_struct.field("name", &self.name);
9408 debug_struct.field("clone_uri", &self.clone_uri);
9409 debug_struct.field("create_time", &self.create_time);
9410 debug_struct.field("update_time", &self.update_time);
9411 debug_struct.field("delete_time", &self.delete_time);
9412 debug_struct.field("labels", &self.labels);
9413 debug_struct.field("etag", &self.etag);
9414 debug_struct.field("reconciling", &self.reconciling);
9415 debug_struct.field("annotations", &self.annotations);
9416 debug_struct.field("uid", &self.uid);
9417 debug_struct.field("webhook_id", &self.webhook_id);
9418 debug_struct.field("git_proxy_uri", &self.git_proxy_uri);
9419 if !self._unknown_fields.is_empty() {
9420 debug_struct.field("_unknown_fields", &self._unknown_fields);
9421 }
9422 debug_struct.finish()
9423 }
9424}
9425
9426#[derive(Clone, Default, PartialEq)]
9428#[non_exhaustive]
9429pub struct CreateGitRepositoryLinkRequest {
9430 pub parent: std::string::String,
9432
9433 pub git_repository_link: std::option::Option<crate::model::GitRepositoryLink>,
9435
9436 pub git_repository_link_id: std::string::String,
9441
9442 pub request_id: std::string::String,
9456
9457 pub validate_only: bool,
9459
9460 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9461}
9462
9463impl CreateGitRepositoryLinkRequest {
9464 pub fn new() -> Self {
9465 std::default::Default::default()
9466 }
9467
9468 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9470 self.parent = v.into();
9471 self
9472 }
9473
9474 pub fn set_git_repository_link<T>(mut self, v: T) -> Self
9476 where
9477 T: std::convert::Into<crate::model::GitRepositoryLink>,
9478 {
9479 self.git_repository_link = std::option::Option::Some(v.into());
9480 self
9481 }
9482
9483 pub fn set_or_clear_git_repository_link<T>(mut self, v: std::option::Option<T>) -> Self
9485 where
9486 T: std::convert::Into<crate::model::GitRepositoryLink>,
9487 {
9488 self.git_repository_link = v.map(|x| x.into());
9489 self
9490 }
9491
9492 pub fn set_git_repository_link_id<T: std::convert::Into<std::string::String>>(
9494 mut self,
9495 v: T,
9496 ) -> Self {
9497 self.git_repository_link_id = v.into();
9498 self
9499 }
9500
9501 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9503 self.request_id = v.into();
9504 self
9505 }
9506
9507 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9509 self.validate_only = v.into();
9510 self
9511 }
9512}
9513
9514impl wkt::message::Message for CreateGitRepositoryLinkRequest {
9515 fn typename() -> &'static str {
9516 "type.googleapis.com/google.cloud.developerconnect.v1.CreateGitRepositoryLinkRequest"
9517 }
9518}
9519
9520#[doc(hidden)]
9521impl<'de> serde::de::Deserialize<'de> for CreateGitRepositoryLinkRequest {
9522 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9523 where
9524 D: serde::Deserializer<'de>,
9525 {
9526 #[allow(non_camel_case_types)]
9527 #[doc(hidden)]
9528 #[derive(PartialEq, Eq, Hash)]
9529 enum __FieldTag {
9530 __parent,
9531 __git_repository_link,
9532 __git_repository_link_id,
9533 __request_id,
9534 __validate_only,
9535 Unknown(std::string::String),
9536 }
9537 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9538 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9539 where
9540 D: serde::Deserializer<'de>,
9541 {
9542 struct Visitor;
9543 impl<'de> serde::de::Visitor<'de> for Visitor {
9544 type Value = __FieldTag;
9545 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9546 formatter.write_str("a field name for CreateGitRepositoryLinkRequest")
9547 }
9548 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9549 where
9550 E: serde::de::Error,
9551 {
9552 use std::result::Result::Ok;
9553 use std::string::ToString;
9554 match value {
9555 "parent" => Ok(__FieldTag::__parent),
9556 "gitRepositoryLink" => Ok(__FieldTag::__git_repository_link),
9557 "git_repository_link" => Ok(__FieldTag::__git_repository_link),
9558 "gitRepositoryLinkId" => Ok(__FieldTag::__git_repository_link_id),
9559 "git_repository_link_id" => Ok(__FieldTag::__git_repository_link_id),
9560 "requestId" => Ok(__FieldTag::__request_id),
9561 "request_id" => Ok(__FieldTag::__request_id),
9562 "validateOnly" => Ok(__FieldTag::__validate_only),
9563 "validate_only" => Ok(__FieldTag::__validate_only),
9564 _ => Ok(__FieldTag::Unknown(value.to_string())),
9565 }
9566 }
9567 }
9568 deserializer.deserialize_identifier(Visitor)
9569 }
9570 }
9571 struct Visitor;
9572 impl<'de> serde::de::Visitor<'de> for Visitor {
9573 type Value = CreateGitRepositoryLinkRequest;
9574 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9575 formatter.write_str("struct CreateGitRepositoryLinkRequest")
9576 }
9577 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9578 where
9579 A: serde::de::MapAccess<'de>,
9580 {
9581 #[allow(unused_imports)]
9582 use serde::de::Error;
9583 use std::option::Option::Some;
9584 let mut fields = std::collections::HashSet::new();
9585 let mut result = Self::Value::new();
9586 while let Some(tag) = map.next_key::<__FieldTag>()? {
9587 #[allow(clippy::match_single_binding)]
9588 match tag {
9589 __FieldTag::__parent => {
9590 if !fields.insert(__FieldTag::__parent) {
9591 return std::result::Result::Err(A::Error::duplicate_field(
9592 "multiple values for parent",
9593 ));
9594 }
9595 result.parent = map
9596 .next_value::<std::option::Option<std::string::String>>()?
9597 .unwrap_or_default();
9598 }
9599 __FieldTag::__git_repository_link => {
9600 if !fields.insert(__FieldTag::__git_repository_link) {
9601 return std::result::Result::Err(A::Error::duplicate_field(
9602 "multiple values for git_repository_link",
9603 ));
9604 }
9605 result.git_repository_link = map
9606 .next_value::<std::option::Option<crate::model::GitRepositoryLink>>(
9607 )?;
9608 }
9609 __FieldTag::__git_repository_link_id => {
9610 if !fields.insert(__FieldTag::__git_repository_link_id) {
9611 return std::result::Result::Err(A::Error::duplicate_field(
9612 "multiple values for git_repository_link_id",
9613 ));
9614 }
9615 result.git_repository_link_id = map
9616 .next_value::<std::option::Option<std::string::String>>()?
9617 .unwrap_or_default();
9618 }
9619 __FieldTag::__request_id => {
9620 if !fields.insert(__FieldTag::__request_id) {
9621 return std::result::Result::Err(A::Error::duplicate_field(
9622 "multiple values for request_id",
9623 ));
9624 }
9625 result.request_id = map
9626 .next_value::<std::option::Option<std::string::String>>()?
9627 .unwrap_or_default();
9628 }
9629 __FieldTag::__validate_only => {
9630 if !fields.insert(__FieldTag::__validate_only) {
9631 return std::result::Result::Err(A::Error::duplicate_field(
9632 "multiple values for validate_only",
9633 ));
9634 }
9635 result.validate_only = map
9636 .next_value::<std::option::Option<bool>>()?
9637 .unwrap_or_default();
9638 }
9639 __FieldTag::Unknown(key) => {
9640 let value = map.next_value::<serde_json::Value>()?;
9641 result._unknown_fields.insert(key, value);
9642 }
9643 }
9644 }
9645 std::result::Result::Ok(result)
9646 }
9647 }
9648 deserializer.deserialize_any(Visitor)
9649 }
9650}
9651
9652#[doc(hidden)]
9653impl serde::ser::Serialize for CreateGitRepositoryLinkRequest {
9654 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9655 where
9656 S: serde::ser::Serializer,
9657 {
9658 use serde::ser::SerializeMap;
9659 #[allow(unused_imports)]
9660 use std::option::Option::Some;
9661 let mut state = serializer.serialize_map(std::option::Option::None)?;
9662 if !self.parent.is_empty() {
9663 state.serialize_entry("parent", &self.parent)?;
9664 }
9665 if self.git_repository_link.is_some() {
9666 state.serialize_entry("gitRepositoryLink", &self.git_repository_link)?;
9667 }
9668 if !self.git_repository_link_id.is_empty() {
9669 state.serialize_entry("gitRepositoryLinkId", &self.git_repository_link_id)?;
9670 }
9671 if !self.request_id.is_empty() {
9672 state.serialize_entry("requestId", &self.request_id)?;
9673 }
9674 if !wkt::internal::is_default(&self.validate_only) {
9675 state.serialize_entry("validateOnly", &self.validate_only)?;
9676 }
9677 if !self._unknown_fields.is_empty() {
9678 for (key, value) in self._unknown_fields.iter() {
9679 state.serialize_entry(key, &value)?;
9680 }
9681 }
9682 state.end()
9683 }
9684}
9685
9686impl std::fmt::Debug for CreateGitRepositoryLinkRequest {
9687 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9688 let mut debug_struct = f.debug_struct("CreateGitRepositoryLinkRequest");
9689 debug_struct.field("parent", &self.parent);
9690 debug_struct.field("git_repository_link", &self.git_repository_link);
9691 debug_struct.field("git_repository_link_id", &self.git_repository_link_id);
9692 debug_struct.field("request_id", &self.request_id);
9693 debug_struct.field("validate_only", &self.validate_only);
9694 if !self._unknown_fields.is_empty() {
9695 debug_struct.field("_unknown_fields", &self._unknown_fields);
9696 }
9697 debug_struct.finish()
9698 }
9699}
9700
9701#[derive(Clone, Default, PartialEq)]
9703#[non_exhaustive]
9704pub struct DeleteGitRepositoryLinkRequest {
9705 pub name: std::string::String,
9707
9708 pub request_id: std::string::String,
9722
9723 pub validate_only: bool,
9725
9726 pub etag: std::string::String,
9730
9731 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9732}
9733
9734impl DeleteGitRepositoryLinkRequest {
9735 pub fn new() -> Self {
9736 std::default::Default::default()
9737 }
9738
9739 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9741 self.name = v.into();
9742 self
9743 }
9744
9745 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9747 self.request_id = v.into();
9748 self
9749 }
9750
9751 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9753 self.validate_only = v.into();
9754 self
9755 }
9756
9757 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9759 self.etag = v.into();
9760 self
9761 }
9762}
9763
9764impl wkt::message::Message for DeleteGitRepositoryLinkRequest {
9765 fn typename() -> &'static str {
9766 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteGitRepositoryLinkRequest"
9767 }
9768}
9769
9770#[doc(hidden)]
9771impl<'de> serde::de::Deserialize<'de> for DeleteGitRepositoryLinkRequest {
9772 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9773 where
9774 D: serde::Deserializer<'de>,
9775 {
9776 #[allow(non_camel_case_types)]
9777 #[doc(hidden)]
9778 #[derive(PartialEq, Eq, Hash)]
9779 enum __FieldTag {
9780 __name,
9781 __request_id,
9782 __validate_only,
9783 __etag,
9784 Unknown(std::string::String),
9785 }
9786 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9787 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9788 where
9789 D: serde::Deserializer<'de>,
9790 {
9791 struct Visitor;
9792 impl<'de> serde::de::Visitor<'de> for Visitor {
9793 type Value = __FieldTag;
9794 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9795 formatter.write_str("a field name for DeleteGitRepositoryLinkRequest")
9796 }
9797 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9798 where
9799 E: serde::de::Error,
9800 {
9801 use std::result::Result::Ok;
9802 use std::string::ToString;
9803 match value {
9804 "name" => Ok(__FieldTag::__name),
9805 "requestId" => Ok(__FieldTag::__request_id),
9806 "request_id" => Ok(__FieldTag::__request_id),
9807 "validateOnly" => Ok(__FieldTag::__validate_only),
9808 "validate_only" => Ok(__FieldTag::__validate_only),
9809 "etag" => Ok(__FieldTag::__etag),
9810 _ => Ok(__FieldTag::Unknown(value.to_string())),
9811 }
9812 }
9813 }
9814 deserializer.deserialize_identifier(Visitor)
9815 }
9816 }
9817 struct Visitor;
9818 impl<'de> serde::de::Visitor<'de> for Visitor {
9819 type Value = DeleteGitRepositoryLinkRequest;
9820 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9821 formatter.write_str("struct DeleteGitRepositoryLinkRequest")
9822 }
9823 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9824 where
9825 A: serde::de::MapAccess<'de>,
9826 {
9827 #[allow(unused_imports)]
9828 use serde::de::Error;
9829 use std::option::Option::Some;
9830 let mut fields = std::collections::HashSet::new();
9831 let mut result = Self::Value::new();
9832 while let Some(tag) = map.next_key::<__FieldTag>()? {
9833 #[allow(clippy::match_single_binding)]
9834 match tag {
9835 __FieldTag::__name => {
9836 if !fields.insert(__FieldTag::__name) {
9837 return std::result::Result::Err(A::Error::duplicate_field(
9838 "multiple values for name",
9839 ));
9840 }
9841 result.name = map
9842 .next_value::<std::option::Option<std::string::String>>()?
9843 .unwrap_or_default();
9844 }
9845 __FieldTag::__request_id => {
9846 if !fields.insert(__FieldTag::__request_id) {
9847 return std::result::Result::Err(A::Error::duplicate_field(
9848 "multiple values for request_id",
9849 ));
9850 }
9851 result.request_id = map
9852 .next_value::<std::option::Option<std::string::String>>()?
9853 .unwrap_or_default();
9854 }
9855 __FieldTag::__validate_only => {
9856 if !fields.insert(__FieldTag::__validate_only) {
9857 return std::result::Result::Err(A::Error::duplicate_field(
9858 "multiple values for validate_only",
9859 ));
9860 }
9861 result.validate_only = map
9862 .next_value::<std::option::Option<bool>>()?
9863 .unwrap_or_default();
9864 }
9865 __FieldTag::__etag => {
9866 if !fields.insert(__FieldTag::__etag) {
9867 return std::result::Result::Err(A::Error::duplicate_field(
9868 "multiple values for etag",
9869 ));
9870 }
9871 result.etag = map
9872 .next_value::<std::option::Option<std::string::String>>()?
9873 .unwrap_or_default();
9874 }
9875 __FieldTag::Unknown(key) => {
9876 let value = map.next_value::<serde_json::Value>()?;
9877 result._unknown_fields.insert(key, value);
9878 }
9879 }
9880 }
9881 std::result::Result::Ok(result)
9882 }
9883 }
9884 deserializer.deserialize_any(Visitor)
9885 }
9886}
9887
9888#[doc(hidden)]
9889impl serde::ser::Serialize for DeleteGitRepositoryLinkRequest {
9890 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9891 where
9892 S: serde::ser::Serializer,
9893 {
9894 use serde::ser::SerializeMap;
9895 #[allow(unused_imports)]
9896 use std::option::Option::Some;
9897 let mut state = serializer.serialize_map(std::option::Option::None)?;
9898 if !self.name.is_empty() {
9899 state.serialize_entry("name", &self.name)?;
9900 }
9901 if !self.request_id.is_empty() {
9902 state.serialize_entry("requestId", &self.request_id)?;
9903 }
9904 if !wkt::internal::is_default(&self.validate_only) {
9905 state.serialize_entry("validateOnly", &self.validate_only)?;
9906 }
9907 if !self.etag.is_empty() {
9908 state.serialize_entry("etag", &self.etag)?;
9909 }
9910 if !self._unknown_fields.is_empty() {
9911 for (key, value) in self._unknown_fields.iter() {
9912 state.serialize_entry(key, &value)?;
9913 }
9914 }
9915 state.end()
9916 }
9917}
9918
9919impl std::fmt::Debug for DeleteGitRepositoryLinkRequest {
9920 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9921 let mut debug_struct = f.debug_struct("DeleteGitRepositoryLinkRequest");
9922 debug_struct.field("name", &self.name);
9923 debug_struct.field("request_id", &self.request_id);
9924 debug_struct.field("validate_only", &self.validate_only);
9925 debug_struct.field("etag", &self.etag);
9926 if !self._unknown_fields.is_empty() {
9927 debug_struct.field("_unknown_fields", &self._unknown_fields);
9928 }
9929 debug_struct.finish()
9930 }
9931}
9932
9933#[derive(Clone, Default, PartialEq)]
9935#[non_exhaustive]
9936pub struct ListGitRepositoryLinksRequest {
9937 pub parent: std::string::String,
9939
9940 pub page_size: i32,
9943
9944 pub page_token: std::string::String,
9946
9947 pub filter: std::string::String,
9949
9950 pub order_by: std::string::String,
9952
9953 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9954}
9955
9956impl ListGitRepositoryLinksRequest {
9957 pub fn new() -> Self {
9958 std::default::Default::default()
9959 }
9960
9961 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9963 self.parent = v.into();
9964 self
9965 }
9966
9967 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9969 self.page_size = v.into();
9970 self
9971 }
9972
9973 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9975 self.page_token = v.into();
9976 self
9977 }
9978
9979 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9981 self.filter = v.into();
9982 self
9983 }
9984
9985 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9987 self.order_by = v.into();
9988 self
9989 }
9990}
9991
9992impl wkt::message::Message for ListGitRepositoryLinksRequest {
9993 fn typename() -> &'static str {
9994 "type.googleapis.com/google.cloud.developerconnect.v1.ListGitRepositoryLinksRequest"
9995 }
9996}
9997
9998#[doc(hidden)]
9999impl<'de> serde::de::Deserialize<'de> for ListGitRepositoryLinksRequest {
10000 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10001 where
10002 D: serde::Deserializer<'de>,
10003 {
10004 #[allow(non_camel_case_types)]
10005 #[doc(hidden)]
10006 #[derive(PartialEq, Eq, Hash)]
10007 enum __FieldTag {
10008 __parent,
10009 __page_size,
10010 __page_token,
10011 __filter,
10012 __order_by,
10013 Unknown(std::string::String),
10014 }
10015 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10016 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10017 where
10018 D: serde::Deserializer<'de>,
10019 {
10020 struct Visitor;
10021 impl<'de> serde::de::Visitor<'de> for Visitor {
10022 type Value = __FieldTag;
10023 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10024 formatter.write_str("a field name for ListGitRepositoryLinksRequest")
10025 }
10026 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10027 where
10028 E: serde::de::Error,
10029 {
10030 use std::result::Result::Ok;
10031 use std::string::ToString;
10032 match value {
10033 "parent" => Ok(__FieldTag::__parent),
10034 "pageSize" => Ok(__FieldTag::__page_size),
10035 "page_size" => Ok(__FieldTag::__page_size),
10036 "pageToken" => Ok(__FieldTag::__page_token),
10037 "page_token" => Ok(__FieldTag::__page_token),
10038 "filter" => Ok(__FieldTag::__filter),
10039 "orderBy" => Ok(__FieldTag::__order_by),
10040 "order_by" => Ok(__FieldTag::__order_by),
10041 _ => Ok(__FieldTag::Unknown(value.to_string())),
10042 }
10043 }
10044 }
10045 deserializer.deserialize_identifier(Visitor)
10046 }
10047 }
10048 struct Visitor;
10049 impl<'de> serde::de::Visitor<'de> for Visitor {
10050 type Value = ListGitRepositoryLinksRequest;
10051 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10052 formatter.write_str("struct ListGitRepositoryLinksRequest")
10053 }
10054 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10055 where
10056 A: serde::de::MapAccess<'de>,
10057 {
10058 #[allow(unused_imports)]
10059 use serde::de::Error;
10060 use std::option::Option::Some;
10061 let mut fields = std::collections::HashSet::new();
10062 let mut result = Self::Value::new();
10063 while let Some(tag) = map.next_key::<__FieldTag>()? {
10064 #[allow(clippy::match_single_binding)]
10065 match tag {
10066 __FieldTag::__parent => {
10067 if !fields.insert(__FieldTag::__parent) {
10068 return std::result::Result::Err(A::Error::duplicate_field(
10069 "multiple values for parent",
10070 ));
10071 }
10072 result.parent = map
10073 .next_value::<std::option::Option<std::string::String>>()?
10074 .unwrap_or_default();
10075 }
10076 __FieldTag::__page_size => {
10077 if !fields.insert(__FieldTag::__page_size) {
10078 return std::result::Result::Err(A::Error::duplicate_field(
10079 "multiple values for page_size",
10080 ));
10081 }
10082 struct __With(std::option::Option<i32>);
10083 impl<'de> serde::de::Deserialize<'de> for __With {
10084 fn deserialize<D>(
10085 deserializer: D,
10086 ) -> std::result::Result<Self, D::Error>
10087 where
10088 D: serde::de::Deserializer<'de>,
10089 {
10090 serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
10091 }
10092 }
10093 result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
10094 }
10095 __FieldTag::__page_token => {
10096 if !fields.insert(__FieldTag::__page_token) {
10097 return std::result::Result::Err(A::Error::duplicate_field(
10098 "multiple values for page_token",
10099 ));
10100 }
10101 result.page_token = map
10102 .next_value::<std::option::Option<std::string::String>>()?
10103 .unwrap_or_default();
10104 }
10105 __FieldTag::__filter => {
10106 if !fields.insert(__FieldTag::__filter) {
10107 return std::result::Result::Err(A::Error::duplicate_field(
10108 "multiple values for filter",
10109 ));
10110 }
10111 result.filter = map
10112 .next_value::<std::option::Option<std::string::String>>()?
10113 .unwrap_or_default();
10114 }
10115 __FieldTag::__order_by => {
10116 if !fields.insert(__FieldTag::__order_by) {
10117 return std::result::Result::Err(A::Error::duplicate_field(
10118 "multiple values for order_by",
10119 ));
10120 }
10121 result.order_by = map
10122 .next_value::<std::option::Option<std::string::String>>()?
10123 .unwrap_or_default();
10124 }
10125 __FieldTag::Unknown(key) => {
10126 let value = map.next_value::<serde_json::Value>()?;
10127 result._unknown_fields.insert(key, value);
10128 }
10129 }
10130 }
10131 std::result::Result::Ok(result)
10132 }
10133 }
10134 deserializer.deserialize_any(Visitor)
10135 }
10136}
10137
10138#[doc(hidden)]
10139impl serde::ser::Serialize for ListGitRepositoryLinksRequest {
10140 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10141 where
10142 S: serde::ser::Serializer,
10143 {
10144 use serde::ser::SerializeMap;
10145 #[allow(unused_imports)]
10146 use std::option::Option::Some;
10147 let mut state = serializer.serialize_map(std::option::Option::None)?;
10148 if !self.parent.is_empty() {
10149 state.serialize_entry("parent", &self.parent)?;
10150 }
10151 if !wkt::internal::is_default(&self.page_size) {
10152 struct __With<'a>(&'a i32);
10153 impl<'a> serde::ser::Serialize for __With<'a> {
10154 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10155 where
10156 S: serde::ser::Serializer,
10157 {
10158 serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
10159 }
10160 }
10161 state.serialize_entry("pageSize", &__With(&self.page_size))?;
10162 }
10163 if !self.page_token.is_empty() {
10164 state.serialize_entry("pageToken", &self.page_token)?;
10165 }
10166 if !self.filter.is_empty() {
10167 state.serialize_entry("filter", &self.filter)?;
10168 }
10169 if !self.order_by.is_empty() {
10170 state.serialize_entry("orderBy", &self.order_by)?;
10171 }
10172 if !self._unknown_fields.is_empty() {
10173 for (key, value) in self._unknown_fields.iter() {
10174 state.serialize_entry(key, &value)?;
10175 }
10176 }
10177 state.end()
10178 }
10179}
10180
10181impl std::fmt::Debug for ListGitRepositoryLinksRequest {
10182 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10183 let mut debug_struct = f.debug_struct("ListGitRepositoryLinksRequest");
10184 debug_struct.field("parent", &self.parent);
10185 debug_struct.field("page_size", &self.page_size);
10186 debug_struct.field("page_token", &self.page_token);
10187 debug_struct.field("filter", &self.filter);
10188 debug_struct.field("order_by", &self.order_by);
10189 if !self._unknown_fields.is_empty() {
10190 debug_struct.field("_unknown_fields", &self._unknown_fields);
10191 }
10192 debug_struct.finish()
10193 }
10194}
10195
10196#[derive(Clone, Default, PartialEq)]
10198#[non_exhaustive]
10199pub struct ListGitRepositoryLinksResponse {
10200 pub git_repository_links: std::vec::Vec<crate::model::GitRepositoryLink>,
10202
10203 pub next_page_token: std::string::String,
10205
10206 pub unreachable: std::vec::Vec<std::string::String>,
10208
10209 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10210}
10211
10212impl ListGitRepositoryLinksResponse {
10213 pub fn new() -> Self {
10214 std::default::Default::default()
10215 }
10216
10217 pub fn set_git_repository_links<T, V>(mut self, v: T) -> Self
10219 where
10220 T: std::iter::IntoIterator<Item = V>,
10221 V: std::convert::Into<crate::model::GitRepositoryLink>,
10222 {
10223 use std::iter::Iterator;
10224 self.git_repository_links = v.into_iter().map(|i| i.into()).collect();
10225 self
10226 }
10227
10228 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10230 self.next_page_token = v.into();
10231 self
10232 }
10233
10234 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10236 where
10237 T: std::iter::IntoIterator<Item = V>,
10238 V: std::convert::Into<std::string::String>,
10239 {
10240 use std::iter::Iterator;
10241 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10242 self
10243 }
10244}
10245
10246impl wkt::message::Message for ListGitRepositoryLinksResponse {
10247 fn typename() -> &'static str {
10248 "type.googleapis.com/google.cloud.developerconnect.v1.ListGitRepositoryLinksResponse"
10249 }
10250}
10251
10252#[doc(hidden)]
10253impl gax::paginator::internal::PageableResponse for ListGitRepositoryLinksResponse {
10254 type PageItem = crate::model::GitRepositoryLink;
10255
10256 fn items(self) -> std::vec::Vec<Self::PageItem> {
10257 self.git_repository_links
10258 }
10259
10260 fn next_page_token(&self) -> std::string::String {
10261 use std::clone::Clone;
10262 self.next_page_token.clone()
10263 }
10264}
10265
10266#[doc(hidden)]
10267impl<'de> serde::de::Deserialize<'de> for ListGitRepositoryLinksResponse {
10268 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10269 where
10270 D: serde::Deserializer<'de>,
10271 {
10272 #[allow(non_camel_case_types)]
10273 #[doc(hidden)]
10274 #[derive(PartialEq, Eq, Hash)]
10275 enum __FieldTag {
10276 __git_repository_links,
10277 __next_page_token,
10278 __unreachable,
10279 Unknown(std::string::String),
10280 }
10281 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10282 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10283 where
10284 D: serde::Deserializer<'de>,
10285 {
10286 struct Visitor;
10287 impl<'de> serde::de::Visitor<'de> for Visitor {
10288 type Value = __FieldTag;
10289 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10290 formatter.write_str("a field name for ListGitRepositoryLinksResponse")
10291 }
10292 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10293 where
10294 E: serde::de::Error,
10295 {
10296 use std::result::Result::Ok;
10297 use std::string::ToString;
10298 match value {
10299 "gitRepositoryLinks" => Ok(__FieldTag::__git_repository_links),
10300 "git_repository_links" => Ok(__FieldTag::__git_repository_links),
10301 "nextPageToken" => Ok(__FieldTag::__next_page_token),
10302 "next_page_token" => Ok(__FieldTag::__next_page_token),
10303 "unreachable" => Ok(__FieldTag::__unreachable),
10304 _ => Ok(__FieldTag::Unknown(value.to_string())),
10305 }
10306 }
10307 }
10308 deserializer.deserialize_identifier(Visitor)
10309 }
10310 }
10311 struct Visitor;
10312 impl<'de> serde::de::Visitor<'de> for Visitor {
10313 type Value = ListGitRepositoryLinksResponse;
10314 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10315 formatter.write_str("struct ListGitRepositoryLinksResponse")
10316 }
10317 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10318 where
10319 A: serde::de::MapAccess<'de>,
10320 {
10321 #[allow(unused_imports)]
10322 use serde::de::Error;
10323 use std::option::Option::Some;
10324 let mut fields = std::collections::HashSet::new();
10325 let mut result = Self::Value::new();
10326 while let Some(tag) = map.next_key::<__FieldTag>()? {
10327 #[allow(clippy::match_single_binding)]
10328 match tag {
10329 __FieldTag::__git_repository_links => {
10330 if !fields.insert(__FieldTag::__git_repository_links) {
10331 return std::result::Result::Err(A::Error::duplicate_field(
10332 "multiple values for git_repository_links",
10333 ));
10334 }
10335 result.git_repository_links =
10336 map.next_value::<std::option::Option<
10337 std::vec::Vec<crate::model::GitRepositoryLink>,
10338 >>()?
10339 .unwrap_or_default();
10340 }
10341 __FieldTag::__next_page_token => {
10342 if !fields.insert(__FieldTag::__next_page_token) {
10343 return std::result::Result::Err(A::Error::duplicate_field(
10344 "multiple values for next_page_token",
10345 ));
10346 }
10347 result.next_page_token = map
10348 .next_value::<std::option::Option<std::string::String>>()?
10349 .unwrap_or_default();
10350 }
10351 __FieldTag::__unreachable => {
10352 if !fields.insert(__FieldTag::__unreachable) {
10353 return std::result::Result::Err(A::Error::duplicate_field(
10354 "multiple values for unreachable",
10355 ));
10356 }
10357 result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
10358 }
10359 __FieldTag::Unknown(key) => {
10360 let value = map.next_value::<serde_json::Value>()?;
10361 result._unknown_fields.insert(key, value);
10362 }
10363 }
10364 }
10365 std::result::Result::Ok(result)
10366 }
10367 }
10368 deserializer.deserialize_any(Visitor)
10369 }
10370}
10371
10372#[doc(hidden)]
10373impl serde::ser::Serialize for ListGitRepositoryLinksResponse {
10374 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10375 where
10376 S: serde::ser::Serializer,
10377 {
10378 use serde::ser::SerializeMap;
10379 #[allow(unused_imports)]
10380 use std::option::Option::Some;
10381 let mut state = serializer.serialize_map(std::option::Option::None)?;
10382 if !self.git_repository_links.is_empty() {
10383 state.serialize_entry("gitRepositoryLinks", &self.git_repository_links)?;
10384 }
10385 if !self.next_page_token.is_empty() {
10386 state.serialize_entry("nextPageToken", &self.next_page_token)?;
10387 }
10388 if !self.unreachable.is_empty() {
10389 state.serialize_entry("unreachable", &self.unreachable)?;
10390 }
10391 if !self._unknown_fields.is_empty() {
10392 for (key, value) in self._unknown_fields.iter() {
10393 state.serialize_entry(key, &value)?;
10394 }
10395 }
10396 state.end()
10397 }
10398}
10399
10400impl std::fmt::Debug for ListGitRepositoryLinksResponse {
10401 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10402 let mut debug_struct = f.debug_struct("ListGitRepositoryLinksResponse");
10403 debug_struct.field("git_repository_links", &self.git_repository_links);
10404 debug_struct.field("next_page_token", &self.next_page_token);
10405 debug_struct.field("unreachable", &self.unreachable);
10406 if !self._unknown_fields.is_empty() {
10407 debug_struct.field("_unknown_fields", &self._unknown_fields);
10408 }
10409 debug_struct.finish()
10410 }
10411}
10412
10413#[derive(Clone, Default, PartialEq)]
10415#[non_exhaustive]
10416pub struct GetGitRepositoryLinkRequest {
10417 pub name: std::string::String,
10419
10420 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10421}
10422
10423impl GetGitRepositoryLinkRequest {
10424 pub fn new() -> Self {
10425 std::default::Default::default()
10426 }
10427
10428 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10430 self.name = v.into();
10431 self
10432 }
10433}
10434
10435impl wkt::message::Message for GetGitRepositoryLinkRequest {
10436 fn typename() -> &'static str {
10437 "type.googleapis.com/google.cloud.developerconnect.v1.GetGitRepositoryLinkRequest"
10438 }
10439}
10440
10441#[doc(hidden)]
10442impl<'de> serde::de::Deserialize<'de> for GetGitRepositoryLinkRequest {
10443 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10444 where
10445 D: serde::Deserializer<'de>,
10446 {
10447 #[allow(non_camel_case_types)]
10448 #[doc(hidden)]
10449 #[derive(PartialEq, Eq, Hash)]
10450 enum __FieldTag {
10451 __name,
10452 Unknown(std::string::String),
10453 }
10454 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10455 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10456 where
10457 D: serde::Deserializer<'de>,
10458 {
10459 struct Visitor;
10460 impl<'de> serde::de::Visitor<'de> for Visitor {
10461 type Value = __FieldTag;
10462 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10463 formatter.write_str("a field name for GetGitRepositoryLinkRequest")
10464 }
10465 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10466 where
10467 E: serde::de::Error,
10468 {
10469 use std::result::Result::Ok;
10470 use std::string::ToString;
10471 match value {
10472 "name" => Ok(__FieldTag::__name),
10473 _ => Ok(__FieldTag::Unknown(value.to_string())),
10474 }
10475 }
10476 }
10477 deserializer.deserialize_identifier(Visitor)
10478 }
10479 }
10480 struct Visitor;
10481 impl<'de> serde::de::Visitor<'de> for Visitor {
10482 type Value = GetGitRepositoryLinkRequest;
10483 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10484 formatter.write_str("struct GetGitRepositoryLinkRequest")
10485 }
10486 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10487 where
10488 A: serde::de::MapAccess<'de>,
10489 {
10490 #[allow(unused_imports)]
10491 use serde::de::Error;
10492 use std::option::Option::Some;
10493 let mut fields = std::collections::HashSet::new();
10494 let mut result = Self::Value::new();
10495 while let Some(tag) = map.next_key::<__FieldTag>()? {
10496 #[allow(clippy::match_single_binding)]
10497 match tag {
10498 __FieldTag::__name => {
10499 if !fields.insert(__FieldTag::__name) {
10500 return std::result::Result::Err(A::Error::duplicate_field(
10501 "multiple values for name",
10502 ));
10503 }
10504 result.name = map
10505 .next_value::<std::option::Option<std::string::String>>()?
10506 .unwrap_or_default();
10507 }
10508 __FieldTag::Unknown(key) => {
10509 let value = map.next_value::<serde_json::Value>()?;
10510 result._unknown_fields.insert(key, value);
10511 }
10512 }
10513 }
10514 std::result::Result::Ok(result)
10515 }
10516 }
10517 deserializer.deserialize_any(Visitor)
10518 }
10519}
10520
10521#[doc(hidden)]
10522impl serde::ser::Serialize for GetGitRepositoryLinkRequest {
10523 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10524 where
10525 S: serde::ser::Serializer,
10526 {
10527 use serde::ser::SerializeMap;
10528 #[allow(unused_imports)]
10529 use std::option::Option::Some;
10530 let mut state = serializer.serialize_map(std::option::Option::None)?;
10531 if !self.name.is_empty() {
10532 state.serialize_entry("name", &self.name)?;
10533 }
10534 if !self._unknown_fields.is_empty() {
10535 for (key, value) in self._unknown_fields.iter() {
10536 state.serialize_entry(key, &value)?;
10537 }
10538 }
10539 state.end()
10540 }
10541}
10542
10543impl std::fmt::Debug for GetGitRepositoryLinkRequest {
10544 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10545 let mut debug_struct = f.debug_struct("GetGitRepositoryLinkRequest");
10546 debug_struct.field("name", &self.name);
10547 if !self._unknown_fields.is_empty() {
10548 debug_struct.field("_unknown_fields", &self._unknown_fields);
10549 }
10550 debug_struct.finish()
10551 }
10552}
10553
10554#[derive(Clone, Default, PartialEq)]
10556#[non_exhaustive]
10557pub struct FetchReadWriteTokenRequest {
10558 pub git_repository_link: std::string::String,
10561
10562 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10563}
10564
10565impl FetchReadWriteTokenRequest {
10566 pub fn new() -> Self {
10567 std::default::Default::default()
10568 }
10569
10570 pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
10572 mut self,
10573 v: T,
10574 ) -> Self {
10575 self.git_repository_link = v.into();
10576 self
10577 }
10578}
10579
10580impl wkt::message::Message for FetchReadWriteTokenRequest {
10581 fn typename() -> &'static str {
10582 "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadWriteTokenRequest"
10583 }
10584}
10585
10586#[doc(hidden)]
10587impl<'de> serde::de::Deserialize<'de> for FetchReadWriteTokenRequest {
10588 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10589 where
10590 D: serde::Deserializer<'de>,
10591 {
10592 #[allow(non_camel_case_types)]
10593 #[doc(hidden)]
10594 #[derive(PartialEq, Eq, Hash)]
10595 enum __FieldTag {
10596 __git_repository_link,
10597 Unknown(std::string::String),
10598 }
10599 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10600 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10601 where
10602 D: serde::Deserializer<'de>,
10603 {
10604 struct Visitor;
10605 impl<'de> serde::de::Visitor<'de> for Visitor {
10606 type Value = __FieldTag;
10607 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10608 formatter.write_str("a field name for FetchReadWriteTokenRequest")
10609 }
10610 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10611 where
10612 E: serde::de::Error,
10613 {
10614 use std::result::Result::Ok;
10615 use std::string::ToString;
10616 match value {
10617 "gitRepositoryLink" => Ok(__FieldTag::__git_repository_link),
10618 "git_repository_link" => Ok(__FieldTag::__git_repository_link),
10619 _ => Ok(__FieldTag::Unknown(value.to_string())),
10620 }
10621 }
10622 }
10623 deserializer.deserialize_identifier(Visitor)
10624 }
10625 }
10626 struct Visitor;
10627 impl<'de> serde::de::Visitor<'de> for Visitor {
10628 type Value = FetchReadWriteTokenRequest;
10629 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10630 formatter.write_str("struct FetchReadWriteTokenRequest")
10631 }
10632 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10633 where
10634 A: serde::de::MapAccess<'de>,
10635 {
10636 #[allow(unused_imports)]
10637 use serde::de::Error;
10638 use std::option::Option::Some;
10639 let mut fields = std::collections::HashSet::new();
10640 let mut result = Self::Value::new();
10641 while let Some(tag) = map.next_key::<__FieldTag>()? {
10642 #[allow(clippy::match_single_binding)]
10643 match tag {
10644 __FieldTag::__git_repository_link => {
10645 if !fields.insert(__FieldTag::__git_repository_link) {
10646 return std::result::Result::Err(A::Error::duplicate_field(
10647 "multiple values for git_repository_link",
10648 ));
10649 }
10650 result.git_repository_link = map
10651 .next_value::<std::option::Option<std::string::String>>()?
10652 .unwrap_or_default();
10653 }
10654 __FieldTag::Unknown(key) => {
10655 let value = map.next_value::<serde_json::Value>()?;
10656 result._unknown_fields.insert(key, value);
10657 }
10658 }
10659 }
10660 std::result::Result::Ok(result)
10661 }
10662 }
10663 deserializer.deserialize_any(Visitor)
10664 }
10665}
10666
10667#[doc(hidden)]
10668impl serde::ser::Serialize for FetchReadWriteTokenRequest {
10669 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10670 where
10671 S: serde::ser::Serializer,
10672 {
10673 use serde::ser::SerializeMap;
10674 #[allow(unused_imports)]
10675 use std::option::Option::Some;
10676 let mut state = serializer.serialize_map(std::option::Option::None)?;
10677 if !self.git_repository_link.is_empty() {
10678 state.serialize_entry("gitRepositoryLink", &self.git_repository_link)?;
10679 }
10680 if !self._unknown_fields.is_empty() {
10681 for (key, value) in self._unknown_fields.iter() {
10682 state.serialize_entry(key, &value)?;
10683 }
10684 }
10685 state.end()
10686 }
10687}
10688
10689impl std::fmt::Debug for FetchReadWriteTokenRequest {
10690 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10691 let mut debug_struct = f.debug_struct("FetchReadWriteTokenRequest");
10692 debug_struct.field("git_repository_link", &self.git_repository_link);
10693 if !self._unknown_fields.is_empty() {
10694 debug_struct.field("_unknown_fields", &self._unknown_fields);
10695 }
10696 debug_struct.finish()
10697 }
10698}
10699
10700#[derive(Clone, Default, PartialEq)]
10702#[non_exhaustive]
10703pub struct FetchReadTokenRequest {
10704 pub git_repository_link: std::string::String,
10707
10708 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10709}
10710
10711impl FetchReadTokenRequest {
10712 pub fn new() -> Self {
10713 std::default::Default::default()
10714 }
10715
10716 pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
10718 mut self,
10719 v: T,
10720 ) -> Self {
10721 self.git_repository_link = v.into();
10722 self
10723 }
10724}
10725
10726impl wkt::message::Message for FetchReadTokenRequest {
10727 fn typename() -> &'static str {
10728 "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadTokenRequest"
10729 }
10730}
10731
10732#[doc(hidden)]
10733impl<'de> serde::de::Deserialize<'de> for FetchReadTokenRequest {
10734 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10735 where
10736 D: serde::Deserializer<'de>,
10737 {
10738 #[allow(non_camel_case_types)]
10739 #[doc(hidden)]
10740 #[derive(PartialEq, Eq, Hash)]
10741 enum __FieldTag {
10742 __git_repository_link,
10743 Unknown(std::string::String),
10744 }
10745 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10746 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10747 where
10748 D: serde::Deserializer<'de>,
10749 {
10750 struct Visitor;
10751 impl<'de> serde::de::Visitor<'de> for Visitor {
10752 type Value = __FieldTag;
10753 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10754 formatter.write_str("a field name for FetchReadTokenRequest")
10755 }
10756 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10757 where
10758 E: serde::de::Error,
10759 {
10760 use std::result::Result::Ok;
10761 use std::string::ToString;
10762 match value {
10763 "gitRepositoryLink" => Ok(__FieldTag::__git_repository_link),
10764 "git_repository_link" => Ok(__FieldTag::__git_repository_link),
10765 _ => Ok(__FieldTag::Unknown(value.to_string())),
10766 }
10767 }
10768 }
10769 deserializer.deserialize_identifier(Visitor)
10770 }
10771 }
10772 struct Visitor;
10773 impl<'de> serde::de::Visitor<'de> for Visitor {
10774 type Value = FetchReadTokenRequest;
10775 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10776 formatter.write_str("struct FetchReadTokenRequest")
10777 }
10778 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10779 where
10780 A: serde::de::MapAccess<'de>,
10781 {
10782 #[allow(unused_imports)]
10783 use serde::de::Error;
10784 use std::option::Option::Some;
10785 let mut fields = std::collections::HashSet::new();
10786 let mut result = Self::Value::new();
10787 while let Some(tag) = map.next_key::<__FieldTag>()? {
10788 #[allow(clippy::match_single_binding)]
10789 match tag {
10790 __FieldTag::__git_repository_link => {
10791 if !fields.insert(__FieldTag::__git_repository_link) {
10792 return std::result::Result::Err(A::Error::duplicate_field(
10793 "multiple values for git_repository_link",
10794 ));
10795 }
10796 result.git_repository_link = map
10797 .next_value::<std::option::Option<std::string::String>>()?
10798 .unwrap_or_default();
10799 }
10800 __FieldTag::Unknown(key) => {
10801 let value = map.next_value::<serde_json::Value>()?;
10802 result._unknown_fields.insert(key, value);
10803 }
10804 }
10805 }
10806 std::result::Result::Ok(result)
10807 }
10808 }
10809 deserializer.deserialize_any(Visitor)
10810 }
10811}
10812
10813#[doc(hidden)]
10814impl serde::ser::Serialize for FetchReadTokenRequest {
10815 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10816 where
10817 S: serde::ser::Serializer,
10818 {
10819 use serde::ser::SerializeMap;
10820 #[allow(unused_imports)]
10821 use std::option::Option::Some;
10822 let mut state = serializer.serialize_map(std::option::Option::None)?;
10823 if !self.git_repository_link.is_empty() {
10824 state.serialize_entry("gitRepositoryLink", &self.git_repository_link)?;
10825 }
10826 if !self._unknown_fields.is_empty() {
10827 for (key, value) in self._unknown_fields.iter() {
10828 state.serialize_entry(key, &value)?;
10829 }
10830 }
10831 state.end()
10832 }
10833}
10834
10835impl std::fmt::Debug for FetchReadTokenRequest {
10836 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10837 let mut debug_struct = f.debug_struct("FetchReadTokenRequest");
10838 debug_struct.field("git_repository_link", &self.git_repository_link);
10839 if !self._unknown_fields.is_empty() {
10840 debug_struct.field("_unknown_fields", &self._unknown_fields);
10841 }
10842 debug_struct.finish()
10843 }
10844}
10845
10846#[derive(Clone, Default, PartialEq)]
10848#[non_exhaustive]
10849pub struct FetchReadTokenResponse {
10850 pub token: std::string::String,
10852
10853 pub expiration_time: std::option::Option<wkt::Timestamp>,
10855
10856 pub git_username: std::string::String,
10860
10861 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10862}
10863
10864impl FetchReadTokenResponse {
10865 pub fn new() -> Self {
10866 std::default::Default::default()
10867 }
10868
10869 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10871 self.token = v.into();
10872 self
10873 }
10874
10875 pub fn set_expiration_time<T>(mut self, v: T) -> Self
10877 where
10878 T: std::convert::Into<wkt::Timestamp>,
10879 {
10880 self.expiration_time = std::option::Option::Some(v.into());
10881 self
10882 }
10883
10884 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
10886 where
10887 T: std::convert::Into<wkt::Timestamp>,
10888 {
10889 self.expiration_time = v.map(|x| x.into());
10890 self
10891 }
10892
10893 pub fn set_git_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10895 self.git_username = v.into();
10896 self
10897 }
10898}
10899
10900impl wkt::message::Message for FetchReadTokenResponse {
10901 fn typename() -> &'static str {
10902 "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadTokenResponse"
10903 }
10904}
10905
10906#[doc(hidden)]
10907impl<'de> serde::de::Deserialize<'de> for FetchReadTokenResponse {
10908 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10909 where
10910 D: serde::Deserializer<'de>,
10911 {
10912 #[allow(non_camel_case_types)]
10913 #[doc(hidden)]
10914 #[derive(PartialEq, Eq, Hash)]
10915 enum __FieldTag {
10916 __token,
10917 __expiration_time,
10918 __git_username,
10919 Unknown(std::string::String),
10920 }
10921 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10922 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10923 where
10924 D: serde::Deserializer<'de>,
10925 {
10926 struct Visitor;
10927 impl<'de> serde::de::Visitor<'de> for Visitor {
10928 type Value = __FieldTag;
10929 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10930 formatter.write_str("a field name for FetchReadTokenResponse")
10931 }
10932 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10933 where
10934 E: serde::de::Error,
10935 {
10936 use std::result::Result::Ok;
10937 use std::string::ToString;
10938 match value {
10939 "token" => Ok(__FieldTag::__token),
10940 "expirationTime" => Ok(__FieldTag::__expiration_time),
10941 "expiration_time" => Ok(__FieldTag::__expiration_time),
10942 "gitUsername" => Ok(__FieldTag::__git_username),
10943 "git_username" => Ok(__FieldTag::__git_username),
10944 _ => Ok(__FieldTag::Unknown(value.to_string())),
10945 }
10946 }
10947 }
10948 deserializer.deserialize_identifier(Visitor)
10949 }
10950 }
10951 struct Visitor;
10952 impl<'de> serde::de::Visitor<'de> for Visitor {
10953 type Value = FetchReadTokenResponse;
10954 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10955 formatter.write_str("struct FetchReadTokenResponse")
10956 }
10957 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10958 where
10959 A: serde::de::MapAccess<'de>,
10960 {
10961 #[allow(unused_imports)]
10962 use serde::de::Error;
10963 use std::option::Option::Some;
10964 let mut fields = std::collections::HashSet::new();
10965 let mut result = Self::Value::new();
10966 while let Some(tag) = map.next_key::<__FieldTag>()? {
10967 #[allow(clippy::match_single_binding)]
10968 match tag {
10969 __FieldTag::__token => {
10970 if !fields.insert(__FieldTag::__token) {
10971 return std::result::Result::Err(A::Error::duplicate_field(
10972 "multiple values for token",
10973 ));
10974 }
10975 result.token = map
10976 .next_value::<std::option::Option<std::string::String>>()?
10977 .unwrap_or_default();
10978 }
10979 __FieldTag::__expiration_time => {
10980 if !fields.insert(__FieldTag::__expiration_time) {
10981 return std::result::Result::Err(A::Error::duplicate_field(
10982 "multiple values for expiration_time",
10983 ));
10984 }
10985 result.expiration_time =
10986 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
10987 }
10988 __FieldTag::__git_username => {
10989 if !fields.insert(__FieldTag::__git_username) {
10990 return std::result::Result::Err(A::Error::duplicate_field(
10991 "multiple values for git_username",
10992 ));
10993 }
10994 result.git_username = map
10995 .next_value::<std::option::Option<std::string::String>>()?
10996 .unwrap_or_default();
10997 }
10998 __FieldTag::Unknown(key) => {
10999 let value = map.next_value::<serde_json::Value>()?;
11000 result._unknown_fields.insert(key, value);
11001 }
11002 }
11003 }
11004 std::result::Result::Ok(result)
11005 }
11006 }
11007 deserializer.deserialize_any(Visitor)
11008 }
11009}
11010
11011#[doc(hidden)]
11012impl serde::ser::Serialize for FetchReadTokenResponse {
11013 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11014 where
11015 S: serde::ser::Serializer,
11016 {
11017 use serde::ser::SerializeMap;
11018 #[allow(unused_imports)]
11019 use std::option::Option::Some;
11020 let mut state = serializer.serialize_map(std::option::Option::None)?;
11021 if !self.token.is_empty() {
11022 state.serialize_entry("token", &self.token)?;
11023 }
11024 if self.expiration_time.is_some() {
11025 state.serialize_entry("expirationTime", &self.expiration_time)?;
11026 }
11027 if !self.git_username.is_empty() {
11028 state.serialize_entry("gitUsername", &self.git_username)?;
11029 }
11030 if !self._unknown_fields.is_empty() {
11031 for (key, value) in self._unknown_fields.iter() {
11032 state.serialize_entry(key, &value)?;
11033 }
11034 }
11035 state.end()
11036 }
11037}
11038
11039impl std::fmt::Debug for FetchReadTokenResponse {
11040 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11041 let mut debug_struct = f.debug_struct("FetchReadTokenResponse");
11042 debug_struct.field("token", &self.token);
11043 debug_struct.field("expiration_time", &self.expiration_time);
11044 debug_struct.field("git_username", &self.git_username);
11045 if !self._unknown_fields.is_empty() {
11046 debug_struct.field("_unknown_fields", &self._unknown_fields);
11047 }
11048 debug_struct.finish()
11049 }
11050}
11051
11052#[derive(Clone, Default, PartialEq)]
11054#[non_exhaustive]
11055pub struct FetchReadWriteTokenResponse {
11056 pub token: std::string::String,
11058
11059 pub expiration_time: std::option::Option<wkt::Timestamp>,
11061
11062 pub git_username: std::string::String,
11066
11067 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11068}
11069
11070impl FetchReadWriteTokenResponse {
11071 pub fn new() -> Self {
11072 std::default::Default::default()
11073 }
11074
11075 pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11077 self.token = v.into();
11078 self
11079 }
11080
11081 pub fn set_expiration_time<T>(mut self, v: T) -> Self
11083 where
11084 T: std::convert::Into<wkt::Timestamp>,
11085 {
11086 self.expiration_time = std::option::Option::Some(v.into());
11087 self
11088 }
11089
11090 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
11092 where
11093 T: std::convert::Into<wkt::Timestamp>,
11094 {
11095 self.expiration_time = v.map(|x| x.into());
11096 self
11097 }
11098
11099 pub fn set_git_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11101 self.git_username = v.into();
11102 self
11103 }
11104}
11105
11106impl wkt::message::Message for FetchReadWriteTokenResponse {
11107 fn typename() -> &'static str {
11108 "type.googleapis.com/google.cloud.developerconnect.v1.FetchReadWriteTokenResponse"
11109 }
11110}
11111
11112#[doc(hidden)]
11113impl<'de> serde::de::Deserialize<'de> for FetchReadWriteTokenResponse {
11114 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11115 where
11116 D: serde::Deserializer<'de>,
11117 {
11118 #[allow(non_camel_case_types)]
11119 #[doc(hidden)]
11120 #[derive(PartialEq, Eq, Hash)]
11121 enum __FieldTag {
11122 __token,
11123 __expiration_time,
11124 __git_username,
11125 Unknown(std::string::String),
11126 }
11127 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11128 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11129 where
11130 D: serde::Deserializer<'de>,
11131 {
11132 struct Visitor;
11133 impl<'de> serde::de::Visitor<'de> for Visitor {
11134 type Value = __FieldTag;
11135 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11136 formatter.write_str("a field name for FetchReadWriteTokenResponse")
11137 }
11138 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11139 where
11140 E: serde::de::Error,
11141 {
11142 use std::result::Result::Ok;
11143 use std::string::ToString;
11144 match value {
11145 "token" => Ok(__FieldTag::__token),
11146 "expirationTime" => Ok(__FieldTag::__expiration_time),
11147 "expiration_time" => Ok(__FieldTag::__expiration_time),
11148 "gitUsername" => Ok(__FieldTag::__git_username),
11149 "git_username" => Ok(__FieldTag::__git_username),
11150 _ => Ok(__FieldTag::Unknown(value.to_string())),
11151 }
11152 }
11153 }
11154 deserializer.deserialize_identifier(Visitor)
11155 }
11156 }
11157 struct Visitor;
11158 impl<'de> serde::de::Visitor<'de> for Visitor {
11159 type Value = FetchReadWriteTokenResponse;
11160 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11161 formatter.write_str("struct FetchReadWriteTokenResponse")
11162 }
11163 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11164 where
11165 A: serde::de::MapAccess<'de>,
11166 {
11167 #[allow(unused_imports)]
11168 use serde::de::Error;
11169 use std::option::Option::Some;
11170 let mut fields = std::collections::HashSet::new();
11171 let mut result = Self::Value::new();
11172 while let Some(tag) = map.next_key::<__FieldTag>()? {
11173 #[allow(clippy::match_single_binding)]
11174 match tag {
11175 __FieldTag::__token => {
11176 if !fields.insert(__FieldTag::__token) {
11177 return std::result::Result::Err(A::Error::duplicate_field(
11178 "multiple values for token",
11179 ));
11180 }
11181 result.token = map
11182 .next_value::<std::option::Option<std::string::String>>()?
11183 .unwrap_or_default();
11184 }
11185 __FieldTag::__expiration_time => {
11186 if !fields.insert(__FieldTag::__expiration_time) {
11187 return std::result::Result::Err(A::Error::duplicate_field(
11188 "multiple values for expiration_time",
11189 ));
11190 }
11191 result.expiration_time =
11192 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
11193 }
11194 __FieldTag::__git_username => {
11195 if !fields.insert(__FieldTag::__git_username) {
11196 return std::result::Result::Err(A::Error::duplicate_field(
11197 "multiple values for git_username",
11198 ));
11199 }
11200 result.git_username = map
11201 .next_value::<std::option::Option<std::string::String>>()?
11202 .unwrap_or_default();
11203 }
11204 __FieldTag::Unknown(key) => {
11205 let value = map.next_value::<serde_json::Value>()?;
11206 result._unknown_fields.insert(key, value);
11207 }
11208 }
11209 }
11210 std::result::Result::Ok(result)
11211 }
11212 }
11213 deserializer.deserialize_any(Visitor)
11214 }
11215}
11216
11217#[doc(hidden)]
11218impl serde::ser::Serialize for FetchReadWriteTokenResponse {
11219 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11220 where
11221 S: serde::ser::Serializer,
11222 {
11223 use serde::ser::SerializeMap;
11224 #[allow(unused_imports)]
11225 use std::option::Option::Some;
11226 let mut state = serializer.serialize_map(std::option::Option::None)?;
11227 if !self.token.is_empty() {
11228 state.serialize_entry("token", &self.token)?;
11229 }
11230 if self.expiration_time.is_some() {
11231 state.serialize_entry("expirationTime", &self.expiration_time)?;
11232 }
11233 if !self.git_username.is_empty() {
11234 state.serialize_entry("gitUsername", &self.git_username)?;
11235 }
11236 if !self._unknown_fields.is_empty() {
11237 for (key, value) in self._unknown_fields.iter() {
11238 state.serialize_entry(key, &value)?;
11239 }
11240 }
11241 state.end()
11242 }
11243}
11244
11245impl std::fmt::Debug for FetchReadWriteTokenResponse {
11246 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11247 let mut debug_struct = f.debug_struct("FetchReadWriteTokenResponse");
11248 debug_struct.field("token", &self.token);
11249 debug_struct.field("expiration_time", &self.expiration_time);
11250 debug_struct.field("git_username", &self.git_username);
11251 if !self._unknown_fields.is_empty() {
11252 debug_struct.field("_unknown_fields", &self._unknown_fields);
11253 }
11254 debug_struct.finish()
11255 }
11256}
11257
11258#[derive(Clone, Default, PartialEq)]
11260#[non_exhaustive]
11261pub struct FetchLinkableGitRepositoriesRequest {
11262 pub connection: std::string::String,
11265
11266 pub page_size: i32,
11268
11269 pub page_token: std::string::String,
11271
11272 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11273}
11274
11275impl FetchLinkableGitRepositoriesRequest {
11276 pub fn new() -> Self {
11277 std::default::Default::default()
11278 }
11279
11280 pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11282 self.connection = v.into();
11283 self
11284 }
11285
11286 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11288 self.page_size = v.into();
11289 self
11290 }
11291
11292 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11294 self.page_token = v.into();
11295 self
11296 }
11297}
11298
11299impl wkt::message::Message for FetchLinkableGitRepositoriesRequest {
11300 fn typename() -> &'static str {
11301 "type.googleapis.com/google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesRequest"
11302 }
11303}
11304
11305#[doc(hidden)]
11306impl<'de> serde::de::Deserialize<'de> for FetchLinkableGitRepositoriesRequest {
11307 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11308 where
11309 D: serde::Deserializer<'de>,
11310 {
11311 #[allow(non_camel_case_types)]
11312 #[doc(hidden)]
11313 #[derive(PartialEq, Eq, Hash)]
11314 enum __FieldTag {
11315 __connection,
11316 __page_size,
11317 __page_token,
11318 Unknown(std::string::String),
11319 }
11320 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11321 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11322 where
11323 D: serde::Deserializer<'de>,
11324 {
11325 struct Visitor;
11326 impl<'de> serde::de::Visitor<'de> for Visitor {
11327 type Value = __FieldTag;
11328 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11329 formatter.write_str("a field name for FetchLinkableGitRepositoriesRequest")
11330 }
11331 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11332 where
11333 E: serde::de::Error,
11334 {
11335 use std::result::Result::Ok;
11336 use std::string::ToString;
11337 match value {
11338 "connection" => Ok(__FieldTag::__connection),
11339 "pageSize" => Ok(__FieldTag::__page_size),
11340 "page_size" => Ok(__FieldTag::__page_size),
11341 "pageToken" => Ok(__FieldTag::__page_token),
11342 "page_token" => Ok(__FieldTag::__page_token),
11343 _ => Ok(__FieldTag::Unknown(value.to_string())),
11344 }
11345 }
11346 }
11347 deserializer.deserialize_identifier(Visitor)
11348 }
11349 }
11350 struct Visitor;
11351 impl<'de> serde::de::Visitor<'de> for Visitor {
11352 type Value = FetchLinkableGitRepositoriesRequest;
11353 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11354 formatter.write_str("struct FetchLinkableGitRepositoriesRequest")
11355 }
11356 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11357 where
11358 A: serde::de::MapAccess<'de>,
11359 {
11360 #[allow(unused_imports)]
11361 use serde::de::Error;
11362 use std::option::Option::Some;
11363 let mut fields = std::collections::HashSet::new();
11364 let mut result = Self::Value::new();
11365 while let Some(tag) = map.next_key::<__FieldTag>()? {
11366 #[allow(clippy::match_single_binding)]
11367 match tag {
11368 __FieldTag::__connection => {
11369 if !fields.insert(__FieldTag::__connection) {
11370 return std::result::Result::Err(A::Error::duplicate_field(
11371 "multiple values for connection",
11372 ));
11373 }
11374 result.connection = map
11375 .next_value::<std::option::Option<std::string::String>>()?
11376 .unwrap_or_default();
11377 }
11378 __FieldTag::__page_size => {
11379 if !fields.insert(__FieldTag::__page_size) {
11380 return std::result::Result::Err(A::Error::duplicate_field(
11381 "multiple values for page_size",
11382 ));
11383 }
11384 struct __With(std::option::Option<i32>);
11385 impl<'de> serde::de::Deserialize<'de> for __With {
11386 fn deserialize<D>(
11387 deserializer: D,
11388 ) -> std::result::Result<Self, D::Error>
11389 where
11390 D: serde::de::Deserializer<'de>,
11391 {
11392 serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
11393 }
11394 }
11395 result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
11396 }
11397 __FieldTag::__page_token => {
11398 if !fields.insert(__FieldTag::__page_token) {
11399 return std::result::Result::Err(A::Error::duplicate_field(
11400 "multiple values for page_token",
11401 ));
11402 }
11403 result.page_token = map
11404 .next_value::<std::option::Option<std::string::String>>()?
11405 .unwrap_or_default();
11406 }
11407 __FieldTag::Unknown(key) => {
11408 let value = map.next_value::<serde_json::Value>()?;
11409 result._unknown_fields.insert(key, value);
11410 }
11411 }
11412 }
11413 std::result::Result::Ok(result)
11414 }
11415 }
11416 deserializer.deserialize_any(Visitor)
11417 }
11418}
11419
11420#[doc(hidden)]
11421impl serde::ser::Serialize for FetchLinkableGitRepositoriesRequest {
11422 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11423 where
11424 S: serde::ser::Serializer,
11425 {
11426 use serde::ser::SerializeMap;
11427 #[allow(unused_imports)]
11428 use std::option::Option::Some;
11429 let mut state = serializer.serialize_map(std::option::Option::None)?;
11430 if !self.connection.is_empty() {
11431 state.serialize_entry("connection", &self.connection)?;
11432 }
11433 if !wkt::internal::is_default(&self.page_size) {
11434 struct __With<'a>(&'a i32);
11435 impl<'a> serde::ser::Serialize for __With<'a> {
11436 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11437 where
11438 S: serde::ser::Serializer,
11439 {
11440 serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
11441 }
11442 }
11443 state.serialize_entry("pageSize", &__With(&self.page_size))?;
11444 }
11445 if !self.page_token.is_empty() {
11446 state.serialize_entry("pageToken", &self.page_token)?;
11447 }
11448 if !self._unknown_fields.is_empty() {
11449 for (key, value) in self._unknown_fields.iter() {
11450 state.serialize_entry(key, &value)?;
11451 }
11452 }
11453 state.end()
11454 }
11455}
11456
11457impl std::fmt::Debug for FetchLinkableGitRepositoriesRequest {
11458 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11459 let mut debug_struct = f.debug_struct("FetchLinkableGitRepositoriesRequest");
11460 debug_struct.field("connection", &self.connection);
11461 debug_struct.field("page_size", &self.page_size);
11462 debug_struct.field("page_token", &self.page_token);
11463 if !self._unknown_fields.is_empty() {
11464 debug_struct.field("_unknown_fields", &self._unknown_fields);
11465 }
11466 debug_struct.finish()
11467 }
11468}
11469
11470#[derive(Clone, Default, PartialEq)]
11472#[non_exhaustive]
11473pub struct FetchLinkableGitRepositoriesResponse {
11474 pub linkable_git_repositories: std::vec::Vec<crate::model::LinkableGitRepository>,
11476
11477 pub next_page_token: std::string::String,
11479
11480 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11481}
11482
11483impl FetchLinkableGitRepositoriesResponse {
11484 pub fn new() -> Self {
11485 std::default::Default::default()
11486 }
11487
11488 pub fn set_linkable_git_repositories<T, V>(mut self, v: T) -> Self
11490 where
11491 T: std::iter::IntoIterator<Item = V>,
11492 V: std::convert::Into<crate::model::LinkableGitRepository>,
11493 {
11494 use std::iter::Iterator;
11495 self.linkable_git_repositories = v.into_iter().map(|i| i.into()).collect();
11496 self
11497 }
11498
11499 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11501 self.next_page_token = v.into();
11502 self
11503 }
11504}
11505
11506impl wkt::message::Message for FetchLinkableGitRepositoriesResponse {
11507 fn typename() -> &'static str {
11508 "type.googleapis.com/google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesResponse"
11509 }
11510}
11511
11512#[doc(hidden)]
11513impl gax::paginator::internal::PageableResponse for FetchLinkableGitRepositoriesResponse {
11514 type PageItem = crate::model::LinkableGitRepository;
11515
11516 fn items(self) -> std::vec::Vec<Self::PageItem> {
11517 self.linkable_git_repositories
11518 }
11519
11520 fn next_page_token(&self) -> std::string::String {
11521 use std::clone::Clone;
11522 self.next_page_token.clone()
11523 }
11524}
11525
11526#[doc(hidden)]
11527impl<'de> serde::de::Deserialize<'de> for FetchLinkableGitRepositoriesResponse {
11528 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11529 where
11530 D: serde::Deserializer<'de>,
11531 {
11532 #[allow(non_camel_case_types)]
11533 #[doc(hidden)]
11534 #[derive(PartialEq, Eq, Hash)]
11535 enum __FieldTag {
11536 __linkable_git_repositories,
11537 __next_page_token,
11538 Unknown(std::string::String),
11539 }
11540 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11541 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11542 where
11543 D: serde::Deserializer<'de>,
11544 {
11545 struct Visitor;
11546 impl<'de> serde::de::Visitor<'de> for Visitor {
11547 type Value = __FieldTag;
11548 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11549 formatter.write_str("a field name for FetchLinkableGitRepositoriesResponse")
11550 }
11551 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11552 where
11553 E: serde::de::Error,
11554 {
11555 use std::result::Result::Ok;
11556 use std::string::ToString;
11557 match value {
11558 "linkableGitRepositories" => {
11559 Ok(__FieldTag::__linkable_git_repositories)
11560 }
11561 "linkable_git_repositories" => {
11562 Ok(__FieldTag::__linkable_git_repositories)
11563 }
11564 "nextPageToken" => Ok(__FieldTag::__next_page_token),
11565 "next_page_token" => Ok(__FieldTag::__next_page_token),
11566 _ => Ok(__FieldTag::Unknown(value.to_string())),
11567 }
11568 }
11569 }
11570 deserializer.deserialize_identifier(Visitor)
11571 }
11572 }
11573 struct Visitor;
11574 impl<'de> serde::de::Visitor<'de> for Visitor {
11575 type Value = FetchLinkableGitRepositoriesResponse;
11576 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11577 formatter.write_str("struct FetchLinkableGitRepositoriesResponse")
11578 }
11579 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11580 where
11581 A: serde::de::MapAccess<'de>,
11582 {
11583 #[allow(unused_imports)]
11584 use serde::de::Error;
11585 use std::option::Option::Some;
11586 let mut fields = std::collections::HashSet::new();
11587 let mut result = Self::Value::new();
11588 while let Some(tag) = map.next_key::<__FieldTag>()? {
11589 #[allow(clippy::match_single_binding)]
11590 match tag {
11591 __FieldTag::__linkable_git_repositories => {
11592 if !fields.insert(__FieldTag::__linkable_git_repositories) {
11593 return std::result::Result::Err(A::Error::duplicate_field(
11594 "multiple values for linkable_git_repositories",
11595 ));
11596 }
11597 result.linkable_git_repositories = map
11598 .next_value::<std::option::Option<
11599 std::vec::Vec<crate::model::LinkableGitRepository>,
11600 >>()?
11601 .unwrap_or_default();
11602 }
11603 __FieldTag::__next_page_token => {
11604 if !fields.insert(__FieldTag::__next_page_token) {
11605 return std::result::Result::Err(A::Error::duplicate_field(
11606 "multiple values for next_page_token",
11607 ));
11608 }
11609 result.next_page_token = map
11610 .next_value::<std::option::Option<std::string::String>>()?
11611 .unwrap_or_default();
11612 }
11613 __FieldTag::Unknown(key) => {
11614 let value = map.next_value::<serde_json::Value>()?;
11615 result._unknown_fields.insert(key, value);
11616 }
11617 }
11618 }
11619 std::result::Result::Ok(result)
11620 }
11621 }
11622 deserializer.deserialize_any(Visitor)
11623 }
11624}
11625
11626#[doc(hidden)]
11627impl serde::ser::Serialize for FetchLinkableGitRepositoriesResponse {
11628 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11629 where
11630 S: serde::ser::Serializer,
11631 {
11632 use serde::ser::SerializeMap;
11633 #[allow(unused_imports)]
11634 use std::option::Option::Some;
11635 let mut state = serializer.serialize_map(std::option::Option::None)?;
11636 if !self.linkable_git_repositories.is_empty() {
11637 state.serialize_entry("linkableGitRepositories", &self.linkable_git_repositories)?;
11638 }
11639 if !self.next_page_token.is_empty() {
11640 state.serialize_entry("nextPageToken", &self.next_page_token)?;
11641 }
11642 if !self._unknown_fields.is_empty() {
11643 for (key, value) in self._unknown_fields.iter() {
11644 state.serialize_entry(key, &value)?;
11645 }
11646 }
11647 state.end()
11648 }
11649}
11650
11651impl std::fmt::Debug for FetchLinkableGitRepositoriesResponse {
11652 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11653 let mut debug_struct = f.debug_struct("FetchLinkableGitRepositoriesResponse");
11654 debug_struct.field("linkable_git_repositories", &self.linkable_git_repositories);
11655 debug_struct.field("next_page_token", &self.next_page_token);
11656 if !self._unknown_fields.is_empty() {
11657 debug_struct.field("_unknown_fields", &self._unknown_fields);
11658 }
11659 debug_struct.finish()
11660 }
11661}
11662
11663#[derive(Clone, Default, PartialEq)]
11666#[non_exhaustive]
11667pub struct LinkableGitRepository {
11668 pub clone_uri: std::string::String,
11670
11671 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11672}
11673
11674impl LinkableGitRepository {
11675 pub fn new() -> Self {
11676 std::default::Default::default()
11677 }
11678
11679 pub fn set_clone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11681 self.clone_uri = v.into();
11682 self
11683 }
11684}
11685
11686impl wkt::message::Message for LinkableGitRepository {
11687 fn typename() -> &'static str {
11688 "type.googleapis.com/google.cloud.developerconnect.v1.LinkableGitRepository"
11689 }
11690}
11691
11692#[doc(hidden)]
11693impl<'de> serde::de::Deserialize<'de> for LinkableGitRepository {
11694 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11695 where
11696 D: serde::Deserializer<'de>,
11697 {
11698 #[allow(non_camel_case_types)]
11699 #[doc(hidden)]
11700 #[derive(PartialEq, Eq, Hash)]
11701 enum __FieldTag {
11702 __clone_uri,
11703 Unknown(std::string::String),
11704 }
11705 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11706 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11707 where
11708 D: serde::Deserializer<'de>,
11709 {
11710 struct Visitor;
11711 impl<'de> serde::de::Visitor<'de> for Visitor {
11712 type Value = __FieldTag;
11713 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11714 formatter.write_str("a field name for LinkableGitRepository")
11715 }
11716 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11717 where
11718 E: serde::de::Error,
11719 {
11720 use std::result::Result::Ok;
11721 use std::string::ToString;
11722 match value {
11723 "cloneUri" => Ok(__FieldTag::__clone_uri),
11724 "clone_uri" => Ok(__FieldTag::__clone_uri),
11725 _ => Ok(__FieldTag::Unknown(value.to_string())),
11726 }
11727 }
11728 }
11729 deserializer.deserialize_identifier(Visitor)
11730 }
11731 }
11732 struct Visitor;
11733 impl<'de> serde::de::Visitor<'de> for Visitor {
11734 type Value = LinkableGitRepository;
11735 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11736 formatter.write_str("struct LinkableGitRepository")
11737 }
11738 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11739 where
11740 A: serde::de::MapAccess<'de>,
11741 {
11742 #[allow(unused_imports)]
11743 use serde::de::Error;
11744 use std::option::Option::Some;
11745 let mut fields = std::collections::HashSet::new();
11746 let mut result = Self::Value::new();
11747 while let Some(tag) = map.next_key::<__FieldTag>()? {
11748 #[allow(clippy::match_single_binding)]
11749 match tag {
11750 __FieldTag::__clone_uri => {
11751 if !fields.insert(__FieldTag::__clone_uri) {
11752 return std::result::Result::Err(A::Error::duplicate_field(
11753 "multiple values for clone_uri",
11754 ));
11755 }
11756 result.clone_uri = map
11757 .next_value::<std::option::Option<std::string::String>>()?
11758 .unwrap_or_default();
11759 }
11760 __FieldTag::Unknown(key) => {
11761 let value = map.next_value::<serde_json::Value>()?;
11762 result._unknown_fields.insert(key, value);
11763 }
11764 }
11765 }
11766 std::result::Result::Ok(result)
11767 }
11768 }
11769 deserializer.deserialize_any(Visitor)
11770 }
11771}
11772
11773#[doc(hidden)]
11774impl serde::ser::Serialize for LinkableGitRepository {
11775 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11776 where
11777 S: serde::ser::Serializer,
11778 {
11779 use serde::ser::SerializeMap;
11780 #[allow(unused_imports)]
11781 use std::option::Option::Some;
11782 let mut state = serializer.serialize_map(std::option::Option::None)?;
11783 if !self.clone_uri.is_empty() {
11784 state.serialize_entry("cloneUri", &self.clone_uri)?;
11785 }
11786 if !self._unknown_fields.is_empty() {
11787 for (key, value) in self._unknown_fields.iter() {
11788 state.serialize_entry(key, &value)?;
11789 }
11790 }
11791 state.end()
11792 }
11793}
11794
11795impl std::fmt::Debug for LinkableGitRepository {
11796 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11797 let mut debug_struct = f.debug_struct("LinkableGitRepository");
11798 debug_struct.field("clone_uri", &self.clone_uri);
11799 if !self._unknown_fields.is_empty() {
11800 debug_struct.field("_unknown_fields", &self._unknown_fields);
11801 }
11802 debug_struct.finish()
11803 }
11804}
11805
11806#[derive(Clone, Default, PartialEq)]
11808#[non_exhaustive]
11809pub struct FetchGitHubInstallationsRequest {
11810 pub connection: std::string::String,
11813
11814 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11815}
11816
11817impl FetchGitHubInstallationsRequest {
11818 pub fn new() -> Self {
11819 std::default::Default::default()
11820 }
11821
11822 pub fn set_connection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11824 self.connection = v.into();
11825 self
11826 }
11827}
11828
11829impl wkt::message::Message for FetchGitHubInstallationsRequest {
11830 fn typename() -> &'static str {
11831 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsRequest"
11832 }
11833}
11834
11835#[doc(hidden)]
11836impl<'de> serde::de::Deserialize<'de> for FetchGitHubInstallationsRequest {
11837 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11838 where
11839 D: serde::Deserializer<'de>,
11840 {
11841 #[allow(non_camel_case_types)]
11842 #[doc(hidden)]
11843 #[derive(PartialEq, Eq, Hash)]
11844 enum __FieldTag {
11845 __connection,
11846 Unknown(std::string::String),
11847 }
11848 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11849 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11850 where
11851 D: serde::Deserializer<'de>,
11852 {
11853 struct Visitor;
11854 impl<'de> serde::de::Visitor<'de> for Visitor {
11855 type Value = __FieldTag;
11856 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11857 formatter.write_str("a field name for FetchGitHubInstallationsRequest")
11858 }
11859 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11860 where
11861 E: serde::de::Error,
11862 {
11863 use std::result::Result::Ok;
11864 use std::string::ToString;
11865 match value {
11866 "connection" => Ok(__FieldTag::__connection),
11867 _ => Ok(__FieldTag::Unknown(value.to_string())),
11868 }
11869 }
11870 }
11871 deserializer.deserialize_identifier(Visitor)
11872 }
11873 }
11874 struct Visitor;
11875 impl<'de> serde::de::Visitor<'de> for Visitor {
11876 type Value = FetchGitHubInstallationsRequest;
11877 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11878 formatter.write_str("struct FetchGitHubInstallationsRequest")
11879 }
11880 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11881 where
11882 A: serde::de::MapAccess<'de>,
11883 {
11884 #[allow(unused_imports)]
11885 use serde::de::Error;
11886 use std::option::Option::Some;
11887 let mut fields = std::collections::HashSet::new();
11888 let mut result = Self::Value::new();
11889 while let Some(tag) = map.next_key::<__FieldTag>()? {
11890 #[allow(clippy::match_single_binding)]
11891 match tag {
11892 __FieldTag::__connection => {
11893 if !fields.insert(__FieldTag::__connection) {
11894 return std::result::Result::Err(A::Error::duplicate_field(
11895 "multiple values for connection",
11896 ));
11897 }
11898 result.connection = map
11899 .next_value::<std::option::Option<std::string::String>>()?
11900 .unwrap_or_default();
11901 }
11902 __FieldTag::Unknown(key) => {
11903 let value = map.next_value::<serde_json::Value>()?;
11904 result._unknown_fields.insert(key, value);
11905 }
11906 }
11907 }
11908 std::result::Result::Ok(result)
11909 }
11910 }
11911 deserializer.deserialize_any(Visitor)
11912 }
11913}
11914
11915#[doc(hidden)]
11916impl serde::ser::Serialize for FetchGitHubInstallationsRequest {
11917 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11918 where
11919 S: serde::ser::Serializer,
11920 {
11921 use serde::ser::SerializeMap;
11922 #[allow(unused_imports)]
11923 use std::option::Option::Some;
11924 let mut state = serializer.serialize_map(std::option::Option::None)?;
11925 if !self.connection.is_empty() {
11926 state.serialize_entry("connection", &self.connection)?;
11927 }
11928 if !self._unknown_fields.is_empty() {
11929 for (key, value) in self._unknown_fields.iter() {
11930 state.serialize_entry(key, &value)?;
11931 }
11932 }
11933 state.end()
11934 }
11935}
11936
11937impl std::fmt::Debug for FetchGitHubInstallationsRequest {
11938 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11939 let mut debug_struct = f.debug_struct("FetchGitHubInstallationsRequest");
11940 debug_struct.field("connection", &self.connection);
11941 if !self._unknown_fields.is_empty() {
11942 debug_struct.field("_unknown_fields", &self._unknown_fields);
11943 }
11944 debug_struct.finish()
11945 }
11946}
11947
11948#[derive(Clone, Default, PartialEq)]
11950#[non_exhaustive]
11951pub struct FetchGitHubInstallationsResponse {
11952 pub installations:
11955 std::vec::Vec<crate::model::fetch_git_hub_installations_response::Installation>,
11956
11957 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11958}
11959
11960impl FetchGitHubInstallationsResponse {
11961 pub fn new() -> Self {
11962 std::default::Default::default()
11963 }
11964
11965 pub fn set_installations<T, V>(mut self, v: T) -> Self
11967 where
11968 T: std::iter::IntoIterator<Item = V>,
11969 V: std::convert::Into<crate::model::fetch_git_hub_installations_response::Installation>,
11970 {
11971 use std::iter::Iterator;
11972 self.installations = v.into_iter().map(|i| i.into()).collect();
11973 self
11974 }
11975}
11976
11977impl wkt::message::Message for FetchGitHubInstallationsResponse {
11978 fn typename() -> &'static str {
11979 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse"
11980 }
11981}
11982
11983#[doc(hidden)]
11984impl<'de> serde::de::Deserialize<'de> for FetchGitHubInstallationsResponse {
11985 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11986 where
11987 D: serde::Deserializer<'de>,
11988 {
11989 #[allow(non_camel_case_types)]
11990 #[doc(hidden)]
11991 #[derive(PartialEq, Eq, Hash)]
11992 enum __FieldTag {
11993 __installations,
11994 Unknown(std::string::String),
11995 }
11996 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11997 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11998 where
11999 D: serde::Deserializer<'de>,
12000 {
12001 struct Visitor;
12002 impl<'de> serde::de::Visitor<'de> for Visitor {
12003 type Value = __FieldTag;
12004 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12005 formatter.write_str("a field name for FetchGitHubInstallationsResponse")
12006 }
12007 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12008 where
12009 E: serde::de::Error,
12010 {
12011 use std::result::Result::Ok;
12012 use std::string::ToString;
12013 match value {
12014 "installations" => Ok(__FieldTag::__installations),
12015 _ => Ok(__FieldTag::Unknown(value.to_string())),
12016 }
12017 }
12018 }
12019 deserializer.deserialize_identifier(Visitor)
12020 }
12021 }
12022 struct Visitor;
12023 impl<'de> serde::de::Visitor<'de> for Visitor {
12024 type Value = FetchGitHubInstallationsResponse;
12025 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12026 formatter.write_str("struct FetchGitHubInstallationsResponse")
12027 }
12028 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12029 where
12030 A: serde::de::MapAccess<'de>,
12031 {
12032 #[allow(unused_imports)]
12033 use serde::de::Error;
12034 use std::option::Option::Some;
12035 let mut fields = std::collections::HashSet::new();
12036 let mut result = Self::Value::new();
12037 while let Some(tag) = map.next_key::<__FieldTag>()? {
12038 #[allow(clippy::match_single_binding)]
12039 match tag {
12040 __FieldTag::__installations => {
12041 if !fields.insert(__FieldTag::__installations) {
12042 return std::result::Result::Err(A::Error::duplicate_field(
12043 "multiple values for installations",
12044 ));
12045 }
12046 result.installations = map.next_value::<std::option::Option<std::vec::Vec<crate::model::fetch_git_hub_installations_response::Installation>>>()?.unwrap_or_default();
12047 }
12048 __FieldTag::Unknown(key) => {
12049 let value = map.next_value::<serde_json::Value>()?;
12050 result._unknown_fields.insert(key, value);
12051 }
12052 }
12053 }
12054 std::result::Result::Ok(result)
12055 }
12056 }
12057 deserializer.deserialize_any(Visitor)
12058 }
12059}
12060
12061#[doc(hidden)]
12062impl serde::ser::Serialize for FetchGitHubInstallationsResponse {
12063 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12064 where
12065 S: serde::ser::Serializer,
12066 {
12067 use serde::ser::SerializeMap;
12068 #[allow(unused_imports)]
12069 use std::option::Option::Some;
12070 let mut state = serializer.serialize_map(std::option::Option::None)?;
12071 if !self.installations.is_empty() {
12072 state.serialize_entry("installations", &self.installations)?;
12073 }
12074 if !self._unknown_fields.is_empty() {
12075 for (key, value) in self._unknown_fields.iter() {
12076 state.serialize_entry(key, &value)?;
12077 }
12078 }
12079 state.end()
12080 }
12081}
12082
12083impl std::fmt::Debug for FetchGitHubInstallationsResponse {
12084 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12085 let mut debug_struct = f.debug_struct("FetchGitHubInstallationsResponse");
12086 debug_struct.field("installations", &self.installations);
12087 if !self._unknown_fields.is_empty() {
12088 debug_struct.field("_unknown_fields", &self._unknown_fields);
12089 }
12090 debug_struct.finish()
12091 }
12092}
12093
12094pub mod fetch_git_hub_installations_response {
12096 #[allow(unused_imports)]
12097 use super::*;
12098
12099 #[derive(Clone, Default, PartialEq)]
12101 #[non_exhaustive]
12102 pub struct Installation {
12103 pub id: i64,
12105
12106 pub name: std::string::String,
12108
12109 pub r#type: std::string::String,
12111
12112 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12113 }
12114
12115 impl Installation {
12116 pub fn new() -> Self {
12117 std::default::Default::default()
12118 }
12119
12120 pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12122 self.id = v.into();
12123 self
12124 }
12125
12126 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12128 self.name = v.into();
12129 self
12130 }
12131
12132 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12134 self.r#type = v.into();
12135 self
12136 }
12137 }
12138
12139 impl wkt::message::Message for Installation {
12140 fn typename() -> &'static str {
12141 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse.Installation"
12142 }
12143 }
12144
12145 #[doc(hidden)]
12146 impl<'de> serde::de::Deserialize<'de> for Installation {
12147 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12148 where
12149 D: serde::Deserializer<'de>,
12150 {
12151 #[allow(non_camel_case_types)]
12152 #[doc(hidden)]
12153 #[derive(PartialEq, Eq, Hash)]
12154 enum __FieldTag {
12155 __id,
12156 __name,
12157 __type,
12158 Unknown(std::string::String),
12159 }
12160 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12161 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12162 where
12163 D: serde::Deserializer<'de>,
12164 {
12165 struct Visitor;
12166 impl<'de> serde::de::Visitor<'de> for Visitor {
12167 type Value = __FieldTag;
12168 fn expecting(
12169 &self,
12170 formatter: &mut std::fmt::Formatter,
12171 ) -> std::fmt::Result {
12172 formatter.write_str("a field name for Installation")
12173 }
12174 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12175 where
12176 E: serde::de::Error,
12177 {
12178 use std::result::Result::Ok;
12179 use std::string::ToString;
12180 match value {
12181 "id" => Ok(__FieldTag::__id),
12182 "name" => Ok(__FieldTag::__name),
12183 "type" => Ok(__FieldTag::__type),
12184 _ => Ok(__FieldTag::Unknown(value.to_string())),
12185 }
12186 }
12187 }
12188 deserializer.deserialize_identifier(Visitor)
12189 }
12190 }
12191 struct Visitor;
12192 impl<'de> serde::de::Visitor<'de> for Visitor {
12193 type Value = Installation;
12194 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12195 formatter.write_str("struct Installation")
12196 }
12197 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12198 where
12199 A: serde::de::MapAccess<'de>,
12200 {
12201 #[allow(unused_imports)]
12202 use serde::de::Error;
12203 use std::option::Option::Some;
12204 let mut fields = std::collections::HashSet::new();
12205 let mut result = Self::Value::new();
12206 while let Some(tag) = map.next_key::<__FieldTag>()? {
12207 #[allow(clippy::match_single_binding)]
12208 match tag {
12209 __FieldTag::__id => {
12210 if !fields.insert(__FieldTag::__id) {
12211 return std::result::Result::Err(A::Error::duplicate_field(
12212 "multiple values for id",
12213 ));
12214 }
12215 struct __With(std::option::Option<i64>);
12216 impl<'de> serde::de::Deserialize<'de> for __With {
12217 fn deserialize<D>(
12218 deserializer: D,
12219 ) -> std::result::Result<Self, D::Error>
12220 where
12221 D: serde::de::Deserializer<'de>,
12222 {
12223 serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
12224 }
12225 }
12226 result.id = map.next_value::<__With>()?.0.unwrap_or_default();
12227 }
12228 __FieldTag::__name => {
12229 if !fields.insert(__FieldTag::__name) {
12230 return std::result::Result::Err(A::Error::duplicate_field(
12231 "multiple values for name",
12232 ));
12233 }
12234 result.name = map
12235 .next_value::<std::option::Option<std::string::String>>()?
12236 .unwrap_or_default();
12237 }
12238 __FieldTag::__type => {
12239 if !fields.insert(__FieldTag::__type) {
12240 return std::result::Result::Err(A::Error::duplicate_field(
12241 "multiple values for type",
12242 ));
12243 }
12244 result.r#type = map
12245 .next_value::<std::option::Option<std::string::String>>()?
12246 .unwrap_or_default();
12247 }
12248 __FieldTag::Unknown(key) => {
12249 let value = map.next_value::<serde_json::Value>()?;
12250 result._unknown_fields.insert(key, value);
12251 }
12252 }
12253 }
12254 std::result::Result::Ok(result)
12255 }
12256 }
12257 deserializer.deserialize_any(Visitor)
12258 }
12259 }
12260
12261 #[doc(hidden)]
12262 impl serde::ser::Serialize for Installation {
12263 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12264 where
12265 S: serde::ser::Serializer,
12266 {
12267 use serde::ser::SerializeMap;
12268 #[allow(unused_imports)]
12269 use std::option::Option::Some;
12270 let mut state = serializer.serialize_map(std::option::Option::None)?;
12271 if !wkt::internal::is_default(&self.id) {
12272 struct __With<'a>(&'a i64);
12273 impl<'a> serde::ser::Serialize for __With<'a> {
12274 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12275 where
12276 S: serde::ser::Serializer,
12277 {
12278 serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
12279 }
12280 }
12281 state.serialize_entry("id", &__With(&self.id))?;
12282 }
12283 if !self.name.is_empty() {
12284 state.serialize_entry("name", &self.name)?;
12285 }
12286 if !self.r#type.is_empty() {
12287 state.serialize_entry("type", &self.r#type)?;
12288 }
12289 if !self._unknown_fields.is_empty() {
12290 for (key, value) in self._unknown_fields.iter() {
12291 state.serialize_entry(key, &value)?;
12292 }
12293 }
12294 state.end()
12295 }
12296 }
12297
12298 impl std::fmt::Debug for Installation {
12299 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12300 let mut debug_struct = f.debug_struct("Installation");
12301 debug_struct.field("id", &self.id);
12302 debug_struct.field("name", &self.name);
12303 debug_struct.field("r#type", &self.r#type);
12304 if !self._unknown_fields.is_empty() {
12305 debug_struct.field("_unknown_fields", &self._unknown_fields);
12306 }
12307 debug_struct.finish()
12308 }
12309 }
12310}
12311
12312#[derive(Clone, Default, PartialEq)]
12314#[non_exhaustive]
12315pub struct FetchGitRefsRequest {
12316 pub git_repository_link: std::string::String,
12319
12320 pub ref_type: crate::model::fetch_git_refs_request::RefType,
12322
12323 pub page_size: i32,
12325
12326 pub page_token: std::string::String,
12328
12329 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12330}
12331
12332impl FetchGitRefsRequest {
12333 pub fn new() -> Self {
12334 std::default::Default::default()
12335 }
12336
12337 pub fn set_git_repository_link<T: std::convert::Into<std::string::String>>(
12339 mut self,
12340 v: T,
12341 ) -> Self {
12342 self.git_repository_link = v.into();
12343 self
12344 }
12345
12346 pub fn set_ref_type<T: std::convert::Into<crate::model::fetch_git_refs_request::RefType>>(
12348 mut self,
12349 v: T,
12350 ) -> Self {
12351 self.ref_type = v.into();
12352 self
12353 }
12354
12355 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12357 self.page_size = v.into();
12358 self
12359 }
12360
12361 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12363 self.page_token = v.into();
12364 self
12365 }
12366}
12367
12368impl wkt::message::Message for FetchGitRefsRequest {
12369 fn typename() -> &'static str {
12370 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRefsRequest"
12371 }
12372}
12373
12374#[doc(hidden)]
12375impl<'de> serde::de::Deserialize<'de> for FetchGitRefsRequest {
12376 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12377 where
12378 D: serde::Deserializer<'de>,
12379 {
12380 #[allow(non_camel_case_types)]
12381 #[doc(hidden)]
12382 #[derive(PartialEq, Eq, Hash)]
12383 enum __FieldTag {
12384 __git_repository_link,
12385 __ref_type,
12386 __page_size,
12387 __page_token,
12388 Unknown(std::string::String),
12389 }
12390 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12391 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12392 where
12393 D: serde::Deserializer<'de>,
12394 {
12395 struct Visitor;
12396 impl<'de> serde::de::Visitor<'de> for Visitor {
12397 type Value = __FieldTag;
12398 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12399 formatter.write_str("a field name for FetchGitRefsRequest")
12400 }
12401 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12402 where
12403 E: serde::de::Error,
12404 {
12405 use std::result::Result::Ok;
12406 use std::string::ToString;
12407 match value {
12408 "gitRepositoryLink" => Ok(__FieldTag::__git_repository_link),
12409 "git_repository_link" => Ok(__FieldTag::__git_repository_link),
12410 "refType" => Ok(__FieldTag::__ref_type),
12411 "ref_type" => Ok(__FieldTag::__ref_type),
12412 "pageSize" => Ok(__FieldTag::__page_size),
12413 "page_size" => Ok(__FieldTag::__page_size),
12414 "pageToken" => Ok(__FieldTag::__page_token),
12415 "page_token" => Ok(__FieldTag::__page_token),
12416 _ => Ok(__FieldTag::Unknown(value.to_string())),
12417 }
12418 }
12419 }
12420 deserializer.deserialize_identifier(Visitor)
12421 }
12422 }
12423 struct Visitor;
12424 impl<'de> serde::de::Visitor<'de> for Visitor {
12425 type Value = FetchGitRefsRequest;
12426 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12427 formatter.write_str("struct FetchGitRefsRequest")
12428 }
12429 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12430 where
12431 A: serde::de::MapAccess<'de>,
12432 {
12433 #[allow(unused_imports)]
12434 use serde::de::Error;
12435 use std::option::Option::Some;
12436 let mut fields = std::collections::HashSet::new();
12437 let mut result = Self::Value::new();
12438 while let Some(tag) = map.next_key::<__FieldTag>()? {
12439 #[allow(clippy::match_single_binding)]
12440 match tag {
12441 __FieldTag::__git_repository_link => {
12442 if !fields.insert(__FieldTag::__git_repository_link) {
12443 return std::result::Result::Err(A::Error::duplicate_field(
12444 "multiple values for git_repository_link",
12445 ));
12446 }
12447 result.git_repository_link = map
12448 .next_value::<std::option::Option<std::string::String>>()?
12449 .unwrap_or_default();
12450 }
12451 __FieldTag::__ref_type => {
12452 if !fields.insert(__FieldTag::__ref_type) {
12453 return std::result::Result::Err(A::Error::duplicate_field(
12454 "multiple values for ref_type",
12455 ));
12456 }
12457 result.ref_type =
12458 map.next_value::<std::option::Option<
12459 crate::model::fetch_git_refs_request::RefType,
12460 >>()?
12461 .unwrap_or_default();
12462 }
12463 __FieldTag::__page_size => {
12464 if !fields.insert(__FieldTag::__page_size) {
12465 return std::result::Result::Err(A::Error::duplicate_field(
12466 "multiple values for page_size",
12467 ));
12468 }
12469 struct __With(std::option::Option<i32>);
12470 impl<'de> serde::de::Deserialize<'de> for __With {
12471 fn deserialize<D>(
12472 deserializer: D,
12473 ) -> std::result::Result<Self, D::Error>
12474 where
12475 D: serde::de::Deserializer<'de>,
12476 {
12477 serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12478 }
12479 }
12480 result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
12481 }
12482 __FieldTag::__page_token => {
12483 if !fields.insert(__FieldTag::__page_token) {
12484 return std::result::Result::Err(A::Error::duplicate_field(
12485 "multiple values for page_token",
12486 ));
12487 }
12488 result.page_token = map
12489 .next_value::<std::option::Option<std::string::String>>()?
12490 .unwrap_or_default();
12491 }
12492 __FieldTag::Unknown(key) => {
12493 let value = map.next_value::<serde_json::Value>()?;
12494 result._unknown_fields.insert(key, value);
12495 }
12496 }
12497 }
12498 std::result::Result::Ok(result)
12499 }
12500 }
12501 deserializer.deserialize_any(Visitor)
12502 }
12503}
12504
12505#[doc(hidden)]
12506impl serde::ser::Serialize for FetchGitRefsRequest {
12507 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12508 where
12509 S: serde::ser::Serializer,
12510 {
12511 use serde::ser::SerializeMap;
12512 #[allow(unused_imports)]
12513 use std::option::Option::Some;
12514 let mut state = serializer.serialize_map(std::option::Option::None)?;
12515 if !self.git_repository_link.is_empty() {
12516 state.serialize_entry("gitRepositoryLink", &self.git_repository_link)?;
12517 }
12518 if !wkt::internal::is_default(&self.ref_type) {
12519 state.serialize_entry("refType", &self.ref_type)?;
12520 }
12521 if !wkt::internal::is_default(&self.page_size) {
12522 struct __With<'a>(&'a i32);
12523 impl<'a> serde::ser::Serialize for __With<'a> {
12524 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12525 where
12526 S: serde::ser::Serializer,
12527 {
12528 serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
12529 }
12530 }
12531 state.serialize_entry("pageSize", &__With(&self.page_size))?;
12532 }
12533 if !self.page_token.is_empty() {
12534 state.serialize_entry("pageToken", &self.page_token)?;
12535 }
12536 if !self._unknown_fields.is_empty() {
12537 for (key, value) in self._unknown_fields.iter() {
12538 state.serialize_entry(key, &value)?;
12539 }
12540 }
12541 state.end()
12542 }
12543}
12544
12545impl std::fmt::Debug for FetchGitRefsRequest {
12546 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12547 let mut debug_struct = f.debug_struct("FetchGitRefsRequest");
12548 debug_struct.field("git_repository_link", &self.git_repository_link);
12549 debug_struct.field("ref_type", &self.ref_type);
12550 debug_struct.field("page_size", &self.page_size);
12551 debug_struct.field("page_token", &self.page_token);
12552 if !self._unknown_fields.is_empty() {
12553 debug_struct.field("_unknown_fields", &self._unknown_fields);
12554 }
12555 debug_struct.finish()
12556 }
12557}
12558
12559pub mod fetch_git_refs_request {
12561 #[allow(unused_imports)]
12562 use super::*;
12563
12564 #[derive(Clone, Debug, PartialEq)]
12580 #[non_exhaustive]
12581 pub enum RefType {
12582 Unspecified,
12584 Tag,
12586 Branch,
12588 UnknownValue(ref_type::UnknownValue),
12593 }
12594
12595 #[doc(hidden)]
12596 pub mod ref_type {
12597 #[allow(unused_imports)]
12598 use super::*;
12599 #[derive(Clone, Debug, PartialEq)]
12600 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12601 }
12602
12603 impl RefType {
12604 pub fn value(&self) -> std::option::Option<i32> {
12609 match self {
12610 Self::Unspecified => std::option::Option::Some(0),
12611 Self::Tag => std::option::Option::Some(1),
12612 Self::Branch => std::option::Option::Some(2),
12613 Self::UnknownValue(u) => u.0.value(),
12614 }
12615 }
12616
12617 pub fn name(&self) -> std::option::Option<&str> {
12622 match self {
12623 Self::Unspecified => std::option::Option::Some("REF_TYPE_UNSPECIFIED"),
12624 Self::Tag => std::option::Option::Some("TAG"),
12625 Self::Branch => std::option::Option::Some("BRANCH"),
12626 Self::UnknownValue(u) => u.0.name(),
12627 }
12628 }
12629 }
12630
12631 impl std::default::Default for RefType {
12632 fn default() -> Self {
12633 use std::convert::From;
12634 Self::from(0)
12635 }
12636 }
12637
12638 impl std::fmt::Display for RefType {
12639 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12640 wkt::internal::display_enum(f, self.name(), self.value())
12641 }
12642 }
12643
12644 impl std::convert::From<i32> for RefType {
12645 fn from(value: i32) -> Self {
12646 match value {
12647 0 => Self::Unspecified,
12648 1 => Self::Tag,
12649 2 => Self::Branch,
12650 _ => Self::UnknownValue(ref_type::UnknownValue(
12651 wkt::internal::UnknownEnumValue::Integer(value),
12652 )),
12653 }
12654 }
12655 }
12656
12657 impl std::convert::From<&str> for RefType {
12658 fn from(value: &str) -> Self {
12659 use std::string::ToString;
12660 match value {
12661 "REF_TYPE_UNSPECIFIED" => Self::Unspecified,
12662 "TAG" => Self::Tag,
12663 "BRANCH" => Self::Branch,
12664 _ => Self::UnknownValue(ref_type::UnknownValue(
12665 wkt::internal::UnknownEnumValue::String(value.to_string()),
12666 )),
12667 }
12668 }
12669 }
12670
12671 impl serde::ser::Serialize for RefType {
12672 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12673 where
12674 S: serde::Serializer,
12675 {
12676 match self {
12677 Self::Unspecified => serializer.serialize_i32(0),
12678 Self::Tag => serializer.serialize_i32(1),
12679 Self::Branch => serializer.serialize_i32(2),
12680 Self::UnknownValue(u) => u.0.serialize(serializer),
12681 }
12682 }
12683 }
12684
12685 impl<'de> serde::de::Deserialize<'de> for RefType {
12686 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12687 where
12688 D: serde::Deserializer<'de>,
12689 {
12690 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RefType>::new(
12691 ".google.cloud.developerconnect.v1.FetchGitRefsRequest.RefType",
12692 ))
12693 }
12694 }
12695}
12696
12697#[derive(Clone, Default, PartialEq)]
12699#[non_exhaustive]
12700pub struct FetchGitRefsResponse {
12701 pub ref_names: std::vec::Vec<std::string::String>,
12703
12704 pub next_page_token: std::string::String,
12706
12707 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12708}
12709
12710impl FetchGitRefsResponse {
12711 pub fn new() -> Self {
12712 std::default::Default::default()
12713 }
12714
12715 pub fn set_ref_names<T, V>(mut self, v: T) -> Self
12717 where
12718 T: std::iter::IntoIterator<Item = V>,
12719 V: std::convert::Into<std::string::String>,
12720 {
12721 use std::iter::Iterator;
12722 self.ref_names = v.into_iter().map(|i| i.into()).collect();
12723 self
12724 }
12725
12726 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12728 self.next_page_token = v.into();
12729 self
12730 }
12731}
12732
12733impl wkt::message::Message for FetchGitRefsResponse {
12734 fn typename() -> &'static str {
12735 "type.googleapis.com/google.cloud.developerconnect.v1.FetchGitRefsResponse"
12736 }
12737}
12738
12739#[doc(hidden)]
12740impl<'de> serde::de::Deserialize<'de> for FetchGitRefsResponse {
12741 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12742 where
12743 D: serde::Deserializer<'de>,
12744 {
12745 #[allow(non_camel_case_types)]
12746 #[doc(hidden)]
12747 #[derive(PartialEq, Eq, Hash)]
12748 enum __FieldTag {
12749 __ref_names,
12750 __next_page_token,
12751 Unknown(std::string::String),
12752 }
12753 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12754 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12755 where
12756 D: serde::Deserializer<'de>,
12757 {
12758 struct Visitor;
12759 impl<'de> serde::de::Visitor<'de> for Visitor {
12760 type Value = __FieldTag;
12761 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12762 formatter.write_str("a field name for FetchGitRefsResponse")
12763 }
12764 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12765 where
12766 E: serde::de::Error,
12767 {
12768 use std::result::Result::Ok;
12769 use std::string::ToString;
12770 match value {
12771 "refNames" => Ok(__FieldTag::__ref_names),
12772 "ref_names" => Ok(__FieldTag::__ref_names),
12773 "nextPageToken" => Ok(__FieldTag::__next_page_token),
12774 "next_page_token" => Ok(__FieldTag::__next_page_token),
12775 _ => Ok(__FieldTag::Unknown(value.to_string())),
12776 }
12777 }
12778 }
12779 deserializer.deserialize_identifier(Visitor)
12780 }
12781 }
12782 struct Visitor;
12783 impl<'de> serde::de::Visitor<'de> for Visitor {
12784 type Value = FetchGitRefsResponse;
12785 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12786 formatter.write_str("struct FetchGitRefsResponse")
12787 }
12788 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12789 where
12790 A: serde::de::MapAccess<'de>,
12791 {
12792 #[allow(unused_imports)]
12793 use serde::de::Error;
12794 use std::option::Option::Some;
12795 let mut fields = std::collections::HashSet::new();
12796 let mut result = Self::Value::new();
12797 while let Some(tag) = map.next_key::<__FieldTag>()? {
12798 #[allow(clippy::match_single_binding)]
12799 match tag {
12800 __FieldTag::__ref_names => {
12801 if !fields.insert(__FieldTag::__ref_names) {
12802 return std::result::Result::Err(A::Error::duplicate_field(
12803 "multiple values for ref_names",
12804 ));
12805 }
12806 result.ref_names = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
12807 }
12808 __FieldTag::__next_page_token => {
12809 if !fields.insert(__FieldTag::__next_page_token) {
12810 return std::result::Result::Err(A::Error::duplicate_field(
12811 "multiple values for next_page_token",
12812 ));
12813 }
12814 result.next_page_token = map
12815 .next_value::<std::option::Option<std::string::String>>()?
12816 .unwrap_or_default();
12817 }
12818 __FieldTag::Unknown(key) => {
12819 let value = map.next_value::<serde_json::Value>()?;
12820 result._unknown_fields.insert(key, value);
12821 }
12822 }
12823 }
12824 std::result::Result::Ok(result)
12825 }
12826 }
12827 deserializer.deserialize_any(Visitor)
12828 }
12829}
12830
12831#[doc(hidden)]
12832impl serde::ser::Serialize for FetchGitRefsResponse {
12833 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12834 where
12835 S: serde::ser::Serializer,
12836 {
12837 use serde::ser::SerializeMap;
12838 #[allow(unused_imports)]
12839 use std::option::Option::Some;
12840 let mut state = serializer.serialize_map(std::option::Option::None)?;
12841 if !self.ref_names.is_empty() {
12842 state.serialize_entry("refNames", &self.ref_names)?;
12843 }
12844 if !self.next_page_token.is_empty() {
12845 state.serialize_entry("nextPageToken", &self.next_page_token)?;
12846 }
12847 if !self._unknown_fields.is_empty() {
12848 for (key, value) in self._unknown_fields.iter() {
12849 state.serialize_entry(key, &value)?;
12850 }
12851 }
12852 state.end()
12853 }
12854}
12855
12856impl std::fmt::Debug for FetchGitRefsResponse {
12857 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12858 let mut debug_struct = f.debug_struct("FetchGitRefsResponse");
12859 debug_struct.field("ref_names", &self.ref_names);
12860 debug_struct.field("next_page_token", &self.next_page_token);
12861 if !self._unknown_fields.is_empty() {
12862 debug_struct.field("_unknown_fields", &self._unknown_fields);
12863 }
12864 debug_struct.finish()
12865 }
12866}
12867
12868#[derive(Clone, Default, PartialEq)]
12873#[non_exhaustive]
12874pub struct AccountConnector {
12875 pub name: std::string::String,
12878
12879 pub create_time: std::option::Option<wkt::Timestamp>,
12881
12882 pub update_time: std::option::Option<wkt::Timestamp>,
12884
12885 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
12887
12888 pub etag: std::string::String,
12892
12893 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12895
12896 pub oauth_start_uri: std::string::String,
12898
12899 pub account_connector_config:
12901 std::option::Option<crate::model::account_connector::AccountConnectorConfig>,
12902
12903 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12904}
12905
12906impl AccountConnector {
12907 pub fn new() -> Self {
12908 std::default::Default::default()
12909 }
12910
12911 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12913 self.name = v.into();
12914 self
12915 }
12916
12917 pub fn set_create_time<T>(mut self, v: T) -> Self
12919 where
12920 T: std::convert::Into<wkt::Timestamp>,
12921 {
12922 self.create_time = std::option::Option::Some(v.into());
12923 self
12924 }
12925
12926 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12928 where
12929 T: std::convert::Into<wkt::Timestamp>,
12930 {
12931 self.create_time = v.map(|x| x.into());
12932 self
12933 }
12934
12935 pub fn set_update_time<T>(mut self, v: T) -> Self
12937 where
12938 T: std::convert::Into<wkt::Timestamp>,
12939 {
12940 self.update_time = std::option::Option::Some(v.into());
12941 self
12942 }
12943
12944 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
12946 where
12947 T: std::convert::Into<wkt::Timestamp>,
12948 {
12949 self.update_time = v.map(|x| x.into());
12950 self
12951 }
12952
12953 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
12955 where
12956 T: std::iter::IntoIterator<Item = (K, V)>,
12957 K: std::convert::Into<std::string::String>,
12958 V: std::convert::Into<std::string::String>,
12959 {
12960 use std::iter::Iterator;
12961 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12962 self
12963 }
12964
12965 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12967 self.etag = v.into();
12968 self
12969 }
12970
12971 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12973 where
12974 T: std::iter::IntoIterator<Item = (K, V)>,
12975 K: std::convert::Into<std::string::String>,
12976 V: std::convert::Into<std::string::String>,
12977 {
12978 use std::iter::Iterator;
12979 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12980 self
12981 }
12982
12983 pub fn set_oauth_start_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12985 self.oauth_start_uri = v.into();
12986 self
12987 }
12988
12989 pub fn set_account_connector_config<
12994 T: std::convert::Into<
12995 std::option::Option<crate::model::account_connector::AccountConnectorConfig>,
12996 >,
12997 >(
12998 mut self,
12999 v: T,
13000 ) -> Self {
13001 self.account_connector_config = v.into();
13002 self
13003 }
13004
13005 pub fn provider_oauth_config(
13009 &self,
13010 ) -> std::option::Option<&std::boxed::Box<crate::model::ProviderOAuthConfig>> {
13011 #[allow(unreachable_patterns)]
13012 self.account_connector_config
13013 .as_ref()
13014 .and_then(|v| match v {
13015 crate::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(v) => {
13016 std::option::Option::Some(v)
13017 }
13018 _ => std::option::Option::None,
13019 })
13020 }
13021
13022 pub fn set_provider_oauth_config<
13028 T: std::convert::Into<std::boxed::Box<crate::model::ProviderOAuthConfig>>,
13029 >(
13030 mut self,
13031 v: T,
13032 ) -> Self {
13033 self.account_connector_config = std::option::Option::Some(
13034 crate::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(v.into()),
13035 );
13036 self
13037 }
13038}
13039
13040impl wkt::message::Message for AccountConnector {
13041 fn typename() -> &'static str {
13042 "type.googleapis.com/google.cloud.developerconnect.v1.AccountConnector"
13043 }
13044}
13045
13046#[doc(hidden)]
13047impl<'de> serde::de::Deserialize<'de> for AccountConnector {
13048 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13049 where
13050 D: serde::Deserializer<'de>,
13051 {
13052 #[allow(non_camel_case_types)]
13053 #[doc(hidden)]
13054 #[derive(PartialEq, Eq, Hash)]
13055 enum __FieldTag {
13056 __provider_oauth_config,
13057 __name,
13058 __create_time,
13059 __update_time,
13060 __annotations,
13061 __etag,
13062 __labels,
13063 __oauth_start_uri,
13064 Unknown(std::string::String),
13065 }
13066 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13067 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13068 where
13069 D: serde::Deserializer<'de>,
13070 {
13071 struct Visitor;
13072 impl<'de> serde::de::Visitor<'de> for Visitor {
13073 type Value = __FieldTag;
13074 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13075 formatter.write_str("a field name for AccountConnector")
13076 }
13077 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13078 where
13079 E: serde::de::Error,
13080 {
13081 use std::result::Result::Ok;
13082 use std::string::ToString;
13083 match value {
13084 "providerOauthConfig" => Ok(__FieldTag::__provider_oauth_config),
13085 "provider_oauth_config" => Ok(__FieldTag::__provider_oauth_config),
13086 "name" => Ok(__FieldTag::__name),
13087 "createTime" => Ok(__FieldTag::__create_time),
13088 "create_time" => Ok(__FieldTag::__create_time),
13089 "updateTime" => Ok(__FieldTag::__update_time),
13090 "update_time" => Ok(__FieldTag::__update_time),
13091 "annotations" => Ok(__FieldTag::__annotations),
13092 "etag" => Ok(__FieldTag::__etag),
13093 "labels" => Ok(__FieldTag::__labels),
13094 "oauthStartUri" => Ok(__FieldTag::__oauth_start_uri),
13095 "oauth_start_uri" => Ok(__FieldTag::__oauth_start_uri),
13096 _ => Ok(__FieldTag::Unknown(value.to_string())),
13097 }
13098 }
13099 }
13100 deserializer.deserialize_identifier(Visitor)
13101 }
13102 }
13103 struct Visitor;
13104 impl<'de> serde::de::Visitor<'de> for Visitor {
13105 type Value = AccountConnector;
13106 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13107 formatter.write_str("struct AccountConnector")
13108 }
13109 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13110 where
13111 A: serde::de::MapAccess<'de>,
13112 {
13113 #[allow(unused_imports)]
13114 use serde::de::Error;
13115 use std::option::Option::Some;
13116 let mut fields = std::collections::HashSet::new();
13117 let mut result = Self::Value::new();
13118 while let Some(tag) = map.next_key::<__FieldTag>()? {
13119 #[allow(clippy::match_single_binding)]
13120 match tag {
13121 __FieldTag::__provider_oauth_config => {
13122 if !fields.insert(__FieldTag::__provider_oauth_config) {
13123 return std::result::Result::Err(A::Error::duplicate_field(
13124 "multiple values for provider_oauth_config",
13125 ));
13126 }
13127 if result.account_connector_config.is_some() {
13128 return std::result::Result::Err(A::Error::duplicate_field(
13129 "multiple values for `account_connector_config`, a oneof with full ID .google.cloud.developerconnect.v1.AccountConnector.provider_oauth_config, latest field was providerOauthConfig",
13130 ));
13131 }
13132 result.account_connector_config = std::option::Option::Some(
13133 crate::model::account_connector::AccountConnectorConfig::ProviderOauthConfig(
13134 map.next_value::<std::option::Option<std::boxed::Box<crate::model::ProviderOAuthConfig>>>()?.unwrap_or_default()
13135 ),
13136 );
13137 }
13138 __FieldTag::__name => {
13139 if !fields.insert(__FieldTag::__name) {
13140 return std::result::Result::Err(A::Error::duplicate_field(
13141 "multiple values for name",
13142 ));
13143 }
13144 result.name = map
13145 .next_value::<std::option::Option<std::string::String>>()?
13146 .unwrap_or_default();
13147 }
13148 __FieldTag::__create_time => {
13149 if !fields.insert(__FieldTag::__create_time) {
13150 return std::result::Result::Err(A::Error::duplicate_field(
13151 "multiple values for create_time",
13152 ));
13153 }
13154 result.create_time =
13155 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
13156 }
13157 __FieldTag::__update_time => {
13158 if !fields.insert(__FieldTag::__update_time) {
13159 return std::result::Result::Err(A::Error::duplicate_field(
13160 "multiple values for update_time",
13161 ));
13162 }
13163 result.update_time =
13164 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
13165 }
13166 __FieldTag::__annotations => {
13167 if !fields.insert(__FieldTag::__annotations) {
13168 return std::result::Result::Err(A::Error::duplicate_field(
13169 "multiple values for annotations",
13170 ));
13171 }
13172 result.annotations = map
13173 .next_value::<std::option::Option<
13174 std::collections::HashMap<
13175 std::string::String,
13176 std::string::String,
13177 >,
13178 >>()?
13179 .unwrap_or_default();
13180 }
13181 __FieldTag::__etag => {
13182 if !fields.insert(__FieldTag::__etag) {
13183 return std::result::Result::Err(A::Error::duplicate_field(
13184 "multiple values for etag",
13185 ));
13186 }
13187 result.etag = map
13188 .next_value::<std::option::Option<std::string::String>>()?
13189 .unwrap_or_default();
13190 }
13191 __FieldTag::__labels => {
13192 if !fields.insert(__FieldTag::__labels) {
13193 return std::result::Result::Err(A::Error::duplicate_field(
13194 "multiple values for labels",
13195 ));
13196 }
13197 result.labels = map
13198 .next_value::<std::option::Option<
13199 std::collections::HashMap<
13200 std::string::String,
13201 std::string::String,
13202 >,
13203 >>()?
13204 .unwrap_or_default();
13205 }
13206 __FieldTag::__oauth_start_uri => {
13207 if !fields.insert(__FieldTag::__oauth_start_uri) {
13208 return std::result::Result::Err(A::Error::duplicate_field(
13209 "multiple values for oauth_start_uri",
13210 ));
13211 }
13212 result.oauth_start_uri = map
13213 .next_value::<std::option::Option<std::string::String>>()?
13214 .unwrap_or_default();
13215 }
13216 __FieldTag::Unknown(key) => {
13217 let value = map.next_value::<serde_json::Value>()?;
13218 result._unknown_fields.insert(key, value);
13219 }
13220 }
13221 }
13222 std::result::Result::Ok(result)
13223 }
13224 }
13225 deserializer.deserialize_any(Visitor)
13226 }
13227}
13228
13229#[doc(hidden)]
13230impl serde::ser::Serialize for AccountConnector {
13231 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13232 where
13233 S: serde::ser::Serializer,
13234 {
13235 use serde::ser::SerializeMap;
13236 #[allow(unused_imports)]
13237 use std::option::Option::Some;
13238 let mut state = serializer.serialize_map(std::option::Option::None)?;
13239 if let Some(value) = self.provider_oauth_config() {
13240 state.serialize_entry("providerOauthConfig", value)?;
13241 }
13242 if !self.name.is_empty() {
13243 state.serialize_entry("name", &self.name)?;
13244 }
13245 if self.create_time.is_some() {
13246 state.serialize_entry("createTime", &self.create_time)?;
13247 }
13248 if self.update_time.is_some() {
13249 state.serialize_entry("updateTime", &self.update_time)?;
13250 }
13251 if !self.annotations.is_empty() {
13252 state.serialize_entry("annotations", &self.annotations)?;
13253 }
13254 if !self.etag.is_empty() {
13255 state.serialize_entry("etag", &self.etag)?;
13256 }
13257 if !self.labels.is_empty() {
13258 state.serialize_entry("labels", &self.labels)?;
13259 }
13260 if !self.oauth_start_uri.is_empty() {
13261 state.serialize_entry("oauthStartUri", &self.oauth_start_uri)?;
13262 }
13263 if !self._unknown_fields.is_empty() {
13264 for (key, value) in self._unknown_fields.iter() {
13265 state.serialize_entry(key, &value)?;
13266 }
13267 }
13268 state.end()
13269 }
13270}
13271
13272impl std::fmt::Debug for AccountConnector {
13273 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13274 let mut debug_struct = f.debug_struct("AccountConnector");
13275 debug_struct.field("name", &self.name);
13276 debug_struct.field("create_time", &self.create_time);
13277 debug_struct.field("update_time", &self.update_time);
13278 debug_struct.field("annotations", &self.annotations);
13279 debug_struct.field("etag", &self.etag);
13280 debug_struct.field("labels", &self.labels);
13281 debug_struct.field("oauth_start_uri", &self.oauth_start_uri);
13282 debug_struct.field("account_connector_config", &self.account_connector_config);
13283 if !self._unknown_fields.is_empty() {
13284 debug_struct.field("_unknown_fields", &self._unknown_fields);
13285 }
13286 debug_struct.finish()
13287 }
13288}
13289
13290pub mod account_connector {
13292 #[allow(unused_imports)]
13293 use super::*;
13294
13295 #[derive(Clone, Debug, PartialEq)]
13297 #[non_exhaustive]
13298 pub enum AccountConnectorConfig {
13299 ProviderOauthConfig(std::boxed::Box<crate::model::ProviderOAuthConfig>),
13301 }
13302}
13303
13304#[derive(Clone, Default, PartialEq)]
13307#[non_exhaustive]
13308pub struct User {
13309 pub name: std::string::String,
13312
13313 pub display_name: std::string::String,
13316
13317 pub create_time: std::option::Option<wkt::Timestamp>,
13319
13320 pub last_token_request_time: std::option::Option<wkt::Timestamp>,
13322
13323 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13324}
13325
13326impl User {
13327 pub fn new() -> Self {
13328 std::default::Default::default()
13329 }
13330
13331 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13333 self.name = v.into();
13334 self
13335 }
13336
13337 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13339 self.display_name = v.into();
13340 self
13341 }
13342
13343 pub fn set_create_time<T>(mut self, v: T) -> Self
13345 where
13346 T: std::convert::Into<wkt::Timestamp>,
13347 {
13348 self.create_time = std::option::Option::Some(v.into());
13349 self
13350 }
13351
13352 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13354 where
13355 T: std::convert::Into<wkt::Timestamp>,
13356 {
13357 self.create_time = v.map(|x| x.into());
13358 self
13359 }
13360
13361 pub fn set_last_token_request_time<T>(mut self, v: T) -> Self
13363 where
13364 T: std::convert::Into<wkt::Timestamp>,
13365 {
13366 self.last_token_request_time = std::option::Option::Some(v.into());
13367 self
13368 }
13369
13370 pub fn set_or_clear_last_token_request_time<T>(mut self, v: std::option::Option<T>) -> Self
13372 where
13373 T: std::convert::Into<wkt::Timestamp>,
13374 {
13375 self.last_token_request_time = v.map(|x| x.into());
13376 self
13377 }
13378}
13379
13380impl wkt::message::Message for User {
13381 fn typename() -> &'static str {
13382 "type.googleapis.com/google.cloud.developerconnect.v1.User"
13383 }
13384}
13385
13386#[doc(hidden)]
13387impl<'de> serde::de::Deserialize<'de> for User {
13388 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13389 where
13390 D: serde::Deserializer<'de>,
13391 {
13392 #[allow(non_camel_case_types)]
13393 #[doc(hidden)]
13394 #[derive(PartialEq, Eq, Hash)]
13395 enum __FieldTag {
13396 __name,
13397 __display_name,
13398 __create_time,
13399 __last_token_request_time,
13400 Unknown(std::string::String),
13401 }
13402 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13403 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13404 where
13405 D: serde::Deserializer<'de>,
13406 {
13407 struct Visitor;
13408 impl<'de> serde::de::Visitor<'de> for Visitor {
13409 type Value = __FieldTag;
13410 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13411 formatter.write_str("a field name for User")
13412 }
13413 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13414 where
13415 E: serde::de::Error,
13416 {
13417 use std::result::Result::Ok;
13418 use std::string::ToString;
13419 match value {
13420 "name" => Ok(__FieldTag::__name),
13421 "displayName" => Ok(__FieldTag::__display_name),
13422 "display_name" => Ok(__FieldTag::__display_name),
13423 "createTime" => Ok(__FieldTag::__create_time),
13424 "create_time" => Ok(__FieldTag::__create_time),
13425 "lastTokenRequestTime" => Ok(__FieldTag::__last_token_request_time),
13426 "last_token_request_time" => Ok(__FieldTag::__last_token_request_time),
13427 _ => Ok(__FieldTag::Unknown(value.to_string())),
13428 }
13429 }
13430 }
13431 deserializer.deserialize_identifier(Visitor)
13432 }
13433 }
13434 struct Visitor;
13435 impl<'de> serde::de::Visitor<'de> for Visitor {
13436 type Value = User;
13437 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13438 formatter.write_str("struct User")
13439 }
13440 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13441 where
13442 A: serde::de::MapAccess<'de>,
13443 {
13444 #[allow(unused_imports)]
13445 use serde::de::Error;
13446 use std::option::Option::Some;
13447 let mut fields = std::collections::HashSet::new();
13448 let mut result = Self::Value::new();
13449 while let Some(tag) = map.next_key::<__FieldTag>()? {
13450 #[allow(clippy::match_single_binding)]
13451 match tag {
13452 __FieldTag::__name => {
13453 if !fields.insert(__FieldTag::__name) {
13454 return std::result::Result::Err(A::Error::duplicate_field(
13455 "multiple values for name",
13456 ));
13457 }
13458 result.name = map
13459 .next_value::<std::option::Option<std::string::String>>()?
13460 .unwrap_or_default();
13461 }
13462 __FieldTag::__display_name => {
13463 if !fields.insert(__FieldTag::__display_name) {
13464 return std::result::Result::Err(A::Error::duplicate_field(
13465 "multiple values for display_name",
13466 ));
13467 }
13468 result.display_name = map
13469 .next_value::<std::option::Option<std::string::String>>()?
13470 .unwrap_or_default();
13471 }
13472 __FieldTag::__create_time => {
13473 if !fields.insert(__FieldTag::__create_time) {
13474 return std::result::Result::Err(A::Error::duplicate_field(
13475 "multiple values for create_time",
13476 ));
13477 }
13478 result.create_time =
13479 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
13480 }
13481 __FieldTag::__last_token_request_time => {
13482 if !fields.insert(__FieldTag::__last_token_request_time) {
13483 return std::result::Result::Err(A::Error::duplicate_field(
13484 "multiple values for last_token_request_time",
13485 ));
13486 }
13487 result.last_token_request_time =
13488 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
13489 }
13490 __FieldTag::Unknown(key) => {
13491 let value = map.next_value::<serde_json::Value>()?;
13492 result._unknown_fields.insert(key, value);
13493 }
13494 }
13495 }
13496 std::result::Result::Ok(result)
13497 }
13498 }
13499 deserializer.deserialize_any(Visitor)
13500 }
13501}
13502
13503#[doc(hidden)]
13504impl serde::ser::Serialize for User {
13505 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13506 where
13507 S: serde::ser::Serializer,
13508 {
13509 use serde::ser::SerializeMap;
13510 #[allow(unused_imports)]
13511 use std::option::Option::Some;
13512 let mut state = serializer.serialize_map(std::option::Option::None)?;
13513 if !self.name.is_empty() {
13514 state.serialize_entry("name", &self.name)?;
13515 }
13516 if !self.display_name.is_empty() {
13517 state.serialize_entry("displayName", &self.display_name)?;
13518 }
13519 if self.create_time.is_some() {
13520 state.serialize_entry("createTime", &self.create_time)?;
13521 }
13522 if self.last_token_request_time.is_some() {
13523 state.serialize_entry("lastTokenRequestTime", &self.last_token_request_time)?;
13524 }
13525 if !self._unknown_fields.is_empty() {
13526 for (key, value) in self._unknown_fields.iter() {
13527 state.serialize_entry(key, &value)?;
13528 }
13529 }
13530 state.end()
13531 }
13532}
13533
13534impl std::fmt::Debug for User {
13535 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13536 let mut debug_struct = f.debug_struct("User");
13537 debug_struct.field("name", &self.name);
13538 debug_struct.field("display_name", &self.display_name);
13539 debug_struct.field("create_time", &self.create_time);
13540 debug_struct.field("last_token_request_time", &self.last_token_request_time);
13541 if !self._unknown_fields.is_empty() {
13542 debug_struct.field("_unknown_fields", &self._unknown_fields);
13543 }
13544 debug_struct.finish()
13545 }
13546}
13547
13548#[derive(Clone, Default, PartialEq)]
13550#[non_exhaustive]
13551pub struct ProviderOAuthConfig {
13552 pub scopes: std::vec::Vec<std::string::String>,
13556
13557 pub oauth_provider_id:
13560 std::option::Option<crate::model::provider_o_auth_config::OauthProviderId>,
13561
13562 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13563}
13564
13565impl ProviderOAuthConfig {
13566 pub fn new() -> Self {
13567 std::default::Default::default()
13568 }
13569
13570 pub fn set_scopes<T, V>(mut self, v: T) -> Self
13572 where
13573 T: std::iter::IntoIterator<Item = V>,
13574 V: std::convert::Into<std::string::String>,
13575 {
13576 use std::iter::Iterator;
13577 self.scopes = v.into_iter().map(|i| i.into()).collect();
13578 self
13579 }
13580
13581 pub fn set_oauth_provider_id<
13586 T: std::convert::Into<
13587 std::option::Option<crate::model::provider_o_auth_config::OauthProviderId>,
13588 >,
13589 >(
13590 mut self,
13591 v: T,
13592 ) -> Self {
13593 self.oauth_provider_id = v.into();
13594 self
13595 }
13596
13597 pub fn system_provider_id(&self) -> std::option::Option<&crate::model::SystemProvider> {
13601 #[allow(unreachable_patterns)]
13602 self.oauth_provider_id.as_ref().and_then(|v| match v {
13603 crate::model::provider_o_auth_config::OauthProviderId::SystemProviderId(v) => {
13604 std::option::Option::Some(v)
13605 }
13606 _ => std::option::Option::None,
13607 })
13608 }
13609
13610 pub fn set_system_provider_id<T: std::convert::Into<crate::model::SystemProvider>>(
13616 mut self,
13617 v: T,
13618 ) -> Self {
13619 self.oauth_provider_id = std::option::Option::Some(
13620 crate::model::provider_o_auth_config::OauthProviderId::SystemProviderId(v.into()),
13621 );
13622 self
13623 }
13624}
13625
13626impl wkt::message::Message for ProviderOAuthConfig {
13627 fn typename() -> &'static str {
13628 "type.googleapis.com/google.cloud.developerconnect.v1.ProviderOAuthConfig"
13629 }
13630}
13631
13632#[doc(hidden)]
13633impl<'de> serde::de::Deserialize<'de> for ProviderOAuthConfig {
13634 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13635 where
13636 D: serde::Deserializer<'de>,
13637 {
13638 #[allow(non_camel_case_types)]
13639 #[doc(hidden)]
13640 #[derive(PartialEq, Eq, Hash)]
13641 enum __FieldTag {
13642 __system_provider_id,
13643 __scopes,
13644 Unknown(std::string::String),
13645 }
13646 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13647 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13648 where
13649 D: serde::Deserializer<'de>,
13650 {
13651 struct Visitor;
13652 impl<'de> serde::de::Visitor<'de> for Visitor {
13653 type Value = __FieldTag;
13654 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13655 formatter.write_str("a field name for ProviderOAuthConfig")
13656 }
13657 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13658 where
13659 E: serde::de::Error,
13660 {
13661 use std::result::Result::Ok;
13662 use std::string::ToString;
13663 match value {
13664 "systemProviderId" => Ok(__FieldTag::__system_provider_id),
13665 "system_provider_id" => Ok(__FieldTag::__system_provider_id),
13666 "scopes" => Ok(__FieldTag::__scopes),
13667 _ => Ok(__FieldTag::Unknown(value.to_string())),
13668 }
13669 }
13670 }
13671 deserializer.deserialize_identifier(Visitor)
13672 }
13673 }
13674 struct Visitor;
13675 impl<'de> serde::de::Visitor<'de> for Visitor {
13676 type Value = ProviderOAuthConfig;
13677 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13678 formatter.write_str("struct ProviderOAuthConfig")
13679 }
13680 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13681 where
13682 A: serde::de::MapAccess<'de>,
13683 {
13684 #[allow(unused_imports)]
13685 use serde::de::Error;
13686 use std::option::Option::Some;
13687 let mut fields = std::collections::HashSet::new();
13688 let mut result = Self::Value::new();
13689 while let Some(tag) = map.next_key::<__FieldTag>()? {
13690 #[allow(clippy::match_single_binding)]
13691 match tag {
13692 __FieldTag::__system_provider_id => {
13693 if !fields.insert(__FieldTag::__system_provider_id) {
13694 return std::result::Result::Err(A::Error::duplicate_field(
13695 "multiple values for system_provider_id",
13696 ));
13697 }
13698 if result.oauth_provider_id.is_some() {
13699 return std::result::Result::Err(A::Error::duplicate_field(
13700 "multiple values for `oauth_provider_id`, a oneof with full ID .google.cloud.developerconnect.v1.ProviderOAuthConfig.system_provider_id, latest field was systemProviderId",
13701 ));
13702 }
13703 result.oauth_provider_id = std::option::Option::Some(
13704 crate::model::provider_o_auth_config::OauthProviderId::SystemProviderId(
13705 map.next_value::<std::option::Option<crate::model::SystemProvider>>()?.unwrap_or_default()
13706 ),
13707 );
13708 }
13709 __FieldTag::__scopes => {
13710 if !fields.insert(__FieldTag::__scopes) {
13711 return std::result::Result::Err(A::Error::duplicate_field(
13712 "multiple values for scopes",
13713 ));
13714 }
13715 result.scopes = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
13716 }
13717 __FieldTag::Unknown(key) => {
13718 let value = map.next_value::<serde_json::Value>()?;
13719 result._unknown_fields.insert(key, value);
13720 }
13721 }
13722 }
13723 std::result::Result::Ok(result)
13724 }
13725 }
13726 deserializer.deserialize_any(Visitor)
13727 }
13728}
13729
13730#[doc(hidden)]
13731impl serde::ser::Serialize for ProviderOAuthConfig {
13732 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13733 where
13734 S: serde::ser::Serializer,
13735 {
13736 use serde::ser::SerializeMap;
13737 #[allow(unused_imports)]
13738 use std::option::Option::Some;
13739 let mut state = serializer.serialize_map(std::option::Option::None)?;
13740 if let Some(value) = self.system_provider_id() {
13741 state.serialize_entry("systemProviderId", value)?;
13742 }
13743 if !self.scopes.is_empty() {
13744 state.serialize_entry("scopes", &self.scopes)?;
13745 }
13746 if !self._unknown_fields.is_empty() {
13747 for (key, value) in self._unknown_fields.iter() {
13748 state.serialize_entry(key, &value)?;
13749 }
13750 }
13751 state.end()
13752 }
13753}
13754
13755impl std::fmt::Debug for ProviderOAuthConfig {
13756 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13757 let mut debug_struct = f.debug_struct("ProviderOAuthConfig");
13758 debug_struct.field("scopes", &self.scopes);
13759 debug_struct.field("oauth_provider_id", &self.oauth_provider_id);
13760 if !self._unknown_fields.is_empty() {
13761 debug_struct.field("_unknown_fields", &self._unknown_fields);
13762 }
13763 debug_struct.finish()
13764 }
13765}
13766
13767pub mod provider_o_auth_config {
13769 #[allow(unused_imports)]
13770 use super::*;
13771
13772 #[derive(Clone, Debug, PartialEq)]
13775 #[non_exhaustive]
13776 pub enum OauthProviderId {
13777 SystemProviderId(crate::model::SystemProvider),
13779 }
13780}
13781
13782#[derive(Clone, Default, PartialEq)]
13787#[non_exhaustive]
13788pub struct InsightsConfig {
13789 pub name: std::string::String,
13793
13794 pub create_time: std::option::Option<wkt::Timestamp>,
13796
13797 pub update_time: std::option::Option<wkt::Timestamp>,
13799
13800 pub runtime_configs: std::vec::Vec<crate::model::RuntimeConfig>,
13802
13803 pub artifact_configs: std::vec::Vec<crate::model::ArtifactConfig>,
13805
13806 pub state: crate::model::insights_config::State,
13808
13809 pub annotations: std::collections::HashMap<std::string::String, std::string::String>,
13813
13814 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
13816
13817 pub reconciling: bool,
13823
13824 pub errors: std::vec::Vec<rpc::model::Status>,
13829
13830 pub insights_config_context:
13832 std::option::Option<crate::model::insights_config::InsightsConfigContext>,
13833
13834 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13835}
13836
13837impl InsightsConfig {
13838 pub fn new() -> Self {
13839 std::default::Default::default()
13840 }
13841
13842 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13844 self.name = v.into();
13845 self
13846 }
13847
13848 pub fn set_create_time<T>(mut self, v: T) -> Self
13850 where
13851 T: std::convert::Into<wkt::Timestamp>,
13852 {
13853 self.create_time = std::option::Option::Some(v.into());
13854 self
13855 }
13856
13857 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13859 where
13860 T: std::convert::Into<wkt::Timestamp>,
13861 {
13862 self.create_time = v.map(|x| x.into());
13863 self
13864 }
13865
13866 pub fn set_update_time<T>(mut self, v: T) -> Self
13868 where
13869 T: std::convert::Into<wkt::Timestamp>,
13870 {
13871 self.update_time = std::option::Option::Some(v.into());
13872 self
13873 }
13874
13875 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13877 where
13878 T: std::convert::Into<wkt::Timestamp>,
13879 {
13880 self.update_time = v.map(|x| x.into());
13881 self
13882 }
13883
13884 pub fn set_runtime_configs<T, V>(mut self, v: T) -> Self
13886 where
13887 T: std::iter::IntoIterator<Item = V>,
13888 V: std::convert::Into<crate::model::RuntimeConfig>,
13889 {
13890 use std::iter::Iterator;
13891 self.runtime_configs = v.into_iter().map(|i| i.into()).collect();
13892 self
13893 }
13894
13895 pub fn set_artifact_configs<T, V>(mut self, v: T) -> Self
13897 where
13898 T: std::iter::IntoIterator<Item = V>,
13899 V: std::convert::Into<crate::model::ArtifactConfig>,
13900 {
13901 use std::iter::Iterator;
13902 self.artifact_configs = v.into_iter().map(|i| i.into()).collect();
13903 self
13904 }
13905
13906 pub fn set_state<T: std::convert::Into<crate::model::insights_config::State>>(
13908 mut self,
13909 v: T,
13910 ) -> Self {
13911 self.state = v.into();
13912 self
13913 }
13914
13915 pub fn set_annotations<T, K, V>(mut self, v: T) -> Self
13917 where
13918 T: std::iter::IntoIterator<Item = (K, V)>,
13919 K: std::convert::Into<std::string::String>,
13920 V: std::convert::Into<std::string::String>,
13921 {
13922 use std::iter::Iterator;
13923 self.annotations = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13924 self
13925 }
13926
13927 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13929 where
13930 T: std::iter::IntoIterator<Item = (K, V)>,
13931 K: std::convert::Into<std::string::String>,
13932 V: std::convert::Into<std::string::String>,
13933 {
13934 use std::iter::Iterator;
13935 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13936 self
13937 }
13938
13939 pub fn set_reconciling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13941 self.reconciling = v.into();
13942 self
13943 }
13944
13945 pub fn set_errors<T, V>(mut self, v: T) -> Self
13947 where
13948 T: std::iter::IntoIterator<Item = V>,
13949 V: std::convert::Into<rpc::model::Status>,
13950 {
13951 use std::iter::Iterator;
13952 self.errors = v.into_iter().map(|i| i.into()).collect();
13953 self
13954 }
13955
13956 pub fn set_insights_config_context<
13961 T: std::convert::Into<
13962 std::option::Option<crate::model::insights_config::InsightsConfigContext>,
13963 >,
13964 >(
13965 mut self,
13966 v: T,
13967 ) -> Self {
13968 self.insights_config_context = v.into();
13969 self
13970 }
13971
13972 pub fn app_hub_application(&self) -> std::option::Option<&std::string::String> {
13976 #[allow(unreachable_patterns)]
13977 self.insights_config_context.as_ref().and_then(|v| match v {
13978 crate::model::insights_config::InsightsConfigContext::AppHubApplication(v) => {
13979 std::option::Option::Some(v)
13980 }
13981 _ => std::option::Option::None,
13982 })
13983 }
13984
13985 pub fn set_app_hub_application<T: std::convert::Into<std::string::String>>(
13991 mut self,
13992 v: T,
13993 ) -> Self {
13994 self.insights_config_context = std::option::Option::Some(
13995 crate::model::insights_config::InsightsConfigContext::AppHubApplication(v.into()),
13996 );
13997 self
13998 }
13999}
14000
14001impl wkt::message::Message for InsightsConfig {
14002 fn typename() -> &'static str {
14003 "type.googleapis.com/google.cloud.developerconnect.v1.InsightsConfig"
14004 }
14005}
14006
14007#[doc(hidden)]
14008impl<'de> serde::de::Deserialize<'de> for InsightsConfig {
14009 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14010 where
14011 D: serde::Deserializer<'de>,
14012 {
14013 #[allow(non_camel_case_types)]
14014 #[doc(hidden)]
14015 #[derive(PartialEq, Eq, Hash)]
14016 enum __FieldTag {
14017 __app_hub_application,
14018 __name,
14019 __create_time,
14020 __update_time,
14021 __runtime_configs,
14022 __artifact_configs,
14023 __state,
14024 __annotations,
14025 __labels,
14026 __reconciling,
14027 __errors,
14028 Unknown(std::string::String),
14029 }
14030 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14031 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14032 where
14033 D: serde::Deserializer<'de>,
14034 {
14035 struct Visitor;
14036 impl<'de> serde::de::Visitor<'de> for Visitor {
14037 type Value = __FieldTag;
14038 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14039 formatter.write_str("a field name for InsightsConfig")
14040 }
14041 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14042 where
14043 E: serde::de::Error,
14044 {
14045 use std::result::Result::Ok;
14046 use std::string::ToString;
14047 match value {
14048 "appHubApplication" => Ok(__FieldTag::__app_hub_application),
14049 "app_hub_application" => Ok(__FieldTag::__app_hub_application),
14050 "name" => Ok(__FieldTag::__name),
14051 "createTime" => Ok(__FieldTag::__create_time),
14052 "create_time" => Ok(__FieldTag::__create_time),
14053 "updateTime" => Ok(__FieldTag::__update_time),
14054 "update_time" => Ok(__FieldTag::__update_time),
14055 "runtimeConfigs" => Ok(__FieldTag::__runtime_configs),
14056 "runtime_configs" => Ok(__FieldTag::__runtime_configs),
14057 "artifactConfigs" => Ok(__FieldTag::__artifact_configs),
14058 "artifact_configs" => Ok(__FieldTag::__artifact_configs),
14059 "state" => Ok(__FieldTag::__state),
14060 "annotations" => Ok(__FieldTag::__annotations),
14061 "labels" => Ok(__FieldTag::__labels),
14062 "reconciling" => Ok(__FieldTag::__reconciling),
14063 "errors" => Ok(__FieldTag::__errors),
14064 _ => Ok(__FieldTag::Unknown(value.to_string())),
14065 }
14066 }
14067 }
14068 deserializer.deserialize_identifier(Visitor)
14069 }
14070 }
14071 struct Visitor;
14072 impl<'de> serde::de::Visitor<'de> for Visitor {
14073 type Value = InsightsConfig;
14074 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14075 formatter.write_str("struct InsightsConfig")
14076 }
14077 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14078 where
14079 A: serde::de::MapAccess<'de>,
14080 {
14081 #[allow(unused_imports)]
14082 use serde::de::Error;
14083 use std::option::Option::Some;
14084 let mut fields = std::collections::HashSet::new();
14085 let mut result = Self::Value::new();
14086 while let Some(tag) = map.next_key::<__FieldTag>()? {
14087 #[allow(clippy::match_single_binding)]
14088 match tag {
14089 __FieldTag::__app_hub_application => {
14090 if !fields.insert(__FieldTag::__app_hub_application) {
14091 return std::result::Result::Err(A::Error::duplicate_field(
14092 "multiple values for app_hub_application",
14093 ));
14094 }
14095 if result.insights_config_context.is_some() {
14096 return std::result::Result::Err(A::Error::duplicate_field(
14097 "multiple values for `insights_config_context`, a oneof with full ID .google.cloud.developerconnect.v1.InsightsConfig.app_hub_application, latest field was appHubApplication",
14098 ));
14099 }
14100 result.insights_config_context = std::option::Option::Some(
14101 crate::model::insights_config::InsightsConfigContext::AppHubApplication(
14102 map.next_value::<std::option::Option<std::string::String>>()?.unwrap_or_default()
14103 ),
14104 );
14105 }
14106 __FieldTag::__name => {
14107 if !fields.insert(__FieldTag::__name) {
14108 return std::result::Result::Err(A::Error::duplicate_field(
14109 "multiple values for name",
14110 ));
14111 }
14112 result.name = map
14113 .next_value::<std::option::Option<std::string::String>>()?
14114 .unwrap_or_default();
14115 }
14116 __FieldTag::__create_time => {
14117 if !fields.insert(__FieldTag::__create_time) {
14118 return std::result::Result::Err(A::Error::duplicate_field(
14119 "multiple values for create_time",
14120 ));
14121 }
14122 result.create_time =
14123 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
14124 }
14125 __FieldTag::__update_time => {
14126 if !fields.insert(__FieldTag::__update_time) {
14127 return std::result::Result::Err(A::Error::duplicate_field(
14128 "multiple values for update_time",
14129 ));
14130 }
14131 result.update_time =
14132 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
14133 }
14134 __FieldTag::__runtime_configs => {
14135 if !fields.insert(__FieldTag::__runtime_configs) {
14136 return std::result::Result::Err(A::Error::duplicate_field(
14137 "multiple values for runtime_configs",
14138 ));
14139 }
14140 result.runtime_configs = map.next_value::<std::option::Option<std::vec::Vec<crate::model::RuntimeConfig>>>()?.unwrap_or_default();
14141 }
14142 __FieldTag::__artifact_configs => {
14143 if !fields.insert(__FieldTag::__artifact_configs) {
14144 return std::result::Result::Err(A::Error::duplicate_field(
14145 "multiple values for artifact_configs",
14146 ));
14147 }
14148 result.artifact_configs =
14149 map.next_value::<std::option::Option<
14150 std::vec::Vec<crate::model::ArtifactConfig>,
14151 >>()?
14152 .unwrap_or_default();
14153 }
14154 __FieldTag::__state => {
14155 if !fields.insert(__FieldTag::__state) {
14156 return std::result::Result::Err(A::Error::duplicate_field(
14157 "multiple values for state",
14158 ));
14159 }
14160 result.state = map.next_value::<std::option::Option<crate::model::insights_config::State>>()?.unwrap_or_default();
14161 }
14162 __FieldTag::__annotations => {
14163 if !fields.insert(__FieldTag::__annotations) {
14164 return std::result::Result::Err(A::Error::duplicate_field(
14165 "multiple values for annotations",
14166 ));
14167 }
14168 result.annotations = map
14169 .next_value::<std::option::Option<
14170 std::collections::HashMap<
14171 std::string::String,
14172 std::string::String,
14173 >,
14174 >>()?
14175 .unwrap_or_default();
14176 }
14177 __FieldTag::__labels => {
14178 if !fields.insert(__FieldTag::__labels) {
14179 return std::result::Result::Err(A::Error::duplicate_field(
14180 "multiple values for labels",
14181 ));
14182 }
14183 result.labels = map
14184 .next_value::<std::option::Option<
14185 std::collections::HashMap<
14186 std::string::String,
14187 std::string::String,
14188 >,
14189 >>()?
14190 .unwrap_or_default();
14191 }
14192 __FieldTag::__reconciling => {
14193 if !fields.insert(__FieldTag::__reconciling) {
14194 return std::result::Result::Err(A::Error::duplicate_field(
14195 "multiple values for reconciling",
14196 ));
14197 }
14198 result.reconciling = map
14199 .next_value::<std::option::Option<bool>>()?
14200 .unwrap_or_default();
14201 }
14202 __FieldTag::__errors => {
14203 if !fields.insert(__FieldTag::__errors) {
14204 return std::result::Result::Err(A::Error::duplicate_field(
14205 "multiple values for errors",
14206 ));
14207 }
14208 result.errors = map.next_value::<std::option::Option<std::vec::Vec<rpc::model::Status>>>()?.unwrap_or_default();
14209 }
14210 __FieldTag::Unknown(key) => {
14211 let value = map.next_value::<serde_json::Value>()?;
14212 result._unknown_fields.insert(key, value);
14213 }
14214 }
14215 }
14216 std::result::Result::Ok(result)
14217 }
14218 }
14219 deserializer.deserialize_any(Visitor)
14220 }
14221}
14222
14223#[doc(hidden)]
14224impl serde::ser::Serialize for InsightsConfig {
14225 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14226 where
14227 S: serde::ser::Serializer,
14228 {
14229 use serde::ser::SerializeMap;
14230 #[allow(unused_imports)]
14231 use std::option::Option::Some;
14232 let mut state = serializer.serialize_map(std::option::Option::None)?;
14233 if let Some(value) = self.app_hub_application() {
14234 state.serialize_entry("appHubApplication", value)?;
14235 }
14236 if !self.name.is_empty() {
14237 state.serialize_entry("name", &self.name)?;
14238 }
14239 if self.create_time.is_some() {
14240 state.serialize_entry("createTime", &self.create_time)?;
14241 }
14242 if self.update_time.is_some() {
14243 state.serialize_entry("updateTime", &self.update_time)?;
14244 }
14245 if !self.runtime_configs.is_empty() {
14246 state.serialize_entry("runtimeConfigs", &self.runtime_configs)?;
14247 }
14248 if !self.artifact_configs.is_empty() {
14249 state.serialize_entry("artifactConfigs", &self.artifact_configs)?;
14250 }
14251 if !wkt::internal::is_default(&self.state) {
14252 state.serialize_entry("state", &self.state)?;
14253 }
14254 if !self.annotations.is_empty() {
14255 state.serialize_entry("annotations", &self.annotations)?;
14256 }
14257 if !self.labels.is_empty() {
14258 state.serialize_entry("labels", &self.labels)?;
14259 }
14260 if !wkt::internal::is_default(&self.reconciling) {
14261 state.serialize_entry("reconciling", &self.reconciling)?;
14262 }
14263 if !self.errors.is_empty() {
14264 state.serialize_entry("errors", &self.errors)?;
14265 }
14266 if !self._unknown_fields.is_empty() {
14267 for (key, value) in self._unknown_fields.iter() {
14268 state.serialize_entry(key, &value)?;
14269 }
14270 }
14271 state.end()
14272 }
14273}
14274
14275impl std::fmt::Debug for InsightsConfig {
14276 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14277 let mut debug_struct = f.debug_struct("InsightsConfig");
14278 debug_struct.field("name", &self.name);
14279 debug_struct.field("create_time", &self.create_time);
14280 debug_struct.field("update_time", &self.update_time);
14281 debug_struct.field("runtime_configs", &self.runtime_configs);
14282 debug_struct.field("artifact_configs", &self.artifact_configs);
14283 debug_struct.field("state", &self.state);
14284 debug_struct.field("annotations", &self.annotations);
14285 debug_struct.field("labels", &self.labels);
14286 debug_struct.field("reconciling", &self.reconciling);
14287 debug_struct.field("errors", &self.errors);
14288 debug_struct.field("insights_config_context", &self.insights_config_context);
14289 if !self._unknown_fields.is_empty() {
14290 debug_struct.field("_unknown_fields", &self._unknown_fields);
14291 }
14292 debug_struct.finish()
14293 }
14294}
14295
14296pub mod insights_config {
14298 #[allow(unused_imports)]
14299 use super::*;
14300
14301 #[derive(Clone, Debug, PartialEq)]
14317 #[non_exhaustive]
14318 pub enum State {
14319 Unspecified,
14321 Pending,
14323 Complete,
14325 Error,
14327 UnknownValue(state::UnknownValue),
14332 }
14333
14334 #[doc(hidden)]
14335 pub mod state {
14336 #[allow(unused_imports)]
14337 use super::*;
14338 #[derive(Clone, Debug, PartialEq)]
14339 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14340 }
14341
14342 impl State {
14343 pub fn value(&self) -> std::option::Option<i32> {
14348 match self {
14349 Self::Unspecified => std::option::Option::Some(0),
14350 Self::Pending => std::option::Option::Some(5),
14351 Self::Complete => std::option::Option::Some(3),
14352 Self::Error => std::option::Option::Some(4),
14353 Self::UnknownValue(u) => u.0.value(),
14354 }
14355 }
14356
14357 pub fn name(&self) -> std::option::Option<&str> {
14362 match self {
14363 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14364 Self::Pending => std::option::Option::Some("PENDING"),
14365 Self::Complete => std::option::Option::Some("COMPLETE"),
14366 Self::Error => std::option::Option::Some("ERROR"),
14367 Self::UnknownValue(u) => u.0.name(),
14368 }
14369 }
14370 }
14371
14372 impl std::default::Default for State {
14373 fn default() -> Self {
14374 use std::convert::From;
14375 Self::from(0)
14376 }
14377 }
14378
14379 impl std::fmt::Display for State {
14380 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14381 wkt::internal::display_enum(f, self.name(), self.value())
14382 }
14383 }
14384
14385 impl std::convert::From<i32> for State {
14386 fn from(value: i32) -> Self {
14387 match value {
14388 0 => Self::Unspecified,
14389 3 => Self::Complete,
14390 4 => Self::Error,
14391 5 => Self::Pending,
14392 _ => Self::UnknownValue(state::UnknownValue(
14393 wkt::internal::UnknownEnumValue::Integer(value),
14394 )),
14395 }
14396 }
14397 }
14398
14399 impl std::convert::From<&str> for State {
14400 fn from(value: &str) -> Self {
14401 use std::string::ToString;
14402 match value {
14403 "STATE_UNSPECIFIED" => Self::Unspecified,
14404 "PENDING" => Self::Pending,
14405 "COMPLETE" => Self::Complete,
14406 "ERROR" => Self::Error,
14407 _ => Self::UnknownValue(state::UnknownValue(
14408 wkt::internal::UnknownEnumValue::String(value.to_string()),
14409 )),
14410 }
14411 }
14412 }
14413
14414 impl serde::ser::Serialize for State {
14415 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14416 where
14417 S: serde::Serializer,
14418 {
14419 match self {
14420 Self::Unspecified => serializer.serialize_i32(0),
14421 Self::Pending => serializer.serialize_i32(5),
14422 Self::Complete => serializer.serialize_i32(3),
14423 Self::Error => serializer.serialize_i32(4),
14424 Self::UnknownValue(u) => u.0.serialize(serializer),
14425 }
14426 }
14427 }
14428
14429 impl<'de> serde::de::Deserialize<'de> for State {
14430 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14431 where
14432 D: serde::Deserializer<'de>,
14433 {
14434 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14435 ".google.cloud.developerconnect.v1.InsightsConfig.State",
14436 ))
14437 }
14438 }
14439
14440 #[derive(Clone, Debug, PartialEq)]
14442 #[non_exhaustive]
14443 pub enum InsightsConfigContext {
14444 AppHubApplication(std::string::String),
14448 }
14449}
14450
14451#[derive(Clone, Default, PartialEq)]
14454#[non_exhaustive]
14455pub struct RuntimeConfig {
14456 pub uri: std::string::String,
14460
14461 pub state: crate::model::runtime_config::State,
14463
14464 pub runtime: std::option::Option<crate::model::runtime_config::Runtime>,
14466
14467 pub derived_from: std::option::Option<crate::model::runtime_config::DerivedFrom>,
14469
14470 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14471}
14472
14473impl RuntimeConfig {
14474 pub fn new() -> Self {
14475 std::default::Default::default()
14476 }
14477
14478 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14480 self.uri = v.into();
14481 self
14482 }
14483
14484 pub fn set_state<T: std::convert::Into<crate::model::runtime_config::State>>(
14486 mut self,
14487 v: T,
14488 ) -> Self {
14489 self.state = v.into();
14490 self
14491 }
14492
14493 pub fn set_runtime<
14498 T: std::convert::Into<std::option::Option<crate::model::runtime_config::Runtime>>,
14499 >(
14500 mut self,
14501 v: T,
14502 ) -> Self {
14503 self.runtime = v.into();
14504 self
14505 }
14506
14507 pub fn gke_workload(&self) -> std::option::Option<&std::boxed::Box<crate::model::GKEWorkload>> {
14511 #[allow(unreachable_patterns)]
14512 self.runtime.as_ref().and_then(|v| match v {
14513 crate::model::runtime_config::Runtime::GkeWorkload(v) => std::option::Option::Some(v),
14514 _ => std::option::Option::None,
14515 })
14516 }
14517
14518 pub fn set_gke_workload<T: std::convert::Into<std::boxed::Box<crate::model::GKEWorkload>>>(
14524 mut self,
14525 v: T,
14526 ) -> Self {
14527 self.runtime =
14528 std::option::Option::Some(crate::model::runtime_config::Runtime::GkeWorkload(v.into()));
14529 self
14530 }
14531
14532 pub fn set_derived_from<
14537 T: std::convert::Into<std::option::Option<crate::model::runtime_config::DerivedFrom>>,
14538 >(
14539 mut self,
14540 v: T,
14541 ) -> Self {
14542 self.derived_from = v.into();
14543 self
14544 }
14545
14546 pub fn app_hub_workload(
14550 &self,
14551 ) -> std::option::Option<&std::boxed::Box<crate::model::AppHubWorkload>> {
14552 #[allow(unreachable_patterns)]
14553 self.derived_from.as_ref().and_then(|v| match v {
14554 crate::model::runtime_config::DerivedFrom::AppHubWorkload(v) => {
14555 std::option::Option::Some(v)
14556 }
14557 _ => std::option::Option::None,
14558 })
14559 }
14560
14561 pub fn set_app_hub_workload<
14567 T: std::convert::Into<std::boxed::Box<crate::model::AppHubWorkload>>,
14568 >(
14569 mut self,
14570 v: T,
14571 ) -> Self {
14572 self.derived_from = std::option::Option::Some(
14573 crate::model::runtime_config::DerivedFrom::AppHubWorkload(v.into()),
14574 );
14575 self
14576 }
14577}
14578
14579impl wkt::message::Message for RuntimeConfig {
14580 fn typename() -> &'static str {
14581 "type.googleapis.com/google.cloud.developerconnect.v1.RuntimeConfig"
14582 }
14583}
14584
14585#[doc(hidden)]
14586impl<'de> serde::de::Deserialize<'de> for RuntimeConfig {
14587 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14588 where
14589 D: serde::Deserializer<'de>,
14590 {
14591 #[allow(non_camel_case_types)]
14592 #[doc(hidden)]
14593 #[derive(PartialEq, Eq, Hash)]
14594 enum __FieldTag {
14595 __gke_workload,
14596 __app_hub_workload,
14597 __uri,
14598 __state,
14599 Unknown(std::string::String),
14600 }
14601 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14602 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14603 where
14604 D: serde::Deserializer<'de>,
14605 {
14606 struct Visitor;
14607 impl<'de> serde::de::Visitor<'de> for Visitor {
14608 type Value = __FieldTag;
14609 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14610 formatter.write_str("a field name for RuntimeConfig")
14611 }
14612 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14613 where
14614 E: serde::de::Error,
14615 {
14616 use std::result::Result::Ok;
14617 use std::string::ToString;
14618 match value {
14619 "gkeWorkload" => Ok(__FieldTag::__gke_workload),
14620 "gke_workload" => Ok(__FieldTag::__gke_workload),
14621 "appHubWorkload" => Ok(__FieldTag::__app_hub_workload),
14622 "app_hub_workload" => Ok(__FieldTag::__app_hub_workload),
14623 "uri" => Ok(__FieldTag::__uri),
14624 "state" => Ok(__FieldTag::__state),
14625 _ => Ok(__FieldTag::Unknown(value.to_string())),
14626 }
14627 }
14628 }
14629 deserializer.deserialize_identifier(Visitor)
14630 }
14631 }
14632 struct Visitor;
14633 impl<'de> serde::de::Visitor<'de> for Visitor {
14634 type Value = RuntimeConfig;
14635 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14636 formatter.write_str("struct RuntimeConfig")
14637 }
14638 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14639 where
14640 A: serde::de::MapAccess<'de>,
14641 {
14642 #[allow(unused_imports)]
14643 use serde::de::Error;
14644 use std::option::Option::Some;
14645 let mut fields = std::collections::HashSet::new();
14646 let mut result = Self::Value::new();
14647 while let Some(tag) = map.next_key::<__FieldTag>()? {
14648 #[allow(clippy::match_single_binding)]
14649 match tag {
14650 __FieldTag::__gke_workload => {
14651 if !fields.insert(__FieldTag::__gke_workload) {
14652 return std::result::Result::Err(A::Error::duplicate_field(
14653 "multiple values for gke_workload",
14654 ));
14655 }
14656 if result.runtime.is_some() {
14657 return std::result::Result::Err(A::Error::duplicate_field(
14658 "multiple values for `runtime`, a oneof with full ID .google.cloud.developerconnect.v1.RuntimeConfig.gke_workload, latest field was gkeWorkload",
14659 ));
14660 }
14661 result.runtime = std::option::Option::Some(
14662 crate::model::runtime_config::Runtime::GkeWorkload(
14663 map.next_value::<std::option::Option<
14664 std::boxed::Box<crate::model::GKEWorkload>,
14665 >>()?
14666 .unwrap_or_default(),
14667 ),
14668 );
14669 }
14670 __FieldTag::__app_hub_workload => {
14671 if !fields.insert(__FieldTag::__app_hub_workload) {
14672 return std::result::Result::Err(A::Error::duplicate_field(
14673 "multiple values for app_hub_workload",
14674 ));
14675 }
14676 if result.derived_from.is_some() {
14677 return std::result::Result::Err(A::Error::duplicate_field(
14678 "multiple values for `derived_from`, a oneof with full ID .google.cloud.developerconnect.v1.RuntimeConfig.app_hub_workload, latest field was appHubWorkload",
14679 ));
14680 }
14681 result.derived_from = std::option::Option::Some(
14682 crate::model::runtime_config::DerivedFrom::AppHubWorkload(
14683 map.next_value::<std::option::Option<
14684 std::boxed::Box<crate::model::AppHubWorkload>,
14685 >>()?
14686 .unwrap_or_default(),
14687 ),
14688 );
14689 }
14690 __FieldTag::__uri => {
14691 if !fields.insert(__FieldTag::__uri) {
14692 return std::result::Result::Err(A::Error::duplicate_field(
14693 "multiple values for uri",
14694 ));
14695 }
14696 result.uri = map
14697 .next_value::<std::option::Option<std::string::String>>()?
14698 .unwrap_or_default();
14699 }
14700 __FieldTag::__state => {
14701 if !fields.insert(__FieldTag::__state) {
14702 return std::result::Result::Err(A::Error::duplicate_field(
14703 "multiple values for state",
14704 ));
14705 }
14706 result.state = map.next_value::<std::option::Option<crate::model::runtime_config::State>>()?.unwrap_or_default();
14707 }
14708 __FieldTag::Unknown(key) => {
14709 let value = map.next_value::<serde_json::Value>()?;
14710 result._unknown_fields.insert(key, value);
14711 }
14712 }
14713 }
14714 std::result::Result::Ok(result)
14715 }
14716 }
14717 deserializer.deserialize_any(Visitor)
14718 }
14719}
14720
14721#[doc(hidden)]
14722impl serde::ser::Serialize for RuntimeConfig {
14723 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14724 where
14725 S: serde::ser::Serializer,
14726 {
14727 use serde::ser::SerializeMap;
14728 #[allow(unused_imports)]
14729 use std::option::Option::Some;
14730 let mut state = serializer.serialize_map(std::option::Option::None)?;
14731 if let Some(value) = self.gke_workload() {
14732 state.serialize_entry("gkeWorkload", value)?;
14733 }
14734 if let Some(value) = self.app_hub_workload() {
14735 state.serialize_entry("appHubWorkload", value)?;
14736 }
14737 if !self.uri.is_empty() {
14738 state.serialize_entry("uri", &self.uri)?;
14739 }
14740 if !wkt::internal::is_default(&self.state) {
14741 state.serialize_entry("state", &self.state)?;
14742 }
14743 if !self._unknown_fields.is_empty() {
14744 for (key, value) in self._unknown_fields.iter() {
14745 state.serialize_entry(key, &value)?;
14746 }
14747 }
14748 state.end()
14749 }
14750}
14751
14752impl std::fmt::Debug for RuntimeConfig {
14753 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14754 let mut debug_struct = f.debug_struct("RuntimeConfig");
14755 debug_struct.field("uri", &self.uri);
14756 debug_struct.field("state", &self.state);
14757 debug_struct.field("runtime", &self.runtime);
14758 debug_struct.field("derived_from", &self.derived_from);
14759 if !self._unknown_fields.is_empty() {
14760 debug_struct.field("_unknown_fields", &self._unknown_fields);
14761 }
14762 debug_struct.finish()
14763 }
14764}
14765
14766pub mod runtime_config {
14768 #[allow(unused_imports)]
14769 use super::*;
14770
14771 #[derive(Clone, Debug, PartialEq)]
14788 #[non_exhaustive]
14789 pub enum State {
14790 Unspecified,
14792 Linked,
14794 Unlinked,
14796 UnknownValue(state::UnknownValue),
14801 }
14802
14803 #[doc(hidden)]
14804 pub mod state {
14805 #[allow(unused_imports)]
14806 use super::*;
14807 #[derive(Clone, Debug, PartialEq)]
14808 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14809 }
14810
14811 impl State {
14812 pub fn value(&self) -> std::option::Option<i32> {
14817 match self {
14818 Self::Unspecified => std::option::Option::Some(0),
14819 Self::Linked => std::option::Option::Some(1),
14820 Self::Unlinked => std::option::Option::Some(2),
14821 Self::UnknownValue(u) => u.0.value(),
14822 }
14823 }
14824
14825 pub fn name(&self) -> std::option::Option<&str> {
14830 match self {
14831 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14832 Self::Linked => std::option::Option::Some("LINKED"),
14833 Self::Unlinked => std::option::Option::Some("UNLINKED"),
14834 Self::UnknownValue(u) => u.0.name(),
14835 }
14836 }
14837 }
14838
14839 impl std::default::Default for State {
14840 fn default() -> Self {
14841 use std::convert::From;
14842 Self::from(0)
14843 }
14844 }
14845
14846 impl std::fmt::Display for State {
14847 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14848 wkt::internal::display_enum(f, self.name(), self.value())
14849 }
14850 }
14851
14852 impl std::convert::From<i32> for State {
14853 fn from(value: i32) -> Self {
14854 match value {
14855 0 => Self::Unspecified,
14856 1 => Self::Linked,
14857 2 => Self::Unlinked,
14858 _ => Self::UnknownValue(state::UnknownValue(
14859 wkt::internal::UnknownEnumValue::Integer(value),
14860 )),
14861 }
14862 }
14863 }
14864
14865 impl std::convert::From<&str> for State {
14866 fn from(value: &str) -> Self {
14867 use std::string::ToString;
14868 match value {
14869 "STATE_UNSPECIFIED" => Self::Unspecified,
14870 "LINKED" => Self::Linked,
14871 "UNLINKED" => Self::Unlinked,
14872 _ => Self::UnknownValue(state::UnknownValue(
14873 wkt::internal::UnknownEnumValue::String(value.to_string()),
14874 )),
14875 }
14876 }
14877 }
14878
14879 impl serde::ser::Serialize for State {
14880 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14881 where
14882 S: serde::Serializer,
14883 {
14884 match self {
14885 Self::Unspecified => serializer.serialize_i32(0),
14886 Self::Linked => serializer.serialize_i32(1),
14887 Self::Unlinked => serializer.serialize_i32(2),
14888 Self::UnknownValue(u) => u.0.serialize(serializer),
14889 }
14890 }
14891 }
14892
14893 impl<'de> serde::de::Deserialize<'de> for State {
14894 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14895 where
14896 D: serde::Deserializer<'de>,
14897 {
14898 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14899 ".google.cloud.developerconnect.v1.RuntimeConfig.State",
14900 ))
14901 }
14902 }
14903
14904 #[derive(Clone, Debug, PartialEq)]
14906 #[non_exhaustive]
14907 pub enum Runtime {
14908 GkeWorkload(std::boxed::Box<crate::model::GKEWorkload>),
14910 }
14911
14912 #[derive(Clone, Debug, PartialEq)]
14914 #[non_exhaustive]
14915 pub enum DerivedFrom {
14916 AppHubWorkload(std::boxed::Box<crate::model::AppHubWorkload>),
14918 }
14919}
14920
14921#[derive(Clone, Default, PartialEq)]
14923#[non_exhaustive]
14924pub struct GKEWorkload {
14925 pub cluster: std::string::String,
14929
14930 pub deployment: std::string::String,
14934
14935 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14936}
14937
14938impl GKEWorkload {
14939 pub fn new() -> Self {
14940 std::default::Default::default()
14941 }
14942
14943 pub fn set_cluster<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14945 self.cluster = v.into();
14946 self
14947 }
14948
14949 pub fn set_deployment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14951 self.deployment = v.into();
14952 self
14953 }
14954}
14955
14956impl wkt::message::Message for GKEWorkload {
14957 fn typename() -> &'static str {
14958 "type.googleapis.com/google.cloud.developerconnect.v1.GKEWorkload"
14959 }
14960}
14961
14962#[doc(hidden)]
14963impl<'de> serde::de::Deserialize<'de> for GKEWorkload {
14964 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14965 where
14966 D: serde::Deserializer<'de>,
14967 {
14968 #[allow(non_camel_case_types)]
14969 #[doc(hidden)]
14970 #[derive(PartialEq, Eq, Hash)]
14971 enum __FieldTag {
14972 __cluster,
14973 __deployment,
14974 Unknown(std::string::String),
14975 }
14976 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14977 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14978 where
14979 D: serde::Deserializer<'de>,
14980 {
14981 struct Visitor;
14982 impl<'de> serde::de::Visitor<'de> for Visitor {
14983 type Value = __FieldTag;
14984 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14985 formatter.write_str("a field name for GKEWorkload")
14986 }
14987 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14988 where
14989 E: serde::de::Error,
14990 {
14991 use std::result::Result::Ok;
14992 use std::string::ToString;
14993 match value {
14994 "cluster" => Ok(__FieldTag::__cluster),
14995 "deployment" => Ok(__FieldTag::__deployment),
14996 _ => Ok(__FieldTag::Unknown(value.to_string())),
14997 }
14998 }
14999 }
15000 deserializer.deserialize_identifier(Visitor)
15001 }
15002 }
15003 struct Visitor;
15004 impl<'de> serde::de::Visitor<'de> for Visitor {
15005 type Value = GKEWorkload;
15006 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15007 formatter.write_str("struct GKEWorkload")
15008 }
15009 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15010 where
15011 A: serde::de::MapAccess<'de>,
15012 {
15013 #[allow(unused_imports)]
15014 use serde::de::Error;
15015 use std::option::Option::Some;
15016 let mut fields = std::collections::HashSet::new();
15017 let mut result = Self::Value::new();
15018 while let Some(tag) = map.next_key::<__FieldTag>()? {
15019 #[allow(clippy::match_single_binding)]
15020 match tag {
15021 __FieldTag::__cluster => {
15022 if !fields.insert(__FieldTag::__cluster) {
15023 return std::result::Result::Err(A::Error::duplicate_field(
15024 "multiple values for cluster",
15025 ));
15026 }
15027 result.cluster = map
15028 .next_value::<std::option::Option<std::string::String>>()?
15029 .unwrap_or_default();
15030 }
15031 __FieldTag::__deployment => {
15032 if !fields.insert(__FieldTag::__deployment) {
15033 return std::result::Result::Err(A::Error::duplicate_field(
15034 "multiple values for deployment",
15035 ));
15036 }
15037 result.deployment = map
15038 .next_value::<std::option::Option<std::string::String>>()?
15039 .unwrap_or_default();
15040 }
15041 __FieldTag::Unknown(key) => {
15042 let value = map.next_value::<serde_json::Value>()?;
15043 result._unknown_fields.insert(key, value);
15044 }
15045 }
15046 }
15047 std::result::Result::Ok(result)
15048 }
15049 }
15050 deserializer.deserialize_any(Visitor)
15051 }
15052}
15053
15054#[doc(hidden)]
15055impl serde::ser::Serialize for GKEWorkload {
15056 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15057 where
15058 S: serde::ser::Serializer,
15059 {
15060 use serde::ser::SerializeMap;
15061 #[allow(unused_imports)]
15062 use std::option::Option::Some;
15063 let mut state = serializer.serialize_map(std::option::Option::None)?;
15064 if !self.cluster.is_empty() {
15065 state.serialize_entry("cluster", &self.cluster)?;
15066 }
15067 if !self.deployment.is_empty() {
15068 state.serialize_entry("deployment", &self.deployment)?;
15069 }
15070 if !self._unknown_fields.is_empty() {
15071 for (key, value) in self._unknown_fields.iter() {
15072 state.serialize_entry(key, &value)?;
15073 }
15074 }
15075 state.end()
15076 }
15077}
15078
15079impl std::fmt::Debug for GKEWorkload {
15080 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15081 let mut debug_struct = f.debug_struct("GKEWorkload");
15082 debug_struct.field("cluster", &self.cluster);
15083 debug_struct.field("deployment", &self.deployment);
15084 if !self._unknown_fields.is_empty() {
15085 debug_struct.field("_unknown_fields", &self._unknown_fields);
15086 }
15087 debug_struct.finish()
15088 }
15089}
15090
15091#[derive(Clone, Default, PartialEq)]
15093#[non_exhaustive]
15094pub struct AppHubWorkload {
15095 pub workload: std::string::String,
15099
15100 pub criticality: std::string::String,
15102
15103 pub environment: std::string::String,
15105
15106 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15107}
15108
15109impl AppHubWorkload {
15110 pub fn new() -> Self {
15111 std::default::Default::default()
15112 }
15113
15114 pub fn set_workload<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15116 self.workload = v.into();
15117 self
15118 }
15119
15120 pub fn set_criticality<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15122 self.criticality = v.into();
15123 self
15124 }
15125
15126 pub fn set_environment<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15128 self.environment = v.into();
15129 self
15130 }
15131}
15132
15133impl wkt::message::Message for AppHubWorkload {
15134 fn typename() -> &'static str {
15135 "type.googleapis.com/google.cloud.developerconnect.v1.AppHubWorkload"
15136 }
15137}
15138
15139#[doc(hidden)]
15140impl<'de> serde::de::Deserialize<'de> for AppHubWorkload {
15141 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15142 where
15143 D: serde::Deserializer<'de>,
15144 {
15145 #[allow(non_camel_case_types)]
15146 #[doc(hidden)]
15147 #[derive(PartialEq, Eq, Hash)]
15148 enum __FieldTag {
15149 __workload,
15150 __criticality,
15151 __environment,
15152 Unknown(std::string::String),
15153 }
15154 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15155 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15156 where
15157 D: serde::Deserializer<'de>,
15158 {
15159 struct Visitor;
15160 impl<'de> serde::de::Visitor<'de> for Visitor {
15161 type Value = __FieldTag;
15162 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15163 formatter.write_str("a field name for AppHubWorkload")
15164 }
15165 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15166 where
15167 E: serde::de::Error,
15168 {
15169 use std::result::Result::Ok;
15170 use std::string::ToString;
15171 match value {
15172 "workload" => Ok(__FieldTag::__workload),
15173 "criticality" => Ok(__FieldTag::__criticality),
15174 "environment" => Ok(__FieldTag::__environment),
15175 _ => Ok(__FieldTag::Unknown(value.to_string())),
15176 }
15177 }
15178 }
15179 deserializer.deserialize_identifier(Visitor)
15180 }
15181 }
15182 struct Visitor;
15183 impl<'de> serde::de::Visitor<'de> for Visitor {
15184 type Value = AppHubWorkload;
15185 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15186 formatter.write_str("struct AppHubWorkload")
15187 }
15188 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15189 where
15190 A: serde::de::MapAccess<'de>,
15191 {
15192 #[allow(unused_imports)]
15193 use serde::de::Error;
15194 use std::option::Option::Some;
15195 let mut fields = std::collections::HashSet::new();
15196 let mut result = Self::Value::new();
15197 while let Some(tag) = map.next_key::<__FieldTag>()? {
15198 #[allow(clippy::match_single_binding)]
15199 match tag {
15200 __FieldTag::__workload => {
15201 if !fields.insert(__FieldTag::__workload) {
15202 return std::result::Result::Err(A::Error::duplicate_field(
15203 "multiple values for workload",
15204 ));
15205 }
15206 result.workload = map
15207 .next_value::<std::option::Option<std::string::String>>()?
15208 .unwrap_or_default();
15209 }
15210 __FieldTag::__criticality => {
15211 if !fields.insert(__FieldTag::__criticality) {
15212 return std::result::Result::Err(A::Error::duplicate_field(
15213 "multiple values for criticality",
15214 ));
15215 }
15216 result.criticality = map
15217 .next_value::<std::option::Option<std::string::String>>()?
15218 .unwrap_or_default();
15219 }
15220 __FieldTag::__environment => {
15221 if !fields.insert(__FieldTag::__environment) {
15222 return std::result::Result::Err(A::Error::duplicate_field(
15223 "multiple values for environment",
15224 ));
15225 }
15226 result.environment = map
15227 .next_value::<std::option::Option<std::string::String>>()?
15228 .unwrap_or_default();
15229 }
15230 __FieldTag::Unknown(key) => {
15231 let value = map.next_value::<serde_json::Value>()?;
15232 result._unknown_fields.insert(key, value);
15233 }
15234 }
15235 }
15236 std::result::Result::Ok(result)
15237 }
15238 }
15239 deserializer.deserialize_any(Visitor)
15240 }
15241}
15242
15243#[doc(hidden)]
15244impl serde::ser::Serialize for AppHubWorkload {
15245 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15246 where
15247 S: serde::ser::Serializer,
15248 {
15249 use serde::ser::SerializeMap;
15250 #[allow(unused_imports)]
15251 use std::option::Option::Some;
15252 let mut state = serializer.serialize_map(std::option::Option::None)?;
15253 if !self.workload.is_empty() {
15254 state.serialize_entry("workload", &self.workload)?;
15255 }
15256 if !self.criticality.is_empty() {
15257 state.serialize_entry("criticality", &self.criticality)?;
15258 }
15259 if !self.environment.is_empty() {
15260 state.serialize_entry("environment", &self.environment)?;
15261 }
15262 if !self._unknown_fields.is_empty() {
15263 for (key, value) in self._unknown_fields.iter() {
15264 state.serialize_entry(key, &value)?;
15265 }
15266 }
15267 state.end()
15268 }
15269}
15270
15271impl std::fmt::Debug for AppHubWorkload {
15272 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15273 let mut debug_struct = f.debug_struct("AppHubWorkload");
15274 debug_struct.field("workload", &self.workload);
15275 debug_struct.field("criticality", &self.criticality);
15276 debug_struct.field("environment", &self.environment);
15277 if !self._unknown_fields.is_empty() {
15278 debug_struct.field("_unknown_fields", &self._unknown_fields);
15279 }
15280 debug_struct.finish()
15281 }
15282}
15283
15284#[derive(Clone, Default, PartialEq)]
15286#[non_exhaustive]
15287pub struct ArtifactConfig {
15288 pub uri: std::string::String,
15293
15294 pub artifact_storage: std::option::Option<crate::model::artifact_config::ArtifactStorage>,
15296
15297 pub artifact_metadata_storage:
15299 std::option::Option<crate::model::artifact_config::ArtifactMetadataStorage>,
15300
15301 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15302}
15303
15304impl ArtifactConfig {
15305 pub fn new() -> Self {
15306 std::default::Default::default()
15307 }
15308
15309 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15311 self.uri = v.into();
15312 self
15313 }
15314
15315 pub fn set_artifact_storage<
15320 T: std::convert::Into<std::option::Option<crate::model::artifact_config::ArtifactStorage>>,
15321 >(
15322 mut self,
15323 v: T,
15324 ) -> Self {
15325 self.artifact_storage = v.into();
15326 self
15327 }
15328
15329 pub fn google_artifact_registry(
15333 &self,
15334 ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleArtifactRegistry>> {
15335 #[allow(unreachable_patterns)]
15336 self.artifact_storage.as_ref().and_then(|v| match v {
15337 crate::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(v) => {
15338 std::option::Option::Some(v)
15339 }
15340 _ => std::option::Option::None,
15341 })
15342 }
15343
15344 pub fn set_google_artifact_registry<
15350 T: std::convert::Into<std::boxed::Box<crate::model::GoogleArtifactRegistry>>,
15351 >(
15352 mut self,
15353 v: T,
15354 ) -> Self {
15355 self.artifact_storage = std::option::Option::Some(
15356 crate::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(v.into()),
15357 );
15358 self
15359 }
15360
15361 pub fn set_artifact_metadata_storage<
15366 T: std::convert::Into<
15367 std::option::Option<crate::model::artifact_config::ArtifactMetadataStorage>,
15368 >,
15369 >(
15370 mut self,
15371 v: T,
15372 ) -> Self {
15373 self.artifact_metadata_storage = v.into();
15374 self
15375 }
15376
15377 pub fn google_artifact_analysis(
15381 &self,
15382 ) -> std::option::Option<&std::boxed::Box<crate::model::GoogleArtifactAnalysis>> {
15383 #[allow(unreachable_patterns)]
15384 self.artifact_metadata_storage
15385 .as_ref()
15386 .and_then(|v| match v {
15387 crate::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(
15388 v,
15389 ) => std::option::Option::Some(v),
15390 _ => std::option::Option::None,
15391 })
15392 }
15393
15394 pub fn set_google_artifact_analysis<
15400 T: std::convert::Into<std::boxed::Box<crate::model::GoogleArtifactAnalysis>>,
15401 >(
15402 mut self,
15403 v: T,
15404 ) -> Self {
15405 self.artifact_metadata_storage = std::option::Option::Some(
15406 crate::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(
15407 v.into(),
15408 ),
15409 );
15410 self
15411 }
15412}
15413
15414impl wkt::message::Message for ArtifactConfig {
15415 fn typename() -> &'static str {
15416 "type.googleapis.com/google.cloud.developerconnect.v1.ArtifactConfig"
15417 }
15418}
15419
15420#[doc(hidden)]
15421impl<'de> serde::de::Deserialize<'de> for ArtifactConfig {
15422 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15423 where
15424 D: serde::Deserializer<'de>,
15425 {
15426 #[allow(non_camel_case_types)]
15427 #[doc(hidden)]
15428 #[derive(PartialEq, Eq, Hash)]
15429 enum __FieldTag {
15430 __google_artifact_registry,
15431 __google_artifact_analysis,
15432 __uri,
15433 Unknown(std::string::String),
15434 }
15435 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15436 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15437 where
15438 D: serde::Deserializer<'de>,
15439 {
15440 struct Visitor;
15441 impl<'de> serde::de::Visitor<'de> for Visitor {
15442 type Value = __FieldTag;
15443 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15444 formatter.write_str("a field name for ArtifactConfig")
15445 }
15446 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15447 where
15448 E: serde::de::Error,
15449 {
15450 use std::result::Result::Ok;
15451 use std::string::ToString;
15452 match value {
15453 "googleArtifactRegistry" => Ok(__FieldTag::__google_artifact_registry),
15454 "google_artifact_registry" => {
15455 Ok(__FieldTag::__google_artifact_registry)
15456 }
15457 "googleArtifactAnalysis" => Ok(__FieldTag::__google_artifact_analysis),
15458 "google_artifact_analysis" => {
15459 Ok(__FieldTag::__google_artifact_analysis)
15460 }
15461 "uri" => Ok(__FieldTag::__uri),
15462 _ => Ok(__FieldTag::Unknown(value.to_string())),
15463 }
15464 }
15465 }
15466 deserializer.deserialize_identifier(Visitor)
15467 }
15468 }
15469 struct Visitor;
15470 impl<'de> serde::de::Visitor<'de> for Visitor {
15471 type Value = ArtifactConfig;
15472 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15473 formatter.write_str("struct ArtifactConfig")
15474 }
15475 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15476 where
15477 A: serde::de::MapAccess<'de>,
15478 {
15479 #[allow(unused_imports)]
15480 use serde::de::Error;
15481 use std::option::Option::Some;
15482 let mut fields = std::collections::HashSet::new();
15483 let mut result = Self::Value::new();
15484 while let Some(tag) = map.next_key::<__FieldTag>()? {
15485 #[allow(clippy::match_single_binding)]
15486 match tag {
15487 __FieldTag::__google_artifact_registry => {
15488 if !fields.insert(__FieldTag::__google_artifact_registry) {
15489 return std::result::Result::Err(A::Error::duplicate_field(
15490 "multiple values for google_artifact_registry",
15491 ));
15492 }
15493 if result.artifact_storage.is_some() {
15494 return std::result::Result::Err(A::Error::duplicate_field(
15495 "multiple values for `artifact_storage`, a oneof with full ID .google.cloud.developerconnect.v1.ArtifactConfig.google_artifact_registry, latest field was googleArtifactRegistry",
15496 ));
15497 }
15498 result.artifact_storage = std::option::Option::Some(
15499 crate::model::artifact_config::ArtifactStorage::GoogleArtifactRegistry(
15500 map.next_value::<std::option::Option<std::boxed::Box<crate::model::GoogleArtifactRegistry>>>()?.unwrap_or_default()
15501 ),
15502 );
15503 }
15504 __FieldTag::__google_artifact_analysis => {
15505 if !fields.insert(__FieldTag::__google_artifact_analysis) {
15506 return std::result::Result::Err(A::Error::duplicate_field(
15507 "multiple values for google_artifact_analysis",
15508 ));
15509 }
15510 if result.artifact_metadata_storage.is_some() {
15511 return std::result::Result::Err(A::Error::duplicate_field(
15512 "multiple values for `artifact_metadata_storage`, a oneof with full ID .google.cloud.developerconnect.v1.ArtifactConfig.google_artifact_analysis, latest field was googleArtifactAnalysis",
15513 ));
15514 }
15515 result.artifact_metadata_storage = std::option::Option::Some(
15516 crate::model::artifact_config::ArtifactMetadataStorage::GoogleArtifactAnalysis(
15517 map.next_value::<std::option::Option<std::boxed::Box<crate::model::GoogleArtifactAnalysis>>>()?.unwrap_or_default()
15518 ),
15519 );
15520 }
15521 __FieldTag::__uri => {
15522 if !fields.insert(__FieldTag::__uri) {
15523 return std::result::Result::Err(A::Error::duplicate_field(
15524 "multiple values for uri",
15525 ));
15526 }
15527 result.uri = map
15528 .next_value::<std::option::Option<std::string::String>>()?
15529 .unwrap_or_default();
15530 }
15531 __FieldTag::Unknown(key) => {
15532 let value = map.next_value::<serde_json::Value>()?;
15533 result._unknown_fields.insert(key, value);
15534 }
15535 }
15536 }
15537 std::result::Result::Ok(result)
15538 }
15539 }
15540 deserializer.deserialize_any(Visitor)
15541 }
15542}
15543
15544#[doc(hidden)]
15545impl serde::ser::Serialize for ArtifactConfig {
15546 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15547 where
15548 S: serde::ser::Serializer,
15549 {
15550 use serde::ser::SerializeMap;
15551 #[allow(unused_imports)]
15552 use std::option::Option::Some;
15553 let mut state = serializer.serialize_map(std::option::Option::None)?;
15554 if let Some(value) = self.google_artifact_registry() {
15555 state.serialize_entry("googleArtifactRegistry", value)?;
15556 }
15557 if let Some(value) = self.google_artifact_analysis() {
15558 state.serialize_entry("googleArtifactAnalysis", value)?;
15559 }
15560 if !self.uri.is_empty() {
15561 state.serialize_entry("uri", &self.uri)?;
15562 }
15563 if !self._unknown_fields.is_empty() {
15564 for (key, value) in self._unknown_fields.iter() {
15565 state.serialize_entry(key, &value)?;
15566 }
15567 }
15568 state.end()
15569 }
15570}
15571
15572impl std::fmt::Debug for ArtifactConfig {
15573 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15574 let mut debug_struct = f.debug_struct("ArtifactConfig");
15575 debug_struct.field("uri", &self.uri);
15576 debug_struct.field("artifact_storage", &self.artifact_storage);
15577 debug_struct.field("artifact_metadata_storage", &self.artifact_metadata_storage);
15578 if !self._unknown_fields.is_empty() {
15579 debug_struct.field("_unknown_fields", &self._unknown_fields);
15580 }
15581 debug_struct.finish()
15582 }
15583}
15584
15585pub mod artifact_config {
15587 #[allow(unused_imports)]
15588 use super::*;
15589
15590 #[derive(Clone, Debug, PartialEq)]
15592 #[non_exhaustive]
15593 pub enum ArtifactStorage {
15594 GoogleArtifactRegistry(std::boxed::Box<crate::model::GoogleArtifactRegistry>),
15596 }
15597
15598 #[derive(Clone, Debug, PartialEq)]
15600 #[non_exhaustive]
15601 pub enum ArtifactMetadataStorage {
15602 GoogleArtifactAnalysis(std::boxed::Box<crate::model::GoogleArtifactAnalysis>),
15604 }
15605}
15606
15607#[derive(Clone, Default, PartialEq)]
15609#[non_exhaustive]
15610pub struct GoogleArtifactAnalysis {
15611 pub project_id: std::string::String,
15613
15614 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15615}
15616
15617impl GoogleArtifactAnalysis {
15618 pub fn new() -> Self {
15619 std::default::Default::default()
15620 }
15621
15622 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15624 self.project_id = v.into();
15625 self
15626 }
15627}
15628
15629impl wkt::message::Message for GoogleArtifactAnalysis {
15630 fn typename() -> &'static str {
15631 "type.googleapis.com/google.cloud.developerconnect.v1.GoogleArtifactAnalysis"
15632 }
15633}
15634
15635#[doc(hidden)]
15636impl<'de> serde::de::Deserialize<'de> for GoogleArtifactAnalysis {
15637 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15638 where
15639 D: serde::Deserializer<'de>,
15640 {
15641 #[allow(non_camel_case_types)]
15642 #[doc(hidden)]
15643 #[derive(PartialEq, Eq, Hash)]
15644 enum __FieldTag {
15645 __project_id,
15646 Unknown(std::string::String),
15647 }
15648 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15649 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15650 where
15651 D: serde::Deserializer<'de>,
15652 {
15653 struct Visitor;
15654 impl<'de> serde::de::Visitor<'de> for Visitor {
15655 type Value = __FieldTag;
15656 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15657 formatter.write_str("a field name for GoogleArtifactAnalysis")
15658 }
15659 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15660 where
15661 E: serde::de::Error,
15662 {
15663 use std::result::Result::Ok;
15664 use std::string::ToString;
15665 match value {
15666 "projectId" => Ok(__FieldTag::__project_id),
15667 "project_id" => Ok(__FieldTag::__project_id),
15668 _ => Ok(__FieldTag::Unknown(value.to_string())),
15669 }
15670 }
15671 }
15672 deserializer.deserialize_identifier(Visitor)
15673 }
15674 }
15675 struct Visitor;
15676 impl<'de> serde::de::Visitor<'de> for Visitor {
15677 type Value = GoogleArtifactAnalysis;
15678 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15679 formatter.write_str("struct GoogleArtifactAnalysis")
15680 }
15681 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15682 where
15683 A: serde::de::MapAccess<'de>,
15684 {
15685 #[allow(unused_imports)]
15686 use serde::de::Error;
15687 use std::option::Option::Some;
15688 let mut fields = std::collections::HashSet::new();
15689 let mut result = Self::Value::new();
15690 while let Some(tag) = map.next_key::<__FieldTag>()? {
15691 #[allow(clippy::match_single_binding)]
15692 match tag {
15693 __FieldTag::__project_id => {
15694 if !fields.insert(__FieldTag::__project_id) {
15695 return std::result::Result::Err(A::Error::duplicate_field(
15696 "multiple values for project_id",
15697 ));
15698 }
15699 result.project_id = map
15700 .next_value::<std::option::Option<std::string::String>>()?
15701 .unwrap_or_default();
15702 }
15703 __FieldTag::Unknown(key) => {
15704 let value = map.next_value::<serde_json::Value>()?;
15705 result._unknown_fields.insert(key, value);
15706 }
15707 }
15708 }
15709 std::result::Result::Ok(result)
15710 }
15711 }
15712 deserializer.deserialize_any(Visitor)
15713 }
15714}
15715
15716#[doc(hidden)]
15717impl serde::ser::Serialize for GoogleArtifactAnalysis {
15718 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15719 where
15720 S: serde::ser::Serializer,
15721 {
15722 use serde::ser::SerializeMap;
15723 #[allow(unused_imports)]
15724 use std::option::Option::Some;
15725 let mut state = serializer.serialize_map(std::option::Option::None)?;
15726 if !self.project_id.is_empty() {
15727 state.serialize_entry("projectId", &self.project_id)?;
15728 }
15729 if !self._unknown_fields.is_empty() {
15730 for (key, value) in self._unknown_fields.iter() {
15731 state.serialize_entry(key, &value)?;
15732 }
15733 }
15734 state.end()
15735 }
15736}
15737
15738impl std::fmt::Debug for GoogleArtifactAnalysis {
15739 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15740 let mut debug_struct = f.debug_struct("GoogleArtifactAnalysis");
15741 debug_struct.field("project_id", &self.project_id);
15742 if !self._unknown_fields.is_empty() {
15743 debug_struct.field("_unknown_fields", &self._unknown_fields);
15744 }
15745 debug_struct.finish()
15746 }
15747}
15748
15749#[derive(Clone, Default, PartialEq)]
15751#[non_exhaustive]
15752pub struct GoogleArtifactRegistry {
15753 pub project_id: std::string::String,
15755
15756 pub artifact_registry_package: std::string::String,
15758
15759 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15760}
15761
15762impl GoogleArtifactRegistry {
15763 pub fn new() -> Self {
15764 std::default::Default::default()
15765 }
15766
15767 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15769 self.project_id = v.into();
15770 self
15771 }
15772
15773 pub fn set_artifact_registry_package<T: std::convert::Into<std::string::String>>(
15775 mut self,
15776 v: T,
15777 ) -> Self {
15778 self.artifact_registry_package = v.into();
15779 self
15780 }
15781}
15782
15783impl wkt::message::Message for GoogleArtifactRegistry {
15784 fn typename() -> &'static str {
15785 "type.googleapis.com/google.cloud.developerconnect.v1.GoogleArtifactRegistry"
15786 }
15787}
15788
15789#[doc(hidden)]
15790impl<'de> serde::de::Deserialize<'de> for GoogleArtifactRegistry {
15791 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15792 where
15793 D: serde::Deserializer<'de>,
15794 {
15795 #[allow(non_camel_case_types)]
15796 #[doc(hidden)]
15797 #[derive(PartialEq, Eq, Hash)]
15798 enum __FieldTag {
15799 __project_id,
15800 __artifact_registry_package,
15801 Unknown(std::string::String),
15802 }
15803 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15804 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15805 where
15806 D: serde::Deserializer<'de>,
15807 {
15808 struct Visitor;
15809 impl<'de> serde::de::Visitor<'de> for Visitor {
15810 type Value = __FieldTag;
15811 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15812 formatter.write_str("a field name for GoogleArtifactRegistry")
15813 }
15814 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15815 where
15816 E: serde::de::Error,
15817 {
15818 use std::result::Result::Ok;
15819 use std::string::ToString;
15820 match value {
15821 "projectId" => Ok(__FieldTag::__project_id),
15822 "project_id" => Ok(__FieldTag::__project_id),
15823 "artifactRegistryPackage" => {
15824 Ok(__FieldTag::__artifact_registry_package)
15825 }
15826 "artifact_registry_package" => {
15827 Ok(__FieldTag::__artifact_registry_package)
15828 }
15829 _ => Ok(__FieldTag::Unknown(value.to_string())),
15830 }
15831 }
15832 }
15833 deserializer.deserialize_identifier(Visitor)
15834 }
15835 }
15836 struct Visitor;
15837 impl<'de> serde::de::Visitor<'de> for Visitor {
15838 type Value = GoogleArtifactRegistry;
15839 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15840 formatter.write_str("struct GoogleArtifactRegistry")
15841 }
15842 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15843 where
15844 A: serde::de::MapAccess<'de>,
15845 {
15846 #[allow(unused_imports)]
15847 use serde::de::Error;
15848 use std::option::Option::Some;
15849 let mut fields = std::collections::HashSet::new();
15850 let mut result = Self::Value::new();
15851 while let Some(tag) = map.next_key::<__FieldTag>()? {
15852 #[allow(clippy::match_single_binding)]
15853 match tag {
15854 __FieldTag::__project_id => {
15855 if !fields.insert(__FieldTag::__project_id) {
15856 return std::result::Result::Err(A::Error::duplicate_field(
15857 "multiple values for project_id",
15858 ));
15859 }
15860 result.project_id = map
15861 .next_value::<std::option::Option<std::string::String>>()?
15862 .unwrap_or_default();
15863 }
15864 __FieldTag::__artifact_registry_package => {
15865 if !fields.insert(__FieldTag::__artifact_registry_package) {
15866 return std::result::Result::Err(A::Error::duplicate_field(
15867 "multiple values for artifact_registry_package",
15868 ));
15869 }
15870 result.artifact_registry_package = map
15871 .next_value::<std::option::Option<std::string::String>>()?
15872 .unwrap_or_default();
15873 }
15874 __FieldTag::Unknown(key) => {
15875 let value = map.next_value::<serde_json::Value>()?;
15876 result._unknown_fields.insert(key, value);
15877 }
15878 }
15879 }
15880 std::result::Result::Ok(result)
15881 }
15882 }
15883 deserializer.deserialize_any(Visitor)
15884 }
15885}
15886
15887#[doc(hidden)]
15888impl serde::ser::Serialize for GoogleArtifactRegistry {
15889 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15890 where
15891 S: serde::ser::Serializer,
15892 {
15893 use serde::ser::SerializeMap;
15894 #[allow(unused_imports)]
15895 use std::option::Option::Some;
15896 let mut state = serializer.serialize_map(std::option::Option::None)?;
15897 if !self.project_id.is_empty() {
15898 state.serialize_entry("projectId", &self.project_id)?;
15899 }
15900 if !self.artifact_registry_package.is_empty() {
15901 state.serialize_entry("artifactRegistryPackage", &self.artifact_registry_package)?;
15902 }
15903 if !self._unknown_fields.is_empty() {
15904 for (key, value) in self._unknown_fields.iter() {
15905 state.serialize_entry(key, &value)?;
15906 }
15907 }
15908 state.end()
15909 }
15910}
15911
15912impl std::fmt::Debug for GoogleArtifactRegistry {
15913 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15914 let mut debug_struct = f.debug_struct("GoogleArtifactRegistry");
15915 debug_struct.field("project_id", &self.project_id);
15916 debug_struct.field("artifact_registry_package", &self.artifact_registry_package);
15917 if !self._unknown_fields.is_empty() {
15918 debug_struct.field("_unknown_fields", &self._unknown_fields);
15919 }
15920 debug_struct.finish()
15921 }
15922}
15923
15924#[derive(Clone, Default, PartialEq)]
15926#[non_exhaustive]
15927pub struct CreateInsightsConfigRequest {
15928 pub parent: std::string::String,
15930
15931 pub insights_config_id: std::string::String,
15933
15934 pub insights_config: std::option::Option<crate::model::InsightsConfig>,
15936
15937 pub validate_only: bool,
15939
15940 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15941}
15942
15943impl CreateInsightsConfigRequest {
15944 pub fn new() -> Self {
15945 std::default::Default::default()
15946 }
15947
15948 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15950 self.parent = v.into();
15951 self
15952 }
15953
15954 pub fn set_insights_config_id<T: std::convert::Into<std::string::String>>(
15956 mut self,
15957 v: T,
15958 ) -> Self {
15959 self.insights_config_id = v.into();
15960 self
15961 }
15962
15963 pub fn set_insights_config<T>(mut self, v: T) -> Self
15965 where
15966 T: std::convert::Into<crate::model::InsightsConfig>,
15967 {
15968 self.insights_config = std::option::Option::Some(v.into());
15969 self
15970 }
15971
15972 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
15974 where
15975 T: std::convert::Into<crate::model::InsightsConfig>,
15976 {
15977 self.insights_config = v.map(|x| x.into());
15978 self
15979 }
15980
15981 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15983 self.validate_only = v.into();
15984 self
15985 }
15986}
15987
15988impl wkt::message::Message for CreateInsightsConfigRequest {
15989 fn typename() -> &'static str {
15990 "type.googleapis.com/google.cloud.developerconnect.v1.CreateInsightsConfigRequest"
15991 }
15992}
15993
15994#[doc(hidden)]
15995impl<'de> serde::de::Deserialize<'de> for CreateInsightsConfigRequest {
15996 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15997 where
15998 D: serde::Deserializer<'de>,
15999 {
16000 #[allow(non_camel_case_types)]
16001 #[doc(hidden)]
16002 #[derive(PartialEq, Eq, Hash)]
16003 enum __FieldTag {
16004 __parent,
16005 __insights_config_id,
16006 __insights_config,
16007 __validate_only,
16008 Unknown(std::string::String),
16009 }
16010 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16011 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16012 where
16013 D: serde::Deserializer<'de>,
16014 {
16015 struct Visitor;
16016 impl<'de> serde::de::Visitor<'de> for Visitor {
16017 type Value = __FieldTag;
16018 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16019 formatter.write_str("a field name for CreateInsightsConfigRequest")
16020 }
16021 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16022 where
16023 E: serde::de::Error,
16024 {
16025 use std::result::Result::Ok;
16026 use std::string::ToString;
16027 match value {
16028 "parent" => Ok(__FieldTag::__parent),
16029 "insightsConfigId" => Ok(__FieldTag::__insights_config_id),
16030 "insights_config_id" => Ok(__FieldTag::__insights_config_id),
16031 "insightsConfig" => Ok(__FieldTag::__insights_config),
16032 "insights_config" => Ok(__FieldTag::__insights_config),
16033 "validateOnly" => Ok(__FieldTag::__validate_only),
16034 "validate_only" => Ok(__FieldTag::__validate_only),
16035 _ => Ok(__FieldTag::Unknown(value.to_string())),
16036 }
16037 }
16038 }
16039 deserializer.deserialize_identifier(Visitor)
16040 }
16041 }
16042 struct Visitor;
16043 impl<'de> serde::de::Visitor<'de> for Visitor {
16044 type Value = CreateInsightsConfigRequest;
16045 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16046 formatter.write_str("struct CreateInsightsConfigRequest")
16047 }
16048 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16049 where
16050 A: serde::de::MapAccess<'de>,
16051 {
16052 #[allow(unused_imports)]
16053 use serde::de::Error;
16054 use std::option::Option::Some;
16055 let mut fields = std::collections::HashSet::new();
16056 let mut result = Self::Value::new();
16057 while let Some(tag) = map.next_key::<__FieldTag>()? {
16058 #[allow(clippy::match_single_binding)]
16059 match tag {
16060 __FieldTag::__parent => {
16061 if !fields.insert(__FieldTag::__parent) {
16062 return std::result::Result::Err(A::Error::duplicate_field(
16063 "multiple values for parent",
16064 ));
16065 }
16066 result.parent = map
16067 .next_value::<std::option::Option<std::string::String>>()?
16068 .unwrap_or_default();
16069 }
16070 __FieldTag::__insights_config_id => {
16071 if !fields.insert(__FieldTag::__insights_config_id) {
16072 return std::result::Result::Err(A::Error::duplicate_field(
16073 "multiple values for insights_config_id",
16074 ));
16075 }
16076 result.insights_config_id = map
16077 .next_value::<std::option::Option<std::string::String>>()?
16078 .unwrap_or_default();
16079 }
16080 __FieldTag::__insights_config => {
16081 if !fields.insert(__FieldTag::__insights_config) {
16082 return std::result::Result::Err(A::Error::duplicate_field(
16083 "multiple values for insights_config",
16084 ));
16085 }
16086 result.insights_config = map
16087 .next_value::<std::option::Option<crate::model::InsightsConfig>>(
16088 )?;
16089 }
16090 __FieldTag::__validate_only => {
16091 if !fields.insert(__FieldTag::__validate_only) {
16092 return std::result::Result::Err(A::Error::duplicate_field(
16093 "multiple values for validate_only",
16094 ));
16095 }
16096 result.validate_only = map
16097 .next_value::<std::option::Option<bool>>()?
16098 .unwrap_or_default();
16099 }
16100 __FieldTag::Unknown(key) => {
16101 let value = map.next_value::<serde_json::Value>()?;
16102 result._unknown_fields.insert(key, value);
16103 }
16104 }
16105 }
16106 std::result::Result::Ok(result)
16107 }
16108 }
16109 deserializer.deserialize_any(Visitor)
16110 }
16111}
16112
16113#[doc(hidden)]
16114impl serde::ser::Serialize for CreateInsightsConfigRequest {
16115 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16116 where
16117 S: serde::ser::Serializer,
16118 {
16119 use serde::ser::SerializeMap;
16120 #[allow(unused_imports)]
16121 use std::option::Option::Some;
16122 let mut state = serializer.serialize_map(std::option::Option::None)?;
16123 if !self.parent.is_empty() {
16124 state.serialize_entry("parent", &self.parent)?;
16125 }
16126 if !self.insights_config_id.is_empty() {
16127 state.serialize_entry("insightsConfigId", &self.insights_config_id)?;
16128 }
16129 if self.insights_config.is_some() {
16130 state.serialize_entry("insightsConfig", &self.insights_config)?;
16131 }
16132 if !wkt::internal::is_default(&self.validate_only) {
16133 state.serialize_entry("validateOnly", &self.validate_only)?;
16134 }
16135 if !self._unknown_fields.is_empty() {
16136 for (key, value) in self._unknown_fields.iter() {
16137 state.serialize_entry(key, &value)?;
16138 }
16139 }
16140 state.end()
16141 }
16142}
16143
16144impl std::fmt::Debug for CreateInsightsConfigRequest {
16145 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16146 let mut debug_struct = f.debug_struct("CreateInsightsConfigRequest");
16147 debug_struct.field("parent", &self.parent);
16148 debug_struct.field("insights_config_id", &self.insights_config_id);
16149 debug_struct.field("insights_config", &self.insights_config);
16150 debug_struct.field("validate_only", &self.validate_only);
16151 if !self._unknown_fields.is_empty() {
16152 debug_struct.field("_unknown_fields", &self._unknown_fields);
16153 }
16154 debug_struct.finish()
16155 }
16156}
16157
16158#[derive(Clone, Default, PartialEq)]
16160#[non_exhaustive]
16161pub struct GetInsightsConfigRequest {
16162 pub name: std::string::String,
16164
16165 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16166}
16167
16168impl GetInsightsConfigRequest {
16169 pub fn new() -> Self {
16170 std::default::Default::default()
16171 }
16172
16173 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16175 self.name = v.into();
16176 self
16177 }
16178}
16179
16180impl wkt::message::Message for GetInsightsConfigRequest {
16181 fn typename() -> &'static str {
16182 "type.googleapis.com/google.cloud.developerconnect.v1.GetInsightsConfigRequest"
16183 }
16184}
16185
16186#[doc(hidden)]
16187impl<'de> serde::de::Deserialize<'de> for GetInsightsConfigRequest {
16188 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16189 where
16190 D: serde::Deserializer<'de>,
16191 {
16192 #[allow(non_camel_case_types)]
16193 #[doc(hidden)]
16194 #[derive(PartialEq, Eq, Hash)]
16195 enum __FieldTag {
16196 __name,
16197 Unknown(std::string::String),
16198 }
16199 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16200 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16201 where
16202 D: serde::Deserializer<'de>,
16203 {
16204 struct Visitor;
16205 impl<'de> serde::de::Visitor<'de> for Visitor {
16206 type Value = __FieldTag;
16207 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16208 formatter.write_str("a field name for GetInsightsConfigRequest")
16209 }
16210 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16211 where
16212 E: serde::de::Error,
16213 {
16214 use std::result::Result::Ok;
16215 use std::string::ToString;
16216 match value {
16217 "name" => Ok(__FieldTag::__name),
16218 _ => Ok(__FieldTag::Unknown(value.to_string())),
16219 }
16220 }
16221 }
16222 deserializer.deserialize_identifier(Visitor)
16223 }
16224 }
16225 struct Visitor;
16226 impl<'de> serde::de::Visitor<'de> for Visitor {
16227 type Value = GetInsightsConfigRequest;
16228 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16229 formatter.write_str("struct GetInsightsConfigRequest")
16230 }
16231 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16232 where
16233 A: serde::de::MapAccess<'de>,
16234 {
16235 #[allow(unused_imports)]
16236 use serde::de::Error;
16237 use std::option::Option::Some;
16238 let mut fields = std::collections::HashSet::new();
16239 let mut result = Self::Value::new();
16240 while let Some(tag) = map.next_key::<__FieldTag>()? {
16241 #[allow(clippy::match_single_binding)]
16242 match tag {
16243 __FieldTag::__name => {
16244 if !fields.insert(__FieldTag::__name) {
16245 return std::result::Result::Err(A::Error::duplicate_field(
16246 "multiple values for name",
16247 ));
16248 }
16249 result.name = map
16250 .next_value::<std::option::Option<std::string::String>>()?
16251 .unwrap_or_default();
16252 }
16253 __FieldTag::Unknown(key) => {
16254 let value = map.next_value::<serde_json::Value>()?;
16255 result._unknown_fields.insert(key, value);
16256 }
16257 }
16258 }
16259 std::result::Result::Ok(result)
16260 }
16261 }
16262 deserializer.deserialize_any(Visitor)
16263 }
16264}
16265
16266#[doc(hidden)]
16267impl serde::ser::Serialize for GetInsightsConfigRequest {
16268 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16269 where
16270 S: serde::ser::Serializer,
16271 {
16272 use serde::ser::SerializeMap;
16273 #[allow(unused_imports)]
16274 use std::option::Option::Some;
16275 let mut state = serializer.serialize_map(std::option::Option::None)?;
16276 if !self.name.is_empty() {
16277 state.serialize_entry("name", &self.name)?;
16278 }
16279 if !self._unknown_fields.is_empty() {
16280 for (key, value) in self._unknown_fields.iter() {
16281 state.serialize_entry(key, &value)?;
16282 }
16283 }
16284 state.end()
16285 }
16286}
16287
16288impl std::fmt::Debug for GetInsightsConfigRequest {
16289 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16290 let mut debug_struct = f.debug_struct("GetInsightsConfigRequest");
16291 debug_struct.field("name", &self.name);
16292 if !self._unknown_fields.is_empty() {
16293 debug_struct.field("_unknown_fields", &self._unknown_fields);
16294 }
16295 debug_struct.finish()
16296 }
16297}
16298
16299#[derive(Clone, Default, PartialEq)]
16301#[non_exhaustive]
16302pub struct ListInsightsConfigsRequest {
16303 pub parent: std::string::String,
16305
16306 pub page_size: i32,
16309
16310 pub page_token: std::string::String,
16312
16313 pub filter: std::string::String,
16318
16319 pub order_by: std::string::String,
16321
16322 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16323}
16324
16325impl ListInsightsConfigsRequest {
16326 pub fn new() -> Self {
16327 std::default::Default::default()
16328 }
16329
16330 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16332 self.parent = v.into();
16333 self
16334 }
16335
16336 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16338 self.page_size = v.into();
16339 self
16340 }
16341
16342 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16344 self.page_token = v.into();
16345 self
16346 }
16347
16348 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16350 self.filter = v.into();
16351 self
16352 }
16353
16354 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16356 self.order_by = v.into();
16357 self
16358 }
16359}
16360
16361impl wkt::message::Message for ListInsightsConfigsRequest {
16362 fn typename() -> &'static str {
16363 "type.googleapis.com/google.cloud.developerconnect.v1.ListInsightsConfigsRequest"
16364 }
16365}
16366
16367#[doc(hidden)]
16368impl<'de> serde::de::Deserialize<'de> for ListInsightsConfigsRequest {
16369 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16370 where
16371 D: serde::Deserializer<'de>,
16372 {
16373 #[allow(non_camel_case_types)]
16374 #[doc(hidden)]
16375 #[derive(PartialEq, Eq, Hash)]
16376 enum __FieldTag {
16377 __parent,
16378 __page_size,
16379 __page_token,
16380 __filter,
16381 __order_by,
16382 Unknown(std::string::String),
16383 }
16384 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16385 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16386 where
16387 D: serde::Deserializer<'de>,
16388 {
16389 struct Visitor;
16390 impl<'de> serde::de::Visitor<'de> for Visitor {
16391 type Value = __FieldTag;
16392 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16393 formatter.write_str("a field name for ListInsightsConfigsRequest")
16394 }
16395 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16396 where
16397 E: serde::de::Error,
16398 {
16399 use std::result::Result::Ok;
16400 use std::string::ToString;
16401 match value {
16402 "parent" => Ok(__FieldTag::__parent),
16403 "pageSize" => Ok(__FieldTag::__page_size),
16404 "page_size" => Ok(__FieldTag::__page_size),
16405 "pageToken" => Ok(__FieldTag::__page_token),
16406 "page_token" => Ok(__FieldTag::__page_token),
16407 "filter" => Ok(__FieldTag::__filter),
16408 "orderBy" => Ok(__FieldTag::__order_by),
16409 "order_by" => Ok(__FieldTag::__order_by),
16410 _ => Ok(__FieldTag::Unknown(value.to_string())),
16411 }
16412 }
16413 }
16414 deserializer.deserialize_identifier(Visitor)
16415 }
16416 }
16417 struct Visitor;
16418 impl<'de> serde::de::Visitor<'de> for Visitor {
16419 type Value = ListInsightsConfigsRequest;
16420 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16421 formatter.write_str("struct ListInsightsConfigsRequest")
16422 }
16423 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16424 where
16425 A: serde::de::MapAccess<'de>,
16426 {
16427 #[allow(unused_imports)]
16428 use serde::de::Error;
16429 use std::option::Option::Some;
16430 let mut fields = std::collections::HashSet::new();
16431 let mut result = Self::Value::new();
16432 while let Some(tag) = map.next_key::<__FieldTag>()? {
16433 #[allow(clippy::match_single_binding)]
16434 match tag {
16435 __FieldTag::__parent => {
16436 if !fields.insert(__FieldTag::__parent) {
16437 return std::result::Result::Err(A::Error::duplicate_field(
16438 "multiple values for parent",
16439 ));
16440 }
16441 result.parent = map
16442 .next_value::<std::option::Option<std::string::String>>()?
16443 .unwrap_or_default();
16444 }
16445 __FieldTag::__page_size => {
16446 if !fields.insert(__FieldTag::__page_size) {
16447 return std::result::Result::Err(A::Error::duplicate_field(
16448 "multiple values for page_size",
16449 ));
16450 }
16451 struct __With(std::option::Option<i32>);
16452 impl<'de> serde::de::Deserialize<'de> for __With {
16453 fn deserialize<D>(
16454 deserializer: D,
16455 ) -> std::result::Result<Self, D::Error>
16456 where
16457 D: serde::de::Deserializer<'de>,
16458 {
16459 serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
16460 }
16461 }
16462 result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
16463 }
16464 __FieldTag::__page_token => {
16465 if !fields.insert(__FieldTag::__page_token) {
16466 return std::result::Result::Err(A::Error::duplicate_field(
16467 "multiple values for page_token",
16468 ));
16469 }
16470 result.page_token = map
16471 .next_value::<std::option::Option<std::string::String>>()?
16472 .unwrap_or_default();
16473 }
16474 __FieldTag::__filter => {
16475 if !fields.insert(__FieldTag::__filter) {
16476 return std::result::Result::Err(A::Error::duplicate_field(
16477 "multiple values for filter",
16478 ));
16479 }
16480 result.filter = map
16481 .next_value::<std::option::Option<std::string::String>>()?
16482 .unwrap_or_default();
16483 }
16484 __FieldTag::__order_by => {
16485 if !fields.insert(__FieldTag::__order_by) {
16486 return std::result::Result::Err(A::Error::duplicate_field(
16487 "multiple values for order_by",
16488 ));
16489 }
16490 result.order_by = map
16491 .next_value::<std::option::Option<std::string::String>>()?
16492 .unwrap_or_default();
16493 }
16494 __FieldTag::Unknown(key) => {
16495 let value = map.next_value::<serde_json::Value>()?;
16496 result._unknown_fields.insert(key, value);
16497 }
16498 }
16499 }
16500 std::result::Result::Ok(result)
16501 }
16502 }
16503 deserializer.deserialize_any(Visitor)
16504 }
16505}
16506
16507#[doc(hidden)]
16508impl serde::ser::Serialize for ListInsightsConfigsRequest {
16509 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16510 where
16511 S: serde::ser::Serializer,
16512 {
16513 use serde::ser::SerializeMap;
16514 #[allow(unused_imports)]
16515 use std::option::Option::Some;
16516 let mut state = serializer.serialize_map(std::option::Option::None)?;
16517 if !self.parent.is_empty() {
16518 state.serialize_entry("parent", &self.parent)?;
16519 }
16520 if !wkt::internal::is_default(&self.page_size) {
16521 struct __With<'a>(&'a i32);
16522 impl<'a> serde::ser::Serialize for __With<'a> {
16523 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16524 where
16525 S: serde::ser::Serializer,
16526 {
16527 serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
16528 }
16529 }
16530 state.serialize_entry("pageSize", &__With(&self.page_size))?;
16531 }
16532 if !self.page_token.is_empty() {
16533 state.serialize_entry("pageToken", &self.page_token)?;
16534 }
16535 if !self.filter.is_empty() {
16536 state.serialize_entry("filter", &self.filter)?;
16537 }
16538 if !self.order_by.is_empty() {
16539 state.serialize_entry("orderBy", &self.order_by)?;
16540 }
16541 if !self._unknown_fields.is_empty() {
16542 for (key, value) in self._unknown_fields.iter() {
16543 state.serialize_entry(key, &value)?;
16544 }
16545 }
16546 state.end()
16547 }
16548}
16549
16550impl std::fmt::Debug for ListInsightsConfigsRequest {
16551 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16552 let mut debug_struct = f.debug_struct("ListInsightsConfigsRequest");
16553 debug_struct.field("parent", &self.parent);
16554 debug_struct.field("page_size", &self.page_size);
16555 debug_struct.field("page_token", &self.page_token);
16556 debug_struct.field("filter", &self.filter);
16557 debug_struct.field("order_by", &self.order_by);
16558 if !self._unknown_fields.is_empty() {
16559 debug_struct.field("_unknown_fields", &self._unknown_fields);
16560 }
16561 debug_struct.finish()
16562 }
16563}
16564
16565#[derive(Clone, Default, PartialEq)]
16567#[non_exhaustive]
16568pub struct ListInsightsConfigsResponse {
16569 pub insights_configs: std::vec::Vec<crate::model::InsightsConfig>,
16571
16572 pub next_page_token: std::string::String,
16574
16575 pub unreachable: std::vec::Vec<std::string::String>,
16577
16578 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16579}
16580
16581impl ListInsightsConfigsResponse {
16582 pub fn new() -> Self {
16583 std::default::Default::default()
16584 }
16585
16586 pub fn set_insights_configs<T, V>(mut self, v: T) -> Self
16588 where
16589 T: std::iter::IntoIterator<Item = V>,
16590 V: std::convert::Into<crate::model::InsightsConfig>,
16591 {
16592 use std::iter::Iterator;
16593 self.insights_configs = v.into_iter().map(|i| i.into()).collect();
16594 self
16595 }
16596
16597 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16599 self.next_page_token = v.into();
16600 self
16601 }
16602
16603 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
16605 where
16606 T: std::iter::IntoIterator<Item = V>,
16607 V: std::convert::Into<std::string::String>,
16608 {
16609 use std::iter::Iterator;
16610 self.unreachable = v.into_iter().map(|i| i.into()).collect();
16611 self
16612 }
16613}
16614
16615impl wkt::message::Message for ListInsightsConfigsResponse {
16616 fn typename() -> &'static str {
16617 "type.googleapis.com/google.cloud.developerconnect.v1.ListInsightsConfigsResponse"
16618 }
16619}
16620
16621#[doc(hidden)]
16622impl gax::paginator::internal::PageableResponse for ListInsightsConfigsResponse {
16623 type PageItem = crate::model::InsightsConfig;
16624
16625 fn items(self) -> std::vec::Vec<Self::PageItem> {
16626 self.insights_configs
16627 }
16628
16629 fn next_page_token(&self) -> std::string::String {
16630 use std::clone::Clone;
16631 self.next_page_token.clone()
16632 }
16633}
16634
16635#[doc(hidden)]
16636impl<'de> serde::de::Deserialize<'de> for ListInsightsConfigsResponse {
16637 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16638 where
16639 D: serde::Deserializer<'de>,
16640 {
16641 #[allow(non_camel_case_types)]
16642 #[doc(hidden)]
16643 #[derive(PartialEq, Eq, Hash)]
16644 enum __FieldTag {
16645 __insights_configs,
16646 __next_page_token,
16647 __unreachable,
16648 Unknown(std::string::String),
16649 }
16650 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16651 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16652 where
16653 D: serde::Deserializer<'de>,
16654 {
16655 struct Visitor;
16656 impl<'de> serde::de::Visitor<'de> for Visitor {
16657 type Value = __FieldTag;
16658 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16659 formatter.write_str("a field name for ListInsightsConfigsResponse")
16660 }
16661 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16662 where
16663 E: serde::de::Error,
16664 {
16665 use std::result::Result::Ok;
16666 use std::string::ToString;
16667 match value {
16668 "insightsConfigs" => Ok(__FieldTag::__insights_configs),
16669 "insights_configs" => Ok(__FieldTag::__insights_configs),
16670 "nextPageToken" => Ok(__FieldTag::__next_page_token),
16671 "next_page_token" => Ok(__FieldTag::__next_page_token),
16672 "unreachable" => Ok(__FieldTag::__unreachable),
16673 _ => Ok(__FieldTag::Unknown(value.to_string())),
16674 }
16675 }
16676 }
16677 deserializer.deserialize_identifier(Visitor)
16678 }
16679 }
16680 struct Visitor;
16681 impl<'de> serde::de::Visitor<'de> for Visitor {
16682 type Value = ListInsightsConfigsResponse;
16683 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16684 formatter.write_str("struct ListInsightsConfigsResponse")
16685 }
16686 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16687 where
16688 A: serde::de::MapAccess<'de>,
16689 {
16690 #[allow(unused_imports)]
16691 use serde::de::Error;
16692 use std::option::Option::Some;
16693 let mut fields = std::collections::HashSet::new();
16694 let mut result = Self::Value::new();
16695 while let Some(tag) = map.next_key::<__FieldTag>()? {
16696 #[allow(clippy::match_single_binding)]
16697 match tag {
16698 __FieldTag::__insights_configs => {
16699 if !fields.insert(__FieldTag::__insights_configs) {
16700 return std::result::Result::Err(A::Error::duplicate_field(
16701 "multiple values for insights_configs",
16702 ));
16703 }
16704 result.insights_configs =
16705 map.next_value::<std::option::Option<
16706 std::vec::Vec<crate::model::InsightsConfig>,
16707 >>()?
16708 .unwrap_or_default();
16709 }
16710 __FieldTag::__next_page_token => {
16711 if !fields.insert(__FieldTag::__next_page_token) {
16712 return std::result::Result::Err(A::Error::duplicate_field(
16713 "multiple values for next_page_token",
16714 ));
16715 }
16716 result.next_page_token = map
16717 .next_value::<std::option::Option<std::string::String>>()?
16718 .unwrap_or_default();
16719 }
16720 __FieldTag::__unreachable => {
16721 if !fields.insert(__FieldTag::__unreachable) {
16722 return std::result::Result::Err(A::Error::duplicate_field(
16723 "multiple values for unreachable",
16724 ));
16725 }
16726 result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
16727 }
16728 __FieldTag::Unknown(key) => {
16729 let value = map.next_value::<serde_json::Value>()?;
16730 result._unknown_fields.insert(key, value);
16731 }
16732 }
16733 }
16734 std::result::Result::Ok(result)
16735 }
16736 }
16737 deserializer.deserialize_any(Visitor)
16738 }
16739}
16740
16741#[doc(hidden)]
16742impl serde::ser::Serialize for ListInsightsConfigsResponse {
16743 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16744 where
16745 S: serde::ser::Serializer,
16746 {
16747 use serde::ser::SerializeMap;
16748 #[allow(unused_imports)]
16749 use std::option::Option::Some;
16750 let mut state = serializer.serialize_map(std::option::Option::None)?;
16751 if !self.insights_configs.is_empty() {
16752 state.serialize_entry("insightsConfigs", &self.insights_configs)?;
16753 }
16754 if !self.next_page_token.is_empty() {
16755 state.serialize_entry("nextPageToken", &self.next_page_token)?;
16756 }
16757 if !self.unreachable.is_empty() {
16758 state.serialize_entry("unreachable", &self.unreachable)?;
16759 }
16760 if !self._unknown_fields.is_empty() {
16761 for (key, value) in self._unknown_fields.iter() {
16762 state.serialize_entry(key, &value)?;
16763 }
16764 }
16765 state.end()
16766 }
16767}
16768
16769impl std::fmt::Debug for ListInsightsConfigsResponse {
16770 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16771 let mut debug_struct = f.debug_struct("ListInsightsConfigsResponse");
16772 debug_struct.field("insights_configs", &self.insights_configs);
16773 debug_struct.field("next_page_token", &self.next_page_token);
16774 debug_struct.field("unreachable", &self.unreachable);
16775 if !self._unknown_fields.is_empty() {
16776 debug_struct.field("_unknown_fields", &self._unknown_fields);
16777 }
16778 debug_struct.finish()
16779 }
16780}
16781
16782#[derive(Clone, Default, PartialEq)]
16784#[non_exhaustive]
16785pub struct DeleteInsightsConfigRequest {
16786 pub name: std::string::String,
16788
16789 pub request_id: std::string::String,
16803
16804 pub validate_only: bool,
16806
16807 pub etag: std::string::String,
16811
16812 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16813}
16814
16815impl DeleteInsightsConfigRequest {
16816 pub fn new() -> Self {
16817 std::default::Default::default()
16818 }
16819
16820 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16822 self.name = v.into();
16823 self
16824 }
16825
16826 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16828 self.request_id = v.into();
16829 self
16830 }
16831
16832 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16834 self.validate_only = v.into();
16835 self
16836 }
16837
16838 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16840 self.etag = v.into();
16841 self
16842 }
16843}
16844
16845impl wkt::message::Message for DeleteInsightsConfigRequest {
16846 fn typename() -> &'static str {
16847 "type.googleapis.com/google.cloud.developerconnect.v1.DeleteInsightsConfigRequest"
16848 }
16849}
16850
16851#[doc(hidden)]
16852impl<'de> serde::de::Deserialize<'de> for DeleteInsightsConfigRequest {
16853 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16854 where
16855 D: serde::Deserializer<'de>,
16856 {
16857 #[allow(non_camel_case_types)]
16858 #[doc(hidden)]
16859 #[derive(PartialEq, Eq, Hash)]
16860 enum __FieldTag {
16861 __name,
16862 __request_id,
16863 __validate_only,
16864 __etag,
16865 Unknown(std::string::String),
16866 }
16867 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16868 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16869 where
16870 D: serde::Deserializer<'de>,
16871 {
16872 struct Visitor;
16873 impl<'de> serde::de::Visitor<'de> for Visitor {
16874 type Value = __FieldTag;
16875 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16876 formatter.write_str("a field name for DeleteInsightsConfigRequest")
16877 }
16878 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16879 where
16880 E: serde::de::Error,
16881 {
16882 use std::result::Result::Ok;
16883 use std::string::ToString;
16884 match value {
16885 "name" => Ok(__FieldTag::__name),
16886 "requestId" => Ok(__FieldTag::__request_id),
16887 "request_id" => Ok(__FieldTag::__request_id),
16888 "validateOnly" => Ok(__FieldTag::__validate_only),
16889 "validate_only" => Ok(__FieldTag::__validate_only),
16890 "etag" => Ok(__FieldTag::__etag),
16891 _ => Ok(__FieldTag::Unknown(value.to_string())),
16892 }
16893 }
16894 }
16895 deserializer.deserialize_identifier(Visitor)
16896 }
16897 }
16898 struct Visitor;
16899 impl<'de> serde::de::Visitor<'de> for Visitor {
16900 type Value = DeleteInsightsConfigRequest;
16901 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16902 formatter.write_str("struct DeleteInsightsConfigRequest")
16903 }
16904 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16905 where
16906 A: serde::de::MapAccess<'de>,
16907 {
16908 #[allow(unused_imports)]
16909 use serde::de::Error;
16910 use std::option::Option::Some;
16911 let mut fields = std::collections::HashSet::new();
16912 let mut result = Self::Value::new();
16913 while let Some(tag) = map.next_key::<__FieldTag>()? {
16914 #[allow(clippy::match_single_binding)]
16915 match tag {
16916 __FieldTag::__name => {
16917 if !fields.insert(__FieldTag::__name) {
16918 return std::result::Result::Err(A::Error::duplicate_field(
16919 "multiple values for name",
16920 ));
16921 }
16922 result.name = map
16923 .next_value::<std::option::Option<std::string::String>>()?
16924 .unwrap_or_default();
16925 }
16926 __FieldTag::__request_id => {
16927 if !fields.insert(__FieldTag::__request_id) {
16928 return std::result::Result::Err(A::Error::duplicate_field(
16929 "multiple values for request_id",
16930 ));
16931 }
16932 result.request_id = map
16933 .next_value::<std::option::Option<std::string::String>>()?
16934 .unwrap_or_default();
16935 }
16936 __FieldTag::__validate_only => {
16937 if !fields.insert(__FieldTag::__validate_only) {
16938 return std::result::Result::Err(A::Error::duplicate_field(
16939 "multiple values for validate_only",
16940 ));
16941 }
16942 result.validate_only = map
16943 .next_value::<std::option::Option<bool>>()?
16944 .unwrap_or_default();
16945 }
16946 __FieldTag::__etag => {
16947 if !fields.insert(__FieldTag::__etag) {
16948 return std::result::Result::Err(A::Error::duplicate_field(
16949 "multiple values for etag",
16950 ));
16951 }
16952 result.etag = map
16953 .next_value::<std::option::Option<std::string::String>>()?
16954 .unwrap_or_default();
16955 }
16956 __FieldTag::Unknown(key) => {
16957 let value = map.next_value::<serde_json::Value>()?;
16958 result._unknown_fields.insert(key, value);
16959 }
16960 }
16961 }
16962 std::result::Result::Ok(result)
16963 }
16964 }
16965 deserializer.deserialize_any(Visitor)
16966 }
16967}
16968
16969#[doc(hidden)]
16970impl serde::ser::Serialize for DeleteInsightsConfigRequest {
16971 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16972 where
16973 S: serde::ser::Serializer,
16974 {
16975 use serde::ser::SerializeMap;
16976 #[allow(unused_imports)]
16977 use std::option::Option::Some;
16978 let mut state = serializer.serialize_map(std::option::Option::None)?;
16979 if !self.name.is_empty() {
16980 state.serialize_entry("name", &self.name)?;
16981 }
16982 if !self.request_id.is_empty() {
16983 state.serialize_entry("requestId", &self.request_id)?;
16984 }
16985 if !wkt::internal::is_default(&self.validate_only) {
16986 state.serialize_entry("validateOnly", &self.validate_only)?;
16987 }
16988 if !self.etag.is_empty() {
16989 state.serialize_entry("etag", &self.etag)?;
16990 }
16991 if !self._unknown_fields.is_empty() {
16992 for (key, value) in self._unknown_fields.iter() {
16993 state.serialize_entry(key, &value)?;
16994 }
16995 }
16996 state.end()
16997 }
16998}
16999
17000impl std::fmt::Debug for DeleteInsightsConfigRequest {
17001 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17002 let mut debug_struct = f.debug_struct("DeleteInsightsConfigRequest");
17003 debug_struct.field("name", &self.name);
17004 debug_struct.field("request_id", &self.request_id);
17005 debug_struct.field("validate_only", &self.validate_only);
17006 debug_struct.field("etag", &self.etag);
17007 if !self._unknown_fields.is_empty() {
17008 debug_struct.field("_unknown_fields", &self._unknown_fields);
17009 }
17010 debug_struct.finish()
17011 }
17012}
17013
17014#[derive(Clone, Default, PartialEq)]
17016#[non_exhaustive]
17017pub struct UpdateInsightsConfigRequest {
17018 pub insights_config: std::option::Option<crate::model::InsightsConfig>,
17020
17021 pub request_id: std::string::String,
17035
17036 pub allow_missing: bool,
17042
17043 pub validate_only: bool,
17045
17046 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17047}
17048
17049impl UpdateInsightsConfigRequest {
17050 pub fn new() -> Self {
17051 std::default::Default::default()
17052 }
17053
17054 pub fn set_insights_config<T>(mut self, v: T) -> Self
17056 where
17057 T: std::convert::Into<crate::model::InsightsConfig>,
17058 {
17059 self.insights_config = std::option::Option::Some(v.into());
17060 self
17061 }
17062
17063 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
17065 where
17066 T: std::convert::Into<crate::model::InsightsConfig>,
17067 {
17068 self.insights_config = v.map(|x| x.into());
17069 self
17070 }
17071
17072 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17074 self.request_id = v.into();
17075 self
17076 }
17077
17078 pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17080 self.allow_missing = v.into();
17081 self
17082 }
17083
17084 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17086 self.validate_only = v.into();
17087 self
17088 }
17089}
17090
17091impl wkt::message::Message for UpdateInsightsConfigRequest {
17092 fn typename() -> &'static str {
17093 "type.googleapis.com/google.cloud.developerconnect.v1.UpdateInsightsConfigRequest"
17094 }
17095}
17096
17097#[doc(hidden)]
17098impl<'de> serde::de::Deserialize<'de> for UpdateInsightsConfigRequest {
17099 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17100 where
17101 D: serde::Deserializer<'de>,
17102 {
17103 #[allow(non_camel_case_types)]
17104 #[doc(hidden)]
17105 #[derive(PartialEq, Eq, Hash)]
17106 enum __FieldTag {
17107 __insights_config,
17108 __request_id,
17109 __allow_missing,
17110 __validate_only,
17111 Unknown(std::string::String),
17112 }
17113 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17114 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17115 where
17116 D: serde::Deserializer<'de>,
17117 {
17118 struct Visitor;
17119 impl<'de> serde::de::Visitor<'de> for Visitor {
17120 type Value = __FieldTag;
17121 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17122 formatter.write_str("a field name for UpdateInsightsConfigRequest")
17123 }
17124 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17125 where
17126 E: serde::de::Error,
17127 {
17128 use std::result::Result::Ok;
17129 use std::string::ToString;
17130 match value {
17131 "insightsConfig" => Ok(__FieldTag::__insights_config),
17132 "insights_config" => Ok(__FieldTag::__insights_config),
17133 "requestId" => Ok(__FieldTag::__request_id),
17134 "request_id" => Ok(__FieldTag::__request_id),
17135 "allowMissing" => Ok(__FieldTag::__allow_missing),
17136 "allow_missing" => Ok(__FieldTag::__allow_missing),
17137 "validateOnly" => Ok(__FieldTag::__validate_only),
17138 "validate_only" => Ok(__FieldTag::__validate_only),
17139 _ => Ok(__FieldTag::Unknown(value.to_string())),
17140 }
17141 }
17142 }
17143 deserializer.deserialize_identifier(Visitor)
17144 }
17145 }
17146 struct Visitor;
17147 impl<'de> serde::de::Visitor<'de> for Visitor {
17148 type Value = UpdateInsightsConfigRequest;
17149 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17150 formatter.write_str("struct UpdateInsightsConfigRequest")
17151 }
17152 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17153 where
17154 A: serde::de::MapAccess<'de>,
17155 {
17156 #[allow(unused_imports)]
17157 use serde::de::Error;
17158 use std::option::Option::Some;
17159 let mut fields = std::collections::HashSet::new();
17160 let mut result = Self::Value::new();
17161 while let Some(tag) = map.next_key::<__FieldTag>()? {
17162 #[allow(clippy::match_single_binding)]
17163 match tag {
17164 __FieldTag::__insights_config => {
17165 if !fields.insert(__FieldTag::__insights_config) {
17166 return std::result::Result::Err(A::Error::duplicate_field(
17167 "multiple values for insights_config",
17168 ));
17169 }
17170 result.insights_config = map
17171 .next_value::<std::option::Option<crate::model::InsightsConfig>>(
17172 )?;
17173 }
17174 __FieldTag::__request_id => {
17175 if !fields.insert(__FieldTag::__request_id) {
17176 return std::result::Result::Err(A::Error::duplicate_field(
17177 "multiple values for request_id",
17178 ));
17179 }
17180 result.request_id = map
17181 .next_value::<std::option::Option<std::string::String>>()?
17182 .unwrap_or_default();
17183 }
17184 __FieldTag::__allow_missing => {
17185 if !fields.insert(__FieldTag::__allow_missing) {
17186 return std::result::Result::Err(A::Error::duplicate_field(
17187 "multiple values for allow_missing",
17188 ));
17189 }
17190 result.allow_missing = map
17191 .next_value::<std::option::Option<bool>>()?
17192 .unwrap_or_default();
17193 }
17194 __FieldTag::__validate_only => {
17195 if !fields.insert(__FieldTag::__validate_only) {
17196 return std::result::Result::Err(A::Error::duplicate_field(
17197 "multiple values for validate_only",
17198 ));
17199 }
17200 result.validate_only = map
17201 .next_value::<std::option::Option<bool>>()?
17202 .unwrap_or_default();
17203 }
17204 __FieldTag::Unknown(key) => {
17205 let value = map.next_value::<serde_json::Value>()?;
17206 result._unknown_fields.insert(key, value);
17207 }
17208 }
17209 }
17210 std::result::Result::Ok(result)
17211 }
17212 }
17213 deserializer.deserialize_any(Visitor)
17214 }
17215}
17216
17217#[doc(hidden)]
17218impl serde::ser::Serialize for UpdateInsightsConfigRequest {
17219 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17220 where
17221 S: serde::ser::Serializer,
17222 {
17223 use serde::ser::SerializeMap;
17224 #[allow(unused_imports)]
17225 use std::option::Option::Some;
17226 let mut state = serializer.serialize_map(std::option::Option::None)?;
17227 if self.insights_config.is_some() {
17228 state.serialize_entry("insightsConfig", &self.insights_config)?;
17229 }
17230 if !self.request_id.is_empty() {
17231 state.serialize_entry("requestId", &self.request_id)?;
17232 }
17233 if !wkt::internal::is_default(&self.allow_missing) {
17234 state.serialize_entry("allowMissing", &self.allow_missing)?;
17235 }
17236 if !wkt::internal::is_default(&self.validate_only) {
17237 state.serialize_entry("validateOnly", &self.validate_only)?;
17238 }
17239 if !self._unknown_fields.is_empty() {
17240 for (key, value) in self._unknown_fields.iter() {
17241 state.serialize_entry(key, &value)?;
17242 }
17243 }
17244 state.end()
17245 }
17246}
17247
17248impl std::fmt::Debug for UpdateInsightsConfigRequest {
17249 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17250 let mut debug_struct = f.debug_struct("UpdateInsightsConfigRequest");
17251 debug_struct.field("insights_config", &self.insights_config);
17252 debug_struct.field("request_id", &self.request_id);
17253 debug_struct.field("allow_missing", &self.allow_missing);
17254 debug_struct.field("validate_only", &self.validate_only);
17255 if !self._unknown_fields.is_empty() {
17256 debug_struct.field("_unknown_fields", &self._unknown_fields);
17257 }
17258 debug_struct.finish()
17259 }
17260}
17261
17262#[derive(Clone, Debug, PartialEq)]
17278#[non_exhaustive]
17279pub enum SystemProvider {
17280 Unspecified,
17282 Github,
17286 Gitlab,
17290 Google,
17295 Sentry,
17299 Rovo,
17302 NewRelic,
17305 Datastax,
17308 Dynatrace,
17310 UnknownValue(system_provider::UnknownValue),
17315}
17316
17317#[doc(hidden)]
17318pub mod system_provider {
17319 #[allow(unused_imports)]
17320 use super::*;
17321 #[derive(Clone, Debug, PartialEq)]
17322 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17323}
17324
17325impl SystemProvider {
17326 pub fn value(&self) -> std::option::Option<i32> {
17331 match self {
17332 Self::Unspecified => std::option::Option::Some(0),
17333 Self::Github => std::option::Option::Some(1),
17334 Self::Gitlab => std::option::Option::Some(2),
17335 Self::Google => std::option::Option::Some(3),
17336 Self::Sentry => std::option::Option::Some(4),
17337 Self::Rovo => std::option::Option::Some(5),
17338 Self::NewRelic => std::option::Option::Some(6),
17339 Self::Datastax => std::option::Option::Some(7),
17340 Self::Dynatrace => std::option::Option::Some(8),
17341 Self::UnknownValue(u) => u.0.value(),
17342 }
17343 }
17344
17345 pub fn name(&self) -> std::option::Option<&str> {
17350 match self {
17351 Self::Unspecified => std::option::Option::Some("SYSTEM_PROVIDER_UNSPECIFIED"),
17352 Self::Github => std::option::Option::Some("GITHUB"),
17353 Self::Gitlab => std::option::Option::Some("GITLAB"),
17354 Self::Google => std::option::Option::Some("GOOGLE"),
17355 Self::Sentry => std::option::Option::Some("SENTRY"),
17356 Self::Rovo => std::option::Option::Some("ROVO"),
17357 Self::NewRelic => std::option::Option::Some("NEW_RELIC"),
17358 Self::Datastax => std::option::Option::Some("DATASTAX"),
17359 Self::Dynatrace => std::option::Option::Some("DYNATRACE"),
17360 Self::UnknownValue(u) => u.0.name(),
17361 }
17362 }
17363}
17364
17365impl std::default::Default for SystemProvider {
17366 fn default() -> Self {
17367 use std::convert::From;
17368 Self::from(0)
17369 }
17370}
17371
17372impl std::fmt::Display for SystemProvider {
17373 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17374 wkt::internal::display_enum(f, self.name(), self.value())
17375 }
17376}
17377
17378impl std::convert::From<i32> for SystemProvider {
17379 fn from(value: i32) -> Self {
17380 match value {
17381 0 => Self::Unspecified,
17382 1 => Self::Github,
17383 2 => Self::Gitlab,
17384 3 => Self::Google,
17385 4 => Self::Sentry,
17386 5 => Self::Rovo,
17387 6 => Self::NewRelic,
17388 7 => Self::Datastax,
17389 8 => Self::Dynatrace,
17390 _ => Self::UnknownValue(system_provider::UnknownValue(
17391 wkt::internal::UnknownEnumValue::Integer(value),
17392 )),
17393 }
17394 }
17395}
17396
17397impl std::convert::From<&str> for SystemProvider {
17398 fn from(value: &str) -> Self {
17399 use std::string::ToString;
17400 match value {
17401 "SYSTEM_PROVIDER_UNSPECIFIED" => Self::Unspecified,
17402 "GITHUB" => Self::Github,
17403 "GITLAB" => Self::Gitlab,
17404 "GOOGLE" => Self::Google,
17405 "SENTRY" => Self::Sentry,
17406 "ROVO" => Self::Rovo,
17407 "NEW_RELIC" => Self::NewRelic,
17408 "DATASTAX" => Self::Datastax,
17409 "DYNATRACE" => Self::Dynatrace,
17410 _ => Self::UnknownValue(system_provider::UnknownValue(
17411 wkt::internal::UnknownEnumValue::String(value.to_string()),
17412 )),
17413 }
17414 }
17415}
17416
17417impl serde::ser::Serialize for SystemProvider {
17418 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17419 where
17420 S: serde::Serializer,
17421 {
17422 match self {
17423 Self::Unspecified => serializer.serialize_i32(0),
17424 Self::Github => serializer.serialize_i32(1),
17425 Self::Gitlab => serializer.serialize_i32(2),
17426 Self::Google => serializer.serialize_i32(3),
17427 Self::Sentry => serializer.serialize_i32(4),
17428 Self::Rovo => serializer.serialize_i32(5),
17429 Self::NewRelic => serializer.serialize_i32(6),
17430 Self::Datastax => serializer.serialize_i32(7),
17431 Self::Dynatrace => serializer.serialize_i32(8),
17432 Self::UnknownValue(u) => u.0.serialize(serializer),
17433 }
17434 }
17435}
17436
17437impl<'de> serde::de::Deserialize<'de> for SystemProvider {
17438 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17439 where
17440 D: serde::Deserializer<'de>,
17441 {
17442 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SystemProvider>::new(
17443 ".google.cloud.developerconnect.v1.SystemProvider",
17444 ))
17445 }
17446}