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 gtype;
25extern crate iam_v1;
26extern crate lazy_static;
27extern crate location;
28extern crate longrunning;
29extern crate lro;
30extern crate reqwest;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38#[derive(Clone, Debug, Default, PartialEq)]
41#[non_exhaustive]
42pub struct Function {
43 pub name: std::string::String,
46
47 pub description: std::string::String,
49
50 pub build_config: std::option::Option<crate::model::BuildConfig>,
53
54 pub service_config: std::option::Option<crate::model::ServiceConfig>,
57
58 pub event_trigger: std::option::Option<crate::model::EventTrigger>,
61
62 pub state: crate::model::function::State,
64
65 pub update_time: std::option::Option<wkt::Timestamp>,
67
68 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
70
71 pub state_messages: std::vec::Vec<crate::model::StateMessage>,
73
74 pub environment: crate::model::Environment,
76
77 pub url: std::string::String,
79
80 pub kms_key_name: std::string::String,
86
87 pub satisfies_pzs: bool,
89
90 pub create_time: std::option::Option<wkt::Timestamp>,
93
94 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
95}
96
97impl Function {
98 pub fn new() -> Self {
99 std::default::Default::default()
100 }
101
102 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
104 self.name = v.into();
105 self
106 }
107
108 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
110 self.description = v.into();
111 self
112 }
113
114 pub fn set_build_config<T>(mut self, v: T) -> Self
116 where
117 T: std::convert::Into<crate::model::BuildConfig>,
118 {
119 self.build_config = std::option::Option::Some(v.into());
120 self
121 }
122
123 pub fn set_or_clear_build_config<T>(mut self, v: std::option::Option<T>) -> Self
125 where
126 T: std::convert::Into<crate::model::BuildConfig>,
127 {
128 self.build_config = v.map(|x| x.into());
129 self
130 }
131
132 pub fn set_service_config<T>(mut self, v: T) -> Self
134 where
135 T: std::convert::Into<crate::model::ServiceConfig>,
136 {
137 self.service_config = std::option::Option::Some(v.into());
138 self
139 }
140
141 pub fn set_or_clear_service_config<T>(mut self, v: std::option::Option<T>) -> Self
143 where
144 T: std::convert::Into<crate::model::ServiceConfig>,
145 {
146 self.service_config = v.map(|x| x.into());
147 self
148 }
149
150 pub fn set_event_trigger<T>(mut self, v: T) -> Self
152 where
153 T: std::convert::Into<crate::model::EventTrigger>,
154 {
155 self.event_trigger = std::option::Option::Some(v.into());
156 self
157 }
158
159 pub fn set_or_clear_event_trigger<T>(mut self, v: std::option::Option<T>) -> Self
161 where
162 T: std::convert::Into<crate::model::EventTrigger>,
163 {
164 self.event_trigger = v.map(|x| x.into());
165 self
166 }
167
168 pub fn set_state<T: std::convert::Into<crate::model::function::State>>(mut self, v: T) -> Self {
170 self.state = v.into();
171 self
172 }
173
174 pub fn set_update_time<T>(mut self, v: T) -> Self
176 where
177 T: std::convert::Into<wkt::Timestamp>,
178 {
179 self.update_time = std::option::Option::Some(v.into());
180 self
181 }
182
183 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
185 where
186 T: std::convert::Into<wkt::Timestamp>,
187 {
188 self.update_time = v.map(|x| x.into());
189 self
190 }
191
192 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
194 where
195 T: std::iter::IntoIterator<Item = (K, V)>,
196 K: std::convert::Into<std::string::String>,
197 V: std::convert::Into<std::string::String>,
198 {
199 use std::iter::Iterator;
200 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
201 self
202 }
203
204 pub fn set_state_messages<T, V>(mut self, v: T) -> Self
206 where
207 T: std::iter::IntoIterator<Item = V>,
208 V: std::convert::Into<crate::model::StateMessage>,
209 {
210 use std::iter::Iterator;
211 self.state_messages = v.into_iter().map(|i| i.into()).collect();
212 self
213 }
214
215 pub fn set_environment<T: std::convert::Into<crate::model::Environment>>(
217 mut self,
218 v: T,
219 ) -> Self {
220 self.environment = v.into();
221 self
222 }
223
224 pub fn set_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
226 self.url = v.into();
227 self
228 }
229
230 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
232 self.kms_key_name = v.into();
233 self
234 }
235
236 pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
238 self.satisfies_pzs = v.into();
239 self
240 }
241
242 pub fn set_create_time<T>(mut self, v: T) -> Self
244 where
245 T: std::convert::Into<wkt::Timestamp>,
246 {
247 self.create_time = std::option::Option::Some(v.into());
248 self
249 }
250
251 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
253 where
254 T: std::convert::Into<wkt::Timestamp>,
255 {
256 self.create_time = v.map(|x| x.into());
257 self
258 }
259}
260
261impl wkt::message::Message for Function {
262 fn typename() -> &'static str {
263 "type.googleapis.com/google.cloud.functions.v2.Function"
264 }
265}
266
267#[doc(hidden)]
268impl<'de> serde::de::Deserialize<'de> for Function {
269 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
270 where
271 D: serde::Deserializer<'de>,
272 {
273 #[allow(non_camel_case_types)]
274 #[doc(hidden)]
275 #[derive(PartialEq, Eq, Hash)]
276 enum __FieldTag {
277 __name,
278 __description,
279 __build_config,
280 __service_config,
281 __event_trigger,
282 __state,
283 __update_time,
284 __labels,
285 __state_messages,
286 __environment,
287 __url,
288 __kms_key_name,
289 __satisfies_pzs,
290 __create_time,
291 Unknown(std::string::String),
292 }
293 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
294 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
295 where
296 D: serde::Deserializer<'de>,
297 {
298 struct Visitor;
299 impl<'de> serde::de::Visitor<'de> for Visitor {
300 type Value = __FieldTag;
301 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
302 formatter.write_str("a field name for Function")
303 }
304 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
305 where
306 E: serde::de::Error,
307 {
308 use std::result::Result::Ok;
309 use std::string::ToString;
310 match value {
311 "name" => Ok(__FieldTag::__name),
312 "description" => Ok(__FieldTag::__description),
313 "buildConfig" => Ok(__FieldTag::__build_config),
314 "build_config" => Ok(__FieldTag::__build_config),
315 "serviceConfig" => Ok(__FieldTag::__service_config),
316 "service_config" => Ok(__FieldTag::__service_config),
317 "eventTrigger" => Ok(__FieldTag::__event_trigger),
318 "event_trigger" => Ok(__FieldTag::__event_trigger),
319 "state" => Ok(__FieldTag::__state),
320 "updateTime" => Ok(__FieldTag::__update_time),
321 "update_time" => Ok(__FieldTag::__update_time),
322 "labels" => Ok(__FieldTag::__labels),
323 "stateMessages" => Ok(__FieldTag::__state_messages),
324 "state_messages" => Ok(__FieldTag::__state_messages),
325 "environment" => Ok(__FieldTag::__environment),
326 "url" => Ok(__FieldTag::__url),
327 "kmsKeyName" => Ok(__FieldTag::__kms_key_name),
328 "kms_key_name" => Ok(__FieldTag::__kms_key_name),
329 "satisfiesPzs" => Ok(__FieldTag::__satisfies_pzs),
330 "satisfies_pzs" => Ok(__FieldTag::__satisfies_pzs),
331 "createTime" => Ok(__FieldTag::__create_time),
332 "create_time" => Ok(__FieldTag::__create_time),
333 _ => Ok(__FieldTag::Unknown(value.to_string())),
334 }
335 }
336 }
337 deserializer.deserialize_identifier(Visitor)
338 }
339 }
340 struct Visitor;
341 impl<'de> serde::de::Visitor<'de> for Visitor {
342 type Value = Function;
343 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
344 formatter.write_str("struct Function")
345 }
346 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
347 where
348 A: serde::de::MapAccess<'de>,
349 {
350 #[allow(unused_imports)]
351 use serde::de::Error;
352 use std::option::Option::Some;
353 let mut fields = std::collections::HashSet::new();
354 let mut result = Self::Value::new();
355 while let Some(tag) = map.next_key::<__FieldTag>()? {
356 #[allow(clippy::match_single_binding)]
357 match tag {
358 __FieldTag::__name => {
359 if !fields.insert(__FieldTag::__name) {
360 return std::result::Result::Err(A::Error::duplicate_field(
361 "multiple values for name",
362 ));
363 }
364 result.name = map
365 .next_value::<std::option::Option<std::string::String>>()?
366 .unwrap_or_default();
367 }
368 __FieldTag::__description => {
369 if !fields.insert(__FieldTag::__description) {
370 return std::result::Result::Err(A::Error::duplicate_field(
371 "multiple values for description",
372 ));
373 }
374 result.description = map
375 .next_value::<std::option::Option<std::string::String>>()?
376 .unwrap_or_default();
377 }
378 __FieldTag::__build_config => {
379 if !fields.insert(__FieldTag::__build_config) {
380 return std::result::Result::Err(A::Error::duplicate_field(
381 "multiple values for build_config",
382 ));
383 }
384 result.build_config =
385 map.next_value::<std::option::Option<crate::model::BuildConfig>>()?;
386 }
387 __FieldTag::__service_config => {
388 if !fields.insert(__FieldTag::__service_config) {
389 return std::result::Result::Err(A::Error::duplicate_field(
390 "multiple values for service_config",
391 ));
392 }
393 result.service_config = map
394 .next_value::<std::option::Option<crate::model::ServiceConfig>>()?;
395 }
396 __FieldTag::__event_trigger => {
397 if !fields.insert(__FieldTag::__event_trigger) {
398 return std::result::Result::Err(A::Error::duplicate_field(
399 "multiple values for event_trigger",
400 ));
401 }
402 result.event_trigger = map
403 .next_value::<std::option::Option<crate::model::EventTrigger>>()?;
404 }
405 __FieldTag::__state => {
406 if !fields.insert(__FieldTag::__state) {
407 return std::result::Result::Err(A::Error::duplicate_field(
408 "multiple values for state",
409 ));
410 }
411 result.state = map
412 .next_value::<std::option::Option<crate::model::function::State>>()?
413 .unwrap_or_default();
414 }
415 __FieldTag::__update_time => {
416 if !fields.insert(__FieldTag::__update_time) {
417 return std::result::Result::Err(A::Error::duplicate_field(
418 "multiple values for update_time",
419 ));
420 }
421 result.update_time =
422 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
423 }
424 __FieldTag::__labels => {
425 if !fields.insert(__FieldTag::__labels) {
426 return std::result::Result::Err(A::Error::duplicate_field(
427 "multiple values for labels",
428 ));
429 }
430 result.labels = map
431 .next_value::<std::option::Option<
432 std::collections::HashMap<
433 std::string::String,
434 std::string::String,
435 >,
436 >>()?
437 .unwrap_or_default();
438 }
439 __FieldTag::__state_messages => {
440 if !fields.insert(__FieldTag::__state_messages) {
441 return std::result::Result::Err(A::Error::duplicate_field(
442 "multiple values for state_messages",
443 ));
444 }
445 result.state_messages = map.next_value::<std::option::Option<std::vec::Vec<crate::model::StateMessage>>>()?.unwrap_or_default();
446 }
447 __FieldTag::__environment => {
448 if !fields.insert(__FieldTag::__environment) {
449 return std::result::Result::Err(A::Error::duplicate_field(
450 "multiple values for environment",
451 ));
452 }
453 result.environment = map
454 .next_value::<std::option::Option<crate::model::Environment>>()?
455 .unwrap_or_default();
456 }
457 __FieldTag::__url => {
458 if !fields.insert(__FieldTag::__url) {
459 return std::result::Result::Err(A::Error::duplicate_field(
460 "multiple values for url",
461 ));
462 }
463 result.url = map
464 .next_value::<std::option::Option<std::string::String>>()?
465 .unwrap_or_default();
466 }
467 __FieldTag::__kms_key_name => {
468 if !fields.insert(__FieldTag::__kms_key_name) {
469 return std::result::Result::Err(A::Error::duplicate_field(
470 "multiple values for kms_key_name",
471 ));
472 }
473 result.kms_key_name = map
474 .next_value::<std::option::Option<std::string::String>>()?
475 .unwrap_or_default();
476 }
477 __FieldTag::__satisfies_pzs => {
478 if !fields.insert(__FieldTag::__satisfies_pzs) {
479 return std::result::Result::Err(A::Error::duplicate_field(
480 "multiple values for satisfies_pzs",
481 ));
482 }
483 result.satisfies_pzs = map
484 .next_value::<std::option::Option<bool>>()?
485 .unwrap_or_default();
486 }
487 __FieldTag::__create_time => {
488 if !fields.insert(__FieldTag::__create_time) {
489 return std::result::Result::Err(A::Error::duplicate_field(
490 "multiple values for create_time",
491 ));
492 }
493 result.create_time =
494 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
495 }
496 __FieldTag::Unknown(key) => {
497 let value = map.next_value::<serde_json::Value>()?;
498 result._unknown_fields.insert(key, value);
499 }
500 }
501 }
502 std::result::Result::Ok(result)
503 }
504 }
505 deserializer.deserialize_any(Visitor)
506 }
507}
508
509#[doc(hidden)]
510impl serde::ser::Serialize for Function {
511 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
512 where
513 S: serde::ser::Serializer,
514 {
515 use serde::ser::SerializeMap;
516 #[allow(unused_imports)]
517 use std::option::Option::Some;
518 let mut state = serializer.serialize_map(std::option::Option::None)?;
519 if !self.name.is_empty() {
520 state.serialize_entry("name", &self.name)?;
521 }
522 if !self.description.is_empty() {
523 state.serialize_entry("description", &self.description)?;
524 }
525 if self.build_config.is_some() {
526 state.serialize_entry("buildConfig", &self.build_config)?;
527 }
528 if self.service_config.is_some() {
529 state.serialize_entry("serviceConfig", &self.service_config)?;
530 }
531 if self.event_trigger.is_some() {
532 state.serialize_entry("eventTrigger", &self.event_trigger)?;
533 }
534 if !wkt::internal::is_default(&self.state) {
535 state.serialize_entry("state", &self.state)?;
536 }
537 if self.update_time.is_some() {
538 state.serialize_entry("updateTime", &self.update_time)?;
539 }
540 if !self.labels.is_empty() {
541 state.serialize_entry("labels", &self.labels)?;
542 }
543 if !self.state_messages.is_empty() {
544 state.serialize_entry("stateMessages", &self.state_messages)?;
545 }
546 if !wkt::internal::is_default(&self.environment) {
547 state.serialize_entry("environment", &self.environment)?;
548 }
549 if !self.url.is_empty() {
550 state.serialize_entry("url", &self.url)?;
551 }
552 if !self.kms_key_name.is_empty() {
553 state.serialize_entry("kmsKeyName", &self.kms_key_name)?;
554 }
555 if !wkt::internal::is_default(&self.satisfies_pzs) {
556 state.serialize_entry("satisfiesPzs", &self.satisfies_pzs)?;
557 }
558 if self.create_time.is_some() {
559 state.serialize_entry("createTime", &self.create_time)?;
560 }
561 if !self._unknown_fields.is_empty() {
562 for (key, value) in self._unknown_fields.iter() {
563 state.serialize_entry(key, &value)?;
564 }
565 }
566 state.end()
567 }
568}
569
570pub mod function {
572 #[allow(unused_imports)]
573 use super::*;
574
575 #[derive(Clone, Debug, PartialEq)]
591 #[non_exhaustive]
592 pub enum State {
593 Unspecified,
595 Active,
597 Failed,
599 Deploying,
601 Deleting,
603 Unknown,
606 UnknownValue(state::UnknownValue),
611 }
612
613 #[doc(hidden)]
614 pub mod state {
615 #[allow(unused_imports)]
616 use super::*;
617 #[derive(Clone, Debug, PartialEq)]
618 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
619 }
620
621 impl State {
622 pub fn value(&self) -> std::option::Option<i32> {
627 match self {
628 Self::Unspecified => std::option::Option::Some(0),
629 Self::Active => std::option::Option::Some(1),
630 Self::Failed => std::option::Option::Some(2),
631 Self::Deploying => std::option::Option::Some(3),
632 Self::Deleting => std::option::Option::Some(4),
633 Self::Unknown => std::option::Option::Some(5),
634 Self::UnknownValue(u) => u.0.value(),
635 }
636 }
637
638 pub fn name(&self) -> std::option::Option<&str> {
643 match self {
644 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
645 Self::Active => std::option::Option::Some("ACTIVE"),
646 Self::Failed => std::option::Option::Some("FAILED"),
647 Self::Deploying => std::option::Option::Some("DEPLOYING"),
648 Self::Deleting => std::option::Option::Some("DELETING"),
649 Self::Unknown => std::option::Option::Some("UNKNOWN"),
650 Self::UnknownValue(u) => u.0.name(),
651 }
652 }
653 }
654
655 impl std::default::Default for State {
656 fn default() -> Self {
657 use std::convert::From;
658 Self::from(0)
659 }
660 }
661
662 impl std::fmt::Display for State {
663 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
664 wkt::internal::display_enum(f, self.name(), self.value())
665 }
666 }
667
668 impl std::convert::From<i32> for State {
669 fn from(value: i32) -> Self {
670 match value {
671 0 => Self::Unspecified,
672 1 => Self::Active,
673 2 => Self::Failed,
674 3 => Self::Deploying,
675 4 => Self::Deleting,
676 5 => Self::Unknown,
677 _ => Self::UnknownValue(state::UnknownValue(
678 wkt::internal::UnknownEnumValue::Integer(value),
679 )),
680 }
681 }
682 }
683
684 impl std::convert::From<&str> for State {
685 fn from(value: &str) -> Self {
686 use std::string::ToString;
687 match value {
688 "STATE_UNSPECIFIED" => Self::Unspecified,
689 "ACTIVE" => Self::Active,
690 "FAILED" => Self::Failed,
691 "DEPLOYING" => Self::Deploying,
692 "DELETING" => Self::Deleting,
693 "UNKNOWN" => Self::Unknown,
694 _ => Self::UnknownValue(state::UnknownValue(
695 wkt::internal::UnknownEnumValue::String(value.to_string()),
696 )),
697 }
698 }
699 }
700
701 impl serde::ser::Serialize for State {
702 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
703 where
704 S: serde::Serializer,
705 {
706 match self {
707 Self::Unspecified => serializer.serialize_i32(0),
708 Self::Active => serializer.serialize_i32(1),
709 Self::Failed => serializer.serialize_i32(2),
710 Self::Deploying => serializer.serialize_i32(3),
711 Self::Deleting => serializer.serialize_i32(4),
712 Self::Unknown => serializer.serialize_i32(5),
713 Self::UnknownValue(u) => u.0.serialize(serializer),
714 }
715 }
716 }
717
718 impl<'de> serde::de::Deserialize<'de> for State {
719 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
720 where
721 D: serde::Deserializer<'de>,
722 {
723 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
724 ".google.cloud.functions.v2.Function.State",
725 ))
726 }
727 }
728}
729
730#[derive(Clone, Debug, Default, PartialEq)]
732#[non_exhaustive]
733pub struct StateMessage {
734 pub severity: crate::model::state_message::Severity,
736
737 pub r#type: std::string::String,
739
740 pub message: std::string::String,
742
743 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
744}
745
746impl StateMessage {
747 pub fn new() -> Self {
748 std::default::Default::default()
749 }
750
751 pub fn set_severity<T: std::convert::Into<crate::model::state_message::Severity>>(
753 mut self,
754 v: T,
755 ) -> Self {
756 self.severity = v.into();
757 self
758 }
759
760 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
762 self.r#type = v.into();
763 self
764 }
765
766 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
768 self.message = v.into();
769 self
770 }
771}
772
773impl wkt::message::Message for StateMessage {
774 fn typename() -> &'static str {
775 "type.googleapis.com/google.cloud.functions.v2.StateMessage"
776 }
777}
778
779#[doc(hidden)]
780impl<'de> serde::de::Deserialize<'de> for StateMessage {
781 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
782 where
783 D: serde::Deserializer<'de>,
784 {
785 #[allow(non_camel_case_types)]
786 #[doc(hidden)]
787 #[derive(PartialEq, Eq, Hash)]
788 enum __FieldTag {
789 __severity,
790 __type,
791 __message,
792 Unknown(std::string::String),
793 }
794 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
795 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
796 where
797 D: serde::Deserializer<'de>,
798 {
799 struct Visitor;
800 impl<'de> serde::de::Visitor<'de> for Visitor {
801 type Value = __FieldTag;
802 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
803 formatter.write_str("a field name for StateMessage")
804 }
805 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
806 where
807 E: serde::de::Error,
808 {
809 use std::result::Result::Ok;
810 use std::string::ToString;
811 match value {
812 "severity" => Ok(__FieldTag::__severity),
813 "type" => Ok(__FieldTag::__type),
814 "message" => Ok(__FieldTag::__message),
815 _ => Ok(__FieldTag::Unknown(value.to_string())),
816 }
817 }
818 }
819 deserializer.deserialize_identifier(Visitor)
820 }
821 }
822 struct Visitor;
823 impl<'de> serde::de::Visitor<'de> for Visitor {
824 type Value = StateMessage;
825 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
826 formatter.write_str("struct StateMessage")
827 }
828 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
829 where
830 A: serde::de::MapAccess<'de>,
831 {
832 #[allow(unused_imports)]
833 use serde::de::Error;
834 use std::option::Option::Some;
835 let mut fields = std::collections::HashSet::new();
836 let mut result = Self::Value::new();
837 while let Some(tag) = map.next_key::<__FieldTag>()? {
838 #[allow(clippy::match_single_binding)]
839 match tag {
840 __FieldTag::__severity => {
841 if !fields.insert(__FieldTag::__severity) {
842 return std::result::Result::Err(A::Error::duplicate_field(
843 "multiple values for severity",
844 ));
845 }
846 result.severity = map.next_value::<std::option::Option<crate::model::state_message::Severity>>()?.unwrap_or_default();
847 }
848 __FieldTag::__type => {
849 if !fields.insert(__FieldTag::__type) {
850 return std::result::Result::Err(A::Error::duplicate_field(
851 "multiple values for type",
852 ));
853 }
854 result.r#type = map
855 .next_value::<std::option::Option<std::string::String>>()?
856 .unwrap_or_default();
857 }
858 __FieldTag::__message => {
859 if !fields.insert(__FieldTag::__message) {
860 return std::result::Result::Err(A::Error::duplicate_field(
861 "multiple values for message",
862 ));
863 }
864 result.message = map
865 .next_value::<std::option::Option<std::string::String>>()?
866 .unwrap_or_default();
867 }
868 __FieldTag::Unknown(key) => {
869 let value = map.next_value::<serde_json::Value>()?;
870 result._unknown_fields.insert(key, value);
871 }
872 }
873 }
874 std::result::Result::Ok(result)
875 }
876 }
877 deserializer.deserialize_any(Visitor)
878 }
879}
880
881#[doc(hidden)]
882impl serde::ser::Serialize for StateMessage {
883 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
884 where
885 S: serde::ser::Serializer,
886 {
887 use serde::ser::SerializeMap;
888 #[allow(unused_imports)]
889 use std::option::Option::Some;
890 let mut state = serializer.serialize_map(std::option::Option::None)?;
891 if !wkt::internal::is_default(&self.severity) {
892 state.serialize_entry("severity", &self.severity)?;
893 }
894 if !self.r#type.is_empty() {
895 state.serialize_entry("type", &self.r#type)?;
896 }
897 if !self.message.is_empty() {
898 state.serialize_entry("message", &self.message)?;
899 }
900 if !self._unknown_fields.is_empty() {
901 for (key, value) in self._unknown_fields.iter() {
902 state.serialize_entry(key, &value)?;
903 }
904 }
905 state.end()
906 }
907}
908
909pub mod state_message {
911 #[allow(unused_imports)]
912 use super::*;
913
914 #[derive(Clone, Debug, PartialEq)]
930 #[non_exhaustive]
931 pub enum Severity {
932 Unspecified,
934 Error,
936 Warning,
938 Info,
940 UnknownValue(severity::UnknownValue),
945 }
946
947 #[doc(hidden)]
948 pub mod severity {
949 #[allow(unused_imports)]
950 use super::*;
951 #[derive(Clone, Debug, PartialEq)]
952 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
953 }
954
955 impl Severity {
956 pub fn value(&self) -> std::option::Option<i32> {
961 match self {
962 Self::Unspecified => std::option::Option::Some(0),
963 Self::Error => std::option::Option::Some(1),
964 Self::Warning => std::option::Option::Some(2),
965 Self::Info => std::option::Option::Some(3),
966 Self::UnknownValue(u) => u.0.value(),
967 }
968 }
969
970 pub fn name(&self) -> std::option::Option<&str> {
975 match self {
976 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
977 Self::Error => std::option::Option::Some("ERROR"),
978 Self::Warning => std::option::Option::Some("WARNING"),
979 Self::Info => std::option::Option::Some("INFO"),
980 Self::UnknownValue(u) => u.0.name(),
981 }
982 }
983 }
984
985 impl std::default::Default for Severity {
986 fn default() -> Self {
987 use std::convert::From;
988 Self::from(0)
989 }
990 }
991
992 impl std::fmt::Display for Severity {
993 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
994 wkt::internal::display_enum(f, self.name(), self.value())
995 }
996 }
997
998 impl std::convert::From<i32> for Severity {
999 fn from(value: i32) -> Self {
1000 match value {
1001 0 => Self::Unspecified,
1002 1 => Self::Error,
1003 2 => Self::Warning,
1004 3 => Self::Info,
1005 _ => Self::UnknownValue(severity::UnknownValue(
1006 wkt::internal::UnknownEnumValue::Integer(value),
1007 )),
1008 }
1009 }
1010 }
1011
1012 impl std::convert::From<&str> for Severity {
1013 fn from(value: &str) -> Self {
1014 use std::string::ToString;
1015 match value {
1016 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
1017 "ERROR" => Self::Error,
1018 "WARNING" => Self::Warning,
1019 "INFO" => Self::Info,
1020 _ => Self::UnknownValue(severity::UnknownValue(
1021 wkt::internal::UnknownEnumValue::String(value.to_string()),
1022 )),
1023 }
1024 }
1025 }
1026
1027 impl serde::ser::Serialize for Severity {
1028 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1029 where
1030 S: serde::Serializer,
1031 {
1032 match self {
1033 Self::Unspecified => serializer.serialize_i32(0),
1034 Self::Error => serializer.serialize_i32(1),
1035 Self::Warning => serializer.serialize_i32(2),
1036 Self::Info => serializer.serialize_i32(3),
1037 Self::UnknownValue(u) => u.0.serialize(serializer),
1038 }
1039 }
1040 }
1041
1042 impl<'de> serde::de::Deserialize<'de> for Severity {
1043 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1044 where
1045 D: serde::Deserializer<'de>,
1046 {
1047 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
1048 ".google.cloud.functions.v2.StateMessage.Severity",
1049 ))
1050 }
1051 }
1052}
1053
1054#[derive(Clone, Debug, Default, PartialEq)]
1056#[non_exhaustive]
1057pub struct StorageSource {
1058 pub bucket: std::string::String,
1062
1063 pub object: std::string::String,
1068
1069 pub generation: i64,
1072
1073 pub source_upload_url: std::string::String,
1077
1078 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1079}
1080
1081impl StorageSource {
1082 pub fn new() -> Self {
1083 std::default::Default::default()
1084 }
1085
1086 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1088 self.bucket = v.into();
1089 self
1090 }
1091
1092 pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1094 self.object = v.into();
1095 self
1096 }
1097
1098 pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1100 self.generation = v.into();
1101 self
1102 }
1103
1104 pub fn set_source_upload_url<T: std::convert::Into<std::string::String>>(
1106 mut self,
1107 v: T,
1108 ) -> Self {
1109 self.source_upload_url = v.into();
1110 self
1111 }
1112}
1113
1114impl wkt::message::Message for StorageSource {
1115 fn typename() -> &'static str {
1116 "type.googleapis.com/google.cloud.functions.v2.StorageSource"
1117 }
1118}
1119
1120#[doc(hidden)]
1121impl<'de> serde::de::Deserialize<'de> for StorageSource {
1122 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1123 where
1124 D: serde::Deserializer<'de>,
1125 {
1126 #[allow(non_camel_case_types)]
1127 #[doc(hidden)]
1128 #[derive(PartialEq, Eq, Hash)]
1129 enum __FieldTag {
1130 __bucket,
1131 __object,
1132 __generation,
1133 __source_upload_url,
1134 Unknown(std::string::String),
1135 }
1136 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1137 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1138 where
1139 D: serde::Deserializer<'de>,
1140 {
1141 struct Visitor;
1142 impl<'de> serde::de::Visitor<'de> for Visitor {
1143 type Value = __FieldTag;
1144 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1145 formatter.write_str("a field name for StorageSource")
1146 }
1147 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1148 where
1149 E: serde::de::Error,
1150 {
1151 use std::result::Result::Ok;
1152 use std::string::ToString;
1153 match value {
1154 "bucket" => Ok(__FieldTag::__bucket),
1155 "object" => Ok(__FieldTag::__object),
1156 "generation" => Ok(__FieldTag::__generation),
1157 "sourceUploadUrl" => Ok(__FieldTag::__source_upload_url),
1158 "source_upload_url" => Ok(__FieldTag::__source_upload_url),
1159 _ => Ok(__FieldTag::Unknown(value.to_string())),
1160 }
1161 }
1162 }
1163 deserializer.deserialize_identifier(Visitor)
1164 }
1165 }
1166 struct Visitor;
1167 impl<'de> serde::de::Visitor<'de> for Visitor {
1168 type Value = StorageSource;
1169 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1170 formatter.write_str("struct StorageSource")
1171 }
1172 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1173 where
1174 A: serde::de::MapAccess<'de>,
1175 {
1176 #[allow(unused_imports)]
1177 use serde::de::Error;
1178 use std::option::Option::Some;
1179 let mut fields = std::collections::HashSet::new();
1180 let mut result = Self::Value::new();
1181 while let Some(tag) = map.next_key::<__FieldTag>()? {
1182 #[allow(clippy::match_single_binding)]
1183 match tag {
1184 __FieldTag::__bucket => {
1185 if !fields.insert(__FieldTag::__bucket) {
1186 return std::result::Result::Err(A::Error::duplicate_field(
1187 "multiple values for bucket",
1188 ));
1189 }
1190 result.bucket = map
1191 .next_value::<std::option::Option<std::string::String>>()?
1192 .unwrap_or_default();
1193 }
1194 __FieldTag::__object => {
1195 if !fields.insert(__FieldTag::__object) {
1196 return std::result::Result::Err(A::Error::duplicate_field(
1197 "multiple values for object",
1198 ));
1199 }
1200 result.object = map
1201 .next_value::<std::option::Option<std::string::String>>()?
1202 .unwrap_or_default();
1203 }
1204 __FieldTag::__generation => {
1205 if !fields.insert(__FieldTag::__generation) {
1206 return std::result::Result::Err(A::Error::duplicate_field(
1207 "multiple values for generation",
1208 ));
1209 }
1210 struct __With(std::option::Option<i64>);
1211 impl<'de> serde::de::Deserialize<'de> for __With {
1212 fn deserialize<D>(
1213 deserializer: D,
1214 ) -> std::result::Result<Self, D::Error>
1215 where
1216 D: serde::de::Deserializer<'de>,
1217 {
1218 serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
1219 }
1220 }
1221 result.generation = map.next_value::<__With>()?.0.unwrap_or_default();
1222 }
1223 __FieldTag::__source_upload_url => {
1224 if !fields.insert(__FieldTag::__source_upload_url) {
1225 return std::result::Result::Err(A::Error::duplicate_field(
1226 "multiple values for source_upload_url",
1227 ));
1228 }
1229 result.source_upload_url = map
1230 .next_value::<std::option::Option<std::string::String>>()?
1231 .unwrap_or_default();
1232 }
1233 __FieldTag::Unknown(key) => {
1234 let value = map.next_value::<serde_json::Value>()?;
1235 result._unknown_fields.insert(key, value);
1236 }
1237 }
1238 }
1239 std::result::Result::Ok(result)
1240 }
1241 }
1242 deserializer.deserialize_any(Visitor)
1243 }
1244}
1245
1246#[doc(hidden)]
1247impl serde::ser::Serialize for StorageSource {
1248 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1249 where
1250 S: serde::ser::Serializer,
1251 {
1252 use serde::ser::SerializeMap;
1253 #[allow(unused_imports)]
1254 use std::option::Option::Some;
1255 let mut state = serializer.serialize_map(std::option::Option::None)?;
1256 if !self.bucket.is_empty() {
1257 state.serialize_entry("bucket", &self.bucket)?;
1258 }
1259 if !self.object.is_empty() {
1260 state.serialize_entry("object", &self.object)?;
1261 }
1262 if !wkt::internal::is_default(&self.generation) {
1263 struct __With<'a>(&'a i64);
1264 impl<'a> serde::ser::Serialize for __With<'a> {
1265 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1266 where
1267 S: serde::ser::Serializer,
1268 {
1269 serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
1270 }
1271 }
1272 state.serialize_entry("generation", &__With(&self.generation))?;
1273 }
1274 if !self.source_upload_url.is_empty() {
1275 state.serialize_entry("sourceUploadUrl", &self.source_upload_url)?;
1276 }
1277 if !self._unknown_fields.is_empty() {
1278 for (key, value) in self._unknown_fields.iter() {
1279 state.serialize_entry(key, &value)?;
1280 }
1281 }
1282 state.end()
1283 }
1284}
1285
1286#[derive(Clone, Debug, Default, PartialEq)]
1288#[non_exhaustive]
1289pub struct RepoSource {
1290 pub project_id: std::string::String,
1293
1294 pub repo_name: std::string::String,
1296
1297 pub dir: std::string::String,
1303
1304 pub invert_regex: bool,
1307
1308 pub revision: std::option::Option<crate::model::repo_source::Revision>,
1311
1312 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1313}
1314
1315impl RepoSource {
1316 pub fn new() -> Self {
1317 std::default::Default::default()
1318 }
1319
1320 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1322 self.project_id = v.into();
1323 self
1324 }
1325
1326 pub fn set_repo_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1328 self.repo_name = v.into();
1329 self
1330 }
1331
1332 pub fn set_dir<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1334 self.dir = v.into();
1335 self
1336 }
1337
1338 pub fn set_invert_regex<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1340 self.invert_regex = v.into();
1341 self
1342 }
1343
1344 pub fn set_revision<
1349 T: std::convert::Into<std::option::Option<crate::model::repo_source::Revision>>,
1350 >(
1351 mut self,
1352 v: T,
1353 ) -> Self {
1354 self.revision = v.into();
1355 self
1356 }
1357
1358 pub fn branch_name(&self) -> std::option::Option<&std::string::String> {
1362 #[allow(unreachable_patterns)]
1363 self.revision.as_ref().and_then(|v| match v {
1364 crate::model::repo_source::Revision::BranchName(v) => std::option::Option::Some(v),
1365 _ => std::option::Option::None,
1366 })
1367 }
1368
1369 pub fn set_branch_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1375 self.revision =
1376 std::option::Option::Some(crate::model::repo_source::Revision::BranchName(v.into()));
1377 self
1378 }
1379
1380 pub fn tag_name(&self) -> std::option::Option<&std::string::String> {
1384 #[allow(unreachable_patterns)]
1385 self.revision.as_ref().and_then(|v| match v {
1386 crate::model::repo_source::Revision::TagName(v) => std::option::Option::Some(v),
1387 _ => std::option::Option::None,
1388 })
1389 }
1390
1391 pub fn set_tag_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1397 self.revision =
1398 std::option::Option::Some(crate::model::repo_source::Revision::TagName(v.into()));
1399 self
1400 }
1401
1402 pub fn commit_sha(&self) -> std::option::Option<&std::string::String> {
1406 #[allow(unreachable_patterns)]
1407 self.revision.as_ref().and_then(|v| match v {
1408 crate::model::repo_source::Revision::CommitSha(v) => std::option::Option::Some(v),
1409 _ => std::option::Option::None,
1410 })
1411 }
1412
1413 pub fn set_commit_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1419 self.revision =
1420 std::option::Option::Some(crate::model::repo_source::Revision::CommitSha(v.into()));
1421 self
1422 }
1423}
1424
1425impl wkt::message::Message for RepoSource {
1426 fn typename() -> &'static str {
1427 "type.googleapis.com/google.cloud.functions.v2.RepoSource"
1428 }
1429}
1430
1431#[doc(hidden)]
1432impl<'de> serde::de::Deserialize<'de> for RepoSource {
1433 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1434 where
1435 D: serde::Deserializer<'de>,
1436 {
1437 #[allow(non_camel_case_types)]
1438 #[doc(hidden)]
1439 #[derive(PartialEq, Eq, Hash)]
1440 enum __FieldTag {
1441 __branch_name,
1442 __tag_name,
1443 __commit_sha,
1444 __project_id,
1445 __repo_name,
1446 __dir,
1447 __invert_regex,
1448 Unknown(std::string::String),
1449 }
1450 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1451 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1452 where
1453 D: serde::Deserializer<'de>,
1454 {
1455 struct Visitor;
1456 impl<'de> serde::de::Visitor<'de> for Visitor {
1457 type Value = __FieldTag;
1458 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1459 formatter.write_str("a field name for RepoSource")
1460 }
1461 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1462 where
1463 E: serde::de::Error,
1464 {
1465 use std::result::Result::Ok;
1466 use std::string::ToString;
1467 match value {
1468 "branchName" => Ok(__FieldTag::__branch_name),
1469 "branch_name" => Ok(__FieldTag::__branch_name),
1470 "tagName" => Ok(__FieldTag::__tag_name),
1471 "tag_name" => Ok(__FieldTag::__tag_name),
1472 "commitSha" => Ok(__FieldTag::__commit_sha),
1473 "commit_sha" => Ok(__FieldTag::__commit_sha),
1474 "projectId" => Ok(__FieldTag::__project_id),
1475 "project_id" => Ok(__FieldTag::__project_id),
1476 "repoName" => Ok(__FieldTag::__repo_name),
1477 "repo_name" => Ok(__FieldTag::__repo_name),
1478 "dir" => Ok(__FieldTag::__dir),
1479 "invertRegex" => Ok(__FieldTag::__invert_regex),
1480 "invert_regex" => Ok(__FieldTag::__invert_regex),
1481 _ => Ok(__FieldTag::Unknown(value.to_string())),
1482 }
1483 }
1484 }
1485 deserializer.deserialize_identifier(Visitor)
1486 }
1487 }
1488 struct Visitor;
1489 impl<'de> serde::de::Visitor<'de> for Visitor {
1490 type Value = RepoSource;
1491 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1492 formatter.write_str("struct RepoSource")
1493 }
1494 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1495 where
1496 A: serde::de::MapAccess<'de>,
1497 {
1498 #[allow(unused_imports)]
1499 use serde::de::Error;
1500 use std::option::Option::Some;
1501 let mut fields = std::collections::HashSet::new();
1502 let mut result = Self::Value::new();
1503 while let Some(tag) = map.next_key::<__FieldTag>()? {
1504 #[allow(clippy::match_single_binding)]
1505 match tag {
1506 __FieldTag::__branch_name => {
1507 if !fields.insert(__FieldTag::__branch_name) {
1508 return std::result::Result::Err(A::Error::duplicate_field(
1509 "multiple values for branch_name",
1510 ));
1511 }
1512 if result.revision.is_some() {
1513 return std::result::Result::Err(A::Error::duplicate_field(
1514 "multiple values for `revision`, a oneof with full ID .google.cloud.functions.v2.RepoSource.branch_name, latest field was branchName",
1515 ));
1516 }
1517 result.revision = std::option::Option::Some(
1518 crate::model::repo_source::Revision::BranchName(
1519 map.next_value::<std::option::Option<std::string::String>>()?
1520 .unwrap_or_default(),
1521 ),
1522 );
1523 }
1524 __FieldTag::__tag_name => {
1525 if !fields.insert(__FieldTag::__tag_name) {
1526 return std::result::Result::Err(A::Error::duplicate_field(
1527 "multiple values for tag_name",
1528 ));
1529 }
1530 if result.revision.is_some() {
1531 return std::result::Result::Err(A::Error::duplicate_field(
1532 "multiple values for `revision`, a oneof with full ID .google.cloud.functions.v2.RepoSource.tag_name, latest field was tagName",
1533 ));
1534 }
1535 result.revision = std::option::Option::Some(
1536 crate::model::repo_source::Revision::TagName(
1537 map.next_value::<std::option::Option<std::string::String>>()?
1538 .unwrap_or_default(),
1539 ),
1540 );
1541 }
1542 __FieldTag::__commit_sha => {
1543 if !fields.insert(__FieldTag::__commit_sha) {
1544 return std::result::Result::Err(A::Error::duplicate_field(
1545 "multiple values for commit_sha",
1546 ));
1547 }
1548 if result.revision.is_some() {
1549 return std::result::Result::Err(A::Error::duplicate_field(
1550 "multiple values for `revision`, a oneof with full ID .google.cloud.functions.v2.RepoSource.commit_sha, latest field was commitSha",
1551 ));
1552 }
1553 result.revision = std::option::Option::Some(
1554 crate::model::repo_source::Revision::CommitSha(
1555 map.next_value::<std::option::Option<std::string::String>>()?
1556 .unwrap_or_default(),
1557 ),
1558 );
1559 }
1560 __FieldTag::__project_id => {
1561 if !fields.insert(__FieldTag::__project_id) {
1562 return std::result::Result::Err(A::Error::duplicate_field(
1563 "multiple values for project_id",
1564 ));
1565 }
1566 result.project_id = map
1567 .next_value::<std::option::Option<std::string::String>>()?
1568 .unwrap_or_default();
1569 }
1570 __FieldTag::__repo_name => {
1571 if !fields.insert(__FieldTag::__repo_name) {
1572 return std::result::Result::Err(A::Error::duplicate_field(
1573 "multiple values for repo_name",
1574 ));
1575 }
1576 result.repo_name = map
1577 .next_value::<std::option::Option<std::string::String>>()?
1578 .unwrap_or_default();
1579 }
1580 __FieldTag::__dir => {
1581 if !fields.insert(__FieldTag::__dir) {
1582 return std::result::Result::Err(A::Error::duplicate_field(
1583 "multiple values for dir",
1584 ));
1585 }
1586 result.dir = map
1587 .next_value::<std::option::Option<std::string::String>>()?
1588 .unwrap_or_default();
1589 }
1590 __FieldTag::__invert_regex => {
1591 if !fields.insert(__FieldTag::__invert_regex) {
1592 return std::result::Result::Err(A::Error::duplicate_field(
1593 "multiple values for invert_regex",
1594 ));
1595 }
1596 result.invert_regex = map
1597 .next_value::<std::option::Option<bool>>()?
1598 .unwrap_or_default();
1599 }
1600 __FieldTag::Unknown(key) => {
1601 let value = map.next_value::<serde_json::Value>()?;
1602 result._unknown_fields.insert(key, value);
1603 }
1604 }
1605 }
1606 std::result::Result::Ok(result)
1607 }
1608 }
1609 deserializer.deserialize_any(Visitor)
1610 }
1611}
1612
1613#[doc(hidden)]
1614impl serde::ser::Serialize for RepoSource {
1615 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1616 where
1617 S: serde::ser::Serializer,
1618 {
1619 use serde::ser::SerializeMap;
1620 #[allow(unused_imports)]
1621 use std::option::Option::Some;
1622 let mut state = serializer.serialize_map(std::option::Option::None)?;
1623 if let Some(value) = self.branch_name() {
1624 state.serialize_entry("branchName", value)?;
1625 }
1626 if let Some(value) = self.tag_name() {
1627 state.serialize_entry("tagName", value)?;
1628 }
1629 if let Some(value) = self.commit_sha() {
1630 state.serialize_entry("commitSha", value)?;
1631 }
1632 if !self.project_id.is_empty() {
1633 state.serialize_entry("projectId", &self.project_id)?;
1634 }
1635 if !self.repo_name.is_empty() {
1636 state.serialize_entry("repoName", &self.repo_name)?;
1637 }
1638 if !self.dir.is_empty() {
1639 state.serialize_entry("dir", &self.dir)?;
1640 }
1641 if !wkt::internal::is_default(&self.invert_regex) {
1642 state.serialize_entry("invertRegex", &self.invert_regex)?;
1643 }
1644 if !self._unknown_fields.is_empty() {
1645 for (key, value) in self._unknown_fields.iter() {
1646 state.serialize_entry(key, &value)?;
1647 }
1648 }
1649 state.end()
1650 }
1651}
1652
1653pub mod repo_source {
1655 #[allow(unused_imports)]
1656 use super::*;
1657
1658 #[derive(Clone, Debug, PartialEq)]
1661 #[non_exhaustive]
1662 pub enum Revision {
1663 BranchName(std::string::String),
1668 TagName(std::string::String),
1673 CommitSha(std::string::String),
1675 }
1676}
1677
1678#[derive(Clone, Debug, Default, PartialEq)]
1680#[non_exhaustive]
1681pub struct Source {
1682 pub source: std::option::Option<crate::model::source::Source>,
1685
1686 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1687}
1688
1689impl Source {
1690 pub fn new() -> Self {
1691 std::default::Default::default()
1692 }
1693
1694 pub fn set_source<T: std::convert::Into<std::option::Option<crate::model::source::Source>>>(
1699 mut self,
1700 v: T,
1701 ) -> Self {
1702 self.source = v.into();
1703 self
1704 }
1705
1706 pub fn storage_source(
1710 &self,
1711 ) -> std::option::Option<&std::boxed::Box<crate::model::StorageSource>> {
1712 #[allow(unreachable_patterns)]
1713 self.source.as_ref().and_then(|v| match v {
1714 crate::model::source::Source::StorageSource(v) => std::option::Option::Some(v),
1715 _ => std::option::Option::None,
1716 })
1717 }
1718
1719 pub fn set_storage_source<
1725 T: std::convert::Into<std::boxed::Box<crate::model::StorageSource>>,
1726 >(
1727 mut self,
1728 v: T,
1729 ) -> Self {
1730 self.source =
1731 std::option::Option::Some(crate::model::source::Source::StorageSource(v.into()));
1732 self
1733 }
1734
1735 pub fn repo_source(&self) -> std::option::Option<&std::boxed::Box<crate::model::RepoSource>> {
1739 #[allow(unreachable_patterns)]
1740 self.source.as_ref().and_then(|v| match v {
1741 crate::model::source::Source::RepoSource(v) => std::option::Option::Some(v),
1742 _ => std::option::Option::None,
1743 })
1744 }
1745
1746 pub fn set_repo_source<T: std::convert::Into<std::boxed::Box<crate::model::RepoSource>>>(
1752 mut self,
1753 v: T,
1754 ) -> Self {
1755 self.source = std::option::Option::Some(crate::model::source::Source::RepoSource(v.into()));
1756 self
1757 }
1758
1759 pub fn git_uri(&self) -> std::option::Option<&std::string::String> {
1763 #[allow(unreachable_patterns)]
1764 self.source.as_ref().and_then(|v| match v {
1765 crate::model::source::Source::GitUri(v) => std::option::Option::Some(v),
1766 _ => std::option::Option::None,
1767 })
1768 }
1769
1770 pub fn set_git_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1776 self.source = std::option::Option::Some(crate::model::source::Source::GitUri(v.into()));
1777 self
1778 }
1779}
1780
1781impl wkt::message::Message for Source {
1782 fn typename() -> &'static str {
1783 "type.googleapis.com/google.cloud.functions.v2.Source"
1784 }
1785}
1786
1787#[doc(hidden)]
1788impl<'de> serde::de::Deserialize<'de> for Source {
1789 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1790 where
1791 D: serde::Deserializer<'de>,
1792 {
1793 #[allow(non_camel_case_types)]
1794 #[doc(hidden)]
1795 #[derive(PartialEq, Eq, Hash)]
1796 enum __FieldTag {
1797 __storage_source,
1798 __repo_source,
1799 __git_uri,
1800 Unknown(std::string::String),
1801 }
1802 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1803 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1804 where
1805 D: serde::Deserializer<'de>,
1806 {
1807 struct Visitor;
1808 impl<'de> serde::de::Visitor<'de> for Visitor {
1809 type Value = __FieldTag;
1810 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1811 formatter.write_str("a field name for Source")
1812 }
1813 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1814 where
1815 E: serde::de::Error,
1816 {
1817 use std::result::Result::Ok;
1818 use std::string::ToString;
1819 match value {
1820 "storageSource" => Ok(__FieldTag::__storage_source),
1821 "storage_source" => Ok(__FieldTag::__storage_source),
1822 "repoSource" => Ok(__FieldTag::__repo_source),
1823 "repo_source" => Ok(__FieldTag::__repo_source),
1824 "gitUri" => Ok(__FieldTag::__git_uri),
1825 "git_uri" => Ok(__FieldTag::__git_uri),
1826 _ => Ok(__FieldTag::Unknown(value.to_string())),
1827 }
1828 }
1829 }
1830 deserializer.deserialize_identifier(Visitor)
1831 }
1832 }
1833 struct Visitor;
1834 impl<'de> serde::de::Visitor<'de> for Visitor {
1835 type Value = Source;
1836 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1837 formatter.write_str("struct Source")
1838 }
1839 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1840 where
1841 A: serde::de::MapAccess<'de>,
1842 {
1843 #[allow(unused_imports)]
1844 use serde::de::Error;
1845 use std::option::Option::Some;
1846 let mut fields = std::collections::HashSet::new();
1847 let mut result = Self::Value::new();
1848 while let Some(tag) = map.next_key::<__FieldTag>()? {
1849 #[allow(clippy::match_single_binding)]
1850 match tag {
1851 __FieldTag::__storage_source => {
1852 if !fields.insert(__FieldTag::__storage_source) {
1853 return std::result::Result::Err(A::Error::duplicate_field(
1854 "multiple values for storage_source",
1855 ));
1856 }
1857 if result.source.is_some() {
1858 return std::result::Result::Err(A::Error::duplicate_field(
1859 "multiple values for `source`, a oneof with full ID .google.cloud.functions.v2.Source.storage_source, latest field was storageSource",
1860 ));
1861 }
1862 result.source = std::option::Option::Some(
1863 crate::model::source::Source::StorageSource(
1864 map.next_value::<std::option::Option<
1865 std::boxed::Box<crate::model::StorageSource>,
1866 >>()?
1867 .unwrap_or_default(),
1868 ),
1869 );
1870 }
1871 __FieldTag::__repo_source => {
1872 if !fields.insert(__FieldTag::__repo_source) {
1873 return std::result::Result::Err(A::Error::duplicate_field(
1874 "multiple values for repo_source",
1875 ));
1876 }
1877 if result.source.is_some() {
1878 return std::result::Result::Err(A::Error::duplicate_field(
1879 "multiple values for `source`, a oneof with full ID .google.cloud.functions.v2.Source.repo_source, latest field was repoSource",
1880 ));
1881 }
1882 result.source = std::option::Option::Some(
1883 crate::model::source::Source::RepoSource(
1884 map.next_value::<std::option::Option<
1885 std::boxed::Box<crate::model::RepoSource>,
1886 >>()?
1887 .unwrap_or_default(),
1888 ),
1889 );
1890 }
1891 __FieldTag::__git_uri => {
1892 if !fields.insert(__FieldTag::__git_uri) {
1893 return std::result::Result::Err(A::Error::duplicate_field(
1894 "multiple values for git_uri",
1895 ));
1896 }
1897 if result.source.is_some() {
1898 return std::result::Result::Err(A::Error::duplicate_field(
1899 "multiple values for `source`, a oneof with full ID .google.cloud.functions.v2.Source.git_uri, latest field was gitUri",
1900 ));
1901 }
1902 result.source =
1903 std::option::Option::Some(crate::model::source::Source::GitUri(
1904 map.next_value::<std::option::Option<std::string::String>>()?
1905 .unwrap_or_default(),
1906 ));
1907 }
1908 __FieldTag::Unknown(key) => {
1909 let value = map.next_value::<serde_json::Value>()?;
1910 result._unknown_fields.insert(key, value);
1911 }
1912 }
1913 }
1914 std::result::Result::Ok(result)
1915 }
1916 }
1917 deserializer.deserialize_any(Visitor)
1918 }
1919}
1920
1921#[doc(hidden)]
1922impl serde::ser::Serialize for Source {
1923 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1924 where
1925 S: serde::ser::Serializer,
1926 {
1927 use serde::ser::SerializeMap;
1928 #[allow(unused_imports)]
1929 use std::option::Option::Some;
1930 let mut state = serializer.serialize_map(std::option::Option::None)?;
1931 if let Some(value) = self.storage_source() {
1932 state.serialize_entry("storageSource", value)?;
1933 }
1934 if let Some(value) = self.repo_source() {
1935 state.serialize_entry("repoSource", value)?;
1936 }
1937 if let Some(value) = self.git_uri() {
1938 state.serialize_entry("gitUri", value)?;
1939 }
1940 if !self._unknown_fields.is_empty() {
1941 for (key, value) in self._unknown_fields.iter() {
1942 state.serialize_entry(key, &value)?;
1943 }
1944 }
1945 state.end()
1946 }
1947}
1948
1949pub mod source {
1951 #[allow(unused_imports)]
1952 use super::*;
1953
1954 #[derive(Clone, Debug, PartialEq)]
1957 #[non_exhaustive]
1958 pub enum Source {
1959 StorageSource(std::boxed::Box<crate::model::StorageSource>),
1961 RepoSource(std::boxed::Box<crate::model::RepoSource>),
1964 GitUri(std::string::String),
1968 }
1969}
1970
1971#[derive(Clone, Debug, Default, PartialEq)]
1974#[non_exhaustive]
1975pub struct SourceProvenance {
1976 pub resolved_storage_source: std::option::Option<crate::model::StorageSource>,
1979
1980 pub resolved_repo_source: std::option::Option<crate::model::RepoSource>,
1983
1984 pub git_uri: std::string::String,
1987
1988 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1989}
1990
1991impl SourceProvenance {
1992 pub fn new() -> Self {
1993 std::default::Default::default()
1994 }
1995
1996 pub fn set_resolved_storage_source<T>(mut self, v: T) -> Self
1998 where
1999 T: std::convert::Into<crate::model::StorageSource>,
2000 {
2001 self.resolved_storage_source = std::option::Option::Some(v.into());
2002 self
2003 }
2004
2005 pub fn set_or_clear_resolved_storage_source<T>(mut self, v: std::option::Option<T>) -> Self
2007 where
2008 T: std::convert::Into<crate::model::StorageSource>,
2009 {
2010 self.resolved_storage_source = v.map(|x| x.into());
2011 self
2012 }
2013
2014 pub fn set_resolved_repo_source<T>(mut self, v: T) -> Self
2016 where
2017 T: std::convert::Into<crate::model::RepoSource>,
2018 {
2019 self.resolved_repo_source = std::option::Option::Some(v.into());
2020 self
2021 }
2022
2023 pub fn set_or_clear_resolved_repo_source<T>(mut self, v: std::option::Option<T>) -> Self
2025 where
2026 T: std::convert::Into<crate::model::RepoSource>,
2027 {
2028 self.resolved_repo_source = v.map(|x| x.into());
2029 self
2030 }
2031
2032 pub fn set_git_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2034 self.git_uri = v.into();
2035 self
2036 }
2037}
2038
2039impl wkt::message::Message for SourceProvenance {
2040 fn typename() -> &'static str {
2041 "type.googleapis.com/google.cloud.functions.v2.SourceProvenance"
2042 }
2043}
2044
2045#[doc(hidden)]
2046impl<'de> serde::de::Deserialize<'de> for SourceProvenance {
2047 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2048 where
2049 D: serde::Deserializer<'de>,
2050 {
2051 #[allow(non_camel_case_types)]
2052 #[doc(hidden)]
2053 #[derive(PartialEq, Eq, Hash)]
2054 enum __FieldTag {
2055 __resolved_storage_source,
2056 __resolved_repo_source,
2057 __git_uri,
2058 Unknown(std::string::String),
2059 }
2060 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2061 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2062 where
2063 D: serde::Deserializer<'de>,
2064 {
2065 struct Visitor;
2066 impl<'de> serde::de::Visitor<'de> for Visitor {
2067 type Value = __FieldTag;
2068 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2069 formatter.write_str("a field name for SourceProvenance")
2070 }
2071 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2072 where
2073 E: serde::de::Error,
2074 {
2075 use std::result::Result::Ok;
2076 use std::string::ToString;
2077 match value {
2078 "resolvedStorageSource" => Ok(__FieldTag::__resolved_storage_source),
2079 "resolved_storage_source" => Ok(__FieldTag::__resolved_storage_source),
2080 "resolvedRepoSource" => Ok(__FieldTag::__resolved_repo_source),
2081 "resolved_repo_source" => Ok(__FieldTag::__resolved_repo_source),
2082 "gitUri" => Ok(__FieldTag::__git_uri),
2083 "git_uri" => Ok(__FieldTag::__git_uri),
2084 _ => Ok(__FieldTag::Unknown(value.to_string())),
2085 }
2086 }
2087 }
2088 deserializer.deserialize_identifier(Visitor)
2089 }
2090 }
2091 struct Visitor;
2092 impl<'de> serde::de::Visitor<'de> for Visitor {
2093 type Value = SourceProvenance;
2094 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2095 formatter.write_str("struct SourceProvenance")
2096 }
2097 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2098 where
2099 A: serde::de::MapAccess<'de>,
2100 {
2101 #[allow(unused_imports)]
2102 use serde::de::Error;
2103 use std::option::Option::Some;
2104 let mut fields = std::collections::HashSet::new();
2105 let mut result = Self::Value::new();
2106 while let Some(tag) = map.next_key::<__FieldTag>()? {
2107 #[allow(clippy::match_single_binding)]
2108 match tag {
2109 __FieldTag::__resolved_storage_source => {
2110 if !fields.insert(__FieldTag::__resolved_storage_source) {
2111 return std::result::Result::Err(A::Error::duplicate_field(
2112 "multiple values for resolved_storage_source",
2113 ));
2114 }
2115 result.resolved_storage_source = map
2116 .next_value::<std::option::Option<crate::model::StorageSource>>()?;
2117 }
2118 __FieldTag::__resolved_repo_source => {
2119 if !fields.insert(__FieldTag::__resolved_repo_source) {
2120 return std::result::Result::Err(A::Error::duplicate_field(
2121 "multiple values for resolved_repo_source",
2122 ));
2123 }
2124 result.resolved_repo_source =
2125 map.next_value::<std::option::Option<crate::model::RepoSource>>()?;
2126 }
2127 __FieldTag::__git_uri => {
2128 if !fields.insert(__FieldTag::__git_uri) {
2129 return std::result::Result::Err(A::Error::duplicate_field(
2130 "multiple values for git_uri",
2131 ));
2132 }
2133 result.git_uri = map
2134 .next_value::<std::option::Option<std::string::String>>()?
2135 .unwrap_or_default();
2136 }
2137 __FieldTag::Unknown(key) => {
2138 let value = map.next_value::<serde_json::Value>()?;
2139 result._unknown_fields.insert(key, value);
2140 }
2141 }
2142 }
2143 std::result::Result::Ok(result)
2144 }
2145 }
2146 deserializer.deserialize_any(Visitor)
2147 }
2148}
2149
2150#[doc(hidden)]
2151impl serde::ser::Serialize for SourceProvenance {
2152 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2153 where
2154 S: serde::ser::Serializer,
2155 {
2156 use serde::ser::SerializeMap;
2157 #[allow(unused_imports)]
2158 use std::option::Option::Some;
2159 let mut state = serializer.serialize_map(std::option::Option::None)?;
2160 if self.resolved_storage_source.is_some() {
2161 state.serialize_entry("resolvedStorageSource", &self.resolved_storage_source)?;
2162 }
2163 if self.resolved_repo_source.is_some() {
2164 state.serialize_entry("resolvedRepoSource", &self.resolved_repo_source)?;
2165 }
2166 if !self.git_uri.is_empty() {
2167 state.serialize_entry("gitUri", &self.git_uri)?;
2168 }
2169 if !self._unknown_fields.is_empty() {
2170 for (key, value) in self._unknown_fields.iter() {
2171 state.serialize_entry(key, &value)?;
2172 }
2173 }
2174 state.end()
2175 }
2176}
2177
2178#[derive(Clone, Debug, Default, PartialEq)]
2181#[non_exhaustive]
2182pub struct BuildConfig {
2183 pub build: std::string::String,
2186
2187 pub runtime: std::string::String,
2193
2194 pub entry_point: std::string::String,
2201
2202 pub source: std::option::Option<crate::model::Source>,
2204
2205 pub source_provenance: std::option::Option<crate::model::SourceProvenance>,
2207
2208 pub worker_pool: std::string::String,
2221
2222 pub environment_variables: std::collections::HashMap<std::string::String, std::string::String>,
2224
2225 #[deprecated]
2237 pub docker_registry: crate::model::build_config::DockerRegistry,
2238
2239 pub docker_repository: std::string::String,
2249
2250 pub service_account: std::string::String,
2253
2254 pub runtime_update_policy: std::option::Option<crate::model::build_config::RuntimeUpdatePolicy>,
2256
2257 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2258}
2259
2260impl BuildConfig {
2261 pub fn new() -> Self {
2262 std::default::Default::default()
2263 }
2264
2265 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2267 self.build = v.into();
2268 self
2269 }
2270
2271 pub fn set_runtime<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2273 self.runtime = v.into();
2274 self
2275 }
2276
2277 pub fn set_entry_point<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2279 self.entry_point = v.into();
2280 self
2281 }
2282
2283 pub fn set_source<T>(mut self, v: T) -> Self
2285 where
2286 T: std::convert::Into<crate::model::Source>,
2287 {
2288 self.source = std::option::Option::Some(v.into());
2289 self
2290 }
2291
2292 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
2294 where
2295 T: std::convert::Into<crate::model::Source>,
2296 {
2297 self.source = v.map(|x| x.into());
2298 self
2299 }
2300
2301 pub fn set_source_provenance<T>(mut self, v: T) -> Self
2303 where
2304 T: std::convert::Into<crate::model::SourceProvenance>,
2305 {
2306 self.source_provenance = std::option::Option::Some(v.into());
2307 self
2308 }
2309
2310 pub fn set_or_clear_source_provenance<T>(mut self, v: std::option::Option<T>) -> Self
2312 where
2313 T: std::convert::Into<crate::model::SourceProvenance>,
2314 {
2315 self.source_provenance = v.map(|x| x.into());
2316 self
2317 }
2318
2319 pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2321 self.worker_pool = v.into();
2322 self
2323 }
2324
2325 pub fn set_environment_variables<T, K, V>(mut self, v: T) -> Self
2327 where
2328 T: std::iter::IntoIterator<Item = (K, V)>,
2329 K: std::convert::Into<std::string::String>,
2330 V: std::convert::Into<std::string::String>,
2331 {
2332 use std::iter::Iterator;
2333 self.environment_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2334 self
2335 }
2336
2337 #[deprecated]
2339 pub fn set_docker_registry<
2340 T: std::convert::Into<crate::model::build_config::DockerRegistry>,
2341 >(
2342 mut self,
2343 v: T,
2344 ) -> Self {
2345 self.docker_registry = v.into();
2346 self
2347 }
2348
2349 pub fn set_docker_repository<T: std::convert::Into<std::string::String>>(
2351 mut self,
2352 v: T,
2353 ) -> Self {
2354 self.docker_repository = v.into();
2355 self
2356 }
2357
2358 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2360 self.service_account = v.into();
2361 self
2362 }
2363
2364 pub fn set_runtime_update_policy<
2369 T: std::convert::Into<std::option::Option<crate::model::build_config::RuntimeUpdatePolicy>>,
2370 >(
2371 mut self,
2372 v: T,
2373 ) -> Self {
2374 self.runtime_update_policy = v.into();
2375 self
2376 }
2377
2378 pub fn automatic_update_policy(
2382 &self,
2383 ) -> std::option::Option<&std::boxed::Box<crate::model::AutomaticUpdatePolicy>> {
2384 #[allow(unreachable_patterns)]
2385 self.runtime_update_policy.as_ref().and_then(|v| match v {
2386 crate::model::build_config::RuntimeUpdatePolicy::AutomaticUpdatePolicy(v) => {
2387 std::option::Option::Some(v)
2388 }
2389 _ => std::option::Option::None,
2390 })
2391 }
2392
2393 pub fn set_automatic_update_policy<
2399 T: std::convert::Into<std::boxed::Box<crate::model::AutomaticUpdatePolicy>>,
2400 >(
2401 mut self,
2402 v: T,
2403 ) -> Self {
2404 self.runtime_update_policy = std::option::Option::Some(
2405 crate::model::build_config::RuntimeUpdatePolicy::AutomaticUpdatePolicy(v.into()),
2406 );
2407 self
2408 }
2409
2410 pub fn on_deploy_update_policy(
2414 &self,
2415 ) -> std::option::Option<&std::boxed::Box<crate::model::OnDeployUpdatePolicy>> {
2416 #[allow(unreachable_patterns)]
2417 self.runtime_update_policy.as_ref().and_then(|v| match v {
2418 crate::model::build_config::RuntimeUpdatePolicy::OnDeployUpdatePolicy(v) => {
2419 std::option::Option::Some(v)
2420 }
2421 _ => std::option::Option::None,
2422 })
2423 }
2424
2425 pub fn set_on_deploy_update_policy<
2431 T: std::convert::Into<std::boxed::Box<crate::model::OnDeployUpdatePolicy>>,
2432 >(
2433 mut self,
2434 v: T,
2435 ) -> Self {
2436 self.runtime_update_policy = std::option::Option::Some(
2437 crate::model::build_config::RuntimeUpdatePolicy::OnDeployUpdatePolicy(v.into()),
2438 );
2439 self
2440 }
2441}
2442
2443impl wkt::message::Message for BuildConfig {
2444 fn typename() -> &'static str {
2445 "type.googleapis.com/google.cloud.functions.v2.BuildConfig"
2446 }
2447}
2448
2449#[doc(hidden)]
2450impl<'de> serde::de::Deserialize<'de> for BuildConfig {
2451 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2452 where
2453 D: serde::Deserializer<'de>,
2454 {
2455 #[allow(non_camel_case_types)]
2456 #[doc(hidden)]
2457 #[derive(PartialEq, Eq, Hash)]
2458 enum __FieldTag {
2459 __automatic_update_policy,
2460 __on_deploy_update_policy,
2461 __build,
2462 __runtime,
2463 __entry_point,
2464 __source,
2465 __source_provenance,
2466 __worker_pool,
2467 __environment_variables,
2468 __docker_registry,
2469 __docker_repository,
2470 __service_account,
2471 Unknown(std::string::String),
2472 }
2473 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2474 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2475 where
2476 D: serde::Deserializer<'de>,
2477 {
2478 struct Visitor;
2479 impl<'de> serde::de::Visitor<'de> for Visitor {
2480 type Value = __FieldTag;
2481 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2482 formatter.write_str("a field name for BuildConfig")
2483 }
2484 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2485 where
2486 E: serde::de::Error,
2487 {
2488 use std::result::Result::Ok;
2489 use std::string::ToString;
2490 match value {
2491 "automaticUpdatePolicy" => Ok(__FieldTag::__automatic_update_policy),
2492 "automatic_update_policy" => Ok(__FieldTag::__automatic_update_policy),
2493 "onDeployUpdatePolicy" => Ok(__FieldTag::__on_deploy_update_policy),
2494 "on_deploy_update_policy" => Ok(__FieldTag::__on_deploy_update_policy),
2495 "build" => Ok(__FieldTag::__build),
2496 "runtime" => Ok(__FieldTag::__runtime),
2497 "entryPoint" => Ok(__FieldTag::__entry_point),
2498 "entry_point" => Ok(__FieldTag::__entry_point),
2499 "source" => Ok(__FieldTag::__source),
2500 "sourceProvenance" => Ok(__FieldTag::__source_provenance),
2501 "source_provenance" => Ok(__FieldTag::__source_provenance),
2502 "workerPool" => Ok(__FieldTag::__worker_pool),
2503 "worker_pool" => Ok(__FieldTag::__worker_pool),
2504 "environmentVariables" => Ok(__FieldTag::__environment_variables),
2505 "environment_variables" => Ok(__FieldTag::__environment_variables),
2506 "dockerRegistry" => Ok(__FieldTag::__docker_registry),
2507 "docker_registry" => Ok(__FieldTag::__docker_registry),
2508 "dockerRepository" => Ok(__FieldTag::__docker_repository),
2509 "docker_repository" => Ok(__FieldTag::__docker_repository),
2510 "serviceAccount" => Ok(__FieldTag::__service_account),
2511 "service_account" => Ok(__FieldTag::__service_account),
2512 _ => Ok(__FieldTag::Unknown(value.to_string())),
2513 }
2514 }
2515 }
2516 deserializer.deserialize_identifier(Visitor)
2517 }
2518 }
2519 struct Visitor;
2520 impl<'de> serde::de::Visitor<'de> for Visitor {
2521 type Value = BuildConfig;
2522 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2523 formatter.write_str("struct BuildConfig")
2524 }
2525 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2526 where
2527 A: serde::de::MapAccess<'de>,
2528 {
2529 #[allow(unused_imports)]
2530 use serde::de::Error;
2531 use std::option::Option::Some;
2532 let mut fields = std::collections::HashSet::new();
2533 let mut result = Self::Value::new();
2534 while let Some(tag) = map.next_key::<__FieldTag>()? {
2535 #[allow(clippy::match_single_binding)]
2536 match tag {
2537 __FieldTag::__automatic_update_policy => {
2538 if !fields.insert(__FieldTag::__automatic_update_policy) {
2539 return std::result::Result::Err(A::Error::duplicate_field(
2540 "multiple values for automatic_update_policy",
2541 ));
2542 }
2543 if result.runtime_update_policy.is_some() {
2544 return std::result::Result::Err(A::Error::duplicate_field(
2545 "multiple values for `runtime_update_policy`, a oneof with full ID .google.cloud.functions.v2.BuildConfig.automatic_update_policy, latest field was automaticUpdatePolicy",
2546 ));
2547 }
2548 result.runtime_update_policy = std::option::Option::Some(
2549 crate::model::build_config::RuntimeUpdatePolicy::AutomaticUpdatePolicy(
2550 map.next_value::<std::option::Option<std::boxed::Box<crate::model::AutomaticUpdatePolicy>>>()?.unwrap_or_default()
2551 ),
2552 );
2553 }
2554 __FieldTag::__on_deploy_update_policy => {
2555 if !fields.insert(__FieldTag::__on_deploy_update_policy) {
2556 return std::result::Result::Err(A::Error::duplicate_field(
2557 "multiple values for on_deploy_update_policy",
2558 ));
2559 }
2560 if result.runtime_update_policy.is_some() {
2561 return std::result::Result::Err(A::Error::duplicate_field(
2562 "multiple values for `runtime_update_policy`, a oneof with full ID .google.cloud.functions.v2.BuildConfig.on_deploy_update_policy, latest field was onDeployUpdatePolicy",
2563 ));
2564 }
2565 result.runtime_update_policy = std::option::Option::Some(
2566 crate::model::build_config::RuntimeUpdatePolicy::OnDeployUpdatePolicy(
2567 map.next_value::<std::option::Option<std::boxed::Box<crate::model::OnDeployUpdatePolicy>>>()?.unwrap_or_default()
2568 ),
2569 );
2570 }
2571 __FieldTag::__build => {
2572 if !fields.insert(__FieldTag::__build) {
2573 return std::result::Result::Err(A::Error::duplicate_field(
2574 "multiple values for build",
2575 ));
2576 }
2577 result.build = map
2578 .next_value::<std::option::Option<std::string::String>>()?
2579 .unwrap_or_default();
2580 }
2581 __FieldTag::__runtime => {
2582 if !fields.insert(__FieldTag::__runtime) {
2583 return std::result::Result::Err(A::Error::duplicate_field(
2584 "multiple values for runtime",
2585 ));
2586 }
2587 result.runtime = map
2588 .next_value::<std::option::Option<std::string::String>>()?
2589 .unwrap_or_default();
2590 }
2591 __FieldTag::__entry_point => {
2592 if !fields.insert(__FieldTag::__entry_point) {
2593 return std::result::Result::Err(A::Error::duplicate_field(
2594 "multiple values for entry_point",
2595 ));
2596 }
2597 result.entry_point = map
2598 .next_value::<std::option::Option<std::string::String>>()?
2599 .unwrap_or_default();
2600 }
2601 __FieldTag::__source => {
2602 if !fields.insert(__FieldTag::__source) {
2603 return std::result::Result::Err(A::Error::duplicate_field(
2604 "multiple values for source",
2605 ));
2606 }
2607 result.source =
2608 map.next_value::<std::option::Option<crate::model::Source>>()?;
2609 }
2610 __FieldTag::__source_provenance => {
2611 if !fields.insert(__FieldTag::__source_provenance) {
2612 return std::result::Result::Err(A::Error::duplicate_field(
2613 "multiple values for source_provenance",
2614 ));
2615 }
2616 result.source_provenance = map
2617 .next_value::<std::option::Option<crate::model::SourceProvenance>>(
2618 )?;
2619 }
2620 __FieldTag::__worker_pool => {
2621 if !fields.insert(__FieldTag::__worker_pool) {
2622 return std::result::Result::Err(A::Error::duplicate_field(
2623 "multiple values for worker_pool",
2624 ));
2625 }
2626 result.worker_pool = map
2627 .next_value::<std::option::Option<std::string::String>>()?
2628 .unwrap_or_default();
2629 }
2630 __FieldTag::__environment_variables => {
2631 if !fields.insert(__FieldTag::__environment_variables) {
2632 return std::result::Result::Err(A::Error::duplicate_field(
2633 "multiple values for environment_variables",
2634 ));
2635 }
2636 result.environment_variables = map
2637 .next_value::<std::option::Option<
2638 std::collections::HashMap<
2639 std::string::String,
2640 std::string::String,
2641 >,
2642 >>()?
2643 .unwrap_or_default();
2644 }
2645 __FieldTag::__docker_registry => {
2646 if !fields.insert(__FieldTag::__docker_registry) {
2647 return std::result::Result::Err(A::Error::duplicate_field(
2648 "multiple values for docker_registry",
2649 ));
2650 }
2651 result.docker_registry = map.next_value::<std::option::Option<crate::model::build_config::DockerRegistry>>()?.unwrap_or_default();
2652 }
2653 __FieldTag::__docker_repository => {
2654 if !fields.insert(__FieldTag::__docker_repository) {
2655 return std::result::Result::Err(A::Error::duplicate_field(
2656 "multiple values for docker_repository",
2657 ));
2658 }
2659 result.docker_repository = map
2660 .next_value::<std::option::Option<std::string::String>>()?
2661 .unwrap_or_default();
2662 }
2663 __FieldTag::__service_account => {
2664 if !fields.insert(__FieldTag::__service_account) {
2665 return std::result::Result::Err(A::Error::duplicate_field(
2666 "multiple values for service_account",
2667 ));
2668 }
2669 result.service_account = map
2670 .next_value::<std::option::Option<std::string::String>>()?
2671 .unwrap_or_default();
2672 }
2673 __FieldTag::Unknown(key) => {
2674 let value = map.next_value::<serde_json::Value>()?;
2675 result._unknown_fields.insert(key, value);
2676 }
2677 }
2678 }
2679 std::result::Result::Ok(result)
2680 }
2681 }
2682 deserializer.deserialize_any(Visitor)
2683 }
2684}
2685
2686#[doc(hidden)]
2687impl serde::ser::Serialize for BuildConfig {
2688 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2689 where
2690 S: serde::ser::Serializer,
2691 {
2692 use serde::ser::SerializeMap;
2693 #[allow(unused_imports)]
2694 use std::option::Option::Some;
2695 let mut state = serializer.serialize_map(std::option::Option::None)?;
2696 if let Some(value) = self.automatic_update_policy() {
2697 state.serialize_entry("automaticUpdatePolicy", value)?;
2698 }
2699 if let Some(value) = self.on_deploy_update_policy() {
2700 state.serialize_entry("onDeployUpdatePolicy", value)?;
2701 }
2702 if !self.build.is_empty() {
2703 state.serialize_entry("build", &self.build)?;
2704 }
2705 if !self.runtime.is_empty() {
2706 state.serialize_entry("runtime", &self.runtime)?;
2707 }
2708 if !self.entry_point.is_empty() {
2709 state.serialize_entry("entryPoint", &self.entry_point)?;
2710 }
2711 if self.source.is_some() {
2712 state.serialize_entry("source", &self.source)?;
2713 }
2714 if self.source_provenance.is_some() {
2715 state.serialize_entry("sourceProvenance", &self.source_provenance)?;
2716 }
2717 if !self.worker_pool.is_empty() {
2718 state.serialize_entry("workerPool", &self.worker_pool)?;
2719 }
2720 if !self.environment_variables.is_empty() {
2721 state.serialize_entry("environmentVariables", &self.environment_variables)?;
2722 }
2723 if !wkt::internal::is_default(&self.docker_registry) {
2724 state.serialize_entry("dockerRegistry", &self.docker_registry)?;
2725 }
2726 if !self.docker_repository.is_empty() {
2727 state.serialize_entry("dockerRepository", &self.docker_repository)?;
2728 }
2729 if !self.service_account.is_empty() {
2730 state.serialize_entry("serviceAccount", &self.service_account)?;
2731 }
2732 if !self._unknown_fields.is_empty() {
2733 for (key, value) in self._unknown_fields.iter() {
2734 state.serialize_entry(key, &value)?;
2735 }
2736 }
2737 state.end()
2738 }
2739}
2740
2741pub mod build_config {
2743 #[allow(unused_imports)]
2744 use super::*;
2745
2746 #[derive(Clone, Debug, PartialEq)]
2762 #[non_exhaustive]
2763 pub enum DockerRegistry {
2764 Unspecified,
2766 ContainerRegistry,
2769 ArtifactRegistry,
2775 UnknownValue(docker_registry::UnknownValue),
2780 }
2781
2782 #[doc(hidden)]
2783 pub mod docker_registry {
2784 #[allow(unused_imports)]
2785 use super::*;
2786 #[derive(Clone, Debug, PartialEq)]
2787 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2788 }
2789
2790 impl DockerRegistry {
2791 pub fn value(&self) -> std::option::Option<i32> {
2796 match self {
2797 Self::Unspecified => std::option::Option::Some(0),
2798 Self::ContainerRegistry => std::option::Option::Some(1),
2799 Self::ArtifactRegistry => std::option::Option::Some(2),
2800 Self::UnknownValue(u) => u.0.value(),
2801 }
2802 }
2803
2804 pub fn name(&self) -> std::option::Option<&str> {
2809 match self {
2810 Self::Unspecified => std::option::Option::Some("DOCKER_REGISTRY_UNSPECIFIED"),
2811 Self::ContainerRegistry => std::option::Option::Some("CONTAINER_REGISTRY"),
2812 Self::ArtifactRegistry => std::option::Option::Some("ARTIFACT_REGISTRY"),
2813 Self::UnknownValue(u) => u.0.name(),
2814 }
2815 }
2816 }
2817
2818 impl std::default::Default for DockerRegistry {
2819 fn default() -> Self {
2820 use std::convert::From;
2821 Self::from(0)
2822 }
2823 }
2824
2825 impl std::fmt::Display for DockerRegistry {
2826 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2827 wkt::internal::display_enum(f, self.name(), self.value())
2828 }
2829 }
2830
2831 impl std::convert::From<i32> for DockerRegistry {
2832 fn from(value: i32) -> Self {
2833 match value {
2834 0 => Self::Unspecified,
2835 1 => Self::ContainerRegistry,
2836 2 => Self::ArtifactRegistry,
2837 _ => Self::UnknownValue(docker_registry::UnknownValue(
2838 wkt::internal::UnknownEnumValue::Integer(value),
2839 )),
2840 }
2841 }
2842 }
2843
2844 impl std::convert::From<&str> for DockerRegistry {
2845 fn from(value: &str) -> Self {
2846 use std::string::ToString;
2847 match value {
2848 "DOCKER_REGISTRY_UNSPECIFIED" => Self::Unspecified,
2849 "CONTAINER_REGISTRY" => Self::ContainerRegistry,
2850 "ARTIFACT_REGISTRY" => Self::ArtifactRegistry,
2851 _ => Self::UnknownValue(docker_registry::UnknownValue(
2852 wkt::internal::UnknownEnumValue::String(value.to_string()),
2853 )),
2854 }
2855 }
2856 }
2857
2858 impl serde::ser::Serialize for DockerRegistry {
2859 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2860 where
2861 S: serde::Serializer,
2862 {
2863 match self {
2864 Self::Unspecified => serializer.serialize_i32(0),
2865 Self::ContainerRegistry => serializer.serialize_i32(1),
2866 Self::ArtifactRegistry => serializer.serialize_i32(2),
2867 Self::UnknownValue(u) => u.0.serialize(serializer),
2868 }
2869 }
2870 }
2871
2872 impl<'de> serde::de::Deserialize<'de> for DockerRegistry {
2873 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2874 where
2875 D: serde::Deserializer<'de>,
2876 {
2877 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DockerRegistry>::new(
2878 ".google.cloud.functions.v2.BuildConfig.DockerRegistry",
2879 ))
2880 }
2881 }
2882
2883 #[derive(Clone, Debug, PartialEq)]
2885 #[non_exhaustive]
2886 pub enum RuntimeUpdatePolicy {
2887 AutomaticUpdatePolicy(std::boxed::Box<crate::model::AutomaticUpdatePolicy>),
2888 OnDeployUpdatePolicy(std::boxed::Box<crate::model::OnDeployUpdatePolicy>),
2889 }
2890}
2891
2892#[derive(Clone, Debug, Default, PartialEq)]
2895#[non_exhaustive]
2896pub struct ServiceConfig {
2897 pub service: std::string::String,
2901
2902 pub timeout_seconds: i32,
2906
2907 pub available_memory: std::string::String,
2914
2915 pub available_cpu: std::string::String,
2921
2922 pub environment_variables: std::collections::HashMap<std::string::String, std::string::String>,
2924
2925 pub max_instance_count: i32,
2938
2939 pub min_instance_count: i32,
2949
2950 pub vpc_connector: std::string::String,
2953
2954 pub vpc_connector_egress_settings: crate::model::service_config::VpcConnectorEgressSettings,
2957
2958 pub ingress_settings: crate::model::service_config::IngressSettings,
2961
2962 pub uri: std::string::String,
2964
2965 pub service_account_email: std::string::String,
2968
2969 pub all_traffic_on_latest_revision: bool,
2975
2976 pub secret_environment_variables: std::vec::Vec<crate::model::SecretEnvVar>,
2978
2979 pub secret_volumes: std::vec::Vec<crate::model::SecretVolume>,
2981
2982 pub revision: std::string::String,
2984
2985 pub max_instance_request_concurrency: i32,
2988
2989 pub security_level: crate::model::service_config::SecurityLevel,
2994
2995 pub binary_authorization_policy: std::string::String,
2998
2999 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3000}
3001
3002impl ServiceConfig {
3003 pub fn new() -> Self {
3004 std::default::Default::default()
3005 }
3006
3007 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3009 self.service = v.into();
3010 self
3011 }
3012
3013 pub fn set_timeout_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3015 self.timeout_seconds = v.into();
3016 self
3017 }
3018
3019 pub fn set_available_memory<T: std::convert::Into<std::string::String>>(
3021 mut self,
3022 v: T,
3023 ) -> Self {
3024 self.available_memory = v.into();
3025 self
3026 }
3027
3028 pub fn set_available_cpu<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3030 self.available_cpu = v.into();
3031 self
3032 }
3033
3034 pub fn set_environment_variables<T, K, V>(mut self, v: T) -> Self
3036 where
3037 T: std::iter::IntoIterator<Item = (K, V)>,
3038 K: std::convert::Into<std::string::String>,
3039 V: std::convert::Into<std::string::String>,
3040 {
3041 use std::iter::Iterator;
3042 self.environment_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3043 self
3044 }
3045
3046 pub fn set_max_instance_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3048 self.max_instance_count = v.into();
3049 self
3050 }
3051
3052 pub fn set_min_instance_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3054 self.min_instance_count = v.into();
3055 self
3056 }
3057
3058 pub fn set_vpc_connector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3060 self.vpc_connector = v.into();
3061 self
3062 }
3063
3064 pub fn set_vpc_connector_egress_settings<
3066 T: std::convert::Into<crate::model::service_config::VpcConnectorEgressSettings>,
3067 >(
3068 mut self,
3069 v: T,
3070 ) -> Self {
3071 self.vpc_connector_egress_settings = v.into();
3072 self
3073 }
3074
3075 pub fn set_ingress_settings<
3077 T: std::convert::Into<crate::model::service_config::IngressSettings>,
3078 >(
3079 mut self,
3080 v: T,
3081 ) -> Self {
3082 self.ingress_settings = v.into();
3083 self
3084 }
3085
3086 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3088 self.uri = v.into();
3089 self
3090 }
3091
3092 pub fn set_service_account_email<T: std::convert::Into<std::string::String>>(
3094 mut self,
3095 v: T,
3096 ) -> Self {
3097 self.service_account_email = v.into();
3098 self
3099 }
3100
3101 pub fn set_all_traffic_on_latest_revision<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3103 self.all_traffic_on_latest_revision = v.into();
3104 self
3105 }
3106
3107 pub fn set_secret_environment_variables<T, V>(mut self, v: T) -> Self
3109 where
3110 T: std::iter::IntoIterator<Item = V>,
3111 V: std::convert::Into<crate::model::SecretEnvVar>,
3112 {
3113 use std::iter::Iterator;
3114 self.secret_environment_variables = v.into_iter().map(|i| i.into()).collect();
3115 self
3116 }
3117
3118 pub fn set_secret_volumes<T, V>(mut self, v: T) -> Self
3120 where
3121 T: std::iter::IntoIterator<Item = V>,
3122 V: std::convert::Into<crate::model::SecretVolume>,
3123 {
3124 use std::iter::Iterator;
3125 self.secret_volumes = v.into_iter().map(|i| i.into()).collect();
3126 self
3127 }
3128
3129 pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3131 self.revision = v.into();
3132 self
3133 }
3134
3135 pub fn set_max_instance_request_concurrency<T: std::convert::Into<i32>>(
3137 mut self,
3138 v: T,
3139 ) -> Self {
3140 self.max_instance_request_concurrency = v.into();
3141 self
3142 }
3143
3144 pub fn set_security_level<
3146 T: std::convert::Into<crate::model::service_config::SecurityLevel>,
3147 >(
3148 mut self,
3149 v: T,
3150 ) -> Self {
3151 self.security_level = v.into();
3152 self
3153 }
3154
3155 pub fn set_binary_authorization_policy<T: std::convert::Into<std::string::String>>(
3157 mut self,
3158 v: T,
3159 ) -> Self {
3160 self.binary_authorization_policy = v.into();
3161 self
3162 }
3163}
3164
3165impl wkt::message::Message for ServiceConfig {
3166 fn typename() -> &'static str {
3167 "type.googleapis.com/google.cloud.functions.v2.ServiceConfig"
3168 }
3169}
3170
3171#[doc(hidden)]
3172impl<'de> serde::de::Deserialize<'de> for ServiceConfig {
3173 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3174 where
3175 D: serde::Deserializer<'de>,
3176 {
3177 #[allow(non_camel_case_types)]
3178 #[doc(hidden)]
3179 #[derive(PartialEq, Eq, Hash)]
3180 enum __FieldTag {
3181 __service,
3182 __timeout_seconds,
3183 __available_memory,
3184 __available_cpu,
3185 __environment_variables,
3186 __max_instance_count,
3187 __min_instance_count,
3188 __vpc_connector,
3189 __vpc_connector_egress_settings,
3190 __ingress_settings,
3191 __uri,
3192 __service_account_email,
3193 __all_traffic_on_latest_revision,
3194 __secret_environment_variables,
3195 __secret_volumes,
3196 __revision,
3197 __max_instance_request_concurrency,
3198 __security_level,
3199 __binary_authorization_policy,
3200 Unknown(std::string::String),
3201 }
3202 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3203 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3204 where
3205 D: serde::Deserializer<'de>,
3206 {
3207 struct Visitor;
3208 impl<'de> serde::de::Visitor<'de> for Visitor {
3209 type Value = __FieldTag;
3210 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3211 formatter.write_str("a field name for ServiceConfig")
3212 }
3213 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3214 where
3215 E: serde::de::Error,
3216 {
3217 use std::result::Result::Ok;
3218 use std::string::ToString;
3219 match value {
3220 "service" => Ok(__FieldTag::__service),
3221 "timeoutSeconds" => Ok(__FieldTag::__timeout_seconds),
3222 "timeout_seconds" => Ok(__FieldTag::__timeout_seconds),
3223 "availableMemory" => Ok(__FieldTag::__available_memory),
3224 "available_memory" => Ok(__FieldTag::__available_memory),
3225 "availableCpu" => Ok(__FieldTag::__available_cpu),
3226 "available_cpu" => Ok(__FieldTag::__available_cpu),
3227 "environmentVariables" => Ok(__FieldTag::__environment_variables),
3228 "environment_variables" => Ok(__FieldTag::__environment_variables),
3229 "maxInstanceCount" => Ok(__FieldTag::__max_instance_count),
3230 "max_instance_count" => Ok(__FieldTag::__max_instance_count),
3231 "minInstanceCount" => Ok(__FieldTag::__min_instance_count),
3232 "min_instance_count" => Ok(__FieldTag::__min_instance_count),
3233 "vpcConnector" => Ok(__FieldTag::__vpc_connector),
3234 "vpc_connector" => Ok(__FieldTag::__vpc_connector),
3235 "vpcConnectorEgressSettings" => {
3236 Ok(__FieldTag::__vpc_connector_egress_settings)
3237 }
3238 "vpc_connector_egress_settings" => {
3239 Ok(__FieldTag::__vpc_connector_egress_settings)
3240 }
3241 "ingressSettings" => Ok(__FieldTag::__ingress_settings),
3242 "ingress_settings" => Ok(__FieldTag::__ingress_settings),
3243 "uri" => Ok(__FieldTag::__uri),
3244 "serviceAccountEmail" => Ok(__FieldTag::__service_account_email),
3245 "service_account_email" => Ok(__FieldTag::__service_account_email),
3246 "allTrafficOnLatestRevision" => {
3247 Ok(__FieldTag::__all_traffic_on_latest_revision)
3248 }
3249 "all_traffic_on_latest_revision" => {
3250 Ok(__FieldTag::__all_traffic_on_latest_revision)
3251 }
3252 "secretEnvironmentVariables" => {
3253 Ok(__FieldTag::__secret_environment_variables)
3254 }
3255 "secret_environment_variables" => {
3256 Ok(__FieldTag::__secret_environment_variables)
3257 }
3258 "secretVolumes" => Ok(__FieldTag::__secret_volumes),
3259 "secret_volumes" => Ok(__FieldTag::__secret_volumes),
3260 "revision" => Ok(__FieldTag::__revision),
3261 "maxInstanceRequestConcurrency" => {
3262 Ok(__FieldTag::__max_instance_request_concurrency)
3263 }
3264 "max_instance_request_concurrency" => {
3265 Ok(__FieldTag::__max_instance_request_concurrency)
3266 }
3267 "securityLevel" => Ok(__FieldTag::__security_level),
3268 "security_level" => Ok(__FieldTag::__security_level),
3269 "binaryAuthorizationPolicy" => {
3270 Ok(__FieldTag::__binary_authorization_policy)
3271 }
3272 "binary_authorization_policy" => {
3273 Ok(__FieldTag::__binary_authorization_policy)
3274 }
3275 _ => Ok(__FieldTag::Unknown(value.to_string())),
3276 }
3277 }
3278 }
3279 deserializer.deserialize_identifier(Visitor)
3280 }
3281 }
3282 struct Visitor;
3283 impl<'de> serde::de::Visitor<'de> for Visitor {
3284 type Value = ServiceConfig;
3285 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3286 formatter.write_str("struct ServiceConfig")
3287 }
3288 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3289 where
3290 A: serde::de::MapAccess<'de>,
3291 {
3292 #[allow(unused_imports)]
3293 use serde::de::Error;
3294 use std::option::Option::Some;
3295 let mut fields = std::collections::HashSet::new();
3296 let mut result = Self::Value::new();
3297 while let Some(tag) = map.next_key::<__FieldTag>()? {
3298 #[allow(clippy::match_single_binding)]
3299 match tag {
3300 __FieldTag::__service => {
3301 if !fields.insert(__FieldTag::__service) {
3302 return std::result::Result::Err(A::Error::duplicate_field(
3303 "multiple values for service",
3304 ));
3305 }
3306 result.service = map
3307 .next_value::<std::option::Option<std::string::String>>()?
3308 .unwrap_or_default();
3309 }
3310 __FieldTag::__timeout_seconds => {
3311 if !fields.insert(__FieldTag::__timeout_seconds) {
3312 return std::result::Result::Err(A::Error::duplicate_field(
3313 "multiple values for timeout_seconds",
3314 ));
3315 }
3316 struct __With(std::option::Option<i32>);
3317 impl<'de> serde::de::Deserialize<'de> for __With {
3318 fn deserialize<D>(
3319 deserializer: D,
3320 ) -> std::result::Result<Self, D::Error>
3321 where
3322 D: serde::de::Deserializer<'de>,
3323 {
3324 serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
3325 }
3326 }
3327 result.timeout_seconds =
3328 map.next_value::<__With>()?.0.unwrap_or_default();
3329 }
3330 __FieldTag::__available_memory => {
3331 if !fields.insert(__FieldTag::__available_memory) {
3332 return std::result::Result::Err(A::Error::duplicate_field(
3333 "multiple values for available_memory",
3334 ));
3335 }
3336 result.available_memory = map
3337 .next_value::<std::option::Option<std::string::String>>()?
3338 .unwrap_or_default();
3339 }
3340 __FieldTag::__available_cpu => {
3341 if !fields.insert(__FieldTag::__available_cpu) {
3342 return std::result::Result::Err(A::Error::duplicate_field(
3343 "multiple values for available_cpu",
3344 ));
3345 }
3346 result.available_cpu = map
3347 .next_value::<std::option::Option<std::string::String>>()?
3348 .unwrap_or_default();
3349 }
3350 __FieldTag::__environment_variables => {
3351 if !fields.insert(__FieldTag::__environment_variables) {
3352 return std::result::Result::Err(A::Error::duplicate_field(
3353 "multiple values for environment_variables",
3354 ));
3355 }
3356 result.environment_variables = map
3357 .next_value::<std::option::Option<
3358 std::collections::HashMap<
3359 std::string::String,
3360 std::string::String,
3361 >,
3362 >>()?
3363 .unwrap_or_default();
3364 }
3365 __FieldTag::__max_instance_count => {
3366 if !fields.insert(__FieldTag::__max_instance_count) {
3367 return std::result::Result::Err(A::Error::duplicate_field(
3368 "multiple values for max_instance_count",
3369 ));
3370 }
3371 struct __With(std::option::Option<i32>);
3372 impl<'de> serde::de::Deserialize<'de> for __With {
3373 fn deserialize<D>(
3374 deserializer: D,
3375 ) -> std::result::Result<Self, D::Error>
3376 where
3377 D: serde::de::Deserializer<'de>,
3378 {
3379 serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
3380 }
3381 }
3382 result.max_instance_count =
3383 map.next_value::<__With>()?.0.unwrap_or_default();
3384 }
3385 __FieldTag::__min_instance_count => {
3386 if !fields.insert(__FieldTag::__min_instance_count) {
3387 return std::result::Result::Err(A::Error::duplicate_field(
3388 "multiple values for min_instance_count",
3389 ));
3390 }
3391 struct __With(std::option::Option<i32>);
3392 impl<'de> serde::de::Deserialize<'de> for __With {
3393 fn deserialize<D>(
3394 deserializer: D,
3395 ) -> std::result::Result<Self, D::Error>
3396 where
3397 D: serde::de::Deserializer<'de>,
3398 {
3399 serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
3400 }
3401 }
3402 result.min_instance_count =
3403 map.next_value::<__With>()?.0.unwrap_or_default();
3404 }
3405 __FieldTag::__vpc_connector => {
3406 if !fields.insert(__FieldTag::__vpc_connector) {
3407 return std::result::Result::Err(A::Error::duplicate_field(
3408 "multiple values for vpc_connector",
3409 ));
3410 }
3411 result.vpc_connector = map
3412 .next_value::<std::option::Option<std::string::String>>()?
3413 .unwrap_or_default();
3414 }
3415 __FieldTag::__vpc_connector_egress_settings => {
3416 if !fields.insert(__FieldTag::__vpc_connector_egress_settings) {
3417 return std::result::Result::Err(A::Error::duplicate_field(
3418 "multiple values for vpc_connector_egress_settings",
3419 ));
3420 }
3421 result.vpc_connector_egress_settings = map
3422 .next_value::<std::option::Option<
3423 crate::model::service_config::VpcConnectorEgressSettings,
3424 >>()?
3425 .unwrap_or_default();
3426 }
3427 __FieldTag::__ingress_settings => {
3428 if !fields.insert(__FieldTag::__ingress_settings) {
3429 return std::result::Result::Err(A::Error::duplicate_field(
3430 "multiple values for ingress_settings",
3431 ));
3432 }
3433 result.ingress_settings =
3434 map.next_value::<std::option::Option<
3435 crate::model::service_config::IngressSettings,
3436 >>()?
3437 .unwrap_or_default();
3438 }
3439 __FieldTag::__uri => {
3440 if !fields.insert(__FieldTag::__uri) {
3441 return std::result::Result::Err(A::Error::duplicate_field(
3442 "multiple values for uri",
3443 ));
3444 }
3445 result.uri = map
3446 .next_value::<std::option::Option<std::string::String>>()?
3447 .unwrap_or_default();
3448 }
3449 __FieldTag::__service_account_email => {
3450 if !fields.insert(__FieldTag::__service_account_email) {
3451 return std::result::Result::Err(A::Error::duplicate_field(
3452 "multiple values for service_account_email",
3453 ));
3454 }
3455 result.service_account_email = map
3456 .next_value::<std::option::Option<std::string::String>>()?
3457 .unwrap_or_default();
3458 }
3459 __FieldTag::__all_traffic_on_latest_revision => {
3460 if !fields.insert(__FieldTag::__all_traffic_on_latest_revision) {
3461 return std::result::Result::Err(A::Error::duplicate_field(
3462 "multiple values for all_traffic_on_latest_revision",
3463 ));
3464 }
3465 result.all_traffic_on_latest_revision = map
3466 .next_value::<std::option::Option<bool>>()?
3467 .unwrap_or_default();
3468 }
3469 __FieldTag::__secret_environment_variables => {
3470 if !fields.insert(__FieldTag::__secret_environment_variables) {
3471 return std::result::Result::Err(A::Error::duplicate_field(
3472 "multiple values for secret_environment_variables",
3473 ));
3474 }
3475 result.secret_environment_variables = map.next_value::<std::option::Option<std::vec::Vec<crate::model::SecretEnvVar>>>()?.unwrap_or_default();
3476 }
3477 __FieldTag::__secret_volumes => {
3478 if !fields.insert(__FieldTag::__secret_volumes) {
3479 return std::result::Result::Err(A::Error::duplicate_field(
3480 "multiple values for secret_volumes",
3481 ));
3482 }
3483 result.secret_volumes = map.next_value::<std::option::Option<std::vec::Vec<crate::model::SecretVolume>>>()?.unwrap_or_default();
3484 }
3485 __FieldTag::__revision => {
3486 if !fields.insert(__FieldTag::__revision) {
3487 return std::result::Result::Err(A::Error::duplicate_field(
3488 "multiple values for revision",
3489 ));
3490 }
3491 result.revision = map
3492 .next_value::<std::option::Option<std::string::String>>()?
3493 .unwrap_or_default();
3494 }
3495 __FieldTag::__max_instance_request_concurrency => {
3496 if !fields.insert(__FieldTag::__max_instance_request_concurrency) {
3497 return std::result::Result::Err(A::Error::duplicate_field(
3498 "multiple values for max_instance_request_concurrency",
3499 ));
3500 }
3501 struct __With(std::option::Option<i32>);
3502 impl<'de> serde::de::Deserialize<'de> for __With {
3503 fn deserialize<D>(
3504 deserializer: D,
3505 ) -> std::result::Result<Self, D::Error>
3506 where
3507 D: serde::de::Deserializer<'de>,
3508 {
3509 serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
3510 }
3511 }
3512 result.max_instance_request_concurrency =
3513 map.next_value::<__With>()?.0.unwrap_or_default();
3514 }
3515 __FieldTag::__security_level => {
3516 if !fields.insert(__FieldTag::__security_level) {
3517 return std::result::Result::Err(A::Error::duplicate_field(
3518 "multiple values for security_level",
3519 ));
3520 }
3521 result.security_level =
3522 map.next_value::<std::option::Option<
3523 crate::model::service_config::SecurityLevel,
3524 >>()?
3525 .unwrap_or_default();
3526 }
3527 __FieldTag::__binary_authorization_policy => {
3528 if !fields.insert(__FieldTag::__binary_authorization_policy) {
3529 return std::result::Result::Err(A::Error::duplicate_field(
3530 "multiple values for binary_authorization_policy",
3531 ));
3532 }
3533 result.binary_authorization_policy = map
3534 .next_value::<std::option::Option<std::string::String>>()?
3535 .unwrap_or_default();
3536 }
3537 __FieldTag::Unknown(key) => {
3538 let value = map.next_value::<serde_json::Value>()?;
3539 result._unknown_fields.insert(key, value);
3540 }
3541 }
3542 }
3543 std::result::Result::Ok(result)
3544 }
3545 }
3546 deserializer.deserialize_any(Visitor)
3547 }
3548}
3549
3550#[doc(hidden)]
3551impl serde::ser::Serialize for ServiceConfig {
3552 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3553 where
3554 S: serde::ser::Serializer,
3555 {
3556 use serde::ser::SerializeMap;
3557 #[allow(unused_imports)]
3558 use std::option::Option::Some;
3559 let mut state = serializer.serialize_map(std::option::Option::None)?;
3560 if !self.service.is_empty() {
3561 state.serialize_entry("service", &self.service)?;
3562 }
3563 if !wkt::internal::is_default(&self.timeout_seconds) {
3564 struct __With<'a>(&'a i32);
3565 impl<'a> serde::ser::Serialize for __With<'a> {
3566 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3567 where
3568 S: serde::ser::Serializer,
3569 {
3570 serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
3571 }
3572 }
3573 state.serialize_entry("timeoutSeconds", &__With(&self.timeout_seconds))?;
3574 }
3575 if !self.available_memory.is_empty() {
3576 state.serialize_entry("availableMemory", &self.available_memory)?;
3577 }
3578 if !self.available_cpu.is_empty() {
3579 state.serialize_entry("availableCpu", &self.available_cpu)?;
3580 }
3581 if !self.environment_variables.is_empty() {
3582 state.serialize_entry("environmentVariables", &self.environment_variables)?;
3583 }
3584 if !wkt::internal::is_default(&self.max_instance_count) {
3585 struct __With<'a>(&'a i32);
3586 impl<'a> serde::ser::Serialize for __With<'a> {
3587 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3588 where
3589 S: serde::ser::Serializer,
3590 {
3591 serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
3592 }
3593 }
3594 state.serialize_entry("maxInstanceCount", &__With(&self.max_instance_count))?;
3595 }
3596 if !wkt::internal::is_default(&self.min_instance_count) {
3597 struct __With<'a>(&'a i32);
3598 impl<'a> serde::ser::Serialize for __With<'a> {
3599 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3600 where
3601 S: serde::ser::Serializer,
3602 {
3603 serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
3604 }
3605 }
3606 state.serialize_entry("minInstanceCount", &__With(&self.min_instance_count))?;
3607 }
3608 if !self.vpc_connector.is_empty() {
3609 state.serialize_entry("vpcConnector", &self.vpc_connector)?;
3610 }
3611 if !wkt::internal::is_default(&self.vpc_connector_egress_settings) {
3612 state.serialize_entry(
3613 "vpcConnectorEgressSettings",
3614 &self.vpc_connector_egress_settings,
3615 )?;
3616 }
3617 if !wkt::internal::is_default(&self.ingress_settings) {
3618 state.serialize_entry("ingressSettings", &self.ingress_settings)?;
3619 }
3620 if !self.uri.is_empty() {
3621 state.serialize_entry("uri", &self.uri)?;
3622 }
3623 if !self.service_account_email.is_empty() {
3624 state.serialize_entry("serviceAccountEmail", &self.service_account_email)?;
3625 }
3626 if !wkt::internal::is_default(&self.all_traffic_on_latest_revision) {
3627 state.serialize_entry(
3628 "allTrafficOnLatestRevision",
3629 &self.all_traffic_on_latest_revision,
3630 )?;
3631 }
3632 if !self.secret_environment_variables.is_empty() {
3633 state.serialize_entry(
3634 "secretEnvironmentVariables",
3635 &self.secret_environment_variables,
3636 )?;
3637 }
3638 if !self.secret_volumes.is_empty() {
3639 state.serialize_entry("secretVolumes", &self.secret_volumes)?;
3640 }
3641 if !self.revision.is_empty() {
3642 state.serialize_entry("revision", &self.revision)?;
3643 }
3644 if !wkt::internal::is_default(&self.max_instance_request_concurrency) {
3645 struct __With<'a>(&'a i32);
3646 impl<'a> serde::ser::Serialize for __With<'a> {
3647 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3648 where
3649 S: serde::ser::Serializer,
3650 {
3651 serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
3652 }
3653 }
3654 state.serialize_entry(
3655 "maxInstanceRequestConcurrency",
3656 &__With(&self.max_instance_request_concurrency),
3657 )?;
3658 }
3659 if !wkt::internal::is_default(&self.security_level) {
3660 state.serialize_entry("securityLevel", &self.security_level)?;
3661 }
3662 if !self.binary_authorization_policy.is_empty() {
3663 state.serialize_entry(
3664 "binaryAuthorizationPolicy",
3665 &self.binary_authorization_policy,
3666 )?;
3667 }
3668 if !self._unknown_fields.is_empty() {
3669 for (key, value) in self._unknown_fields.iter() {
3670 state.serialize_entry(key, &value)?;
3671 }
3672 }
3673 state.end()
3674 }
3675}
3676
3677pub mod service_config {
3679 #[allow(unused_imports)]
3680 use super::*;
3681
3682 #[derive(Clone, Debug, PartialEq)]
3701 #[non_exhaustive]
3702 pub enum VpcConnectorEgressSettings {
3703 Unspecified,
3705 PrivateRangesOnly,
3707 AllTraffic,
3710 UnknownValue(vpc_connector_egress_settings::UnknownValue),
3715 }
3716
3717 #[doc(hidden)]
3718 pub mod vpc_connector_egress_settings {
3719 #[allow(unused_imports)]
3720 use super::*;
3721 #[derive(Clone, Debug, PartialEq)]
3722 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3723 }
3724
3725 impl VpcConnectorEgressSettings {
3726 pub fn value(&self) -> std::option::Option<i32> {
3731 match self {
3732 Self::Unspecified => std::option::Option::Some(0),
3733 Self::PrivateRangesOnly => std::option::Option::Some(1),
3734 Self::AllTraffic => std::option::Option::Some(2),
3735 Self::UnknownValue(u) => u.0.value(),
3736 }
3737 }
3738
3739 pub fn name(&self) -> std::option::Option<&str> {
3744 match self {
3745 Self::Unspecified => {
3746 std::option::Option::Some("VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED")
3747 }
3748 Self::PrivateRangesOnly => std::option::Option::Some("PRIVATE_RANGES_ONLY"),
3749 Self::AllTraffic => std::option::Option::Some("ALL_TRAFFIC"),
3750 Self::UnknownValue(u) => u.0.name(),
3751 }
3752 }
3753 }
3754
3755 impl std::default::Default for VpcConnectorEgressSettings {
3756 fn default() -> Self {
3757 use std::convert::From;
3758 Self::from(0)
3759 }
3760 }
3761
3762 impl std::fmt::Display for VpcConnectorEgressSettings {
3763 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3764 wkt::internal::display_enum(f, self.name(), self.value())
3765 }
3766 }
3767
3768 impl std::convert::From<i32> for VpcConnectorEgressSettings {
3769 fn from(value: i32) -> Self {
3770 match value {
3771 0 => Self::Unspecified,
3772 1 => Self::PrivateRangesOnly,
3773 2 => Self::AllTraffic,
3774 _ => Self::UnknownValue(vpc_connector_egress_settings::UnknownValue(
3775 wkt::internal::UnknownEnumValue::Integer(value),
3776 )),
3777 }
3778 }
3779 }
3780
3781 impl std::convert::From<&str> for VpcConnectorEgressSettings {
3782 fn from(value: &str) -> Self {
3783 use std::string::ToString;
3784 match value {
3785 "VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED" => Self::Unspecified,
3786 "PRIVATE_RANGES_ONLY" => Self::PrivateRangesOnly,
3787 "ALL_TRAFFIC" => Self::AllTraffic,
3788 _ => Self::UnknownValue(vpc_connector_egress_settings::UnknownValue(
3789 wkt::internal::UnknownEnumValue::String(value.to_string()),
3790 )),
3791 }
3792 }
3793 }
3794
3795 impl serde::ser::Serialize for VpcConnectorEgressSettings {
3796 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3797 where
3798 S: serde::Serializer,
3799 {
3800 match self {
3801 Self::Unspecified => serializer.serialize_i32(0),
3802 Self::PrivateRangesOnly => serializer.serialize_i32(1),
3803 Self::AllTraffic => serializer.serialize_i32(2),
3804 Self::UnknownValue(u) => u.0.serialize(serializer),
3805 }
3806 }
3807 }
3808
3809 impl<'de> serde::de::Deserialize<'de> for VpcConnectorEgressSettings {
3810 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3811 where
3812 D: serde::Deserializer<'de>,
3813 {
3814 deserializer.deserialize_any(
3815 wkt::internal::EnumVisitor::<VpcConnectorEgressSettings>::new(
3816 ".google.cloud.functions.v2.ServiceConfig.VpcConnectorEgressSettings",
3817 ),
3818 )
3819 }
3820 }
3821
3822 #[derive(Clone, Debug, PartialEq)]
3842 #[non_exhaustive]
3843 pub enum IngressSettings {
3844 Unspecified,
3846 AllowAll,
3848 AllowInternalOnly,
3850 AllowInternalAndGclb,
3852 UnknownValue(ingress_settings::UnknownValue),
3857 }
3858
3859 #[doc(hidden)]
3860 pub mod ingress_settings {
3861 #[allow(unused_imports)]
3862 use super::*;
3863 #[derive(Clone, Debug, PartialEq)]
3864 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3865 }
3866
3867 impl IngressSettings {
3868 pub fn value(&self) -> std::option::Option<i32> {
3873 match self {
3874 Self::Unspecified => std::option::Option::Some(0),
3875 Self::AllowAll => std::option::Option::Some(1),
3876 Self::AllowInternalOnly => std::option::Option::Some(2),
3877 Self::AllowInternalAndGclb => std::option::Option::Some(3),
3878 Self::UnknownValue(u) => u.0.value(),
3879 }
3880 }
3881
3882 pub fn name(&self) -> std::option::Option<&str> {
3887 match self {
3888 Self::Unspecified => std::option::Option::Some("INGRESS_SETTINGS_UNSPECIFIED"),
3889 Self::AllowAll => std::option::Option::Some("ALLOW_ALL"),
3890 Self::AllowInternalOnly => std::option::Option::Some("ALLOW_INTERNAL_ONLY"),
3891 Self::AllowInternalAndGclb => std::option::Option::Some("ALLOW_INTERNAL_AND_GCLB"),
3892 Self::UnknownValue(u) => u.0.name(),
3893 }
3894 }
3895 }
3896
3897 impl std::default::Default for IngressSettings {
3898 fn default() -> Self {
3899 use std::convert::From;
3900 Self::from(0)
3901 }
3902 }
3903
3904 impl std::fmt::Display for IngressSettings {
3905 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3906 wkt::internal::display_enum(f, self.name(), self.value())
3907 }
3908 }
3909
3910 impl std::convert::From<i32> for IngressSettings {
3911 fn from(value: i32) -> Self {
3912 match value {
3913 0 => Self::Unspecified,
3914 1 => Self::AllowAll,
3915 2 => Self::AllowInternalOnly,
3916 3 => Self::AllowInternalAndGclb,
3917 _ => Self::UnknownValue(ingress_settings::UnknownValue(
3918 wkt::internal::UnknownEnumValue::Integer(value),
3919 )),
3920 }
3921 }
3922 }
3923
3924 impl std::convert::From<&str> for IngressSettings {
3925 fn from(value: &str) -> Self {
3926 use std::string::ToString;
3927 match value {
3928 "INGRESS_SETTINGS_UNSPECIFIED" => Self::Unspecified,
3929 "ALLOW_ALL" => Self::AllowAll,
3930 "ALLOW_INTERNAL_ONLY" => Self::AllowInternalOnly,
3931 "ALLOW_INTERNAL_AND_GCLB" => Self::AllowInternalAndGclb,
3932 _ => Self::UnknownValue(ingress_settings::UnknownValue(
3933 wkt::internal::UnknownEnumValue::String(value.to_string()),
3934 )),
3935 }
3936 }
3937 }
3938
3939 impl serde::ser::Serialize for IngressSettings {
3940 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3941 where
3942 S: serde::Serializer,
3943 {
3944 match self {
3945 Self::Unspecified => serializer.serialize_i32(0),
3946 Self::AllowAll => serializer.serialize_i32(1),
3947 Self::AllowInternalOnly => serializer.serialize_i32(2),
3948 Self::AllowInternalAndGclb => serializer.serialize_i32(3),
3949 Self::UnknownValue(u) => u.0.serialize(serializer),
3950 }
3951 }
3952 }
3953
3954 impl<'de> serde::de::Deserialize<'de> for IngressSettings {
3955 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3956 where
3957 D: serde::Deserializer<'de>,
3958 {
3959 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IngressSettings>::new(
3960 ".google.cloud.functions.v2.ServiceConfig.IngressSettings",
3961 ))
3962 }
3963 }
3964
3965 #[derive(Clone, Debug, PartialEq)]
3986 #[non_exhaustive]
3987 pub enum SecurityLevel {
3988 Unspecified,
3990 SecureAlways,
3994 SecureOptional,
3998 UnknownValue(security_level::UnknownValue),
4003 }
4004
4005 #[doc(hidden)]
4006 pub mod security_level {
4007 #[allow(unused_imports)]
4008 use super::*;
4009 #[derive(Clone, Debug, PartialEq)]
4010 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4011 }
4012
4013 impl SecurityLevel {
4014 pub fn value(&self) -> std::option::Option<i32> {
4019 match self {
4020 Self::Unspecified => std::option::Option::Some(0),
4021 Self::SecureAlways => std::option::Option::Some(1),
4022 Self::SecureOptional => std::option::Option::Some(2),
4023 Self::UnknownValue(u) => u.0.value(),
4024 }
4025 }
4026
4027 pub fn name(&self) -> std::option::Option<&str> {
4032 match self {
4033 Self::Unspecified => std::option::Option::Some("SECURITY_LEVEL_UNSPECIFIED"),
4034 Self::SecureAlways => std::option::Option::Some("SECURE_ALWAYS"),
4035 Self::SecureOptional => std::option::Option::Some("SECURE_OPTIONAL"),
4036 Self::UnknownValue(u) => u.0.name(),
4037 }
4038 }
4039 }
4040
4041 impl std::default::Default for SecurityLevel {
4042 fn default() -> Self {
4043 use std::convert::From;
4044 Self::from(0)
4045 }
4046 }
4047
4048 impl std::fmt::Display for SecurityLevel {
4049 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4050 wkt::internal::display_enum(f, self.name(), self.value())
4051 }
4052 }
4053
4054 impl std::convert::From<i32> for SecurityLevel {
4055 fn from(value: i32) -> Self {
4056 match value {
4057 0 => Self::Unspecified,
4058 1 => Self::SecureAlways,
4059 2 => Self::SecureOptional,
4060 _ => Self::UnknownValue(security_level::UnknownValue(
4061 wkt::internal::UnknownEnumValue::Integer(value),
4062 )),
4063 }
4064 }
4065 }
4066
4067 impl std::convert::From<&str> for SecurityLevel {
4068 fn from(value: &str) -> Self {
4069 use std::string::ToString;
4070 match value {
4071 "SECURITY_LEVEL_UNSPECIFIED" => Self::Unspecified,
4072 "SECURE_ALWAYS" => Self::SecureAlways,
4073 "SECURE_OPTIONAL" => Self::SecureOptional,
4074 _ => Self::UnknownValue(security_level::UnknownValue(
4075 wkt::internal::UnknownEnumValue::String(value.to_string()),
4076 )),
4077 }
4078 }
4079 }
4080
4081 impl serde::ser::Serialize for SecurityLevel {
4082 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4083 where
4084 S: serde::Serializer,
4085 {
4086 match self {
4087 Self::Unspecified => serializer.serialize_i32(0),
4088 Self::SecureAlways => serializer.serialize_i32(1),
4089 Self::SecureOptional => serializer.serialize_i32(2),
4090 Self::UnknownValue(u) => u.0.serialize(serializer),
4091 }
4092 }
4093 }
4094
4095 impl<'de> serde::de::Deserialize<'de> for SecurityLevel {
4096 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4097 where
4098 D: serde::Deserializer<'de>,
4099 {
4100 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SecurityLevel>::new(
4101 ".google.cloud.functions.v2.ServiceConfig.SecurityLevel",
4102 ))
4103 }
4104 }
4105}
4106
4107#[derive(Clone, Debug, Default, PartialEq)]
4111#[non_exhaustive]
4112pub struct SecretEnvVar {
4113 pub key: std::string::String,
4115
4116 pub project_id: std::string::String,
4120
4121 pub secret: std::string::String,
4123
4124 pub version: std::string::String,
4129
4130 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4131}
4132
4133impl SecretEnvVar {
4134 pub fn new() -> Self {
4135 std::default::Default::default()
4136 }
4137
4138 pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4140 self.key = v.into();
4141 self
4142 }
4143
4144 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4146 self.project_id = v.into();
4147 self
4148 }
4149
4150 pub fn set_secret<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4152 self.secret = v.into();
4153 self
4154 }
4155
4156 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4158 self.version = v.into();
4159 self
4160 }
4161}
4162
4163impl wkt::message::Message for SecretEnvVar {
4164 fn typename() -> &'static str {
4165 "type.googleapis.com/google.cloud.functions.v2.SecretEnvVar"
4166 }
4167}
4168
4169#[doc(hidden)]
4170impl<'de> serde::de::Deserialize<'de> for SecretEnvVar {
4171 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4172 where
4173 D: serde::Deserializer<'de>,
4174 {
4175 #[allow(non_camel_case_types)]
4176 #[doc(hidden)]
4177 #[derive(PartialEq, Eq, Hash)]
4178 enum __FieldTag {
4179 __key,
4180 __project_id,
4181 __secret,
4182 __version,
4183 Unknown(std::string::String),
4184 }
4185 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4186 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4187 where
4188 D: serde::Deserializer<'de>,
4189 {
4190 struct Visitor;
4191 impl<'de> serde::de::Visitor<'de> for Visitor {
4192 type Value = __FieldTag;
4193 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4194 formatter.write_str("a field name for SecretEnvVar")
4195 }
4196 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4197 where
4198 E: serde::de::Error,
4199 {
4200 use std::result::Result::Ok;
4201 use std::string::ToString;
4202 match value {
4203 "key" => Ok(__FieldTag::__key),
4204 "projectId" => Ok(__FieldTag::__project_id),
4205 "project_id" => Ok(__FieldTag::__project_id),
4206 "secret" => Ok(__FieldTag::__secret),
4207 "version" => Ok(__FieldTag::__version),
4208 _ => Ok(__FieldTag::Unknown(value.to_string())),
4209 }
4210 }
4211 }
4212 deserializer.deserialize_identifier(Visitor)
4213 }
4214 }
4215 struct Visitor;
4216 impl<'de> serde::de::Visitor<'de> for Visitor {
4217 type Value = SecretEnvVar;
4218 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4219 formatter.write_str("struct SecretEnvVar")
4220 }
4221 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4222 where
4223 A: serde::de::MapAccess<'de>,
4224 {
4225 #[allow(unused_imports)]
4226 use serde::de::Error;
4227 use std::option::Option::Some;
4228 let mut fields = std::collections::HashSet::new();
4229 let mut result = Self::Value::new();
4230 while let Some(tag) = map.next_key::<__FieldTag>()? {
4231 #[allow(clippy::match_single_binding)]
4232 match tag {
4233 __FieldTag::__key => {
4234 if !fields.insert(__FieldTag::__key) {
4235 return std::result::Result::Err(A::Error::duplicate_field(
4236 "multiple values for key",
4237 ));
4238 }
4239 result.key = map
4240 .next_value::<std::option::Option<std::string::String>>()?
4241 .unwrap_or_default();
4242 }
4243 __FieldTag::__project_id => {
4244 if !fields.insert(__FieldTag::__project_id) {
4245 return std::result::Result::Err(A::Error::duplicate_field(
4246 "multiple values for project_id",
4247 ));
4248 }
4249 result.project_id = map
4250 .next_value::<std::option::Option<std::string::String>>()?
4251 .unwrap_or_default();
4252 }
4253 __FieldTag::__secret => {
4254 if !fields.insert(__FieldTag::__secret) {
4255 return std::result::Result::Err(A::Error::duplicate_field(
4256 "multiple values for secret",
4257 ));
4258 }
4259 result.secret = map
4260 .next_value::<std::option::Option<std::string::String>>()?
4261 .unwrap_or_default();
4262 }
4263 __FieldTag::__version => {
4264 if !fields.insert(__FieldTag::__version) {
4265 return std::result::Result::Err(A::Error::duplicate_field(
4266 "multiple values for version",
4267 ));
4268 }
4269 result.version = map
4270 .next_value::<std::option::Option<std::string::String>>()?
4271 .unwrap_or_default();
4272 }
4273 __FieldTag::Unknown(key) => {
4274 let value = map.next_value::<serde_json::Value>()?;
4275 result._unknown_fields.insert(key, value);
4276 }
4277 }
4278 }
4279 std::result::Result::Ok(result)
4280 }
4281 }
4282 deserializer.deserialize_any(Visitor)
4283 }
4284}
4285
4286#[doc(hidden)]
4287impl serde::ser::Serialize for SecretEnvVar {
4288 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4289 where
4290 S: serde::ser::Serializer,
4291 {
4292 use serde::ser::SerializeMap;
4293 #[allow(unused_imports)]
4294 use std::option::Option::Some;
4295 let mut state = serializer.serialize_map(std::option::Option::None)?;
4296 if !self.key.is_empty() {
4297 state.serialize_entry("key", &self.key)?;
4298 }
4299 if !self.project_id.is_empty() {
4300 state.serialize_entry("projectId", &self.project_id)?;
4301 }
4302 if !self.secret.is_empty() {
4303 state.serialize_entry("secret", &self.secret)?;
4304 }
4305 if !self.version.is_empty() {
4306 state.serialize_entry("version", &self.version)?;
4307 }
4308 if !self._unknown_fields.is_empty() {
4309 for (key, value) in self._unknown_fields.iter() {
4310 state.serialize_entry(key, &value)?;
4311 }
4312 }
4313 state.end()
4314 }
4315}
4316
4317#[derive(Clone, Debug, Default, PartialEq)]
4321#[non_exhaustive]
4322pub struct SecretVolume {
4323 pub mount_path: std::string::String,
4329
4330 pub project_id: std::string::String,
4334
4335 pub secret: std::string::String,
4337
4338 pub versions: std::vec::Vec<crate::model::secret_volume::SecretVersion>,
4342
4343 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4344}
4345
4346impl SecretVolume {
4347 pub fn new() -> Self {
4348 std::default::Default::default()
4349 }
4350
4351 pub fn set_mount_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4353 self.mount_path = v.into();
4354 self
4355 }
4356
4357 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4359 self.project_id = v.into();
4360 self
4361 }
4362
4363 pub fn set_secret<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4365 self.secret = v.into();
4366 self
4367 }
4368
4369 pub fn set_versions<T, V>(mut self, v: T) -> Self
4371 where
4372 T: std::iter::IntoIterator<Item = V>,
4373 V: std::convert::Into<crate::model::secret_volume::SecretVersion>,
4374 {
4375 use std::iter::Iterator;
4376 self.versions = v.into_iter().map(|i| i.into()).collect();
4377 self
4378 }
4379}
4380
4381impl wkt::message::Message for SecretVolume {
4382 fn typename() -> &'static str {
4383 "type.googleapis.com/google.cloud.functions.v2.SecretVolume"
4384 }
4385}
4386
4387#[doc(hidden)]
4388impl<'de> serde::de::Deserialize<'de> for SecretVolume {
4389 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4390 where
4391 D: serde::Deserializer<'de>,
4392 {
4393 #[allow(non_camel_case_types)]
4394 #[doc(hidden)]
4395 #[derive(PartialEq, Eq, Hash)]
4396 enum __FieldTag {
4397 __mount_path,
4398 __project_id,
4399 __secret,
4400 __versions,
4401 Unknown(std::string::String),
4402 }
4403 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4404 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4405 where
4406 D: serde::Deserializer<'de>,
4407 {
4408 struct Visitor;
4409 impl<'de> serde::de::Visitor<'de> for Visitor {
4410 type Value = __FieldTag;
4411 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4412 formatter.write_str("a field name for SecretVolume")
4413 }
4414 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4415 where
4416 E: serde::de::Error,
4417 {
4418 use std::result::Result::Ok;
4419 use std::string::ToString;
4420 match value {
4421 "mountPath" => Ok(__FieldTag::__mount_path),
4422 "mount_path" => Ok(__FieldTag::__mount_path),
4423 "projectId" => Ok(__FieldTag::__project_id),
4424 "project_id" => Ok(__FieldTag::__project_id),
4425 "secret" => Ok(__FieldTag::__secret),
4426 "versions" => Ok(__FieldTag::__versions),
4427 _ => Ok(__FieldTag::Unknown(value.to_string())),
4428 }
4429 }
4430 }
4431 deserializer.deserialize_identifier(Visitor)
4432 }
4433 }
4434 struct Visitor;
4435 impl<'de> serde::de::Visitor<'de> for Visitor {
4436 type Value = SecretVolume;
4437 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4438 formatter.write_str("struct SecretVolume")
4439 }
4440 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4441 where
4442 A: serde::de::MapAccess<'de>,
4443 {
4444 #[allow(unused_imports)]
4445 use serde::de::Error;
4446 use std::option::Option::Some;
4447 let mut fields = std::collections::HashSet::new();
4448 let mut result = Self::Value::new();
4449 while let Some(tag) = map.next_key::<__FieldTag>()? {
4450 #[allow(clippy::match_single_binding)]
4451 match tag {
4452 __FieldTag::__mount_path => {
4453 if !fields.insert(__FieldTag::__mount_path) {
4454 return std::result::Result::Err(A::Error::duplicate_field(
4455 "multiple values for mount_path",
4456 ));
4457 }
4458 result.mount_path = map
4459 .next_value::<std::option::Option<std::string::String>>()?
4460 .unwrap_or_default();
4461 }
4462 __FieldTag::__project_id => {
4463 if !fields.insert(__FieldTag::__project_id) {
4464 return std::result::Result::Err(A::Error::duplicate_field(
4465 "multiple values for project_id",
4466 ));
4467 }
4468 result.project_id = map
4469 .next_value::<std::option::Option<std::string::String>>()?
4470 .unwrap_or_default();
4471 }
4472 __FieldTag::__secret => {
4473 if !fields.insert(__FieldTag::__secret) {
4474 return std::result::Result::Err(A::Error::duplicate_field(
4475 "multiple values for secret",
4476 ));
4477 }
4478 result.secret = map
4479 .next_value::<std::option::Option<std::string::String>>()?
4480 .unwrap_or_default();
4481 }
4482 __FieldTag::__versions => {
4483 if !fields.insert(__FieldTag::__versions) {
4484 return std::result::Result::Err(A::Error::duplicate_field(
4485 "multiple values for versions",
4486 ));
4487 }
4488 result.versions = map
4489 .next_value::<std::option::Option<
4490 std::vec::Vec<crate::model::secret_volume::SecretVersion>,
4491 >>()?
4492 .unwrap_or_default();
4493 }
4494 __FieldTag::Unknown(key) => {
4495 let value = map.next_value::<serde_json::Value>()?;
4496 result._unknown_fields.insert(key, value);
4497 }
4498 }
4499 }
4500 std::result::Result::Ok(result)
4501 }
4502 }
4503 deserializer.deserialize_any(Visitor)
4504 }
4505}
4506
4507#[doc(hidden)]
4508impl serde::ser::Serialize for SecretVolume {
4509 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4510 where
4511 S: serde::ser::Serializer,
4512 {
4513 use serde::ser::SerializeMap;
4514 #[allow(unused_imports)]
4515 use std::option::Option::Some;
4516 let mut state = serializer.serialize_map(std::option::Option::None)?;
4517 if !self.mount_path.is_empty() {
4518 state.serialize_entry("mountPath", &self.mount_path)?;
4519 }
4520 if !self.project_id.is_empty() {
4521 state.serialize_entry("projectId", &self.project_id)?;
4522 }
4523 if !self.secret.is_empty() {
4524 state.serialize_entry("secret", &self.secret)?;
4525 }
4526 if !self.versions.is_empty() {
4527 state.serialize_entry("versions", &self.versions)?;
4528 }
4529 if !self._unknown_fields.is_empty() {
4530 for (key, value) in self._unknown_fields.iter() {
4531 state.serialize_entry(key, &value)?;
4532 }
4533 }
4534 state.end()
4535 }
4536}
4537
4538pub mod secret_volume {
4540 #[allow(unused_imports)]
4541 use super::*;
4542
4543 #[derive(Clone, Debug, Default, PartialEq)]
4545 #[non_exhaustive]
4546 pub struct SecretVersion {
4547 pub version: std::string::String,
4551
4552 pub path: std::string::String,
4557
4558 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4559 }
4560
4561 impl SecretVersion {
4562 pub fn new() -> Self {
4563 std::default::Default::default()
4564 }
4565
4566 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4568 self.version = v.into();
4569 self
4570 }
4571
4572 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4574 self.path = v.into();
4575 self
4576 }
4577 }
4578
4579 impl wkt::message::Message for SecretVersion {
4580 fn typename() -> &'static str {
4581 "type.googleapis.com/google.cloud.functions.v2.SecretVolume.SecretVersion"
4582 }
4583 }
4584
4585 #[doc(hidden)]
4586 impl<'de> serde::de::Deserialize<'de> for SecretVersion {
4587 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4588 where
4589 D: serde::Deserializer<'de>,
4590 {
4591 #[allow(non_camel_case_types)]
4592 #[doc(hidden)]
4593 #[derive(PartialEq, Eq, Hash)]
4594 enum __FieldTag {
4595 __version,
4596 __path,
4597 Unknown(std::string::String),
4598 }
4599 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4600 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4601 where
4602 D: serde::Deserializer<'de>,
4603 {
4604 struct Visitor;
4605 impl<'de> serde::de::Visitor<'de> for Visitor {
4606 type Value = __FieldTag;
4607 fn expecting(
4608 &self,
4609 formatter: &mut std::fmt::Formatter,
4610 ) -> std::fmt::Result {
4611 formatter.write_str("a field name for SecretVersion")
4612 }
4613 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4614 where
4615 E: serde::de::Error,
4616 {
4617 use std::result::Result::Ok;
4618 use std::string::ToString;
4619 match value {
4620 "version" => Ok(__FieldTag::__version),
4621 "path" => Ok(__FieldTag::__path),
4622 _ => Ok(__FieldTag::Unknown(value.to_string())),
4623 }
4624 }
4625 }
4626 deserializer.deserialize_identifier(Visitor)
4627 }
4628 }
4629 struct Visitor;
4630 impl<'de> serde::de::Visitor<'de> for Visitor {
4631 type Value = SecretVersion;
4632 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4633 formatter.write_str("struct SecretVersion")
4634 }
4635 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4636 where
4637 A: serde::de::MapAccess<'de>,
4638 {
4639 #[allow(unused_imports)]
4640 use serde::de::Error;
4641 use std::option::Option::Some;
4642 let mut fields = std::collections::HashSet::new();
4643 let mut result = Self::Value::new();
4644 while let Some(tag) = map.next_key::<__FieldTag>()? {
4645 #[allow(clippy::match_single_binding)]
4646 match tag {
4647 __FieldTag::__version => {
4648 if !fields.insert(__FieldTag::__version) {
4649 return std::result::Result::Err(A::Error::duplicate_field(
4650 "multiple values for version",
4651 ));
4652 }
4653 result.version = map
4654 .next_value::<std::option::Option<std::string::String>>()?
4655 .unwrap_or_default();
4656 }
4657 __FieldTag::__path => {
4658 if !fields.insert(__FieldTag::__path) {
4659 return std::result::Result::Err(A::Error::duplicate_field(
4660 "multiple values for path",
4661 ));
4662 }
4663 result.path = map
4664 .next_value::<std::option::Option<std::string::String>>()?
4665 .unwrap_or_default();
4666 }
4667 __FieldTag::Unknown(key) => {
4668 let value = map.next_value::<serde_json::Value>()?;
4669 result._unknown_fields.insert(key, value);
4670 }
4671 }
4672 }
4673 std::result::Result::Ok(result)
4674 }
4675 }
4676 deserializer.deserialize_any(Visitor)
4677 }
4678 }
4679
4680 #[doc(hidden)]
4681 impl serde::ser::Serialize for SecretVersion {
4682 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4683 where
4684 S: serde::ser::Serializer,
4685 {
4686 use serde::ser::SerializeMap;
4687 #[allow(unused_imports)]
4688 use std::option::Option::Some;
4689 let mut state = serializer.serialize_map(std::option::Option::None)?;
4690 if !self.version.is_empty() {
4691 state.serialize_entry("version", &self.version)?;
4692 }
4693 if !self.path.is_empty() {
4694 state.serialize_entry("path", &self.path)?;
4695 }
4696 if !self._unknown_fields.is_empty() {
4697 for (key, value) in self._unknown_fields.iter() {
4698 state.serialize_entry(key, &value)?;
4699 }
4700 }
4701 state.end()
4702 }
4703 }
4704}
4705
4706#[derive(Clone, Debug, Default, PartialEq)]
4709#[non_exhaustive]
4710pub struct EventTrigger {
4711 pub trigger: std::string::String,
4714
4715 pub trigger_region: std::string::String,
4720
4721 pub event_type: std::string::String,
4725
4726 pub event_filters: std::vec::Vec<crate::model::EventFilter>,
4728
4729 pub pubsub_topic: std::string::String,
4737
4738 pub service_account_email: std::string::String,
4744
4745 pub retry_policy: crate::model::event_trigger::RetryPolicy,
4748
4749 pub channel: std::string::String,
4753
4754 pub service: std::string::String,
4763
4764 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4765}
4766
4767impl EventTrigger {
4768 pub fn new() -> Self {
4769 std::default::Default::default()
4770 }
4771
4772 pub fn set_trigger<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4774 self.trigger = v.into();
4775 self
4776 }
4777
4778 pub fn set_trigger_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4780 self.trigger_region = v.into();
4781 self
4782 }
4783
4784 pub fn set_event_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4786 self.event_type = v.into();
4787 self
4788 }
4789
4790 pub fn set_event_filters<T, V>(mut self, v: T) -> Self
4792 where
4793 T: std::iter::IntoIterator<Item = V>,
4794 V: std::convert::Into<crate::model::EventFilter>,
4795 {
4796 use std::iter::Iterator;
4797 self.event_filters = v.into_iter().map(|i| i.into()).collect();
4798 self
4799 }
4800
4801 pub fn set_pubsub_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4803 self.pubsub_topic = v.into();
4804 self
4805 }
4806
4807 pub fn set_service_account_email<T: std::convert::Into<std::string::String>>(
4809 mut self,
4810 v: T,
4811 ) -> Self {
4812 self.service_account_email = v.into();
4813 self
4814 }
4815
4816 pub fn set_retry_policy<T: std::convert::Into<crate::model::event_trigger::RetryPolicy>>(
4818 mut self,
4819 v: T,
4820 ) -> Self {
4821 self.retry_policy = v.into();
4822 self
4823 }
4824
4825 pub fn set_channel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4827 self.channel = v.into();
4828 self
4829 }
4830
4831 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4833 self.service = v.into();
4834 self
4835 }
4836}
4837
4838impl wkt::message::Message for EventTrigger {
4839 fn typename() -> &'static str {
4840 "type.googleapis.com/google.cloud.functions.v2.EventTrigger"
4841 }
4842}
4843
4844#[doc(hidden)]
4845impl<'de> serde::de::Deserialize<'de> for EventTrigger {
4846 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4847 where
4848 D: serde::Deserializer<'de>,
4849 {
4850 #[allow(non_camel_case_types)]
4851 #[doc(hidden)]
4852 #[derive(PartialEq, Eq, Hash)]
4853 enum __FieldTag {
4854 __trigger,
4855 __trigger_region,
4856 __event_type,
4857 __event_filters,
4858 __pubsub_topic,
4859 __service_account_email,
4860 __retry_policy,
4861 __channel,
4862 __service,
4863 Unknown(std::string::String),
4864 }
4865 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4866 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4867 where
4868 D: serde::Deserializer<'de>,
4869 {
4870 struct Visitor;
4871 impl<'de> serde::de::Visitor<'de> for Visitor {
4872 type Value = __FieldTag;
4873 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4874 formatter.write_str("a field name for EventTrigger")
4875 }
4876 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4877 where
4878 E: serde::de::Error,
4879 {
4880 use std::result::Result::Ok;
4881 use std::string::ToString;
4882 match value {
4883 "trigger" => Ok(__FieldTag::__trigger),
4884 "triggerRegion" => Ok(__FieldTag::__trigger_region),
4885 "trigger_region" => Ok(__FieldTag::__trigger_region),
4886 "eventType" => Ok(__FieldTag::__event_type),
4887 "event_type" => Ok(__FieldTag::__event_type),
4888 "eventFilters" => Ok(__FieldTag::__event_filters),
4889 "event_filters" => Ok(__FieldTag::__event_filters),
4890 "pubsubTopic" => Ok(__FieldTag::__pubsub_topic),
4891 "pubsub_topic" => Ok(__FieldTag::__pubsub_topic),
4892 "serviceAccountEmail" => Ok(__FieldTag::__service_account_email),
4893 "service_account_email" => Ok(__FieldTag::__service_account_email),
4894 "retryPolicy" => Ok(__FieldTag::__retry_policy),
4895 "retry_policy" => Ok(__FieldTag::__retry_policy),
4896 "channel" => Ok(__FieldTag::__channel),
4897 "service" => Ok(__FieldTag::__service),
4898 _ => Ok(__FieldTag::Unknown(value.to_string())),
4899 }
4900 }
4901 }
4902 deserializer.deserialize_identifier(Visitor)
4903 }
4904 }
4905 struct Visitor;
4906 impl<'de> serde::de::Visitor<'de> for Visitor {
4907 type Value = EventTrigger;
4908 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4909 formatter.write_str("struct EventTrigger")
4910 }
4911 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4912 where
4913 A: serde::de::MapAccess<'de>,
4914 {
4915 #[allow(unused_imports)]
4916 use serde::de::Error;
4917 use std::option::Option::Some;
4918 let mut fields = std::collections::HashSet::new();
4919 let mut result = Self::Value::new();
4920 while let Some(tag) = map.next_key::<__FieldTag>()? {
4921 #[allow(clippy::match_single_binding)]
4922 match tag {
4923 __FieldTag::__trigger => {
4924 if !fields.insert(__FieldTag::__trigger) {
4925 return std::result::Result::Err(A::Error::duplicate_field(
4926 "multiple values for trigger",
4927 ));
4928 }
4929 result.trigger = map
4930 .next_value::<std::option::Option<std::string::String>>()?
4931 .unwrap_or_default();
4932 }
4933 __FieldTag::__trigger_region => {
4934 if !fields.insert(__FieldTag::__trigger_region) {
4935 return std::result::Result::Err(A::Error::duplicate_field(
4936 "multiple values for trigger_region",
4937 ));
4938 }
4939 result.trigger_region = map
4940 .next_value::<std::option::Option<std::string::String>>()?
4941 .unwrap_or_default();
4942 }
4943 __FieldTag::__event_type => {
4944 if !fields.insert(__FieldTag::__event_type) {
4945 return std::result::Result::Err(A::Error::duplicate_field(
4946 "multiple values for event_type",
4947 ));
4948 }
4949 result.event_type = map
4950 .next_value::<std::option::Option<std::string::String>>()?
4951 .unwrap_or_default();
4952 }
4953 __FieldTag::__event_filters => {
4954 if !fields.insert(__FieldTag::__event_filters) {
4955 return std::result::Result::Err(A::Error::duplicate_field(
4956 "multiple values for event_filters",
4957 ));
4958 }
4959 result.event_filters = map.next_value::<std::option::Option<std::vec::Vec<crate::model::EventFilter>>>()?.unwrap_or_default();
4960 }
4961 __FieldTag::__pubsub_topic => {
4962 if !fields.insert(__FieldTag::__pubsub_topic) {
4963 return std::result::Result::Err(A::Error::duplicate_field(
4964 "multiple values for pubsub_topic",
4965 ));
4966 }
4967 result.pubsub_topic = map
4968 .next_value::<std::option::Option<std::string::String>>()?
4969 .unwrap_or_default();
4970 }
4971 __FieldTag::__service_account_email => {
4972 if !fields.insert(__FieldTag::__service_account_email) {
4973 return std::result::Result::Err(A::Error::duplicate_field(
4974 "multiple values for service_account_email",
4975 ));
4976 }
4977 result.service_account_email = map
4978 .next_value::<std::option::Option<std::string::String>>()?
4979 .unwrap_or_default();
4980 }
4981 __FieldTag::__retry_policy => {
4982 if !fields.insert(__FieldTag::__retry_policy) {
4983 return std::result::Result::Err(A::Error::duplicate_field(
4984 "multiple values for retry_policy",
4985 ));
4986 }
4987 result.retry_policy = map.next_value::<std::option::Option<crate::model::event_trigger::RetryPolicy>>()?.unwrap_or_default();
4988 }
4989 __FieldTag::__channel => {
4990 if !fields.insert(__FieldTag::__channel) {
4991 return std::result::Result::Err(A::Error::duplicate_field(
4992 "multiple values for channel",
4993 ));
4994 }
4995 result.channel = map
4996 .next_value::<std::option::Option<std::string::String>>()?
4997 .unwrap_or_default();
4998 }
4999 __FieldTag::__service => {
5000 if !fields.insert(__FieldTag::__service) {
5001 return std::result::Result::Err(A::Error::duplicate_field(
5002 "multiple values for service",
5003 ));
5004 }
5005 result.service = map
5006 .next_value::<std::option::Option<std::string::String>>()?
5007 .unwrap_or_default();
5008 }
5009 __FieldTag::Unknown(key) => {
5010 let value = map.next_value::<serde_json::Value>()?;
5011 result._unknown_fields.insert(key, value);
5012 }
5013 }
5014 }
5015 std::result::Result::Ok(result)
5016 }
5017 }
5018 deserializer.deserialize_any(Visitor)
5019 }
5020}
5021
5022#[doc(hidden)]
5023impl serde::ser::Serialize for EventTrigger {
5024 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5025 where
5026 S: serde::ser::Serializer,
5027 {
5028 use serde::ser::SerializeMap;
5029 #[allow(unused_imports)]
5030 use std::option::Option::Some;
5031 let mut state = serializer.serialize_map(std::option::Option::None)?;
5032 if !self.trigger.is_empty() {
5033 state.serialize_entry("trigger", &self.trigger)?;
5034 }
5035 if !self.trigger_region.is_empty() {
5036 state.serialize_entry("triggerRegion", &self.trigger_region)?;
5037 }
5038 if !self.event_type.is_empty() {
5039 state.serialize_entry("eventType", &self.event_type)?;
5040 }
5041 if !self.event_filters.is_empty() {
5042 state.serialize_entry("eventFilters", &self.event_filters)?;
5043 }
5044 if !self.pubsub_topic.is_empty() {
5045 state.serialize_entry("pubsubTopic", &self.pubsub_topic)?;
5046 }
5047 if !self.service_account_email.is_empty() {
5048 state.serialize_entry("serviceAccountEmail", &self.service_account_email)?;
5049 }
5050 if !wkt::internal::is_default(&self.retry_policy) {
5051 state.serialize_entry("retryPolicy", &self.retry_policy)?;
5052 }
5053 if !self.channel.is_empty() {
5054 state.serialize_entry("channel", &self.channel)?;
5055 }
5056 if !self.service.is_empty() {
5057 state.serialize_entry("service", &self.service)?;
5058 }
5059 if !self._unknown_fields.is_empty() {
5060 for (key, value) in self._unknown_fields.iter() {
5061 state.serialize_entry(key, &value)?;
5062 }
5063 }
5064 state.end()
5065 }
5066}
5067
5068pub mod event_trigger {
5070 #[allow(unused_imports)]
5071 use super::*;
5072
5073 #[derive(Clone, Debug, PartialEq)]
5090 #[non_exhaustive]
5091 pub enum RetryPolicy {
5092 Unspecified,
5094 DoNotRetry,
5096 Retry,
5099 UnknownValue(retry_policy::UnknownValue),
5104 }
5105
5106 #[doc(hidden)]
5107 pub mod retry_policy {
5108 #[allow(unused_imports)]
5109 use super::*;
5110 #[derive(Clone, Debug, PartialEq)]
5111 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5112 }
5113
5114 impl RetryPolicy {
5115 pub fn value(&self) -> std::option::Option<i32> {
5120 match self {
5121 Self::Unspecified => std::option::Option::Some(0),
5122 Self::DoNotRetry => std::option::Option::Some(1),
5123 Self::Retry => std::option::Option::Some(2),
5124 Self::UnknownValue(u) => u.0.value(),
5125 }
5126 }
5127
5128 pub fn name(&self) -> std::option::Option<&str> {
5133 match self {
5134 Self::Unspecified => std::option::Option::Some("RETRY_POLICY_UNSPECIFIED"),
5135 Self::DoNotRetry => std::option::Option::Some("RETRY_POLICY_DO_NOT_RETRY"),
5136 Self::Retry => std::option::Option::Some("RETRY_POLICY_RETRY"),
5137 Self::UnknownValue(u) => u.0.name(),
5138 }
5139 }
5140 }
5141
5142 impl std::default::Default for RetryPolicy {
5143 fn default() -> Self {
5144 use std::convert::From;
5145 Self::from(0)
5146 }
5147 }
5148
5149 impl std::fmt::Display for RetryPolicy {
5150 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5151 wkt::internal::display_enum(f, self.name(), self.value())
5152 }
5153 }
5154
5155 impl std::convert::From<i32> for RetryPolicy {
5156 fn from(value: i32) -> Self {
5157 match value {
5158 0 => Self::Unspecified,
5159 1 => Self::DoNotRetry,
5160 2 => Self::Retry,
5161 _ => Self::UnknownValue(retry_policy::UnknownValue(
5162 wkt::internal::UnknownEnumValue::Integer(value),
5163 )),
5164 }
5165 }
5166 }
5167
5168 impl std::convert::From<&str> for RetryPolicy {
5169 fn from(value: &str) -> Self {
5170 use std::string::ToString;
5171 match value {
5172 "RETRY_POLICY_UNSPECIFIED" => Self::Unspecified,
5173 "RETRY_POLICY_DO_NOT_RETRY" => Self::DoNotRetry,
5174 "RETRY_POLICY_RETRY" => Self::Retry,
5175 _ => Self::UnknownValue(retry_policy::UnknownValue(
5176 wkt::internal::UnknownEnumValue::String(value.to_string()),
5177 )),
5178 }
5179 }
5180 }
5181
5182 impl serde::ser::Serialize for RetryPolicy {
5183 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5184 where
5185 S: serde::Serializer,
5186 {
5187 match self {
5188 Self::Unspecified => serializer.serialize_i32(0),
5189 Self::DoNotRetry => serializer.serialize_i32(1),
5190 Self::Retry => serializer.serialize_i32(2),
5191 Self::UnknownValue(u) => u.0.serialize(serializer),
5192 }
5193 }
5194 }
5195
5196 impl<'de> serde::de::Deserialize<'de> for RetryPolicy {
5197 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5198 where
5199 D: serde::Deserializer<'de>,
5200 {
5201 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RetryPolicy>::new(
5202 ".google.cloud.functions.v2.EventTrigger.RetryPolicy",
5203 ))
5204 }
5205 }
5206}
5207
5208#[derive(Clone, Debug, Default, PartialEq)]
5210#[non_exhaustive]
5211pub struct EventFilter {
5212 pub attribute: std::string::String,
5214
5215 pub value: std::string::String,
5217
5218 pub operator: std::string::String,
5223
5224 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5225}
5226
5227impl EventFilter {
5228 pub fn new() -> Self {
5229 std::default::Default::default()
5230 }
5231
5232 pub fn set_attribute<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5234 self.attribute = v.into();
5235 self
5236 }
5237
5238 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5240 self.value = v.into();
5241 self
5242 }
5243
5244 pub fn set_operator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5246 self.operator = v.into();
5247 self
5248 }
5249}
5250
5251impl wkt::message::Message for EventFilter {
5252 fn typename() -> &'static str {
5253 "type.googleapis.com/google.cloud.functions.v2.EventFilter"
5254 }
5255}
5256
5257#[doc(hidden)]
5258impl<'de> serde::de::Deserialize<'de> for EventFilter {
5259 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5260 where
5261 D: serde::Deserializer<'de>,
5262 {
5263 #[allow(non_camel_case_types)]
5264 #[doc(hidden)]
5265 #[derive(PartialEq, Eq, Hash)]
5266 enum __FieldTag {
5267 __attribute,
5268 __value,
5269 __operator,
5270 Unknown(std::string::String),
5271 }
5272 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5273 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5274 where
5275 D: serde::Deserializer<'de>,
5276 {
5277 struct Visitor;
5278 impl<'de> serde::de::Visitor<'de> for Visitor {
5279 type Value = __FieldTag;
5280 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5281 formatter.write_str("a field name for EventFilter")
5282 }
5283 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5284 where
5285 E: serde::de::Error,
5286 {
5287 use std::result::Result::Ok;
5288 use std::string::ToString;
5289 match value {
5290 "attribute" => Ok(__FieldTag::__attribute),
5291 "value" => Ok(__FieldTag::__value),
5292 "operator" => Ok(__FieldTag::__operator),
5293 _ => Ok(__FieldTag::Unknown(value.to_string())),
5294 }
5295 }
5296 }
5297 deserializer.deserialize_identifier(Visitor)
5298 }
5299 }
5300 struct Visitor;
5301 impl<'de> serde::de::Visitor<'de> for Visitor {
5302 type Value = EventFilter;
5303 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5304 formatter.write_str("struct EventFilter")
5305 }
5306 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5307 where
5308 A: serde::de::MapAccess<'de>,
5309 {
5310 #[allow(unused_imports)]
5311 use serde::de::Error;
5312 use std::option::Option::Some;
5313 let mut fields = std::collections::HashSet::new();
5314 let mut result = Self::Value::new();
5315 while let Some(tag) = map.next_key::<__FieldTag>()? {
5316 #[allow(clippy::match_single_binding)]
5317 match tag {
5318 __FieldTag::__attribute => {
5319 if !fields.insert(__FieldTag::__attribute) {
5320 return std::result::Result::Err(A::Error::duplicate_field(
5321 "multiple values for attribute",
5322 ));
5323 }
5324 result.attribute = map
5325 .next_value::<std::option::Option<std::string::String>>()?
5326 .unwrap_or_default();
5327 }
5328 __FieldTag::__value => {
5329 if !fields.insert(__FieldTag::__value) {
5330 return std::result::Result::Err(A::Error::duplicate_field(
5331 "multiple values for value",
5332 ));
5333 }
5334 result.value = map
5335 .next_value::<std::option::Option<std::string::String>>()?
5336 .unwrap_or_default();
5337 }
5338 __FieldTag::__operator => {
5339 if !fields.insert(__FieldTag::__operator) {
5340 return std::result::Result::Err(A::Error::duplicate_field(
5341 "multiple values for operator",
5342 ));
5343 }
5344 result.operator = map
5345 .next_value::<std::option::Option<std::string::String>>()?
5346 .unwrap_or_default();
5347 }
5348 __FieldTag::Unknown(key) => {
5349 let value = map.next_value::<serde_json::Value>()?;
5350 result._unknown_fields.insert(key, value);
5351 }
5352 }
5353 }
5354 std::result::Result::Ok(result)
5355 }
5356 }
5357 deserializer.deserialize_any(Visitor)
5358 }
5359}
5360
5361#[doc(hidden)]
5362impl serde::ser::Serialize for EventFilter {
5363 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5364 where
5365 S: serde::ser::Serializer,
5366 {
5367 use serde::ser::SerializeMap;
5368 #[allow(unused_imports)]
5369 use std::option::Option::Some;
5370 let mut state = serializer.serialize_map(std::option::Option::None)?;
5371 if !self.attribute.is_empty() {
5372 state.serialize_entry("attribute", &self.attribute)?;
5373 }
5374 if !self.value.is_empty() {
5375 state.serialize_entry("value", &self.value)?;
5376 }
5377 if !self.operator.is_empty() {
5378 state.serialize_entry("operator", &self.operator)?;
5379 }
5380 if !self._unknown_fields.is_empty() {
5381 for (key, value) in self._unknown_fields.iter() {
5382 state.serialize_entry(key, &value)?;
5383 }
5384 }
5385 state.end()
5386 }
5387}
5388
5389#[derive(Clone, Debug, Default, PartialEq)]
5391#[non_exhaustive]
5392pub struct GetFunctionRequest {
5393 pub name: std::string::String,
5395
5396 pub revision: std::string::String,
5403
5404 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5405}
5406
5407impl GetFunctionRequest {
5408 pub fn new() -> Self {
5409 std::default::Default::default()
5410 }
5411
5412 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5414 self.name = v.into();
5415 self
5416 }
5417
5418 pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5420 self.revision = v.into();
5421 self
5422 }
5423}
5424
5425impl wkt::message::Message for GetFunctionRequest {
5426 fn typename() -> &'static str {
5427 "type.googleapis.com/google.cloud.functions.v2.GetFunctionRequest"
5428 }
5429}
5430
5431#[doc(hidden)]
5432impl<'de> serde::de::Deserialize<'de> for GetFunctionRequest {
5433 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5434 where
5435 D: serde::Deserializer<'de>,
5436 {
5437 #[allow(non_camel_case_types)]
5438 #[doc(hidden)]
5439 #[derive(PartialEq, Eq, Hash)]
5440 enum __FieldTag {
5441 __name,
5442 __revision,
5443 Unknown(std::string::String),
5444 }
5445 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5446 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5447 where
5448 D: serde::Deserializer<'de>,
5449 {
5450 struct Visitor;
5451 impl<'de> serde::de::Visitor<'de> for Visitor {
5452 type Value = __FieldTag;
5453 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5454 formatter.write_str("a field name for GetFunctionRequest")
5455 }
5456 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5457 where
5458 E: serde::de::Error,
5459 {
5460 use std::result::Result::Ok;
5461 use std::string::ToString;
5462 match value {
5463 "name" => Ok(__FieldTag::__name),
5464 "revision" => Ok(__FieldTag::__revision),
5465 _ => Ok(__FieldTag::Unknown(value.to_string())),
5466 }
5467 }
5468 }
5469 deserializer.deserialize_identifier(Visitor)
5470 }
5471 }
5472 struct Visitor;
5473 impl<'de> serde::de::Visitor<'de> for Visitor {
5474 type Value = GetFunctionRequest;
5475 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5476 formatter.write_str("struct GetFunctionRequest")
5477 }
5478 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5479 where
5480 A: serde::de::MapAccess<'de>,
5481 {
5482 #[allow(unused_imports)]
5483 use serde::de::Error;
5484 use std::option::Option::Some;
5485 let mut fields = std::collections::HashSet::new();
5486 let mut result = Self::Value::new();
5487 while let Some(tag) = map.next_key::<__FieldTag>()? {
5488 #[allow(clippy::match_single_binding)]
5489 match tag {
5490 __FieldTag::__name => {
5491 if !fields.insert(__FieldTag::__name) {
5492 return std::result::Result::Err(A::Error::duplicate_field(
5493 "multiple values for name",
5494 ));
5495 }
5496 result.name = map
5497 .next_value::<std::option::Option<std::string::String>>()?
5498 .unwrap_or_default();
5499 }
5500 __FieldTag::__revision => {
5501 if !fields.insert(__FieldTag::__revision) {
5502 return std::result::Result::Err(A::Error::duplicate_field(
5503 "multiple values for revision",
5504 ));
5505 }
5506 result.revision = map
5507 .next_value::<std::option::Option<std::string::String>>()?
5508 .unwrap_or_default();
5509 }
5510 __FieldTag::Unknown(key) => {
5511 let value = map.next_value::<serde_json::Value>()?;
5512 result._unknown_fields.insert(key, value);
5513 }
5514 }
5515 }
5516 std::result::Result::Ok(result)
5517 }
5518 }
5519 deserializer.deserialize_any(Visitor)
5520 }
5521}
5522
5523#[doc(hidden)]
5524impl serde::ser::Serialize for GetFunctionRequest {
5525 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5526 where
5527 S: serde::ser::Serializer,
5528 {
5529 use serde::ser::SerializeMap;
5530 #[allow(unused_imports)]
5531 use std::option::Option::Some;
5532 let mut state = serializer.serialize_map(std::option::Option::None)?;
5533 if !self.name.is_empty() {
5534 state.serialize_entry("name", &self.name)?;
5535 }
5536 if !self.revision.is_empty() {
5537 state.serialize_entry("revision", &self.revision)?;
5538 }
5539 if !self._unknown_fields.is_empty() {
5540 for (key, value) in self._unknown_fields.iter() {
5541 state.serialize_entry(key, &value)?;
5542 }
5543 }
5544 state.end()
5545 }
5546}
5547
5548#[derive(Clone, Debug, Default, PartialEq)]
5550#[non_exhaustive]
5551pub struct ListFunctionsRequest {
5552 pub parent: std::string::String,
5559
5560 pub page_size: i32,
5565
5566 pub page_token: std::string::String,
5571
5572 pub filter: std::string::String,
5575
5576 pub order_by: std::string::String,
5580
5581 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5582}
5583
5584impl ListFunctionsRequest {
5585 pub fn new() -> Self {
5586 std::default::Default::default()
5587 }
5588
5589 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5591 self.parent = v.into();
5592 self
5593 }
5594
5595 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5597 self.page_size = v.into();
5598 self
5599 }
5600
5601 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5603 self.page_token = v.into();
5604 self
5605 }
5606
5607 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5609 self.filter = v.into();
5610 self
5611 }
5612
5613 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5615 self.order_by = v.into();
5616 self
5617 }
5618}
5619
5620impl wkt::message::Message for ListFunctionsRequest {
5621 fn typename() -> &'static str {
5622 "type.googleapis.com/google.cloud.functions.v2.ListFunctionsRequest"
5623 }
5624}
5625
5626#[doc(hidden)]
5627impl<'de> serde::de::Deserialize<'de> for ListFunctionsRequest {
5628 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5629 where
5630 D: serde::Deserializer<'de>,
5631 {
5632 #[allow(non_camel_case_types)]
5633 #[doc(hidden)]
5634 #[derive(PartialEq, Eq, Hash)]
5635 enum __FieldTag {
5636 __parent,
5637 __page_size,
5638 __page_token,
5639 __filter,
5640 __order_by,
5641 Unknown(std::string::String),
5642 }
5643 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5644 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5645 where
5646 D: serde::Deserializer<'de>,
5647 {
5648 struct Visitor;
5649 impl<'de> serde::de::Visitor<'de> for Visitor {
5650 type Value = __FieldTag;
5651 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5652 formatter.write_str("a field name for ListFunctionsRequest")
5653 }
5654 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5655 where
5656 E: serde::de::Error,
5657 {
5658 use std::result::Result::Ok;
5659 use std::string::ToString;
5660 match value {
5661 "parent" => Ok(__FieldTag::__parent),
5662 "pageSize" => Ok(__FieldTag::__page_size),
5663 "page_size" => Ok(__FieldTag::__page_size),
5664 "pageToken" => Ok(__FieldTag::__page_token),
5665 "page_token" => Ok(__FieldTag::__page_token),
5666 "filter" => Ok(__FieldTag::__filter),
5667 "orderBy" => Ok(__FieldTag::__order_by),
5668 "order_by" => Ok(__FieldTag::__order_by),
5669 _ => Ok(__FieldTag::Unknown(value.to_string())),
5670 }
5671 }
5672 }
5673 deserializer.deserialize_identifier(Visitor)
5674 }
5675 }
5676 struct Visitor;
5677 impl<'de> serde::de::Visitor<'de> for Visitor {
5678 type Value = ListFunctionsRequest;
5679 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5680 formatter.write_str("struct ListFunctionsRequest")
5681 }
5682 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5683 where
5684 A: serde::de::MapAccess<'de>,
5685 {
5686 #[allow(unused_imports)]
5687 use serde::de::Error;
5688 use std::option::Option::Some;
5689 let mut fields = std::collections::HashSet::new();
5690 let mut result = Self::Value::new();
5691 while let Some(tag) = map.next_key::<__FieldTag>()? {
5692 #[allow(clippy::match_single_binding)]
5693 match tag {
5694 __FieldTag::__parent => {
5695 if !fields.insert(__FieldTag::__parent) {
5696 return std::result::Result::Err(A::Error::duplicate_field(
5697 "multiple values for parent",
5698 ));
5699 }
5700 result.parent = map
5701 .next_value::<std::option::Option<std::string::String>>()?
5702 .unwrap_or_default();
5703 }
5704 __FieldTag::__page_size => {
5705 if !fields.insert(__FieldTag::__page_size) {
5706 return std::result::Result::Err(A::Error::duplicate_field(
5707 "multiple values for page_size",
5708 ));
5709 }
5710 struct __With(std::option::Option<i32>);
5711 impl<'de> serde::de::Deserialize<'de> for __With {
5712 fn deserialize<D>(
5713 deserializer: D,
5714 ) -> std::result::Result<Self, D::Error>
5715 where
5716 D: serde::de::Deserializer<'de>,
5717 {
5718 serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
5719 }
5720 }
5721 result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
5722 }
5723 __FieldTag::__page_token => {
5724 if !fields.insert(__FieldTag::__page_token) {
5725 return std::result::Result::Err(A::Error::duplicate_field(
5726 "multiple values for page_token",
5727 ));
5728 }
5729 result.page_token = map
5730 .next_value::<std::option::Option<std::string::String>>()?
5731 .unwrap_or_default();
5732 }
5733 __FieldTag::__filter => {
5734 if !fields.insert(__FieldTag::__filter) {
5735 return std::result::Result::Err(A::Error::duplicate_field(
5736 "multiple values for filter",
5737 ));
5738 }
5739 result.filter = map
5740 .next_value::<std::option::Option<std::string::String>>()?
5741 .unwrap_or_default();
5742 }
5743 __FieldTag::__order_by => {
5744 if !fields.insert(__FieldTag::__order_by) {
5745 return std::result::Result::Err(A::Error::duplicate_field(
5746 "multiple values for order_by",
5747 ));
5748 }
5749 result.order_by = map
5750 .next_value::<std::option::Option<std::string::String>>()?
5751 .unwrap_or_default();
5752 }
5753 __FieldTag::Unknown(key) => {
5754 let value = map.next_value::<serde_json::Value>()?;
5755 result._unknown_fields.insert(key, value);
5756 }
5757 }
5758 }
5759 std::result::Result::Ok(result)
5760 }
5761 }
5762 deserializer.deserialize_any(Visitor)
5763 }
5764}
5765
5766#[doc(hidden)]
5767impl serde::ser::Serialize for ListFunctionsRequest {
5768 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5769 where
5770 S: serde::ser::Serializer,
5771 {
5772 use serde::ser::SerializeMap;
5773 #[allow(unused_imports)]
5774 use std::option::Option::Some;
5775 let mut state = serializer.serialize_map(std::option::Option::None)?;
5776 if !self.parent.is_empty() {
5777 state.serialize_entry("parent", &self.parent)?;
5778 }
5779 if !wkt::internal::is_default(&self.page_size) {
5780 struct __With<'a>(&'a i32);
5781 impl<'a> serde::ser::Serialize for __With<'a> {
5782 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5783 where
5784 S: serde::ser::Serializer,
5785 {
5786 serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
5787 }
5788 }
5789 state.serialize_entry("pageSize", &__With(&self.page_size))?;
5790 }
5791 if !self.page_token.is_empty() {
5792 state.serialize_entry("pageToken", &self.page_token)?;
5793 }
5794 if !self.filter.is_empty() {
5795 state.serialize_entry("filter", &self.filter)?;
5796 }
5797 if !self.order_by.is_empty() {
5798 state.serialize_entry("orderBy", &self.order_by)?;
5799 }
5800 if !self._unknown_fields.is_empty() {
5801 for (key, value) in self._unknown_fields.iter() {
5802 state.serialize_entry(key, &value)?;
5803 }
5804 }
5805 state.end()
5806 }
5807}
5808
5809#[derive(Clone, Debug, Default, PartialEq)]
5811#[non_exhaustive]
5812pub struct ListFunctionsResponse {
5813 pub functions: std::vec::Vec<crate::model::Function>,
5815
5816 pub next_page_token: std::string::String,
5819
5820 pub unreachable: std::vec::Vec<std::string::String>,
5823
5824 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5825}
5826
5827impl ListFunctionsResponse {
5828 pub fn new() -> Self {
5829 std::default::Default::default()
5830 }
5831
5832 pub fn set_functions<T, V>(mut self, v: T) -> Self
5834 where
5835 T: std::iter::IntoIterator<Item = V>,
5836 V: std::convert::Into<crate::model::Function>,
5837 {
5838 use std::iter::Iterator;
5839 self.functions = v.into_iter().map(|i| i.into()).collect();
5840 self
5841 }
5842
5843 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5845 self.next_page_token = v.into();
5846 self
5847 }
5848
5849 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5851 where
5852 T: std::iter::IntoIterator<Item = V>,
5853 V: std::convert::Into<std::string::String>,
5854 {
5855 use std::iter::Iterator;
5856 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5857 self
5858 }
5859}
5860
5861impl wkt::message::Message for ListFunctionsResponse {
5862 fn typename() -> &'static str {
5863 "type.googleapis.com/google.cloud.functions.v2.ListFunctionsResponse"
5864 }
5865}
5866
5867#[doc(hidden)]
5868impl gax::paginator::internal::PageableResponse for ListFunctionsResponse {
5869 type PageItem = crate::model::Function;
5870
5871 fn items(self) -> std::vec::Vec<Self::PageItem> {
5872 self.functions
5873 }
5874
5875 fn next_page_token(&self) -> std::string::String {
5876 use std::clone::Clone;
5877 self.next_page_token.clone()
5878 }
5879}
5880
5881#[doc(hidden)]
5882impl<'de> serde::de::Deserialize<'de> for ListFunctionsResponse {
5883 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5884 where
5885 D: serde::Deserializer<'de>,
5886 {
5887 #[allow(non_camel_case_types)]
5888 #[doc(hidden)]
5889 #[derive(PartialEq, Eq, Hash)]
5890 enum __FieldTag {
5891 __functions,
5892 __next_page_token,
5893 __unreachable,
5894 Unknown(std::string::String),
5895 }
5896 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5897 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5898 where
5899 D: serde::Deserializer<'de>,
5900 {
5901 struct Visitor;
5902 impl<'de> serde::de::Visitor<'de> for Visitor {
5903 type Value = __FieldTag;
5904 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5905 formatter.write_str("a field name for ListFunctionsResponse")
5906 }
5907 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5908 where
5909 E: serde::de::Error,
5910 {
5911 use std::result::Result::Ok;
5912 use std::string::ToString;
5913 match value {
5914 "functions" => Ok(__FieldTag::__functions),
5915 "nextPageToken" => Ok(__FieldTag::__next_page_token),
5916 "next_page_token" => Ok(__FieldTag::__next_page_token),
5917 "unreachable" => Ok(__FieldTag::__unreachable),
5918 _ => Ok(__FieldTag::Unknown(value.to_string())),
5919 }
5920 }
5921 }
5922 deserializer.deserialize_identifier(Visitor)
5923 }
5924 }
5925 struct Visitor;
5926 impl<'de> serde::de::Visitor<'de> for Visitor {
5927 type Value = ListFunctionsResponse;
5928 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5929 formatter.write_str("struct ListFunctionsResponse")
5930 }
5931 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5932 where
5933 A: serde::de::MapAccess<'de>,
5934 {
5935 #[allow(unused_imports)]
5936 use serde::de::Error;
5937 use std::option::Option::Some;
5938 let mut fields = std::collections::HashSet::new();
5939 let mut result = Self::Value::new();
5940 while let Some(tag) = map.next_key::<__FieldTag>()? {
5941 #[allow(clippy::match_single_binding)]
5942 match tag {
5943 __FieldTag::__functions => {
5944 if !fields.insert(__FieldTag::__functions) {
5945 return std::result::Result::Err(A::Error::duplicate_field(
5946 "multiple values for functions",
5947 ));
5948 }
5949 result.functions = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Function>>>()?.unwrap_or_default();
5950 }
5951 __FieldTag::__next_page_token => {
5952 if !fields.insert(__FieldTag::__next_page_token) {
5953 return std::result::Result::Err(A::Error::duplicate_field(
5954 "multiple values for next_page_token",
5955 ));
5956 }
5957 result.next_page_token = map
5958 .next_value::<std::option::Option<std::string::String>>()?
5959 .unwrap_or_default();
5960 }
5961 __FieldTag::__unreachable => {
5962 if !fields.insert(__FieldTag::__unreachable) {
5963 return std::result::Result::Err(A::Error::duplicate_field(
5964 "multiple values for unreachable",
5965 ));
5966 }
5967 result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
5968 }
5969 __FieldTag::Unknown(key) => {
5970 let value = map.next_value::<serde_json::Value>()?;
5971 result._unknown_fields.insert(key, value);
5972 }
5973 }
5974 }
5975 std::result::Result::Ok(result)
5976 }
5977 }
5978 deserializer.deserialize_any(Visitor)
5979 }
5980}
5981
5982#[doc(hidden)]
5983impl serde::ser::Serialize for ListFunctionsResponse {
5984 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5985 where
5986 S: serde::ser::Serializer,
5987 {
5988 use serde::ser::SerializeMap;
5989 #[allow(unused_imports)]
5990 use std::option::Option::Some;
5991 let mut state = serializer.serialize_map(std::option::Option::None)?;
5992 if !self.functions.is_empty() {
5993 state.serialize_entry("functions", &self.functions)?;
5994 }
5995 if !self.next_page_token.is_empty() {
5996 state.serialize_entry("nextPageToken", &self.next_page_token)?;
5997 }
5998 if !self.unreachable.is_empty() {
5999 state.serialize_entry("unreachable", &self.unreachable)?;
6000 }
6001 if !self._unknown_fields.is_empty() {
6002 for (key, value) in self._unknown_fields.iter() {
6003 state.serialize_entry(key, &value)?;
6004 }
6005 }
6006 state.end()
6007 }
6008}
6009
6010#[derive(Clone, Debug, Default, PartialEq)]
6012#[non_exhaustive]
6013pub struct CreateFunctionRequest {
6014 pub parent: std::string::String,
6017
6018 pub function: std::option::Option<crate::model::Function>,
6020
6021 pub function_id: std::string::String,
6027
6028 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6029}
6030
6031impl CreateFunctionRequest {
6032 pub fn new() -> Self {
6033 std::default::Default::default()
6034 }
6035
6036 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6038 self.parent = v.into();
6039 self
6040 }
6041
6042 pub fn set_function<T>(mut self, v: T) -> Self
6044 where
6045 T: std::convert::Into<crate::model::Function>,
6046 {
6047 self.function = std::option::Option::Some(v.into());
6048 self
6049 }
6050
6051 pub fn set_or_clear_function<T>(mut self, v: std::option::Option<T>) -> Self
6053 where
6054 T: std::convert::Into<crate::model::Function>,
6055 {
6056 self.function = v.map(|x| x.into());
6057 self
6058 }
6059
6060 pub fn set_function_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6062 self.function_id = v.into();
6063 self
6064 }
6065}
6066
6067impl wkt::message::Message for CreateFunctionRequest {
6068 fn typename() -> &'static str {
6069 "type.googleapis.com/google.cloud.functions.v2.CreateFunctionRequest"
6070 }
6071}
6072
6073#[doc(hidden)]
6074impl<'de> serde::de::Deserialize<'de> for CreateFunctionRequest {
6075 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6076 where
6077 D: serde::Deserializer<'de>,
6078 {
6079 #[allow(non_camel_case_types)]
6080 #[doc(hidden)]
6081 #[derive(PartialEq, Eq, Hash)]
6082 enum __FieldTag {
6083 __parent,
6084 __function,
6085 __function_id,
6086 Unknown(std::string::String),
6087 }
6088 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6089 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6090 where
6091 D: serde::Deserializer<'de>,
6092 {
6093 struct Visitor;
6094 impl<'de> serde::de::Visitor<'de> for Visitor {
6095 type Value = __FieldTag;
6096 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6097 formatter.write_str("a field name for CreateFunctionRequest")
6098 }
6099 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6100 where
6101 E: serde::de::Error,
6102 {
6103 use std::result::Result::Ok;
6104 use std::string::ToString;
6105 match value {
6106 "parent" => Ok(__FieldTag::__parent),
6107 "function" => Ok(__FieldTag::__function),
6108 "functionId" => Ok(__FieldTag::__function_id),
6109 "function_id" => Ok(__FieldTag::__function_id),
6110 _ => Ok(__FieldTag::Unknown(value.to_string())),
6111 }
6112 }
6113 }
6114 deserializer.deserialize_identifier(Visitor)
6115 }
6116 }
6117 struct Visitor;
6118 impl<'de> serde::de::Visitor<'de> for Visitor {
6119 type Value = CreateFunctionRequest;
6120 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6121 formatter.write_str("struct CreateFunctionRequest")
6122 }
6123 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6124 where
6125 A: serde::de::MapAccess<'de>,
6126 {
6127 #[allow(unused_imports)]
6128 use serde::de::Error;
6129 use std::option::Option::Some;
6130 let mut fields = std::collections::HashSet::new();
6131 let mut result = Self::Value::new();
6132 while let Some(tag) = map.next_key::<__FieldTag>()? {
6133 #[allow(clippy::match_single_binding)]
6134 match tag {
6135 __FieldTag::__parent => {
6136 if !fields.insert(__FieldTag::__parent) {
6137 return std::result::Result::Err(A::Error::duplicate_field(
6138 "multiple values for parent",
6139 ));
6140 }
6141 result.parent = map
6142 .next_value::<std::option::Option<std::string::String>>()?
6143 .unwrap_or_default();
6144 }
6145 __FieldTag::__function => {
6146 if !fields.insert(__FieldTag::__function) {
6147 return std::result::Result::Err(A::Error::duplicate_field(
6148 "multiple values for function",
6149 ));
6150 }
6151 result.function =
6152 map.next_value::<std::option::Option<crate::model::Function>>()?;
6153 }
6154 __FieldTag::__function_id => {
6155 if !fields.insert(__FieldTag::__function_id) {
6156 return std::result::Result::Err(A::Error::duplicate_field(
6157 "multiple values for function_id",
6158 ));
6159 }
6160 result.function_id = map
6161 .next_value::<std::option::Option<std::string::String>>()?
6162 .unwrap_or_default();
6163 }
6164 __FieldTag::Unknown(key) => {
6165 let value = map.next_value::<serde_json::Value>()?;
6166 result._unknown_fields.insert(key, value);
6167 }
6168 }
6169 }
6170 std::result::Result::Ok(result)
6171 }
6172 }
6173 deserializer.deserialize_any(Visitor)
6174 }
6175}
6176
6177#[doc(hidden)]
6178impl serde::ser::Serialize for CreateFunctionRequest {
6179 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6180 where
6181 S: serde::ser::Serializer,
6182 {
6183 use serde::ser::SerializeMap;
6184 #[allow(unused_imports)]
6185 use std::option::Option::Some;
6186 let mut state = serializer.serialize_map(std::option::Option::None)?;
6187 if !self.parent.is_empty() {
6188 state.serialize_entry("parent", &self.parent)?;
6189 }
6190 if self.function.is_some() {
6191 state.serialize_entry("function", &self.function)?;
6192 }
6193 if !self.function_id.is_empty() {
6194 state.serialize_entry("functionId", &self.function_id)?;
6195 }
6196 if !self._unknown_fields.is_empty() {
6197 for (key, value) in self._unknown_fields.iter() {
6198 state.serialize_entry(key, &value)?;
6199 }
6200 }
6201 state.end()
6202 }
6203}
6204
6205#[derive(Clone, Debug, Default, PartialEq)]
6207#[non_exhaustive]
6208pub struct UpdateFunctionRequest {
6209 pub function: std::option::Option<crate::model::Function>,
6211
6212 pub update_mask: std::option::Option<wkt::FieldMask>,
6215
6216 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6217}
6218
6219impl UpdateFunctionRequest {
6220 pub fn new() -> Self {
6221 std::default::Default::default()
6222 }
6223
6224 pub fn set_function<T>(mut self, v: T) -> Self
6226 where
6227 T: std::convert::Into<crate::model::Function>,
6228 {
6229 self.function = std::option::Option::Some(v.into());
6230 self
6231 }
6232
6233 pub fn set_or_clear_function<T>(mut self, v: std::option::Option<T>) -> Self
6235 where
6236 T: std::convert::Into<crate::model::Function>,
6237 {
6238 self.function = v.map(|x| x.into());
6239 self
6240 }
6241
6242 pub fn set_update_mask<T>(mut self, v: T) -> Self
6244 where
6245 T: std::convert::Into<wkt::FieldMask>,
6246 {
6247 self.update_mask = std::option::Option::Some(v.into());
6248 self
6249 }
6250
6251 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6253 where
6254 T: std::convert::Into<wkt::FieldMask>,
6255 {
6256 self.update_mask = v.map(|x| x.into());
6257 self
6258 }
6259}
6260
6261impl wkt::message::Message for UpdateFunctionRequest {
6262 fn typename() -> &'static str {
6263 "type.googleapis.com/google.cloud.functions.v2.UpdateFunctionRequest"
6264 }
6265}
6266
6267#[doc(hidden)]
6268impl<'de> serde::de::Deserialize<'de> for UpdateFunctionRequest {
6269 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6270 where
6271 D: serde::Deserializer<'de>,
6272 {
6273 #[allow(non_camel_case_types)]
6274 #[doc(hidden)]
6275 #[derive(PartialEq, Eq, Hash)]
6276 enum __FieldTag {
6277 __function,
6278 __update_mask,
6279 Unknown(std::string::String),
6280 }
6281 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6282 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6283 where
6284 D: serde::Deserializer<'de>,
6285 {
6286 struct Visitor;
6287 impl<'de> serde::de::Visitor<'de> for Visitor {
6288 type Value = __FieldTag;
6289 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6290 formatter.write_str("a field name for UpdateFunctionRequest")
6291 }
6292 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6293 where
6294 E: serde::de::Error,
6295 {
6296 use std::result::Result::Ok;
6297 use std::string::ToString;
6298 match value {
6299 "function" => Ok(__FieldTag::__function),
6300 "updateMask" => Ok(__FieldTag::__update_mask),
6301 "update_mask" => Ok(__FieldTag::__update_mask),
6302 _ => Ok(__FieldTag::Unknown(value.to_string())),
6303 }
6304 }
6305 }
6306 deserializer.deserialize_identifier(Visitor)
6307 }
6308 }
6309 struct Visitor;
6310 impl<'de> serde::de::Visitor<'de> for Visitor {
6311 type Value = UpdateFunctionRequest;
6312 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6313 formatter.write_str("struct UpdateFunctionRequest")
6314 }
6315 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6316 where
6317 A: serde::de::MapAccess<'de>,
6318 {
6319 #[allow(unused_imports)]
6320 use serde::de::Error;
6321 use std::option::Option::Some;
6322 let mut fields = std::collections::HashSet::new();
6323 let mut result = Self::Value::new();
6324 while let Some(tag) = map.next_key::<__FieldTag>()? {
6325 #[allow(clippy::match_single_binding)]
6326 match tag {
6327 __FieldTag::__function => {
6328 if !fields.insert(__FieldTag::__function) {
6329 return std::result::Result::Err(A::Error::duplicate_field(
6330 "multiple values for function",
6331 ));
6332 }
6333 result.function =
6334 map.next_value::<std::option::Option<crate::model::Function>>()?;
6335 }
6336 __FieldTag::__update_mask => {
6337 if !fields.insert(__FieldTag::__update_mask) {
6338 return std::result::Result::Err(A::Error::duplicate_field(
6339 "multiple values for update_mask",
6340 ));
6341 }
6342 result.update_mask =
6343 map.next_value::<std::option::Option<wkt::FieldMask>>()?;
6344 }
6345 __FieldTag::Unknown(key) => {
6346 let value = map.next_value::<serde_json::Value>()?;
6347 result._unknown_fields.insert(key, value);
6348 }
6349 }
6350 }
6351 std::result::Result::Ok(result)
6352 }
6353 }
6354 deserializer.deserialize_any(Visitor)
6355 }
6356}
6357
6358#[doc(hidden)]
6359impl serde::ser::Serialize for UpdateFunctionRequest {
6360 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6361 where
6362 S: serde::ser::Serializer,
6363 {
6364 use serde::ser::SerializeMap;
6365 #[allow(unused_imports)]
6366 use std::option::Option::Some;
6367 let mut state = serializer.serialize_map(std::option::Option::None)?;
6368 if self.function.is_some() {
6369 state.serialize_entry("function", &self.function)?;
6370 }
6371 if self.update_mask.is_some() {
6372 state.serialize_entry("updateMask", &self.update_mask)?;
6373 }
6374 if !self._unknown_fields.is_empty() {
6375 for (key, value) in self._unknown_fields.iter() {
6376 state.serialize_entry(key, &value)?;
6377 }
6378 }
6379 state.end()
6380 }
6381}
6382
6383#[derive(Clone, Debug, Default, PartialEq)]
6385#[non_exhaustive]
6386pub struct DeleteFunctionRequest {
6387 pub name: std::string::String,
6389
6390 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6391}
6392
6393impl DeleteFunctionRequest {
6394 pub fn new() -> Self {
6395 std::default::Default::default()
6396 }
6397
6398 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6400 self.name = v.into();
6401 self
6402 }
6403}
6404
6405impl wkt::message::Message for DeleteFunctionRequest {
6406 fn typename() -> &'static str {
6407 "type.googleapis.com/google.cloud.functions.v2.DeleteFunctionRequest"
6408 }
6409}
6410
6411#[doc(hidden)]
6412impl<'de> serde::de::Deserialize<'de> for DeleteFunctionRequest {
6413 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6414 where
6415 D: serde::Deserializer<'de>,
6416 {
6417 #[allow(non_camel_case_types)]
6418 #[doc(hidden)]
6419 #[derive(PartialEq, Eq, Hash)]
6420 enum __FieldTag {
6421 __name,
6422 Unknown(std::string::String),
6423 }
6424 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6425 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6426 where
6427 D: serde::Deserializer<'de>,
6428 {
6429 struct Visitor;
6430 impl<'de> serde::de::Visitor<'de> for Visitor {
6431 type Value = __FieldTag;
6432 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6433 formatter.write_str("a field name for DeleteFunctionRequest")
6434 }
6435 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6436 where
6437 E: serde::de::Error,
6438 {
6439 use std::result::Result::Ok;
6440 use std::string::ToString;
6441 match value {
6442 "name" => Ok(__FieldTag::__name),
6443 _ => Ok(__FieldTag::Unknown(value.to_string())),
6444 }
6445 }
6446 }
6447 deserializer.deserialize_identifier(Visitor)
6448 }
6449 }
6450 struct Visitor;
6451 impl<'de> serde::de::Visitor<'de> for Visitor {
6452 type Value = DeleteFunctionRequest;
6453 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6454 formatter.write_str("struct DeleteFunctionRequest")
6455 }
6456 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6457 where
6458 A: serde::de::MapAccess<'de>,
6459 {
6460 #[allow(unused_imports)]
6461 use serde::de::Error;
6462 use std::option::Option::Some;
6463 let mut fields = std::collections::HashSet::new();
6464 let mut result = Self::Value::new();
6465 while let Some(tag) = map.next_key::<__FieldTag>()? {
6466 #[allow(clippy::match_single_binding)]
6467 match tag {
6468 __FieldTag::__name => {
6469 if !fields.insert(__FieldTag::__name) {
6470 return std::result::Result::Err(A::Error::duplicate_field(
6471 "multiple values for name",
6472 ));
6473 }
6474 result.name = map
6475 .next_value::<std::option::Option<std::string::String>>()?
6476 .unwrap_or_default();
6477 }
6478 __FieldTag::Unknown(key) => {
6479 let value = map.next_value::<serde_json::Value>()?;
6480 result._unknown_fields.insert(key, value);
6481 }
6482 }
6483 }
6484 std::result::Result::Ok(result)
6485 }
6486 }
6487 deserializer.deserialize_any(Visitor)
6488 }
6489}
6490
6491#[doc(hidden)]
6492impl serde::ser::Serialize for DeleteFunctionRequest {
6493 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6494 where
6495 S: serde::ser::Serializer,
6496 {
6497 use serde::ser::SerializeMap;
6498 #[allow(unused_imports)]
6499 use std::option::Option::Some;
6500 let mut state = serializer.serialize_map(std::option::Option::None)?;
6501 if !self.name.is_empty() {
6502 state.serialize_entry("name", &self.name)?;
6503 }
6504 if !self._unknown_fields.is_empty() {
6505 for (key, value) in self._unknown_fields.iter() {
6506 state.serialize_entry(key, &value)?;
6507 }
6508 }
6509 state.end()
6510 }
6511}
6512
6513#[derive(Clone, Debug, Default, PartialEq)]
6515#[non_exhaustive]
6516pub struct GenerateUploadUrlRequest {
6517 pub parent: std::string::String,
6520
6521 pub kms_key_name: std::string::String,
6537
6538 pub environment: crate::model::Environment,
6543
6544 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6545}
6546
6547impl GenerateUploadUrlRequest {
6548 pub fn new() -> Self {
6549 std::default::Default::default()
6550 }
6551
6552 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6554 self.parent = v.into();
6555 self
6556 }
6557
6558 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6560 self.kms_key_name = v.into();
6561 self
6562 }
6563
6564 pub fn set_environment<T: std::convert::Into<crate::model::Environment>>(
6566 mut self,
6567 v: T,
6568 ) -> Self {
6569 self.environment = v.into();
6570 self
6571 }
6572}
6573
6574impl wkt::message::Message for GenerateUploadUrlRequest {
6575 fn typename() -> &'static str {
6576 "type.googleapis.com/google.cloud.functions.v2.GenerateUploadUrlRequest"
6577 }
6578}
6579
6580#[doc(hidden)]
6581impl<'de> serde::de::Deserialize<'de> for GenerateUploadUrlRequest {
6582 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6583 where
6584 D: serde::Deserializer<'de>,
6585 {
6586 #[allow(non_camel_case_types)]
6587 #[doc(hidden)]
6588 #[derive(PartialEq, Eq, Hash)]
6589 enum __FieldTag {
6590 __parent,
6591 __kms_key_name,
6592 __environment,
6593 Unknown(std::string::String),
6594 }
6595 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6596 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6597 where
6598 D: serde::Deserializer<'de>,
6599 {
6600 struct Visitor;
6601 impl<'de> serde::de::Visitor<'de> for Visitor {
6602 type Value = __FieldTag;
6603 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6604 formatter.write_str("a field name for GenerateUploadUrlRequest")
6605 }
6606 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6607 where
6608 E: serde::de::Error,
6609 {
6610 use std::result::Result::Ok;
6611 use std::string::ToString;
6612 match value {
6613 "parent" => Ok(__FieldTag::__parent),
6614 "kmsKeyName" => Ok(__FieldTag::__kms_key_name),
6615 "kms_key_name" => Ok(__FieldTag::__kms_key_name),
6616 "environment" => Ok(__FieldTag::__environment),
6617 _ => Ok(__FieldTag::Unknown(value.to_string())),
6618 }
6619 }
6620 }
6621 deserializer.deserialize_identifier(Visitor)
6622 }
6623 }
6624 struct Visitor;
6625 impl<'de> serde::de::Visitor<'de> for Visitor {
6626 type Value = GenerateUploadUrlRequest;
6627 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6628 formatter.write_str("struct GenerateUploadUrlRequest")
6629 }
6630 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6631 where
6632 A: serde::de::MapAccess<'de>,
6633 {
6634 #[allow(unused_imports)]
6635 use serde::de::Error;
6636 use std::option::Option::Some;
6637 let mut fields = std::collections::HashSet::new();
6638 let mut result = Self::Value::new();
6639 while let Some(tag) = map.next_key::<__FieldTag>()? {
6640 #[allow(clippy::match_single_binding)]
6641 match tag {
6642 __FieldTag::__parent => {
6643 if !fields.insert(__FieldTag::__parent) {
6644 return std::result::Result::Err(A::Error::duplicate_field(
6645 "multiple values for parent",
6646 ));
6647 }
6648 result.parent = map
6649 .next_value::<std::option::Option<std::string::String>>()?
6650 .unwrap_or_default();
6651 }
6652 __FieldTag::__kms_key_name => {
6653 if !fields.insert(__FieldTag::__kms_key_name) {
6654 return std::result::Result::Err(A::Error::duplicate_field(
6655 "multiple values for kms_key_name",
6656 ));
6657 }
6658 result.kms_key_name = map
6659 .next_value::<std::option::Option<std::string::String>>()?
6660 .unwrap_or_default();
6661 }
6662 __FieldTag::__environment => {
6663 if !fields.insert(__FieldTag::__environment) {
6664 return std::result::Result::Err(A::Error::duplicate_field(
6665 "multiple values for environment",
6666 ));
6667 }
6668 result.environment = map
6669 .next_value::<std::option::Option<crate::model::Environment>>()?
6670 .unwrap_or_default();
6671 }
6672 __FieldTag::Unknown(key) => {
6673 let value = map.next_value::<serde_json::Value>()?;
6674 result._unknown_fields.insert(key, value);
6675 }
6676 }
6677 }
6678 std::result::Result::Ok(result)
6679 }
6680 }
6681 deserializer.deserialize_any(Visitor)
6682 }
6683}
6684
6685#[doc(hidden)]
6686impl serde::ser::Serialize for GenerateUploadUrlRequest {
6687 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6688 where
6689 S: serde::ser::Serializer,
6690 {
6691 use serde::ser::SerializeMap;
6692 #[allow(unused_imports)]
6693 use std::option::Option::Some;
6694 let mut state = serializer.serialize_map(std::option::Option::None)?;
6695 if !self.parent.is_empty() {
6696 state.serialize_entry("parent", &self.parent)?;
6697 }
6698 if !self.kms_key_name.is_empty() {
6699 state.serialize_entry("kmsKeyName", &self.kms_key_name)?;
6700 }
6701 if !wkt::internal::is_default(&self.environment) {
6702 state.serialize_entry("environment", &self.environment)?;
6703 }
6704 if !self._unknown_fields.is_empty() {
6705 for (key, value) in self._unknown_fields.iter() {
6706 state.serialize_entry(key, &value)?;
6707 }
6708 }
6709 state.end()
6710 }
6711}
6712
6713#[derive(Clone, Debug, Default, PartialEq)]
6715#[non_exhaustive]
6716pub struct GenerateUploadUrlResponse {
6717 pub upload_url: std::string::String,
6721
6722 pub storage_source: std::option::Option<crate::model::StorageSource>,
6731
6732 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6733}
6734
6735impl GenerateUploadUrlResponse {
6736 pub fn new() -> Self {
6737 std::default::Default::default()
6738 }
6739
6740 pub fn set_upload_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6742 self.upload_url = v.into();
6743 self
6744 }
6745
6746 pub fn set_storage_source<T>(mut self, v: T) -> Self
6748 where
6749 T: std::convert::Into<crate::model::StorageSource>,
6750 {
6751 self.storage_source = std::option::Option::Some(v.into());
6752 self
6753 }
6754
6755 pub fn set_or_clear_storage_source<T>(mut self, v: std::option::Option<T>) -> Self
6757 where
6758 T: std::convert::Into<crate::model::StorageSource>,
6759 {
6760 self.storage_source = v.map(|x| x.into());
6761 self
6762 }
6763}
6764
6765impl wkt::message::Message for GenerateUploadUrlResponse {
6766 fn typename() -> &'static str {
6767 "type.googleapis.com/google.cloud.functions.v2.GenerateUploadUrlResponse"
6768 }
6769}
6770
6771#[doc(hidden)]
6772impl<'de> serde::de::Deserialize<'de> for GenerateUploadUrlResponse {
6773 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6774 where
6775 D: serde::Deserializer<'de>,
6776 {
6777 #[allow(non_camel_case_types)]
6778 #[doc(hidden)]
6779 #[derive(PartialEq, Eq, Hash)]
6780 enum __FieldTag {
6781 __upload_url,
6782 __storage_source,
6783 Unknown(std::string::String),
6784 }
6785 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6786 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6787 where
6788 D: serde::Deserializer<'de>,
6789 {
6790 struct Visitor;
6791 impl<'de> serde::de::Visitor<'de> for Visitor {
6792 type Value = __FieldTag;
6793 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6794 formatter.write_str("a field name for GenerateUploadUrlResponse")
6795 }
6796 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6797 where
6798 E: serde::de::Error,
6799 {
6800 use std::result::Result::Ok;
6801 use std::string::ToString;
6802 match value {
6803 "uploadUrl" => Ok(__FieldTag::__upload_url),
6804 "upload_url" => Ok(__FieldTag::__upload_url),
6805 "storageSource" => Ok(__FieldTag::__storage_source),
6806 "storage_source" => Ok(__FieldTag::__storage_source),
6807 _ => Ok(__FieldTag::Unknown(value.to_string())),
6808 }
6809 }
6810 }
6811 deserializer.deserialize_identifier(Visitor)
6812 }
6813 }
6814 struct Visitor;
6815 impl<'de> serde::de::Visitor<'de> for Visitor {
6816 type Value = GenerateUploadUrlResponse;
6817 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6818 formatter.write_str("struct GenerateUploadUrlResponse")
6819 }
6820 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6821 where
6822 A: serde::de::MapAccess<'de>,
6823 {
6824 #[allow(unused_imports)]
6825 use serde::de::Error;
6826 use std::option::Option::Some;
6827 let mut fields = std::collections::HashSet::new();
6828 let mut result = Self::Value::new();
6829 while let Some(tag) = map.next_key::<__FieldTag>()? {
6830 #[allow(clippy::match_single_binding)]
6831 match tag {
6832 __FieldTag::__upload_url => {
6833 if !fields.insert(__FieldTag::__upload_url) {
6834 return std::result::Result::Err(A::Error::duplicate_field(
6835 "multiple values for upload_url",
6836 ));
6837 }
6838 result.upload_url = map
6839 .next_value::<std::option::Option<std::string::String>>()?
6840 .unwrap_or_default();
6841 }
6842 __FieldTag::__storage_source => {
6843 if !fields.insert(__FieldTag::__storage_source) {
6844 return std::result::Result::Err(A::Error::duplicate_field(
6845 "multiple values for storage_source",
6846 ));
6847 }
6848 result.storage_source = map
6849 .next_value::<std::option::Option<crate::model::StorageSource>>()?;
6850 }
6851 __FieldTag::Unknown(key) => {
6852 let value = map.next_value::<serde_json::Value>()?;
6853 result._unknown_fields.insert(key, value);
6854 }
6855 }
6856 }
6857 std::result::Result::Ok(result)
6858 }
6859 }
6860 deserializer.deserialize_any(Visitor)
6861 }
6862}
6863
6864#[doc(hidden)]
6865impl serde::ser::Serialize for GenerateUploadUrlResponse {
6866 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6867 where
6868 S: serde::ser::Serializer,
6869 {
6870 use serde::ser::SerializeMap;
6871 #[allow(unused_imports)]
6872 use std::option::Option::Some;
6873 let mut state = serializer.serialize_map(std::option::Option::None)?;
6874 if !self.upload_url.is_empty() {
6875 state.serialize_entry("uploadUrl", &self.upload_url)?;
6876 }
6877 if self.storage_source.is_some() {
6878 state.serialize_entry("storageSource", &self.storage_source)?;
6879 }
6880 if !self._unknown_fields.is_empty() {
6881 for (key, value) in self._unknown_fields.iter() {
6882 state.serialize_entry(key, &value)?;
6883 }
6884 }
6885 state.end()
6886 }
6887}
6888
6889#[derive(Clone, Debug, Default, PartialEq)]
6891#[non_exhaustive]
6892pub struct GenerateDownloadUrlRequest {
6893 pub name: std::string::String,
6896
6897 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6898}
6899
6900impl GenerateDownloadUrlRequest {
6901 pub fn new() -> Self {
6902 std::default::Default::default()
6903 }
6904
6905 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6907 self.name = v.into();
6908 self
6909 }
6910}
6911
6912impl wkt::message::Message for GenerateDownloadUrlRequest {
6913 fn typename() -> &'static str {
6914 "type.googleapis.com/google.cloud.functions.v2.GenerateDownloadUrlRequest"
6915 }
6916}
6917
6918#[doc(hidden)]
6919impl<'de> serde::de::Deserialize<'de> for GenerateDownloadUrlRequest {
6920 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6921 where
6922 D: serde::Deserializer<'de>,
6923 {
6924 #[allow(non_camel_case_types)]
6925 #[doc(hidden)]
6926 #[derive(PartialEq, Eq, Hash)]
6927 enum __FieldTag {
6928 __name,
6929 Unknown(std::string::String),
6930 }
6931 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6932 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6933 where
6934 D: serde::Deserializer<'de>,
6935 {
6936 struct Visitor;
6937 impl<'de> serde::de::Visitor<'de> for Visitor {
6938 type Value = __FieldTag;
6939 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6940 formatter.write_str("a field name for GenerateDownloadUrlRequest")
6941 }
6942 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6943 where
6944 E: serde::de::Error,
6945 {
6946 use std::result::Result::Ok;
6947 use std::string::ToString;
6948 match value {
6949 "name" => Ok(__FieldTag::__name),
6950 _ => Ok(__FieldTag::Unknown(value.to_string())),
6951 }
6952 }
6953 }
6954 deserializer.deserialize_identifier(Visitor)
6955 }
6956 }
6957 struct Visitor;
6958 impl<'de> serde::de::Visitor<'de> for Visitor {
6959 type Value = GenerateDownloadUrlRequest;
6960 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6961 formatter.write_str("struct GenerateDownloadUrlRequest")
6962 }
6963 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6964 where
6965 A: serde::de::MapAccess<'de>,
6966 {
6967 #[allow(unused_imports)]
6968 use serde::de::Error;
6969 use std::option::Option::Some;
6970 let mut fields = std::collections::HashSet::new();
6971 let mut result = Self::Value::new();
6972 while let Some(tag) = map.next_key::<__FieldTag>()? {
6973 #[allow(clippy::match_single_binding)]
6974 match tag {
6975 __FieldTag::__name => {
6976 if !fields.insert(__FieldTag::__name) {
6977 return std::result::Result::Err(A::Error::duplicate_field(
6978 "multiple values for name",
6979 ));
6980 }
6981 result.name = map
6982 .next_value::<std::option::Option<std::string::String>>()?
6983 .unwrap_or_default();
6984 }
6985 __FieldTag::Unknown(key) => {
6986 let value = map.next_value::<serde_json::Value>()?;
6987 result._unknown_fields.insert(key, value);
6988 }
6989 }
6990 }
6991 std::result::Result::Ok(result)
6992 }
6993 }
6994 deserializer.deserialize_any(Visitor)
6995 }
6996}
6997
6998#[doc(hidden)]
6999impl serde::ser::Serialize for GenerateDownloadUrlRequest {
7000 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7001 where
7002 S: serde::ser::Serializer,
7003 {
7004 use serde::ser::SerializeMap;
7005 #[allow(unused_imports)]
7006 use std::option::Option::Some;
7007 let mut state = serializer.serialize_map(std::option::Option::None)?;
7008 if !self.name.is_empty() {
7009 state.serialize_entry("name", &self.name)?;
7010 }
7011 if !self._unknown_fields.is_empty() {
7012 for (key, value) in self._unknown_fields.iter() {
7013 state.serialize_entry(key, &value)?;
7014 }
7015 }
7016 state.end()
7017 }
7018}
7019
7020#[derive(Clone, Debug, Default, PartialEq)]
7022#[non_exhaustive]
7023pub struct GenerateDownloadUrlResponse {
7024 pub download_url: std::string::String,
7027
7028 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7029}
7030
7031impl GenerateDownloadUrlResponse {
7032 pub fn new() -> Self {
7033 std::default::Default::default()
7034 }
7035
7036 pub fn set_download_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7038 self.download_url = v.into();
7039 self
7040 }
7041}
7042
7043impl wkt::message::Message for GenerateDownloadUrlResponse {
7044 fn typename() -> &'static str {
7045 "type.googleapis.com/google.cloud.functions.v2.GenerateDownloadUrlResponse"
7046 }
7047}
7048
7049#[doc(hidden)]
7050impl<'de> serde::de::Deserialize<'de> for GenerateDownloadUrlResponse {
7051 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7052 where
7053 D: serde::Deserializer<'de>,
7054 {
7055 #[allow(non_camel_case_types)]
7056 #[doc(hidden)]
7057 #[derive(PartialEq, Eq, Hash)]
7058 enum __FieldTag {
7059 __download_url,
7060 Unknown(std::string::String),
7061 }
7062 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7063 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7064 where
7065 D: serde::Deserializer<'de>,
7066 {
7067 struct Visitor;
7068 impl<'de> serde::de::Visitor<'de> for Visitor {
7069 type Value = __FieldTag;
7070 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7071 formatter.write_str("a field name for GenerateDownloadUrlResponse")
7072 }
7073 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7074 where
7075 E: serde::de::Error,
7076 {
7077 use std::result::Result::Ok;
7078 use std::string::ToString;
7079 match value {
7080 "downloadUrl" => Ok(__FieldTag::__download_url),
7081 "download_url" => Ok(__FieldTag::__download_url),
7082 _ => Ok(__FieldTag::Unknown(value.to_string())),
7083 }
7084 }
7085 }
7086 deserializer.deserialize_identifier(Visitor)
7087 }
7088 }
7089 struct Visitor;
7090 impl<'de> serde::de::Visitor<'de> for Visitor {
7091 type Value = GenerateDownloadUrlResponse;
7092 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7093 formatter.write_str("struct GenerateDownloadUrlResponse")
7094 }
7095 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7096 where
7097 A: serde::de::MapAccess<'de>,
7098 {
7099 #[allow(unused_imports)]
7100 use serde::de::Error;
7101 use std::option::Option::Some;
7102 let mut fields = std::collections::HashSet::new();
7103 let mut result = Self::Value::new();
7104 while let Some(tag) = map.next_key::<__FieldTag>()? {
7105 #[allow(clippy::match_single_binding)]
7106 match tag {
7107 __FieldTag::__download_url => {
7108 if !fields.insert(__FieldTag::__download_url) {
7109 return std::result::Result::Err(A::Error::duplicate_field(
7110 "multiple values for download_url",
7111 ));
7112 }
7113 result.download_url = map
7114 .next_value::<std::option::Option<std::string::String>>()?
7115 .unwrap_or_default();
7116 }
7117 __FieldTag::Unknown(key) => {
7118 let value = map.next_value::<serde_json::Value>()?;
7119 result._unknown_fields.insert(key, value);
7120 }
7121 }
7122 }
7123 std::result::Result::Ok(result)
7124 }
7125 }
7126 deserializer.deserialize_any(Visitor)
7127 }
7128}
7129
7130#[doc(hidden)]
7131impl serde::ser::Serialize for GenerateDownloadUrlResponse {
7132 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7133 where
7134 S: serde::ser::Serializer,
7135 {
7136 use serde::ser::SerializeMap;
7137 #[allow(unused_imports)]
7138 use std::option::Option::Some;
7139 let mut state = serializer.serialize_map(std::option::Option::None)?;
7140 if !self.download_url.is_empty() {
7141 state.serialize_entry("downloadUrl", &self.download_url)?;
7142 }
7143 if !self._unknown_fields.is_empty() {
7144 for (key, value) in self._unknown_fields.iter() {
7145 state.serialize_entry(key, &value)?;
7146 }
7147 }
7148 state.end()
7149 }
7150}
7151
7152#[derive(Clone, Debug, Default, PartialEq)]
7154#[non_exhaustive]
7155pub struct ListRuntimesRequest {
7156 pub parent: std::string::String,
7159
7160 pub filter: std::string::String,
7163
7164 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7165}
7166
7167impl ListRuntimesRequest {
7168 pub fn new() -> Self {
7169 std::default::Default::default()
7170 }
7171
7172 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7174 self.parent = v.into();
7175 self
7176 }
7177
7178 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7180 self.filter = v.into();
7181 self
7182 }
7183}
7184
7185impl wkt::message::Message for ListRuntimesRequest {
7186 fn typename() -> &'static str {
7187 "type.googleapis.com/google.cloud.functions.v2.ListRuntimesRequest"
7188 }
7189}
7190
7191#[doc(hidden)]
7192impl<'de> serde::de::Deserialize<'de> for ListRuntimesRequest {
7193 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7194 where
7195 D: serde::Deserializer<'de>,
7196 {
7197 #[allow(non_camel_case_types)]
7198 #[doc(hidden)]
7199 #[derive(PartialEq, Eq, Hash)]
7200 enum __FieldTag {
7201 __parent,
7202 __filter,
7203 Unknown(std::string::String),
7204 }
7205 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7206 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7207 where
7208 D: serde::Deserializer<'de>,
7209 {
7210 struct Visitor;
7211 impl<'de> serde::de::Visitor<'de> for Visitor {
7212 type Value = __FieldTag;
7213 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7214 formatter.write_str("a field name for ListRuntimesRequest")
7215 }
7216 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7217 where
7218 E: serde::de::Error,
7219 {
7220 use std::result::Result::Ok;
7221 use std::string::ToString;
7222 match value {
7223 "parent" => Ok(__FieldTag::__parent),
7224 "filter" => Ok(__FieldTag::__filter),
7225 _ => Ok(__FieldTag::Unknown(value.to_string())),
7226 }
7227 }
7228 }
7229 deserializer.deserialize_identifier(Visitor)
7230 }
7231 }
7232 struct Visitor;
7233 impl<'de> serde::de::Visitor<'de> for Visitor {
7234 type Value = ListRuntimesRequest;
7235 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7236 formatter.write_str("struct ListRuntimesRequest")
7237 }
7238 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7239 where
7240 A: serde::de::MapAccess<'de>,
7241 {
7242 #[allow(unused_imports)]
7243 use serde::de::Error;
7244 use std::option::Option::Some;
7245 let mut fields = std::collections::HashSet::new();
7246 let mut result = Self::Value::new();
7247 while let Some(tag) = map.next_key::<__FieldTag>()? {
7248 #[allow(clippy::match_single_binding)]
7249 match tag {
7250 __FieldTag::__parent => {
7251 if !fields.insert(__FieldTag::__parent) {
7252 return std::result::Result::Err(A::Error::duplicate_field(
7253 "multiple values for parent",
7254 ));
7255 }
7256 result.parent = map
7257 .next_value::<std::option::Option<std::string::String>>()?
7258 .unwrap_or_default();
7259 }
7260 __FieldTag::__filter => {
7261 if !fields.insert(__FieldTag::__filter) {
7262 return std::result::Result::Err(A::Error::duplicate_field(
7263 "multiple values for filter",
7264 ));
7265 }
7266 result.filter = map
7267 .next_value::<std::option::Option<std::string::String>>()?
7268 .unwrap_or_default();
7269 }
7270 __FieldTag::Unknown(key) => {
7271 let value = map.next_value::<serde_json::Value>()?;
7272 result._unknown_fields.insert(key, value);
7273 }
7274 }
7275 }
7276 std::result::Result::Ok(result)
7277 }
7278 }
7279 deserializer.deserialize_any(Visitor)
7280 }
7281}
7282
7283#[doc(hidden)]
7284impl serde::ser::Serialize for ListRuntimesRequest {
7285 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7286 where
7287 S: serde::ser::Serializer,
7288 {
7289 use serde::ser::SerializeMap;
7290 #[allow(unused_imports)]
7291 use std::option::Option::Some;
7292 let mut state = serializer.serialize_map(std::option::Option::None)?;
7293 if !self.parent.is_empty() {
7294 state.serialize_entry("parent", &self.parent)?;
7295 }
7296 if !self.filter.is_empty() {
7297 state.serialize_entry("filter", &self.filter)?;
7298 }
7299 if !self._unknown_fields.is_empty() {
7300 for (key, value) in self._unknown_fields.iter() {
7301 state.serialize_entry(key, &value)?;
7302 }
7303 }
7304 state.end()
7305 }
7306}
7307
7308#[derive(Clone, Debug, Default, PartialEq)]
7310#[non_exhaustive]
7311pub struct ListRuntimesResponse {
7312 pub runtimes: std::vec::Vec<crate::model::list_runtimes_response::Runtime>,
7314
7315 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7316}
7317
7318impl ListRuntimesResponse {
7319 pub fn new() -> Self {
7320 std::default::Default::default()
7321 }
7322
7323 pub fn set_runtimes<T, V>(mut self, v: T) -> Self
7325 where
7326 T: std::iter::IntoIterator<Item = V>,
7327 V: std::convert::Into<crate::model::list_runtimes_response::Runtime>,
7328 {
7329 use std::iter::Iterator;
7330 self.runtimes = v.into_iter().map(|i| i.into()).collect();
7331 self
7332 }
7333}
7334
7335impl wkt::message::Message for ListRuntimesResponse {
7336 fn typename() -> &'static str {
7337 "type.googleapis.com/google.cloud.functions.v2.ListRuntimesResponse"
7338 }
7339}
7340
7341#[doc(hidden)]
7342impl<'de> serde::de::Deserialize<'de> for ListRuntimesResponse {
7343 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7344 where
7345 D: serde::Deserializer<'de>,
7346 {
7347 #[allow(non_camel_case_types)]
7348 #[doc(hidden)]
7349 #[derive(PartialEq, Eq, Hash)]
7350 enum __FieldTag {
7351 __runtimes,
7352 Unknown(std::string::String),
7353 }
7354 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7355 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7356 where
7357 D: serde::Deserializer<'de>,
7358 {
7359 struct Visitor;
7360 impl<'de> serde::de::Visitor<'de> for Visitor {
7361 type Value = __FieldTag;
7362 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7363 formatter.write_str("a field name for ListRuntimesResponse")
7364 }
7365 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7366 where
7367 E: serde::de::Error,
7368 {
7369 use std::result::Result::Ok;
7370 use std::string::ToString;
7371 match value {
7372 "runtimes" => Ok(__FieldTag::__runtimes),
7373 _ => Ok(__FieldTag::Unknown(value.to_string())),
7374 }
7375 }
7376 }
7377 deserializer.deserialize_identifier(Visitor)
7378 }
7379 }
7380 struct Visitor;
7381 impl<'de> serde::de::Visitor<'de> for Visitor {
7382 type Value = ListRuntimesResponse;
7383 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7384 formatter.write_str("struct ListRuntimesResponse")
7385 }
7386 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7387 where
7388 A: serde::de::MapAccess<'de>,
7389 {
7390 #[allow(unused_imports)]
7391 use serde::de::Error;
7392 use std::option::Option::Some;
7393 let mut fields = std::collections::HashSet::new();
7394 let mut result = Self::Value::new();
7395 while let Some(tag) = map.next_key::<__FieldTag>()? {
7396 #[allow(clippy::match_single_binding)]
7397 match tag {
7398 __FieldTag::__runtimes => {
7399 if !fields.insert(__FieldTag::__runtimes) {
7400 return std::result::Result::Err(A::Error::duplicate_field(
7401 "multiple values for runtimes",
7402 ));
7403 }
7404 result.runtimes = map
7405 .next_value::<std::option::Option<
7406 std::vec::Vec<crate::model::list_runtimes_response::Runtime>,
7407 >>()?
7408 .unwrap_or_default();
7409 }
7410 __FieldTag::Unknown(key) => {
7411 let value = map.next_value::<serde_json::Value>()?;
7412 result._unknown_fields.insert(key, value);
7413 }
7414 }
7415 }
7416 std::result::Result::Ok(result)
7417 }
7418 }
7419 deserializer.deserialize_any(Visitor)
7420 }
7421}
7422
7423#[doc(hidden)]
7424impl serde::ser::Serialize for ListRuntimesResponse {
7425 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7426 where
7427 S: serde::ser::Serializer,
7428 {
7429 use serde::ser::SerializeMap;
7430 #[allow(unused_imports)]
7431 use std::option::Option::Some;
7432 let mut state = serializer.serialize_map(std::option::Option::None)?;
7433 if !self.runtimes.is_empty() {
7434 state.serialize_entry("runtimes", &self.runtimes)?;
7435 }
7436 if !self._unknown_fields.is_empty() {
7437 for (key, value) in self._unknown_fields.iter() {
7438 state.serialize_entry(key, &value)?;
7439 }
7440 }
7441 state.end()
7442 }
7443}
7444
7445pub mod list_runtimes_response {
7447 #[allow(unused_imports)]
7448 use super::*;
7449
7450 #[derive(Clone, Debug, Default, PartialEq)]
7453 #[non_exhaustive]
7454 pub struct Runtime {
7455 pub name: std::string::String,
7457
7458 pub display_name: std::string::String,
7460
7461 pub stage: crate::model::list_runtimes_response::RuntimeStage,
7463
7464 pub warnings: std::vec::Vec<std::string::String>,
7466
7467 pub environment: crate::model::Environment,
7469
7470 pub deprecation_date: std::option::Option<gtype::model::Date>,
7472
7473 pub decommission_date: std::option::Option<gtype::model::Date>,
7475
7476 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7477 }
7478
7479 impl Runtime {
7480 pub fn new() -> Self {
7481 std::default::Default::default()
7482 }
7483
7484 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7486 self.name = v.into();
7487 self
7488 }
7489
7490 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
7492 mut self,
7493 v: T,
7494 ) -> Self {
7495 self.display_name = v.into();
7496 self
7497 }
7498
7499 pub fn set_stage<
7501 T: std::convert::Into<crate::model::list_runtimes_response::RuntimeStage>,
7502 >(
7503 mut self,
7504 v: T,
7505 ) -> Self {
7506 self.stage = v.into();
7507 self
7508 }
7509
7510 pub fn set_warnings<T, V>(mut self, v: T) -> Self
7512 where
7513 T: std::iter::IntoIterator<Item = V>,
7514 V: std::convert::Into<std::string::String>,
7515 {
7516 use std::iter::Iterator;
7517 self.warnings = v.into_iter().map(|i| i.into()).collect();
7518 self
7519 }
7520
7521 pub fn set_environment<T: std::convert::Into<crate::model::Environment>>(
7523 mut self,
7524 v: T,
7525 ) -> Self {
7526 self.environment = v.into();
7527 self
7528 }
7529
7530 pub fn set_deprecation_date<T>(mut self, v: T) -> Self
7532 where
7533 T: std::convert::Into<gtype::model::Date>,
7534 {
7535 self.deprecation_date = std::option::Option::Some(v.into());
7536 self
7537 }
7538
7539 pub fn set_or_clear_deprecation_date<T>(mut self, v: std::option::Option<T>) -> Self
7541 where
7542 T: std::convert::Into<gtype::model::Date>,
7543 {
7544 self.deprecation_date = v.map(|x| x.into());
7545 self
7546 }
7547
7548 pub fn set_decommission_date<T>(mut self, v: T) -> Self
7550 where
7551 T: std::convert::Into<gtype::model::Date>,
7552 {
7553 self.decommission_date = std::option::Option::Some(v.into());
7554 self
7555 }
7556
7557 pub fn set_or_clear_decommission_date<T>(mut self, v: std::option::Option<T>) -> Self
7559 where
7560 T: std::convert::Into<gtype::model::Date>,
7561 {
7562 self.decommission_date = v.map(|x| x.into());
7563 self
7564 }
7565 }
7566
7567 impl wkt::message::Message for Runtime {
7568 fn typename() -> &'static str {
7569 "type.googleapis.com/google.cloud.functions.v2.ListRuntimesResponse.Runtime"
7570 }
7571 }
7572
7573 #[doc(hidden)]
7574 impl<'de> serde::de::Deserialize<'de> for Runtime {
7575 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7576 where
7577 D: serde::Deserializer<'de>,
7578 {
7579 #[allow(non_camel_case_types)]
7580 #[doc(hidden)]
7581 #[derive(PartialEq, Eq, Hash)]
7582 enum __FieldTag {
7583 __name,
7584 __display_name,
7585 __stage,
7586 __warnings,
7587 __environment,
7588 __deprecation_date,
7589 __decommission_date,
7590 Unknown(std::string::String),
7591 }
7592 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7593 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7594 where
7595 D: serde::Deserializer<'de>,
7596 {
7597 struct Visitor;
7598 impl<'de> serde::de::Visitor<'de> for Visitor {
7599 type Value = __FieldTag;
7600 fn expecting(
7601 &self,
7602 formatter: &mut std::fmt::Formatter,
7603 ) -> std::fmt::Result {
7604 formatter.write_str("a field name for Runtime")
7605 }
7606 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7607 where
7608 E: serde::de::Error,
7609 {
7610 use std::result::Result::Ok;
7611 use std::string::ToString;
7612 match value {
7613 "name" => Ok(__FieldTag::__name),
7614 "displayName" => Ok(__FieldTag::__display_name),
7615 "display_name" => Ok(__FieldTag::__display_name),
7616 "stage" => Ok(__FieldTag::__stage),
7617 "warnings" => Ok(__FieldTag::__warnings),
7618 "environment" => Ok(__FieldTag::__environment),
7619 "deprecationDate" => Ok(__FieldTag::__deprecation_date),
7620 "deprecation_date" => Ok(__FieldTag::__deprecation_date),
7621 "decommissionDate" => Ok(__FieldTag::__decommission_date),
7622 "decommission_date" => Ok(__FieldTag::__decommission_date),
7623 _ => Ok(__FieldTag::Unknown(value.to_string())),
7624 }
7625 }
7626 }
7627 deserializer.deserialize_identifier(Visitor)
7628 }
7629 }
7630 struct Visitor;
7631 impl<'de> serde::de::Visitor<'de> for Visitor {
7632 type Value = Runtime;
7633 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7634 formatter.write_str("struct Runtime")
7635 }
7636 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7637 where
7638 A: serde::de::MapAccess<'de>,
7639 {
7640 #[allow(unused_imports)]
7641 use serde::de::Error;
7642 use std::option::Option::Some;
7643 let mut fields = std::collections::HashSet::new();
7644 let mut result = Self::Value::new();
7645 while let Some(tag) = map.next_key::<__FieldTag>()? {
7646 #[allow(clippy::match_single_binding)]
7647 match tag {
7648 __FieldTag::__name => {
7649 if !fields.insert(__FieldTag::__name) {
7650 return std::result::Result::Err(A::Error::duplicate_field(
7651 "multiple values for name",
7652 ));
7653 }
7654 result.name = map
7655 .next_value::<std::option::Option<std::string::String>>()?
7656 .unwrap_or_default();
7657 }
7658 __FieldTag::__display_name => {
7659 if !fields.insert(__FieldTag::__display_name) {
7660 return std::result::Result::Err(A::Error::duplicate_field(
7661 "multiple values for display_name",
7662 ));
7663 }
7664 result.display_name = map
7665 .next_value::<std::option::Option<std::string::String>>()?
7666 .unwrap_or_default();
7667 }
7668 __FieldTag::__stage => {
7669 if !fields.insert(__FieldTag::__stage) {
7670 return std::result::Result::Err(A::Error::duplicate_field(
7671 "multiple values for stage",
7672 ));
7673 }
7674 result.stage = map
7675 .next_value::<std::option::Option<
7676 crate::model::list_runtimes_response::RuntimeStage,
7677 >>()?
7678 .unwrap_or_default();
7679 }
7680 __FieldTag::__warnings => {
7681 if !fields.insert(__FieldTag::__warnings) {
7682 return std::result::Result::Err(A::Error::duplicate_field(
7683 "multiple values for warnings",
7684 ));
7685 }
7686 result.warnings = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
7687 }
7688 __FieldTag::__environment => {
7689 if !fields.insert(__FieldTag::__environment) {
7690 return std::result::Result::Err(A::Error::duplicate_field(
7691 "multiple values for environment",
7692 ));
7693 }
7694 result.environment = map
7695 .next_value::<std::option::Option<crate::model::Environment>>()?
7696 .unwrap_or_default();
7697 }
7698 __FieldTag::__deprecation_date => {
7699 if !fields.insert(__FieldTag::__deprecation_date) {
7700 return std::result::Result::Err(A::Error::duplicate_field(
7701 "multiple values for deprecation_date",
7702 ));
7703 }
7704 result.deprecation_date =
7705 map.next_value::<std::option::Option<gtype::model::Date>>()?;
7706 }
7707 __FieldTag::__decommission_date => {
7708 if !fields.insert(__FieldTag::__decommission_date) {
7709 return std::result::Result::Err(A::Error::duplicate_field(
7710 "multiple values for decommission_date",
7711 ));
7712 }
7713 result.decommission_date =
7714 map.next_value::<std::option::Option<gtype::model::Date>>()?;
7715 }
7716 __FieldTag::Unknown(key) => {
7717 let value = map.next_value::<serde_json::Value>()?;
7718 result._unknown_fields.insert(key, value);
7719 }
7720 }
7721 }
7722 std::result::Result::Ok(result)
7723 }
7724 }
7725 deserializer.deserialize_any(Visitor)
7726 }
7727 }
7728
7729 #[doc(hidden)]
7730 impl serde::ser::Serialize for Runtime {
7731 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7732 where
7733 S: serde::ser::Serializer,
7734 {
7735 use serde::ser::SerializeMap;
7736 #[allow(unused_imports)]
7737 use std::option::Option::Some;
7738 let mut state = serializer.serialize_map(std::option::Option::None)?;
7739 if !self.name.is_empty() {
7740 state.serialize_entry("name", &self.name)?;
7741 }
7742 if !self.display_name.is_empty() {
7743 state.serialize_entry("displayName", &self.display_name)?;
7744 }
7745 if !wkt::internal::is_default(&self.stage) {
7746 state.serialize_entry("stage", &self.stage)?;
7747 }
7748 if !self.warnings.is_empty() {
7749 state.serialize_entry("warnings", &self.warnings)?;
7750 }
7751 if !wkt::internal::is_default(&self.environment) {
7752 state.serialize_entry("environment", &self.environment)?;
7753 }
7754 if self.deprecation_date.is_some() {
7755 state.serialize_entry("deprecationDate", &self.deprecation_date)?;
7756 }
7757 if self.decommission_date.is_some() {
7758 state.serialize_entry("decommissionDate", &self.decommission_date)?;
7759 }
7760 if !self._unknown_fields.is_empty() {
7761 for (key, value) in self._unknown_fields.iter() {
7762 state.serialize_entry(key, &value)?;
7763 }
7764 }
7765 state.end()
7766 }
7767 }
7768
7769 #[derive(Clone, Debug, PartialEq)]
7785 #[non_exhaustive]
7786 pub enum RuntimeStage {
7787 Unspecified,
7789 Development,
7791 Alpha,
7793 Beta,
7795 Ga,
7797 Deprecated,
7799 Decommissioned,
7801 UnknownValue(runtime_stage::UnknownValue),
7806 }
7807
7808 #[doc(hidden)]
7809 pub mod runtime_stage {
7810 #[allow(unused_imports)]
7811 use super::*;
7812 #[derive(Clone, Debug, PartialEq)]
7813 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7814 }
7815
7816 impl RuntimeStage {
7817 pub fn value(&self) -> std::option::Option<i32> {
7822 match self {
7823 Self::Unspecified => std::option::Option::Some(0),
7824 Self::Development => std::option::Option::Some(1),
7825 Self::Alpha => std::option::Option::Some(2),
7826 Self::Beta => std::option::Option::Some(3),
7827 Self::Ga => std::option::Option::Some(4),
7828 Self::Deprecated => std::option::Option::Some(5),
7829 Self::Decommissioned => std::option::Option::Some(6),
7830 Self::UnknownValue(u) => u.0.value(),
7831 }
7832 }
7833
7834 pub fn name(&self) -> std::option::Option<&str> {
7839 match self {
7840 Self::Unspecified => std::option::Option::Some("RUNTIME_STAGE_UNSPECIFIED"),
7841 Self::Development => std::option::Option::Some("DEVELOPMENT"),
7842 Self::Alpha => std::option::Option::Some("ALPHA"),
7843 Self::Beta => std::option::Option::Some("BETA"),
7844 Self::Ga => std::option::Option::Some("GA"),
7845 Self::Deprecated => std::option::Option::Some("DEPRECATED"),
7846 Self::Decommissioned => std::option::Option::Some("DECOMMISSIONED"),
7847 Self::UnknownValue(u) => u.0.name(),
7848 }
7849 }
7850 }
7851
7852 impl std::default::Default for RuntimeStage {
7853 fn default() -> Self {
7854 use std::convert::From;
7855 Self::from(0)
7856 }
7857 }
7858
7859 impl std::fmt::Display for RuntimeStage {
7860 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7861 wkt::internal::display_enum(f, self.name(), self.value())
7862 }
7863 }
7864
7865 impl std::convert::From<i32> for RuntimeStage {
7866 fn from(value: i32) -> Self {
7867 match value {
7868 0 => Self::Unspecified,
7869 1 => Self::Development,
7870 2 => Self::Alpha,
7871 3 => Self::Beta,
7872 4 => Self::Ga,
7873 5 => Self::Deprecated,
7874 6 => Self::Decommissioned,
7875 _ => Self::UnknownValue(runtime_stage::UnknownValue(
7876 wkt::internal::UnknownEnumValue::Integer(value),
7877 )),
7878 }
7879 }
7880 }
7881
7882 impl std::convert::From<&str> for RuntimeStage {
7883 fn from(value: &str) -> Self {
7884 use std::string::ToString;
7885 match value {
7886 "RUNTIME_STAGE_UNSPECIFIED" => Self::Unspecified,
7887 "DEVELOPMENT" => Self::Development,
7888 "ALPHA" => Self::Alpha,
7889 "BETA" => Self::Beta,
7890 "GA" => Self::Ga,
7891 "DEPRECATED" => Self::Deprecated,
7892 "DECOMMISSIONED" => Self::Decommissioned,
7893 _ => Self::UnknownValue(runtime_stage::UnknownValue(
7894 wkt::internal::UnknownEnumValue::String(value.to_string()),
7895 )),
7896 }
7897 }
7898 }
7899
7900 impl serde::ser::Serialize for RuntimeStage {
7901 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7902 where
7903 S: serde::Serializer,
7904 {
7905 match self {
7906 Self::Unspecified => serializer.serialize_i32(0),
7907 Self::Development => serializer.serialize_i32(1),
7908 Self::Alpha => serializer.serialize_i32(2),
7909 Self::Beta => serializer.serialize_i32(3),
7910 Self::Ga => serializer.serialize_i32(4),
7911 Self::Deprecated => serializer.serialize_i32(5),
7912 Self::Decommissioned => serializer.serialize_i32(6),
7913 Self::UnknownValue(u) => u.0.serialize(serializer),
7914 }
7915 }
7916 }
7917
7918 impl<'de> serde::de::Deserialize<'de> for RuntimeStage {
7919 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7920 where
7921 D: serde::Deserializer<'de>,
7922 {
7923 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RuntimeStage>::new(
7924 ".google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage",
7925 ))
7926 }
7927 }
7928}
7929
7930#[derive(Clone, Debug, Default, PartialEq)]
7933#[non_exhaustive]
7934pub struct AutomaticUpdatePolicy {
7935 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7936}
7937
7938impl AutomaticUpdatePolicy {
7939 pub fn new() -> Self {
7940 std::default::Default::default()
7941 }
7942}
7943
7944impl wkt::message::Message for AutomaticUpdatePolicy {
7945 fn typename() -> &'static str {
7946 "type.googleapis.com/google.cloud.functions.v2.AutomaticUpdatePolicy"
7947 }
7948}
7949
7950#[doc(hidden)]
7951impl<'de> serde::de::Deserialize<'de> for AutomaticUpdatePolicy {
7952 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7953 where
7954 D: serde::Deserializer<'de>,
7955 {
7956 #[allow(non_camel_case_types)]
7957 #[doc(hidden)]
7958 #[derive(PartialEq, Eq, Hash)]
7959 enum __FieldTag {
7960 Unknown(std::string::String),
7961 }
7962 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7963 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7964 where
7965 D: serde::Deserializer<'de>,
7966 {
7967 struct Visitor;
7968 impl<'de> serde::de::Visitor<'de> for Visitor {
7969 type Value = __FieldTag;
7970 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7971 formatter.write_str("a field name for AutomaticUpdatePolicy")
7972 }
7973 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7974 where
7975 E: serde::de::Error,
7976 {
7977 use std::result::Result::Ok;
7978 use std::string::ToString;
7979 Ok(__FieldTag::Unknown(value.to_string()))
7980 }
7981 }
7982 deserializer.deserialize_identifier(Visitor)
7983 }
7984 }
7985 struct Visitor;
7986 impl<'de> serde::de::Visitor<'de> for Visitor {
7987 type Value = AutomaticUpdatePolicy;
7988 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7989 formatter.write_str("struct AutomaticUpdatePolicy")
7990 }
7991 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7992 where
7993 A: serde::de::MapAccess<'de>,
7994 {
7995 #[allow(unused_imports)]
7996 use serde::de::Error;
7997 use std::option::Option::Some;
7998 let mut result = Self::Value::new();
7999 while let Some(tag) = map.next_key::<__FieldTag>()? {
8000 #[allow(clippy::match_single_binding)]
8001 match tag {
8002 __FieldTag::Unknown(key) => {
8003 let value = map.next_value::<serde_json::Value>()?;
8004 result._unknown_fields.insert(key, value);
8005 }
8006 }
8007 }
8008 std::result::Result::Ok(result)
8009 }
8010 }
8011 deserializer.deserialize_any(Visitor)
8012 }
8013}
8014
8015#[doc(hidden)]
8016impl serde::ser::Serialize for AutomaticUpdatePolicy {
8017 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8018 where
8019 S: serde::ser::Serializer,
8020 {
8021 use serde::ser::SerializeMap;
8022 #[allow(unused_imports)]
8023 use std::option::Option::Some;
8024 let mut state = serializer.serialize_map(std::option::Option::None)?;
8025 if !self._unknown_fields.is_empty() {
8026 for (key, value) in self._unknown_fields.iter() {
8027 state.serialize_entry(key, &value)?;
8028 }
8029 }
8030 state.end()
8031 }
8032}
8033
8034#[derive(Clone, Debug, Default, PartialEq)]
8036#[non_exhaustive]
8037pub struct OnDeployUpdatePolicy {
8038 pub runtime_version: std::string::String,
8041
8042 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8043}
8044
8045impl OnDeployUpdatePolicy {
8046 pub fn new() -> Self {
8047 std::default::Default::default()
8048 }
8049
8050 pub fn set_runtime_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8052 self.runtime_version = v.into();
8053 self
8054 }
8055}
8056
8057impl wkt::message::Message for OnDeployUpdatePolicy {
8058 fn typename() -> &'static str {
8059 "type.googleapis.com/google.cloud.functions.v2.OnDeployUpdatePolicy"
8060 }
8061}
8062
8063#[doc(hidden)]
8064impl<'de> serde::de::Deserialize<'de> for OnDeployUpdatePolicy {
8065 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8066 where
8067 D: serde::Deserializer<'de>,
8068 {
8069 #[allow(non_camel_case_types)]
8070 #[doc(hidden)]
8071 #[derive(PartialEq, Eq, Hash)]
8072 enum __FieldTag {
8073 __runtime_version,
8074 Unknown(std::string::String),
8075 }
8076 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8077 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8078 where
8079 D: serde::Deserializer<'de>,
8080 {
8081 struct Visitor;
8082 impl<'de> serde::de::Visitor<'de> for Visitor {
8083 type Value = __FieldTag;
8084 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8085 formatter.write_str("a field name for OnDeployUpdatePolicy")
8086 }
8087 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8088 where
8089 E: serde::de::Error,
8090 {
8091 use std::result::Result::Ok;
8092 use std::string::ToString;
8093 match value {
8094 "runtimeVersion" => Ok(__FieldTag::__runtime_version),
8095 "runtime_version" => Ok(__FieldTag::__runtime_version),
8096 _ => Ok(__FieldTag::Unknown(value.to_string())),
8097 }
8098 }
8099 }
8100 deserializer.deserialize_identifier(Visitor)
8101 }
8102 }
8103 struct Visitor;
8104 impl<'de> serde::de::Visitor<'de> for Visitor {
8105 type Value = OnDeployUpdatePolicy;
8106 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8107 formatter.write_str("struct OnDeployUpdatePolicy")
8108 }
8109 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8110 where
8111 A: serde::de::MapAccess<'de>,
8112 {
8113 #[allow(unused_imports)]
8114 use serde::de::Error;
8115 use std::option::Option::Some;
8116 let mut fields = std::collections::HashSet::new();
8117 let mut result = Self::Value::new();
8118 while let Some(tag) = map.next_key::<__FieldTag>()? {
8119 #[allow(clippy::match_single_binding)]
8120 match tag {
8121 __FieldTag::__runtime_version => {
8122 if !fields.insert(__FieldTag::__runtime_version) {
8123 return std::result::Result::Err(A::Error::duplicate_field(
8124 "multiple values for runtime_version",
8125 ));
8126 }
8127 result.runtime_version = map
8128 .next_value::<std::option::Option<std::string::String>>()?
8129 .unwrap_or_default();
8130 }
8131 __FieldTag::Unknown(key) => {
8132 let value = map.next_value::<serde_json::Value>()?;
8133 result._unknown_fields.insert(key, value);
8134 }
8135 }
8136 }
8137 std::result::Result::Ok(result)
8138 }
8139 }
8140 deserializer.deserialize_any(Visitor)
8141 }
8142}
8143
8144#[doc(hidden)]
8145impl serde::ser::Serialize for OnDeployUpdatePolicy {
8146 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8147 where
8148 S: serde::ser::Serializer,
8149 {
8150 use serde::ser::SerializeMap;
8151 #[allow(unused_imports)]
8152 use std::option::Option::Some;
8153 let mut state = serializer.serialize_map(std::option::Option::None)?;
8154 if !self.runtime_version.is_empty() {
8155 state.serialize_entry("runtimeVersion", &self.runtime_version)?;
8156 }
8157 if !self._unknown_fields.is_empty() {
8158 for (key, value) in self._unknown_fields.iter() {
8159 state.serialize_entry(key, &value)?;
8160 }
8161 }
8162 state.end()
8163 }
8164}
8165
8166#[derive(Clone, Debug, Default, PartialEq)]
8168#[non_exhaustive]
8169pub struct OperationMetadata {
8170 pub create_time: std::option::Option<wkt::Timestamp>,
8172
8173 pub end_time: std::option::Option<wkt::Timestamp>,
8175
8176 pub target: std::string::String,
8178
8179 pub verb: std::string::String,
8181
8182 pub status_detail: std::string::String,
8184
8185 pub cancel_requested: bool,
8195
8196 pub api_version: std::string::String,
8198
8199 pub request_resource: std::option::Option<wkt::Any>,
8201
8202 pub stages: std::vec::Vec<crate::model::Stage>,
8204
8205 pub source_token: std::string::String,
8208
8209 pub build_name: std::string::String,
8211
8212 pub operation_type: crate::model::OperationType,
8214
8215 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8216}
8217
8218impl OperationMetadata {
8219 pub fn new() -> Self {
8220 std::default::Default::default()
8221 }
8222
8223 pub fn set_create_time<T>(mut self, v: T) -> Self
8225 where
8226 T: std::convert::Into<wkt::Timestamp>,
8227 {
8228 self.create_time = std::option::Option::Some(v.into());
8229 self
8230 }
8231
8232 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8234 where
8235 T: std::convert::Into<wkt::Timestamp>,
8236 {
8237 self.create_time = v.map(|x| x.into());
8238 self
8239 }
8240
8241 pub fn set_end_time<T>(mut self, v: T) -> Self
8243 where
8244 T: std::convert::Into<wkt::Timestamp>,
8245 {
8246 self.end_time = std::option::Option::Some(v.into());
8247 self
8248 }
8249
8250 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8252 where
8253 T: std::convert::Into<wkt::Timestamp>,
8254 {
8255 self.end_time = v.map(|x| x.into());
8256 self
8257 }
8258
8259 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8261 self.target = v.into();
8262 self
8263 }
8264
8265 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8267 self.verb = v.into();
8268 self
8269 }
8270
8271 pub fn set_status_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8273 self.status_detail = v.into();
8274 self
8275 }
8276
8277 pub fn set_cancel_requested<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8279 self.cancel_requested = v.into();
8280 self
8281 }
8282
8283 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8285 self.api_version = v.into();
8286 self
8287 }
8288
8289 pub fn set_request_resource<T>(mut self, v: T) -> Self
8291 where
8292 T: std::convert::Into<wkt::Any>,
8293 {
8294 self.request_resource = std::option::Option::Some(v.into());
8295 self
8296 }
8297
8298 pub fn set_or_clear_request_resource<T>(mut self, v: std::option::Option<T>) -> Self
8300 where
8301 T: std::convert::Into<wkt::Any>,
8302 {
8303 self.request_resource = v.map(|x| x.into());
8304 self
8305 }
8306
8307 pub fn set_stages<T, V>(mut self, v: T) -> Self
8309 where
8310 T: std::iter::IntoIterator<Item = V>,
8311 V: std::convert::Into<crate::model::Stage>,
8312 {
8313 use std::iter::Iterator;
8314 self.stages = v.into_iter().map(|i| i.into()).collect();
8315 self
8316 }
8317
8318 pub fn set_source_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8320 self.source_token = v.into();
8321 self
8322 }
8323
8324 pub fn set_build_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8326 self.build_name = v.into();
8327 self
8328 }
8329
8330 pub fn set_operation_type<T: std::convert::Into<crate::model::OperationType>>(
8332 mut self,
8333 v: T,
8334 ) -> Self {
8335 self.operation_type = v.into();
8336 self
8337 }
8338}
8339
8340impl wkt::message::Message for OperationMetadata {
8341 fn typename() -> &'static str {
8342 "type.googleapis.com/google.cloud.functions.v2.OperationMetadata"
8343 }
8344}
8345
8346#[doc(hidden)]
8347impl<'de> serde::de::Deserialize<'de> for OperationMetadata {
8348 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8349 where
8350 D: serde::Deserializer<'de>,
8351 {
8352 #[allow(non_camel_case_types)]
8353 #[doc(hidden)]
8354 #[derive(PartialEq, Eq, Hash)]
8355 enum __FieldTag {
8356 __create_time,
8357 __end_time,
8358 __target,
8359 __verb,
8360 __status_detail,
8361 __cancel_requested,
8362 __api_version,
8363 __request_resource,
8364 __stages,
8365 __source_token,
8366 __build_name,
8367 __operation_type,
8368 Unknown(std::string::String),
8369 }
8370 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8371 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8372 where
8373 D: serde::Deserializer<'de>,
8374 {
8375 struct Visitor;
8376 impl<'de> serde::de::Visitor<'de> for Visitor {
8377 type Value = __FieldTag;
8378 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8379 formatter.write_str("a field name for OperationMetadata")
8380 }
8381 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8382 where
8383 E: serde::de::Error,
8384 {
8385 use std::result::Result::Ok;
8386 use std::string::ToString;
8387 match value {
8388 "createTime" => Ok(__FieldTag::__create_time),
8389 "create_time" => Ok(__FieldTag::__create_time),
8390 "endTime" => Ok(__FieldTag::__end_time),
8391 "end_time" => Ok(__FieldTag::__end_time),
8392 "target" => Ok(__FieldTag::__target),
8393 "verb" => Ok(__FieldTag::__verb),
8394 "statusDetail" => Ok(__FieldTag::__status_detail),
8395 "status_detail" => Ok(__FieldTag::__status_detail),
8396 "cancelRequested" => Ok(__FieldTag::__cancel_requested),
8397 "cancel_requested" => Ok(__FieldTag::__cancel_requested),
8398 "apiVersion" => Ok(__FieldTag::__api_version),
8399 "api_version" => Ok(__FieldTag::__api_version),
8400 "requestResource" => Ok(__FieldTag::__request_resource),
8401 "request_resource" => Ok(__FieldTag::__request_resource),
8402 "stages" => Ok(__FieldTag::__stages),
8403 "sourceToken" => Ok(__FieldTag::__source_token),
8404 "source_token" => Ok(__FieldTag::__source_token),
8405 "buildName" => Ok(__FieldTag::__build_name),
8406 "build_name" => Ok(__FieldTag::__build_name),
8407 "operationType" => Ok(__FieldTag::__operation_type),
8408 "operation_type" => Ok(__FieldTag::__operation_type),
8409 _ => Ok(__FieldTag::Unknown(value.to_string())),
8410 }
8411 }
8412 }
8413 deserializer.deserialize_identifier(Visitor)
8414 }
8415 }
8416 struct Visitor;
8417 impl<'de> serde::de::Visitor<'de> for Visitor {
8418 type Value = OperationMetadata;
8419 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8420 formatter.write_str("struct OperationMetadata")
8421 }
8422 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8423 where
8424 A: serde::de::MapAccess<'de>,
8425 {
8426 #[allow(unused_imports)]
8427 use serde::de::Error;
8428 use std::option::Option::Some;
8429 let mut fields = std::collections::HashSet::new();
8430 let mut result = Self::Value::new();
8431 while let Some(tag) = map.next_key::<__FieldTag>()? {
8432 #[allow(clippy::match_single_binding)]
8433 match tag {
8434 __FieldTag::__create_time => {
8435 if !fields.insert(__FieldTag::__create_time) {
8436 return std::result::Result::Err(A::Error::duplicate_field(
8437 "multiple values for create_time",
8438 ));
8439 }
8440 result.create_time =
8441 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
8442 }
8443 __FieldTag::__end_time => {
8444 if !fields.insert(__FieldTag::__end_time) {
8445 return std::result::Result::Err(A::Error::duplicate_field(
8446 "multiple values for end_time",
8447 ));
8448 }
8449 result.end_time =
8450 map.next_value::<std::option::Option<wkt::Timestamp>>()?;
8451 }
8452 __FieldTag::__target => {
8453 if !fields.insert(__FieldTag::__target) {
8454 return std::result::Result::Err(A::Error::duplicate_field(
8455 "multiple values for target",
8456 ));
8457 }
8458 result.target = map
8459 .next_value::<std::option::Option<std::string::String>>()?
8460 .unwrap_or_default();
8461 }
8462 __FieldTag::__verb => {
8463 if !fields.insert(__FieldTag::__verb) {
8464 return std::result::Result::Err(A::Error::duplicate_field(
8465 "multiple values for verb",
8466 ));
8467 }
8468 result.verb = map
8469 .next_value::<std::option::Option<std::string::String>>()?
8470 .unwrap_or_default();
8471 }
8472 __FieldTag::__status_detail => {
8473 if !fields.insert(__FieldTag::__status_detail) {
8474 return std::result::Result::Err(A::Error::duplicate_field(
8475 "multiple values for status_detail",
8476 ));
8477 }
8478 result.status_detail = map
8479 .next_value::<std::option::Option<std::string::String>>()?
8480 .unwrap_or_default();
8481 }
8482 __FieldTag::__cancel_requested => {
8483 if !fields.insert(__FieldTag::__cancel_requested) {
8484 return std::result::Result::Err(A::Error::duplicate_field(
8485 "multiple values for cancel_requested",
8486 ));
8487 }
8488 result.cancel_requested = map
8489 .next_value::<std::option::Option<bool>>()?
8490 .unwrap_or_default();
8491 }
8492 __FieldTag::__api_version => {
8493 if !fields.insert(__FieldTag::__api_version) {
8494 return std::result::Result::Err(A::Error::duplicate_field(
8495 "multiple values for api_version",
8496 ));
8497 }
8498 result.api_version = map
8499 .next_value::<std::option::Option<std::string::String>>()?
8500 .unwrap_or_default();
8501 }
8502 __FieldTag::__request_resource => {
8503 if !fields.insert(__FieldTag::__request_resource) {
8504 return std::result::Result::Err(A::Error::duplicate_field(
8505 "multiple values for request_resource",
8506 ));
8507 }
8508 result.request_resource =
8509 map.next_value::<std::option::Option<wkt::Any>>()?;
8510 }
8511 __FieldTag::__stages => {
8512 if !fields.insert(__FieldTag::__stages) {
8513 return std::result::Result::Err(A::Error::duplicate_field(
8514 "multiple values for stages",
8515 ));
8516 }
8517 result.stages = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Stage>>>()?.unwrap_or_default();
8518 }
8519 __FieldTag::__source_token => {
8520 if !fields.insert(__FieldTag::__source_token) {
8521 return std::result::Result::Err(A::Error::duplicate_field(
8522 "multiple values for source_token",
8523 ));
8524 }
8525 result.source_token = map
8526 .next_value::<std::option::Option<std::string::String>>()?
8527 .unwrap_or_default();
8528 }
8529 __FieldTag::__build_name => {
8530 if !fields.insert(__FieldTag::__build_name) {
8531 return std::result::Result::Err(A::Error::duplicate_field(
8532 "multiple values for build_name",
8533 ));
8534 }
8535 result.build_name = map
8536 .next_value::<std::option::Option<std::string::String>>()?
8537 .unwrap_or_default();
8538 }
8539 __FieldTag::__operation_type => {
8540 if !fields.insert(__FieldTag::__operation_type) {
8541 return std::result::Result::Err(A::Error::duplicate_field(
8542 "multiple values for operation_type",
8543 ));
8544 }
8545 result.operation_type = map
8546 .next_value::<std::option::Option<crate::model::OperationType>>()?
8547 .unwrap_or_default();
8548 }
8549 __FieldTag::Unknown(key) => {
8550 let value = map.next_value::<serde_json::Value>()?;
8551 result._unknown_fields.insert(key, value);
8552 }
8553 }
8554 }
8555 std::result::Result::Ok(result)
8556 }
8557 }
8558 deserializer.deserialize_any(Visitor)
8559 }
8560}
8561
8562#[doc(hidden)]
8563impl serde::ser::Serialize for OperationMetadata {
8564 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8565 where
8566 S: serde::ser::Serializer,
8567 {
8568 use serde::ser::SerializeMap;
8569 #[allow(unused_imports)]
8570 use std::option::Option::Some;
8571 let mut state = serializer.serialize_map(std::option::Option::None)?;
8572 if self.create_time.is_some() {
8573 state.serialize_entry("createTime", &self.create_time)?;
8574 }
8575 if self.end_time.is_some() {
8576 state.serialize_entry("endTime", &self.end_time)?;
8577 }
8578 if !self.target.is_empty() {
8579 state.serialize_entry("target", &self.target)?;
8580 }
8581 if !self.verb.is_empty() {
8582 state.serialize_entry("verb", &self.verb)?;
8583 }
8584 if !self.status_detail.is_empty() {
8585 state.serialize_entry("statusDetail", &self.status_detail)?;
8586 }
8587 if !wkt::internal::is_default(&self.cancel_requested) {
8588 state.serialize_entry("cancelRequested", &self.cancel_requested)?;
8589 }
8590 if !self.api_version.is_empty() {
8591 state.serialize_entry("apiVersion", &self.api_version)?;
8592 }
8593 if self.request_resource.is_some() {
8594 state.serialize_entry("requestResource", &self.request_resource)?;
8595 }
8596 if !self.stages.is_empty() {
8597 state.serialize_entry("stages", &self.stages)?;
8598 }
8599 if !self.source_token.is_empty() {
8600 state.serialize_entry("sourceToken", &self.source_token)?;
8601 }
8602 if !self.build_name.is_empty() {
8603 state.serialize_entry("buildName", &self.build_name)?;
8604 }
8605 if !wkt::internal::is_default(&self.operation_type) {
8606 state.serialize_entry("operationType", &self.operation_type)?;
8607 }
8608 if !self._unknown_fields.is_empty() {
8609 for (key, value) in self._unknown_fields.iter() {
8610 state.serialize_entry(key, &value)?;
8611 }
8612 }
8613 state.end()
8614 }
8615}
8616
8617#[derive(Clone, Debug, Default, PartialEq)]
8619#[non_exhaustive]
8620pub struct LocationMetadata {
8621 pub environments: std::vec::Vec<crate::model::Environment>,
8623
8624 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8625}
8626
8627impl LocationMetadata {
8628 pub fn new() -> Self {
8629 std::default::Default::default()
8630 }
8631
8632 pub fn set_environments<T, V>(mut self, v: T) -> Self
8634 where
8635 T: std::iter::IntoIterator<Item = V>,
8636 V: std::convert::Into<crate::model::Environment>,
8637 {
8638 use std::iter::Iterator;
8639 self.environments = v.into_iter().map(|i| i.into()).collect();
8640 self
8641 }
8642}
8643
8644impl wkt::message::Message for LocationMetadata {
8645 fn typename() -> &'static str {
8646 "type.googleapis.com/google.cloud.functions.v2.LocationMetadata"
8647 }
8648}
8649
8650#[doc(hidden)]
8651impl<'de> serde::de::Deserialize<'de> for LocationMetadata {
8652 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8653 where
8654 D: serde::Deserializer<'de>,
8655 {
8656 #[allow(non_camel_case_types)]
8657 #[doc(hidden)]
8658 #[derive(PartialEq, Eq, Hash)]
8659 enum __FieldTag {
8660 __environments,
8661 Unknown(std::string::String),
8662 }
8663 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8664 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8665 where
8666 D: serde::Deserializer<'de>,
8667 {
8668 struct Visitor;
8669 impl<'de> serde::de::Visitor<'de> for Visitor {
8670 type Value = __FieldTag;
8671 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8672 formatter.write_str("a field name for LocationMetadata")
8673 }
8674 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8675 where
8676 E: serde::de::Error,
8677 {
8678 use std::result::Result::Ok;
8679 use std::string::ToString;
8680 match value {
8681 "environments" => Ok(__FieldTag::__environments),
8682 _ => Ok(__FieldTag::Unknown(value.to_string())),
8683 }
8684 }
8685 }
8686 deserializer.deserialize_identifier(Visitor)
8687 }
8688 }
8689 struct Visitor;
8690 impl<'de> serde::de::Visitor<'de> for Visitor {
8691 type Value = LocationMetadata;
8692 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8693 formatter.write_str("struct LocationMetadata")
8694 }
8695 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8696 where
8697 A: serde::de::MapAccess<'de>,
8698 {
8699 #[allow(unused_imports)]
8700 use serde::de::Error;
8701 use std::option::Option::Some;
8702 let mut fields = std::collections::HashSet::new();
8703 let mut result = Self::Value::new();
8704 while let Some(tag) = map.next_key::<__FieldTag>()? {
8705 #[allow(clippy::match_single_binding)]
8706 match tag {
8707 __FieldTag::__environments => {
8708 if !fields.insert(__FieldTag::__environments) {
8709 return std::result::Result::Err(A::Error::duplicate_field(
8710 "multiple values for environments",
8711 ));
8712 }
8713 result.environments = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Environment>>>()?.unwrap_or_default();
8714 }
8715 __FieldTag::Unknown(key) => {
8716 let value = map.next_value::<serde_json::Value>()?;
8717 result._unknown_fields.insert(key, value);
8718 }
8719 }
8720 }
8721 std::result::Result::Ok(result)
8722 }
8723 }
8724 deserializer.deserialize_any(Visitor)
8725 }
8726}
8727
8728#[doc(hidden)]
8729impl serde::ser::Serialize for LocationMetadata {
8730 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8731 where
8732 S: serde::ser::Serializer,
8733 {
8734 use serde::ser::SerializeMap;
8735 #[allow(unused_imports)]
8736 use std::option::Option::Some;
8737 let mut state = serializer.serialize_map(std::option::Option::None)?;
8738 if !self.environments.is_empty() {
8739 state.serialize_entry("environments", &self.environments)?;
8740 }
8741 if !self._unknown_fields.is_empty() {
8742 for (key, value) in self._unknown_fields.iter() {
8743 state.serialize_entry(key, &value)?;
8744 }
8745 }
8746 state.end()
8747 }
8748}
8749
8750#[derive(Clone, Debug, Default, PartialEq)]
8752#[non_exhaustive]
8753pub struct Stage {
8754 pub name: crate::model::stage::Name,
8756
8757 pub message: std::string::String,
8759
8760 pub state: crate::model::stage::State,
8762
8763 pub resource: std::string::String,
8765
8766 pub resource_uri: std::string::String,
8768
8769 pub state_messages: std::vec::Vec<crate::model::StateMessage>,
8771
8772 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8773}
8774
8775impl Stage {
8776 pub fn new() -> Self {
8777 std::default::Default::default()
8778 }
8779
8780 pub fn set_name<T: std::convert::Into<crate::model::stage::Name>>(mut self, v: T) -> Self {
8782 self.name = v.into();
8783 self
8784 }
8785
8786 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8788 self.message = v.into();
8789 self
8790 }
8791
8792 pub fn set_state<T: std::convert::Into<crate::model::stage::State>>(mut self, v: T) -> Self {
8794 self.state = v.into();
8795 self
8796 }
8797
8798 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8800 self.resource = v.into();
8801 self
8802 }
8803
8804 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8806 self.resource_uri = v.into();
8807 self
8808 }
8809
8810 pub fn set_state_messages<T, V>(mut self, v: T) -> Self
8812 where
8813 T: std::iter::IntoIterator<Item = V>,
8814 V: std::convert::Into<crate::model::StateMessage>,
8815 {
8816 use std::iter::Iterator;
8817 self.state_messages = v.into_iter().map(|i| i.into()).collect();
8818 self
8819 }
8820}
8821
8822impl wkt::message::Message for Stage {
8823 fn typename() -> &'static str {
8824 "type.googleapis.com/google.cloud.functions.v2.Stage"
8825 }
8826}
8827
8828#[doc(hidden)]
8829impl<'de> serde::de::Deserialize<'de> for Stage {
8830 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8831 where
8832 D: serde::Deserializer<'de>,
8833 {
8834 #[allow(non_camel_case_types)]
8835 #[doc(hidden)]
8836 #[derive(PartialEq, Eq, Hash)]
8837 enum __FieldTag {
8838 __name,
8839 __message,
8840 __state,
8841 __resource,
8842 __resource_uri,
8843 __state_messages,
8844 Unknown(std::string::String),
8845 }
8846 impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8847 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8848 where
8849 D: serde::Deserializer<'de>,
8850 {
8851 struct Visitor;
8852 impl<'de> serde::de::Visitor<'de> for Visitor {
8853 type Value = __FieldTag;
8854 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8855 formatter.write_str("a field name for Stage")
8856 }
8857 fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8858 where
8859 E: serde::de::Error,
8860 {
8861 use std::result::Result::Ok;
8862 use std::string::ToString;
8863 match value {
8864 "name" => Ok(__FieldTag::__name),
8865 "message" => Ok(__FieldTag::__message),
8866 "state" => Ok(__FieldTag::__state),
8867 "resource" => Ok(__FieldTag::__resource),
8868 "resourceUri" => Ok(__FieldTag::__resource_uri),
8869 "resource_uri" => Ok(__FieldTag::__resource_uri),
8870 "stateMessages" => Ok(__FieldTag::__state_messages),
8871 "state_messages" => Ok(__FieldTag::__state_messages),
8872 _ => Ok(__FieldTag::Unknown(value.to_string())),
8873 }
8874 }
8875 }
8876 deserializer.deserialize_identifier(Visitor)
8877 }
8878 }
8879 struct Visitor;
8880 impl<'de> serde::de::Visitor<'de> for Visitor {
8881 type Value = Stage;
8882 fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8883 formatter.write_str("struct Stage")
8884 }
8885 fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8886 where
8887 A: serde::de::MapAccess<'de>,
8888 {
8889 #[allow(unused_imports)]
8890 use serde::de::Error;
8891 use std::option::Option::Some;
8892 let mut fields = std::collections::HashSet::new();
8893 let mut result = Self::Value::new();
8894 while let Some(tag) = map.next_key::<__FieldTag>()? {
8895 #[allow(clippy::match_single_binding)]
8896 match tag {
8897 __FieldTag::__name => {
8898 if !fields.insert(__FieldTag::__name) {
8899 return std::result::Result::Err(A::Error::duplicate_field(
8900 "multiple values for name",
8901 ));
8902 }
8903 result.name = map
8904 .next_value::<std::option::Option<crate::model::stage::Name>>()?
8905 .unwrap_or_default();
8906 }
8907 __FieldTag::__message => {
8908 if !fields.insert(__FieldTag::__message) {
8909 return std::result::Result::Err(A::Error::duplicate_field(
8910 "multiple values for message",
8911 ));
8912 }
8913 result.message = map
8914 .next_value::<std::option::Option<std::string::String>>()?
8915 .unwrap_or_default();
8916 }
8917 __FieldTag::__state => {
8918 if !fields.insert(__FieldTag::__state) {
8919 return std::result::Result::Err(A::Error::duplicate_field(
8920 "multiple values for state",
8921 ));
8922 }
8923 result.state = map
8924 .next_value::<std::option::Option<crate::model::stage::State>>()?
8925 .unwrap_or_default();
8926 }
8927 __FieldTag::__resource => {
8928 if !fields.insert(__FieldTag::__resource) {
8929 return std::result::Result::Err(A::Error::duplicate_field(
8930 "multiple values for resource",
8931 ));
8932 }
8933 result.resource = map
8934 .next_value::<std::option::Option<std::string::String>>()?
8935 .unwrap_or_default();
8936 }
8937 __FieldTag::__resource_uri => {
8938 if !fields.insert(__FieldTag::__resource_uri) {
8939 return std::result::Result::Err(A::Error::duplicate_field(
8940 "multiple values for resource_uri",
8941 ));
8942 }
8943 result.resource_uri = map
8944 .next_value::<std::option::Option<std::string::String>>()?
8945 .unwrap_or_default();
8946 }
8947 __FieldTag::__state_messages => {
8948 if !fields.insert(__FieldTag::__state_messages) {
8949 return std::result::Result::Err(A::Error::duplicate_field(
8950 "multiple values for state_messages",
8951 ));
8952 }
8953 result.state_messages = map.next_value::<std::option::Option<std::vec::Vec<crate::model::StateMessage>>>()?.unwrap_or_default();
8954 }
8955 __FieldTag::Unknown(key) => {
8956 let value = map.next_value::<serde_json::Value>()?;
8957 result._unknown_fields.insert(key, value);
8958 }
8959 }
8960 }
8961 std::result::Result::Ok(result)
8962 }
8963 }
8964 deserializer.deserialize_any(Visitor)
8965 }
8966}
8967
8968#[doc(hidden)]
8969impl serde::ser::Serialize for Stage {
8970 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8971 where
8972 S: serde::ser::Serializer,
8973 {
8974 use serde::ser::SerializeMap;
8975 #[allow(unused_imports)]
8976 use std::option::Option::Some;
8977 let mut state = serializer.serialize_map(std::option::Option::None)?;
8978 if !wkt::internal::is_default(&self.name) {
8979 state.serialize_entry("name", &self.name)?;
8980 }
8981 if !self.message.is_empty() {
8982 state.serialize_entry("message", &self.message)?;
8983 }
8984 if !wkt::internal::is_default(&self.state) {
8985 state.serialize_entry("state", &self.state)?;
8986 }
8987 if !self.resource.is_empty() {
8988 state.serialize_entry("resource", &self.resource)?;
8989 }
8990 if !self.resource_uri.is_empty() {
8991 state.serialize_entry("resourceUri", &self.resource_uri)?;
8992 }
8993 if !self.state_messages.is_empty() {
8994 state.serialize_entry("stateMessages", &self.state_messages)?;
8995 }
8996 if !self._unknown_fields.is_empty() {
8997 for (key, value) in self._unknown_fields.iter() {
8998 state.serialize_entry(key, &value)?;
8999 }
9000 }
9001 state.end()
9002 }
9003}
9004
9005pub mod stage {
9007 #[allow(unused_imports)]
9008 use super::*;
9009
9010 #[derive(Clone, Debug, PartialEq)]
9026 #[non_exhaustive]
9027 pub enum Name {
9028 Unspecified,
9030 ArtifactRegistry,
9032 Build,
9034 Service,
9036 Trigger,
9038 ServiceRollback,
9040 TriggerRollback,
9042 UnknownValue(name::UnknownValue),
9047 }
9048
9049 #[doc(hidden)]
9050 pub mod name {
9051 #[allow(unused_imports)]
9052 use super::*;
9053 #[derive(Clone, Debug, PartialEq)]
9054 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9055 }
9056
9057 impl Name {
9058 pub fn value(&self) -> std::option::Option<i32> {
9063 match self {
9064 Self::Unspecified => std::option::Option::Some(0),
9065 Self::ArtifactRegistry => std::option::Option::Some(1),
9066 Self::Build => std::option::Option::Some(2),
9067 Self::Service => std::option::Option::Some(3),
9068 Self::Trigger => std::option::Option::Some(4),
9069 Self::ServiceRollback => std::option::Option::Some(5),
9070 Self::TriggerRollback => std::option::Option::Some(6),
9071 Self::UnknownValue(u) => u.0.value(),
9072 }
9073 }
9074
9075 pub fn name(&self) -> std::option::Option<&str> {
9080 match self {
9081 Self::Unspecified => std::option::Option::Some("NAME_UNSPECIFIED"),
9082 Self::ArtifactRegistry => std::option::Option::Some("ARTIFACT_REGISTRY"),
9083 Self::Build => std::option::Option::Some("BUILD"),
9084 Self::Service => std::option::Option::Some("SERVICE"),
9085 Self::Trigger => std::option::Option::Some("TRIGGER"),
9086 Self::ServiceRollback => std::option::Option::Some("SERVICE_ROLLBACK"),
9087 Self::TriggerRollback => std::option::Option::Some("TRIGGER_ROLLBACK"),
9088 Self::UnknownValue(u) => u.0.name(),
9089 }
9090 }
9091 }
9092
9093 impl std::default::Default for Name {
9094 fn default() -> Self {
9095 use std::convert::From;
9096 Self::from(0)
9097 }
9098 }
9099
9100 impl std::fmt::Display for Name {
9101 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9102 wkt::internal::display_enum(f, self.name(), self.value())
9103 }
9104 }
9105
9106 impl std::convert::From<i32> for Name {
9107 fn from(value: i32) -> Self {
9108 match value {
9109 0 => Self::Unspecified,
9110 1 => Self::ArtifactRegistry,
9111 2 => Self::Build,
9112 3 => Self::Service,
9113 4 => Self::Trigger,
9114 5 => Self::ServiceRollback,
9115 6 => Self::TriggerRollback,
9116 _ => Self::UnknownValue(name::UnknownValue(
9117 wkt::internal::UnknownEnumValue::Integer(value),
9118 )),
9119 }
9120 }
9121 }
9122
9123 impl std::convert::From<&str> for Name {
9124 fn from(value: &str) -> Self {
9125 use std::string::ToString;
9126 match value {
9127 "NAME_UNSPECIFIED" => Self::Unspecified,
9128 "ARTIFACT_REGISTRY" => Self::ArtifactRegistry,
9129 "BUILD" => Self::Build,
9130 "SERVICE" => Self::Service,
9131 "TRIGGER" => Self::Trigger,
9132 "SERVICE_ROLLBACK" => Self::ServiceRollback,
9133 "TRIGGER_ROLLBACK" => Self::TriggerRollback,
9134 _ => Self::UnknownValue(name::UnknownValue(
9135 wkt::internal::UnknownEnumValue::String(value.to_string()),
9136 )),
9137 }
9138 }
9139 }
9140
9141 impl serde::ser::Serialize for Name {
9142 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9143 where
9144 S: serde::Serializer,
9145 {
9146 match self {
9147 Self::Unspecified => serializer.serialize_i32(0),
9148 Self::ArtifactRegistry => serializer.serialize_i32(1),
9149 Self::Build => serializer.serialize_i32(2),
9150 Self::Service => serializer.serialize_i32(3),
9151 Self::Trigger => serializer.serialize_i32(4),
9152 Self::ServiceRollback => serializer.serialize_i32(5),
9153 Self::TriggerRollback => serializer.serialize_i32(6),
9154 Self::UnknownValue(u) => u.0.serialize(serializer),
9155 }
9156 }
9157 }
9158
9159 impl<'de> serde::de::Deserialize<'de> for Name {
9160 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9161 where
9162 D: serde::Deserializer<'de>,
9163 {
9164 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Name>::new(
9165 ".google.cloud.functions.v2.Stage.Name",
9166 ))
9167 }
9168 }
9169
9170 #[derive(Clone, Debug, PartialEq)]
9186 #[non_exhaustive]
9187 pub enum State {
9188 Unspecified,
9190 NotStarted,
9192 InProgress,
9194 Complete,
9196 UnknownValue(state::UnknownValue),
9201 }
9202
9203 #[doc(hidden)]
9204 pub mod state {
9205 #[allow(unused_imports)]
9206 use super::*;
9207 #[derive(Clone, Debug, PartialEq)]
9208 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9209 }
9210
9211 impl State {
9212 pub fn value(&self) -> std::option::Option<i32> {
9217 match self {
9218 Self::Unspecified => std::option::Option::Some(0),
9219 Self::NotStarted => std::option::Option::Some(1),
9220 Self::InProgress => std::option::Option::Some(2),
9221 Self::Complete => std::option::Option::Some(3),
9222 Self::UnknownValue(u) => u.0.value(),
9223 }
9224 }
9225
9226 pub fn name(&self) -> std::option::Option<&str> {
9231 match self {
9232 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9233 Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
9234 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
9235 Self::Complete => std::option::Option::Some("COMPLETE"),
9236 Self::UnknownValue(u) => u.0.name(),
9237 }
9238 }
9239 }
9240
9241 impl std::default::Default for State {
9242 fn default() -> Self {
9243 use std::convert::From;
9244 Self::from(0)
9245 }
9246 }
9247
9248 impl std::fmt::Display for State {
9249 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9250 wkt::internal::display_enum(f, self.name(), self.value())
9251 }
9252 }
9253
9254 impl std::convert::From<i32> for State {
9255 fn from(value: i32) -> Self {
9256 match value {
9257 0 => Self::Unspecified,
9258 1 => Self::NotStarted,
9259 2 => Self::InProgress,
9260 3 => Self::Complete,
9261 _ => Self::UnknownValue(state::UnknownValue(
9262 wkt::internal::UnknownEnumValue::Integer(value),
9263 )),
9264 }
9265 }
9266 }
9267
9268 impl std::convert::From<&str> for State {
9269 fn from(value: &str) -> Self {
9270 use std::string::ToString;
9271 match value {
9272 "STATE_UNSPECIFIED" => Self::Unspecified,
9273 "NOT_STARTED" => Self::NotStarted,
9274 "IN_PROGRESS" => Self::InProgress,
9275 "COMPLETE" => Self::Complete,
9276 _ => Self::UnknownValue(state::UnknownValue(
9277 wkt::internal::UnknownEnumValue::String(value.to_string()),
9278 )),
9279 }
9280 }
9281 }
9282
9283 impl serde::ser::Serialize for State {
9284 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9285 where
9286 S: serde::Serializer,
9287 {
9288 match self {
9289 Self::Unspecified => serializer.serialize_i32(0),
9290 Self::NotStarted => serializer.serialize_i32(1),
9291 Self::InProgress => serializer.serialize_i32(2),
9292 Self::Complete => serializer.serialize_i32(3),
9293 Self::UnknownValue(u) => u.0.serialize(serializer),
9294 }
9295 }
9296 }
9297
9298 impl<'de> serde::de::Deserialize<'de> for State {
9299 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9300 where
9301 D: serde::Deserializer<'de>,
9302 {
9303 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9304 ".google.cloud.functions.v2.Stage.State",
9305 ))
9306 }
9307 }
9308}
9309
9310#[derive(Clone, Debug, PartialEq)]
9326#[non_exhaustive]
9327pub enum OperationType {
9328 OperationtypeUnspecified,
9330 CreateFunction,
9332 UpdateFunction,
9334 DeleteFunction,
9336 UnknownValue(operation_type::UnknownValue),
9341}
9342
9343#[doc(hidden)]
9344pub mod operation_type {
9345 #[allow(unused_imports)]
9346 use super::*;
9347 #[derive(Clone, Debug, PartialEq)]
9348 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9349}
9350
9351impl OperationType {
9352 pub fn value(&self) -> std::option::Option<i32> {
9357 match self {
9358 Self::OperationtypeUnspecified => std::option::Option::Some(0),
9359 Self::CreateFunction => std::option::Option::Some(1),
9360 Self::UpdateFunction => std::option::Option::Some(2),
9361 Self::DeleteFunction => std::option::Option::Some(3),
9362 Self::UnknownValue(u) => u.0.value(),
9363 }
9364 }
9365
9366 pub fn name(&self) -> std::option::Option<&str> {
9371 match self {
9372 Self::OperationtypeUnspecified => {
9373 std::option::Option::Some("OPERATIONTYPE_UNSPECIFIED")
9374 }
9375 Self::CreateFunction => std::option::Option::Some("CREATE_FUNCTION"),
9376 Self::UpdateFunction => std::option::Option::Some("UPDATE_FUNCTION"),
9377 Self::DeleteFunction => std::option::Option::Some("DELETE_FUNCTION"),
9378 Self::UnknownValue(u) => u.0.name(),
9379 }
9380 }
9381}
9382
9383impl std::default::Default for OperationType {
9384 fn default() -> Self {
9385 use std::convert::From;
9386 Self::from(0)
9387 }
9388}
9389
9390impl std::fmt::Display for OperationType {
9391 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9392 wkt::internal::display_enum(f, self.name(), self.value())
9393 }
9394}
9395
9396impl std::convert::From<i32> for OperationType {
9397 fn from(value: i32) -> Self {
9398 match value {
9399 0 => Self::OperationtypeUnspecified,
9400 1 => Self::CreateFunction,
9401 2 => Self::UpdateFunction,
9402 3 => Self::DeleteFunction,
9403 _ => Self::UnknownValue(operation_type::UnknownValue(
9404 wkt::internal::UnknownEnumValue::Integer(value),
9405 )),
9406 }
9407 }
9408}
9409
9410impl std::convert::From<&str> for OperationType {
9411 fn from(value: &str) -> Self {
9412 use std::string::ToString;
9413 match value {
9414 "OPERATIONTYPE_UNSPECIFIED" => Self::OperationtypeUnspecified,
9415 "CREATE_FUNCTION" => Self::CreateFunction,
9416 "UPDATE_FUNCTION" => Self::UpdateFunction,
9417 "DELETE_FUNCTION" => Self::DeleteFunction,
9418 _ => Self::UnknownValue(operation_type::UnknownValue(
9419 wkt::internal::UnknownEnumValue::String(value.to_string()),
9420 )),
9421 }
9422 }
9423}
9424
9425impl serde::ser::Serialize for OperationType {
9426 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9427 where
9428 S: serde::Serializer,
9429 {
9430 match self {
9431 Self::OperationtypeUnspecified => serializer.serialize_i32(0),
9432 Self::CreateFunction => serializer.serialize_i32(1),
9433 Self::UpdateFunction => serializer.serialize_i32(2),
9434 Self::DeleteFunction => serializer.serialize_i32(3),
9435 Self::UnknownValue(u) => u.0.serialize(serializer),
9436 }
9437 }
9438}
9439
9440impl<'de> serde::de::Deserialize<'de> for OperationType {
9441 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9442 where
9443 D: serde::Deserializer<'de>,
9444 {
9445 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperationType>::new(
9446 ".google.cloud.functions.v2.OperationType",
9447 ))
9448 }
9449}
9450
9451#[derive(Clone, Debug, PartialEq)]
9467#[non_exhaustive]
9468pub enum Environment {
9469 Unspecified,
9471 Gen1,
9473 Gen2,
9475 UnknownValue(environment::UnknownValue),
9480}
9481
9482#[doc(hidden)]
9483pub mod environment {
9484 #[allow(unused_imports)]
9485 use super::*;
9486 #[derive(Clone, Debug, PartialEq)]
9487 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9488}
9489
9490impl Environment {
9491 pub fn value(&self) -> std::option::Option<i32> {
9496 match self {
9497 Self::Unspecified => std::option::Option::Some(0),
9498 Self::Gen1 => std::option::Option::Some(1),
9499 Self::Gen2 => std::option::Option::Some(2),
9500 Self::UnknownValue(u) => u.0.value(),
9501 }
9502 }
9503
9504 pub fn name(&self) -> std::option::Option<&str> {
9509 match self {
9510 Self::Unspecified => std::option::Option::Some("ENVIRONMENT_UNSPECIFIED"),
9511 Self::Gen1 => std::option::Option::Some("GEN_1"),
9512 Self::Gen2 => std::option::Option::Some("GEN_2"),
9513 Self::UnknownValue(u) => u.0.name(),
9514 }
9515 }
9516}
9517
9518impl std::default::Default for Environment {
9519 fn default() -> Self {
9520 use std::convert::From;
9521 Self::from(0)
9522 }
9523}
9524
9525impl std::fmt::Display for Environment {
9526 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9527 wkt::internal::display_enum(f, self.name(), self.value())
9528 }
9529}
9530
9531impl std::convert::From<i32> for Environment {
9532 fn from(value: i32) -> Self {
9533 match value {
9534 0 => Self::Unspecified,
9535 1 => Self::Gen1,
9536 2 => Self::Gen2,
9537 _ => Self::UnknownValue(environment::UnknownValue(
9538 wkt::internal::UnknownEnumValue::Integer(value),
9539 )),
9540 }
9541 }
9542}
9543
9544impl std::convert::From<&str> for Environment {
9545 fn from(value: &str) -> Self {
9546 use std::string::ToString;
9547 match value {
9548 "ENVIRONMENT_UNSPECIFIED" => Self::Unspecified,
9549 "GEN_1" => Self::Gen1,
9550 "GEN_2" => Self::Gen2,
9551 _ => Self::UnknownValue(environment::UnknownValue(
9552 wkt::internal::UnknownEnumValue::String(value.to_string()),
9553 )),
9554 }
9555 }
9556}
9557
9558impl serde::ser::Serialize for Environment {
9559 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9560 where
9561 S: serde::Serializer,
9562 {
9563 match self {
9564 Self::Unspecified => serializer.serialize_i32(0),
9565 Self::Gen1 => serializer.serialize_i32(1),
9566 Self::Gen2 => serializer.serialize_i32(2),
9567 Self::UnknownValue(u) => u.0.serialize(serializer),
9568 }
9569 }
9570}
9571
9572impl<'de> serde::de::Deserialize<'de> for Environment {
9573 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9574 where
9575 D: serde::Deserializer<'de>,
9576 {
9577 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Environment>::new(
9578 ".google.cloud.functions.v2.Environment",
9579 ))
9580 }
9581}