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
38mod debug;
39mod deserialize;
40mod serialize;
41
42#[derive(Clone, Default, PartialEq)]
45#[non_exhaustive]
46pub struct Function {
47 pub name: std::string::String,
50
51 pub description: std::string::String,
53
54 pub build_config: std::option::Option<crate::model::BuildConfig>,
57
58 pub service_config: std::option::Option<crate::model::ServiceConfig>,
61
62 pub event_trigger: std::option::Option<crate::model::EventTrigger>,
65
66 pub state: crate::model::function::State,
68
69 pub update_time: std::option::Option<wkt::Timestamp>,
71
72 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
74
75 pub state_messages: std::vec::Vec<crate::model::StateMessage>,
77
78 pub environment: crate::model::Environment,
80
81 pub url: std::string::String,
83
84 pub kms_key_name: std::string::String,
90
91 pub satisfies_pzs: bool,
93
94 pub create_time: std::option::Option<wkt::Timestamp>,
97
98 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
99}
100
101impl Function {
102 pub fn new() -> Self {
103 std::default::Default::default()
104 }
105
106 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
108 self.name = v.into();
109 self
110 }
111
112 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
114 self.description = v.into();
115 self
116 }
117
118 pub fn set_build_config<T>(mut self, v: T) -> Self
120 where
121 T: std::convert::Into<crate::model::BuildConfig>,
122 {
123 self.build_config = std::option::Option::Some(v.into());
124 self
125 }
126
127 pub fn set_or_clear_build_config<T>(mut self, v: std::option::Option<T>) -> Self
129 where
130 T: std::convert::Into<crate::model::BuildConfig>,
131 {
132 self.build_config = v.map(|x| x.into());
133 self
134 }
135
136 pub fn set_service_config<T>(mut self, v: T) -> Self
138 where
139 T: std::convert::Into<crate::model::ServiceConfig>,
140 {
141 self.service_config = std::option::Option::Some(v.into());
142 self
143 }
144
145 pub fn set_or_clear_service_config<T>(mut self, v: std::option::Option<T>) -> Self
147 where
148 T: std::convert::Into<crate::model::ServiceConfig>,
149 {
150 self.service_config = v.map(|x| x.into());
151 self
152 }
153
154 pub fn set_event_trigger<T>(mut self, v: T) -> Self
156 where
157 T: std::convert::Into<crate::model::EventTrigger>,
158 {
159 self.event_trigger = std::option::Option::Some(v.into());
160 self
161 }
162
163 pub fn set_or_clear_event_trigger<T>(mut self, v: std::option::Option<T>) -> Self
165 where
166 T: std::convert::Into<crate::model::EventTrigger>,
167 {
168 self.event_trigger = v.map(|x| x.into());
169 self
170 }
171
172 pub fn set_state<T: std::convert::Into<crate::model::function::State>>(mut self, v: T) -> Self {
174 self.state = v.into();
175 self
176 }
177
178 pub fn set_update_time<T>(mut self, v: T) -> Self
180 where
181 T: std::convert::Into<wkt::Timestamp>,
182 {
183 self.update_time = std::option::Option::Some(v.into());
184 self
185 }
186
187 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
189 where
190 T: std::convert::Into<wkt::Timestamp>,
191 {
192 self.update_time = v.map(|x| x.into());
193 self
194 }
195
196 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
198 where
199 T: std::iter::IntoIterator<Item = (K, V)>,
200 K: std::convert::Into<std::string::String>,
201 V: std::convert::Into<std::string::String>,
202 {
203 use std::iter::Iterator;
204 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
205 self
206 }
207
208 pub fn set_state_messages<T, V>(mut self, v: T) -> Self
210 where
211 T: std::iter::IntoIterator<Item = V>,
212 V: std::convert::Into<crate::model::StateMessage>,
213 {
214 use std::iter::Iterator;
215 self.state_messages = v.into_iter().map(|i| i.into()).collect();
216 self
217 }
218
219 pub fn set_environment<T: std::convert::Into<crate::model::Environment>>(
221 mut self,
222 v: T,
223 ) -> Self {
224 self.environment = v.into();
225 self
226 }
227
228 pub fn set_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
230 self.url = v.into();
231 self
232 }
233
234 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
236 self.kms_key_name = v.into();
237 self
238 }
239
240 pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
242 self.satisfies_pzs = v.into();
243 self
244 }
245
246 pub fn set_create_time<T>(mut self, v: T) -> Self
248 where
249 T: std::convert::Into<wkt::Timestamp>,
250 {
251 self.create_time = std::option::Option::Some(v.into());
252 self
253 }
254
255 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
257 where
258 T: std::convert::Into<wkt::Timestamp>,
259 {
260 self.create_time = v.map(|x| x.into());
261 self
262 }
263}
264
265impl wkt::message::Message for Function {
266 fn typename() -> &'static str {
267 "type.googleapis.com/google.cloud.functions.v2.Function"
268 }
269}
270
271pub mod function {
273 #[allow(unused_imports)]
274 use super::*;
275
276 #[derive(Clone, Debug, PartialEq)]
292 #[non_exhaustive]
293 pub enum State {
294 Unspecified,
296 Active,
298 Failed,
300 Deploying,
302 Deleting,
304 Unknown,
307 UnknownValue(state::UnknownValue),
312 }
313
314 #[doc(hidden)]
315 pub mod state {
316 #[allow(unused_imports)]
317 use super::*;
318 #[derive(Clone, Debug, PartialEq)]
319 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
320 }
321
322 impl State {
323 pub fn value(&self) -> std::option::Option<i32> {
328 match self {
329 Self::Unspecified => std::option::Option::Some(0),
330 Self::Active => std::option::Option::Some(1),
331 Self::Failed => std::option::Option::Some(2),
332 Self::Deploying => std::option::Option::Some(3),
333 Self::Deleting => std::option::Option::Some(4),
334 Self::Unknown => std::option::Option::Some(5),
335 Self::UnknownValue(u) => u.0.value(),
336 }
337 }
338
339 pub fn name(&self) -> std::option::Option<&str> {
344 match self {
345 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
346 Self::Active => std::option::Option::Some("ACTIVE"),
347 Self::Failed => std::option::Option::Some("FAILED"),
348 Self::Deploying => std::option::Option::Some("DEPLOYING"),
349 Self::Deleting => std::option::Option::Some("DELETING"),
350 Self::Unknown => std::option::Option::Some("UNKNOWN"),
351 Self::UnknownValue(u) => u.0.name(),
352 }
353 }
354 }
355
356 impl std::default::Default for State {
357 fn default() -> Self {
358 use std::convert::From;
359 Self::from(0)
360 }
361 }
362
363 impl std::fmt::Display for State {
364 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
365 wkt::internal::display_enum(f, self.name(), self.value())
366 }
367 }
368
369 impl std::convert::From<i32> for State {
370 fn from(value: i32) -> Self {
371 match value {
372 0 => Self::Unspecified,
373 1 => Self::Active,
374 2 => Self::Failed,
375 3 => Self::Deploying,
376 4 => Self::Deleting,
377 5 => Self::Unknown,
378 _ => Self::UnknownValue(state::UnknownValue(
379 wkt::internal::UnknownEnumValue::Integer(value),
380 )),
381 }
382 }
383 }
384
385 impl std::convert::From<&str> for State {
386 fn from(value: &str) -> Self {
387 use std::string::ToString;
388 match value {
389 "STATE_UNSPECIFIED" => Self::Unspecified,
390 "ACTIVE" => Self::Active,
391 "FAILED" => Self::Failed,
392 "DEPLOYING" => Self::Deploying,
393 "DELETING" => Self::Deleting,
394 "UNKNOWN" => Self::Unknown,
395 _ => Self::UnknownValue(state::UnknownValue(
396 wkt::internal::UnknownEnumValue::String(value.to_string()),
397 )),
398 }
399 }
400 }
401
402 impl serde::ser::Serialize for State {
403 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
404 where
405 S: serde::Serializer,
406 {
407 match self {
408 Self::Unspecified => serializer.serialize_i32(0),
409 Self::Active => serializer.serialize_i32(1),
410 Self::Failed => serializer.serialize_i32(2),
411 Self::Deploying => serializer.serialize_i32(3),
412 Self::Deleting => serializer.serialize_i32(4),
413 Self::Unknown => serializer.serialize_i32(5),
414 Self::UnknownValue(u) => u.0.serialize(serializer),
415 }
416 }
417 }
418
419 impl<'de> serde::de::Deserialize<'de> for State {
420 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
421 where
422 D: serde::Deserializer<'de>,
423 {
424 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
425 ".google.cloud.functions.v2.Function.State",
426 ))
427 }
428 }
429}
430
431#[derive(Clone, Default, PartialEq)]
433#[non_exhaustive]
434pub struct StateMessage {
435 pub severity: crate::model::state_message::Severity,
437
438 pub r#type: std::string::String,
440
441 pub message: std::string::String,
443
444 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
445}
446
447impl StateMessage {
448 pub fn new() -> Self {
449 std::default::Default::default()
450 }
451
452 pub fn set_severity<T: std::convert::Into<crate::model::state_message::Severity>>(
454 mut self,
455 v: T,
456 ) -> Self {
457 self.severity = v.into();
458 self
459 }
460
461 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
463 self.r#type = v.into();
464 self
465 }
466
467 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
469 self.message = v.into();
470 self
471 }
472}
473
474impl wkt::message::Message for StateMessage {
475 fn typename() -> &'static str {
476 "type.googleapis.com/google.cloud.functions.v2.StateMessage"
477 }
478}
479
480pub mod state_message {
482 #[allow(unused_imports)]
483 use super::*;
484
485 #[derive(Clone, Debug, PartialEq)]
501 #[non_exhaustive]
502 pub enum Severity {
503 Unspecified,
505 Error,
507 Warning,
509 Info,
511 UnknownValue(severity::UnknownValue),
516 }
517
518 #[doc(hidden)]
519 pub mod severity {
520 #[allow(unused_imports)]
521 use super::*;
522 #[derive(Clone, Debug, PartialEq)]
523 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
524 }
525
526 impl Severity {
527 pub fn value(&self) -> std::option::Option<i32> {
532 match self {
533 Self::Unspecified => std::option::Option::Some(0),
534 Self::Error => std::option::Option::Some(1),
535 Self::Warning => std::option::Option::Some(2),
536 Self::Info => std::option::Option::Some(3),
537 Self::UnknownValue(u) => u.0.value(),
538 }
539 }
540
541 pub fn name(&self) -> std::option::Option<&str> {
546 match self {
547 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
548 Self::Error => std::option::Option::Some("ERROR"),
549 Self::Warning => std::option::Option::Some("WARNING"),
550 Self::Info => std::option::Option::Some("INFO"),
551 Self::UnknownValue(u) => u.0.name(),
552 }
553 }
554 }
555
556 impl std::default::Default for Severity {
557 fn default() -> Self {
558 use std::convert::From;
559 Self::from(0)
560 }
561 }
562
563 impl std::fmt::Display for Severity {
564 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
565 wkt::internal::display_enum(f, self.name(), self.value())
566 }
567 }
568
569 impl std::convert::From<i32> for Severity {
570 fn from(value: i32) -> Self {
571 match value {
572 0 => Self::Unspecified,
573 1 => Self::Error,
574 2 => Self::Warning,
575 3 => Self::Info,
576 _ => Self::UnknownValue(severity::UnknownValue(
577 wkt::internal::UnknownEnumValue::Integer(value),
578 )),
579 }
580 }
581 }
582
583 impl std::convert::From<&str> for Severity {
584 fn from(value: &str) -> Self {
585 use std::string::ToString;
586 match value {
587 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
588 "ERROR" => Self::Error,
589 "WARNING" => Self::Warning,
590 "INFO" => Self::Info,
591 _ => Self::UnknownValue(severity::UnknownValue(
592 wkt::internal::UnknownEnumValue::String(value.to_string()),
593 )),
594 }
595 }
596 }
597
598 impl serde::ser::Serialize for Severity {
599 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
600 where
601 S: serde::Serializer,
602 {
603 match self {
604 Self::Unspecified => serializer.serialize_i32(0),
605 Self::Error => serializer.serialize_i32(1),
606 Self::Warning => serializer.serialize_i32(2),
607 Self::Info => serializer.serialize_i32(3),
608 Self::UnknownValue(u) => u.0.serialize(serializer),
609 }
610 }
611 }
612
613 impl<'de> serde::de::Deserialize<'de> for Severity {
614 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
615 where
616 D: serde::Deserializer<'de>,
617 {
618 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
619 ".google.cloud.functions.v2.StateMessage.Severity",
620 ))
621 }
622 }
623}
624
625#[derive(Clone, Default, PartialEq)]
627#[non_exhaustive]
628pub struct StorageSource {
629 pub bucket: std::string::String,
633
634 pub object: std::string::String,
639
640 pub generation: i64,
643
644 pub source_upload_url: std::string::String,
648
649 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
650}
651
652impl StorageSource {
653 pub fn new() -> Self {
654 std::default::Default::default()
655 }
656
657 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
659 self.bucket = v.into();
660 self
661 }
662
663 pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
665 self.object = v.into();
666 self
667 }
668
669 pub fn set_generation<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
671 self.generation = v.into();
672 self
673 }
674
675 pub fn set_source_upload_url<T: std::convert::Into<std::string::String>>(
677 mut self,
678 v: T,
679 ) -> Self {
680 self.source_upload_url = v.into();
681 self
682 }
683}
684
685impl wkt::message::Message for StorageSource {
686 fn typename() -> &'static str {
687 "type.googleapis.com/google.cloud.functions.v2.StorageSource"
688 }
689}
690
691#[derive(Clone, Default, PartialEq)]
693#[non_exhaustive]
694pub struct RepoSource {
695 pub project_id: std::string::String,
698
699 pub repo_name: std::string::String,
701
702 pub dir: std::string::String,
708
709 pub invert_regex: bool,
712
713 pub revision: std::option::Option<crate::model::repo_source::Revision>,
716
717 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
718}
719
720impl RepoSource {
721 pub fn new() -> Self {
722 std::default::Default::default()
723 }
724
725 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
727 self.project_id = v.into();
728 self
729 }
730
731 pub fn set_repo_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
733 self.repo_name = v.into();
734 self
735 }
736
737 pub fn set_dir<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
739 self.dir = v.into();
740 self
741 }
742
743 pub fn set_invert_regex<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
745 self.invert_regex = v.into();
746 self
747 }
748
749 pub fn set_revision<
754 T: std::convert::Into<std::option::Option<crate::model::repo_source::Revision>>,
755 >(
756 mut self,
757 v: T,
758 ) -> Self {
759 self.revision = v.into();
760 self
761 }
762
763 pub fn branch_name(&self) -> std::option::Option<&std::string::String> {
767 #[allow(unreachable_patterns)]
768 self.revision.as_ref().and_then(|v| match v {
769 crate::model::repo_source::Revision::BranchName(v) => std::option::Option::Some(v),
770 _ => std::option::Option::None,
771 })
772 }
773
774 pub fn set_branch_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
780 self.revision =
781 std::option::Option::Some(crate::model::repo_source::Revision::BranchName(v.into()));
782 self
783 }
784
785 pub fn tag_name(&self) -> std::option::Option<&std::string::String> {
789 #[allow(unreachable_patterns)]
790 self.revision.as_ref().and_then(|v| match v {
791 crate::model::repo_source::Revision::TagName(v) => std::option::Option::Some(v),
792 _ => std::option::Option::None,
793 })
794 }
795
796 pub fn set_tag_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
802 self.revision =
803 std::option::Option::Some(crate::model::repo_source::Revision::TagName(v.into()));
804 self
805 }
806
807 pub fn commit_sha(&self) -> std::option::Option<&std::string::String> {
811 #[allow(unreachable_patterns)]
812 self.revision.as_ref().and_then(|v| match v {
813 crate::model::repo_source::Revision::CommitSha(v) => std::option::Option::Some(v),
814 _ => std::option::Option::None,
815 })
816 }
817
818 pub fn set_commit_sha<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
824 self.revision =
825 std::option::Option::Some(crate::model::repo_source::Revision::CommitSha(v.into()));
826 self
827 }
828}
829
830impl wkt::message::Message for RepoSource {
831 fn typename() -> &'static str {
832 "type.googleapis.com/google.cloud.functions.v2.RepoSource"
833 }
834}
835
836pub mod repo_source {
838 #[allow(unused_imports)]
839 use super::*;
840
841 #[derive(Clone, Debug, PartialEq)]
844 #[non_exhaustive]
845 pub enum Revision {
846 BranchName(std::string::String),
851 TagName(std::string::String),
856 CommitSha(std::string::String),
858 }
859}
860
861#[derive(Clone, Default, PartialEq)]
863#[non_exhaustive]
864pub struct Source {
865 pub source: std::option::Option<crate::model::source::Source>,
868
869 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
870}
871
872impl Source {
873 pub fn new() -> Self {
874 std::default::Default::default()
875 }
876
877 pub fn set_source<T: std::convert::Into<std::option::Option<crate::model::source::Source>>>(
882 mut self,
883 v: T,
884 ) -> Self {
885 self.source = v.into();
886 self
887 }
888
889 pub fn storage_source(
893 &self,
894 ) -> std::option::Option<&std::boxed::Box<crate::model::StorageSource>> {
895 #[allow(unreachable_patterns)]
896 self.source.as_ref().and_then(|v| match v {
897 crate::model::source::Source::StorageSource(v) => std::option::Option::Some(v),
898 _ => std::option::Option::None,
899 })
900 }
901
902 pub fn set_storage_source<
908 T: std::convert::Into<std::boxed::Box<crate::model::StorageSource>>,
909 >(
910 mut self,
911 v: T,
912 ) -> Self {
913 self.source =
914 std::option::Option::Some(crate::model::source::Source::StorageSource(v.into()));
915 self
916 }
917
918 pub fn repo_source(&self) -> std::option::Option<&std::boxed::Box<crate::model::RepoSource>> {
922 #[allow(unreachable_patterns)]
923 self.source.as_ref().and_then(|v| match v {
924 crate::model::source::Source::RepoSource(v) => std::option::Option::Some(v),
925 _ => std::option::Option::None,
926 })
927 }
928
929 pub fn set_repo_source<T: std::convert::Into<std::boxed::Box<crate::model::RepoSource>>>(
935 mut self,
936 v: T,
937 ) -> Self {
938 self.source = std::option::Option::Some(crate::model::source::Source::RepoSource(v.into()));
939 self
940 }
941
942 pub fn git_uri(&self) -> std::option::Option<&std::string::String> {
946 #[allow(unreachable_patterns)]
947 self.source.as_ref().and_then(|v| match v {
948 crate::model::source::Source::GitUri(v) => std::option::Option::Some(v),
949 _ => std::option::Option::None,
950 })
951 }
952
953 pub fn set_git_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
959 self.source = std::option::Option::Some(crate::model::source::Source::GitUri(v.into()));
960 self
961 }
962}
963
964impl wkt::message::Message for Source {
965 fn typename() -> &'static str {
966 "type.googleapis.com/google.cloud.functions.v2.Source"
967 }
968}
969
970pub mod source {
972 #[allow(unused_imports)]
973 use super::*;
974
975 #[derive(Clone, Debug, PartialEq)]
978 #[non_exhaustive]
979 pub enum Source {
980 StorageSource(std::boxed::Box<crate::model::StorageSource>),
982 RepoSource(std::boxed::Box<crate::model::RepoSource>),
985 GitUri(std::string::String),
989 }
990}
991
992#[derive(Clone, Default, PartialEq)]
995#[non_exhaustive]
996pub struct SourceProvenance {
997 pub resolved_storage_source: std::option::Option<crate::model::StorageSource>,
1000
1001 pub resolved_repo_source: std::option::Option<crate::model::RepoSource>,
1004
1005 pub git_uri: std::string::String,
1008
1009 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1010}
1011
1012impl SourceProvenance {
1013 pub fn new() -> Self {
1014 std::default::Default::default()
1015 }
1016
1017 pub fn set_resolved_storage_source<T>(mut self, v: T) -> Self
1019 where
1020 T: std::convert::Into<crate::model::StorageSource>,
1021 {
1022 self.resolved_storage_source = std::option::Option::Some(v.into());
1023 self
1024 }
1025
1026 pub fn set_or_clear_resolved_storage_source<T>(mut self, v: std::option::Option<T>) -> Self
1028 where
1029 T: std::convert::Into<crate::model::StorageSource>,
1030 {
1031 self.resolved_storage_source = v.map(|x| x.into());
1032 self
1033 }
1034
1035 pub fn set_resolved_repo_source<T>(mut self, v: T) -> Self
1037 where
1038 T: std::convert::Into<crate::model::RepoSource>,
1039 {
1040 self.resolved_repo_source = std::option::Option::Some(v.into());
1041 self
1042 }
1043
1044 pub fn set_or_clear_resolved_repo_source<T>(mut self, v: std::option::Option<T>) -> Self
1046 where
1047 T: std::convert::Into<crate::model::RepoSource>,
1048 {
1049 self.resolved_repo_source = v.map(|x| x.into());
1050 self
1051 }
1052
1053 pub fn set_git_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1055 self.git_uri = v.into();
1056 self
1057 }
1058}
1059
1060impl wkt::message::Message for SourceProvenance {
1061 fn typename() -> &'static str {
1062 "type.googleapis.com/google.cloud.functions.v2.SourceProvenance"
1063 }
1064}
1065
1066#[derive(Clone, Default, PartialEq)]
1069#[non_exhaustive]
1070pub struct BuildConfig {
1071 pub build: std::string::String,
1074
1075 pub runtime: std::string::String,
1081
1082 pub entry_point: std::string::String,
1089
1090 pub source: std::option::Option<crate::model::Source>,
1092
1093 pub source_provenance: std::option::Option<crate::model::SourceProvenance>,
1095
1096 pub worker_pool: std::string::String,
1109
1110 pub environment_variables: std::collections::HashMap<std::string::String, std::string::String>,
1112
1113 #[deprecated]
1125 pub docker_registry: crate::model::build_config::DockerRegistry,
1126
1127 pub docker_repository: std::string::String,
1137
1138 pub service_account: std::string::String,
1141
1142 pub runtime_update_policy: std::option::Option<crate::model::build_config::RuntimeUpdatePolicy>,
1144
1145 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1146}
1147
1148impl BuildConfig {
1149 pub fn new() -> Self {
1150 std::default::Default::default()
1151 }
1152
1153 pub fn set_build<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1155 self.build = v.into();
1156 self
1157 }
1158
1159 pub fn set_runtime<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1161 self.runtime = v.into();
1162 self
1163 }
1164
1165 pub fn set_entry_point<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1167 self.entry_point = v.into();
1168 self
1169 }
1170
1171 pub fn set_source<T>(mut self, v: T) -> Self
1173 where
1174 T: std::convert::Into<crate::model::Source>,
1175 {
1176 self.source = std::option::Option::Some(v.into());
1177 self
1178 }
1179
1180 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
1182 where
1183 T: std::convert::Into<crate::model::Source>,
1184 {
1185 self.source = v.map(|x| x.into());
1186 self
1187 }
1188
1189 pub fn set_source_provenance<T>(mut self, v: T) -> Self
1191 where
1192 T: std::convert::Into<crate::model::SourceProvenance>,
1193 {
1194 self.source_provenance = std::option::Option::Some(v.into());
1195 self
1196 }
1197
1198 pub fn set_or_clear_source_provenance<T>(mut self, v: std::option::Option<T>) -> Self
1200 where
1201 T: std::convert::Into<crate::model::SourceProvenance>,
1202 {
1203 self.source_provenance = v.map(|x| x.into());
1204 self
1205 }
1206
1207 pub fn set_worker_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1209 self.worker_pool = v.into();
1210 self
1211 }
1212
1213 pub fn set_environment_variables<T, K, V>(mut self, v: T) -> Self
1215 where
1216 T: std::iter::IntoIterator<Item = (K, V)>,
1217 K: std::convert::Into<std::string::String>,
1218 V: std::convert::Into<std::string::String>,
1219 {
1220 use std::iter::Iterator;
1221 self.environment_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1222 self
1223 }
1224
1225 #[deprecated]
1227 pub fn set_docker_registry<
1228 T: std::convert::Into<crate::model::build_config::DockerRegistry>,
1229 >(
1230 mut self,
1231 v: T,
1232 ) -> Self {
1233 self.docker_registry = v.into();
1234 self
1235 }
1236
1237 pub fn set_docker_repository<T: std::convert::Into<std::string::String>>(
1239 mut self,
1240 v: T,
1241 ) -> Self {
1242 self.docker_repository = v.into();
1243 self
1244 }
1245
1246 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1248 self.service_account = v.into();
1249 self
1250 }
1251
1252 pub fn set_runtime_update_policy<
1257 T: std::convert::Into<std::option::Option<crate::model::build_config::RuntimeUpdatePolicy>>,
1258 >(
1259 mut self,
1260 v: T,
1261 ) -> Self {
1262 self.runtime_update_policy = v.into();
1263 self
1264 }
1265
1266 pub fn automatic_update_policy(
1270 &self,
1271 ) -> std::option::Option<&std::boxed::Box<crate::model::AutomaticUpdatePolicy>> {
1272 #[allow(unreachable_patterns)]
1273 self.runtime_update_policy.as_ref().and_then(|v| match v {
1274 crate::model::build_config::RuntimeUpdatePolicy::AutomaticUpdatePolicy(v) => {
1275 std::option::Option::Some(v)
1276 }
1277 _ => std::option::Option::None,
1278 })
1279 }
1280
1281 pub fn set_automatic_update_policy<
1287 T: std::convert::Into<std::boxed::Box<crate::model::AutomaticUpdatePolicy>>,
1288 >(
1289 mut self,
1290 v: T,
1291 ) -> Self {
1292 self.runtime_update_policy = std::option::Option::Some(
1293 crate::model::build_config::RuntimeUpdatePolicy::AutomaticUpdatePolicy(v.into()),
1294 );
1295 self
1296 }
1297
1298 pub fn on_deploy_update_policy(
1302 &self,
1303 ) -> std::option::Option<&std::boxed::Box<crate::model::OnDeployUpdatePolicy>> {
1304 #[allow(unreachable_patterns)]
1305 self.runtime_update_policy.as_ref().and_then(|v| match v {
1306 crate::model::build_config::RuntimeUpdatePolicy::OnDeployUpdatePolicy(v) => {
1307 std::option::Option::Some(v)
1308 }
1309 _ => std::option::Option::None,
1310 })
1311 }
1312
1313 pub fn set_on_deploy_update_policy<
1319 T: std::convert::Into<std::boxed::Box<crate::model::OnDeployUpdatePolicy>>,
1320 >(
1321 mut self,
1322 v: T,
1323 ) -> Self {
1324 self.runtime_update_policy = std::option::Option::Some(
1325 crate::model::build_config::RuntimeUpdatePolicy::OnDeployUpdatePolicy(v.into()),
1326 );
1327 self
1328 }
1329}
1330
1331impl wkt::message::Message for BuildConfig {
1332 fn typename() -> &'static str {
1333 "type.googleapis.com/google.cloud.functions.v2.BuildConfig"
1334 }
1335}
1336
1337pub mod build_config {
1339 #[allow(unused_imports)]
1340 use super::*;
1341
1342 #[derive(Clone, Debug, PartialEq)]
1358 #[non_exhaustive]
1359 pub enum DockerRegistry {
1360 Unspecified,
1362 ContainerRegistry,
1365 ArtifactRegistry,
1371 UnknownValue(docker_registry::UnknownValue),
1376 }
1377
1378 #[doc(hidden)]
1379 pub mod docker_registry {
1380 #[allow(unused_imports)]
1381 use super::*;
1382 #[derive(Clone, Debug, PartialEq)]
1383 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1384 }
1385
1386 impl DockerRegistry {
1387 pub fn value(&self) -> std::option::Option<i32> {
1392 match self {
1393 Self::Unspecified => std::option::Option::Some(0),
1394 Self::ContainerRegistry => std::option::Option::Some(1),
1395 Self::ArtifactRegistry => std::option::Option::Some(2),
1396 Self::UnknownValue(u) => u.0.value(),
1397 }
1398 }
1399
1400 pub fn name(&self) -> std::option::Option<&str> {
1405 match self {
1406 Self::Unspecified => std::option::Option::Some("DOCKER_REGISTRY_UNSPECIFIED"),
1407 Self::ContainerRegistry => std::option::Option::Some("CONTAINER_REGISTRY"),
1408 Self::ArtifactRegistry => std::option::Option::Some("ARTIFACT_REGISTRY"),
1409 Self::UnknownValue(u) => u.0.name(),
1410 }
1411 }
1412 }
1413
1414 impl std::default::Default for DockerRegistry {
1415 fn default() -> Self {
1416 use std::convert::From;
1417 Self::from(0)
1418 }
1419 }
1420
1421 impl std::fmt::Display for DockerRegistry {
1422 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1423 wkt::internal::display_enum(f, self.name(), self.value())
1424 }
1425 }
1426
1427 impl std::convert::From<i32> for DockerRegistry {
1428 fn from(value: i32) -> Self {
1429 match value {
1430 0 => Self::Unspecified,
1431 1 => Self::ContainerRegistry,
1432 2 => Self::ArtifactRegistry,
1433 _ => Self::UnknownValue(docker_registry::UnknownValue(
1434 wkt::internal::UnknownEnumValue::Integer(value),
1435 )),
1436 }
1437 }
1438 }
1439
1440 impl std::convert::From<&str> for DockerRegistry {
1441 fn from(value: &str) -> Self {
1442 use std::string::ToString;
1443 match value {
1444 "DOCKER_REGISTRY_UNSPECIFIED" => Self::Unspecified,
1445 "CONTAINER_REGISTRY" => Self::ContainerRegistry,
1446 "ARTIFACT_REGISTRY" => Self::ArtifactRegistry,
1447 _ => Self::UnknownValue(docker_registry::UnknownValue(
1448 wkt::internal::UnknownEnumValue::String(value.to_string()),
1449 )),
1450 }
1451 }
1452 }
1453
1454 impl serde::ser::Serialize for DockerRegistry {
1455 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1456 where
1457 S: serde::Serializer,
1458 {
1459 match self {
1460 Self::Unspecified => serializer.serialize_i32(0),
1461 Self::ContainerRegistry => serializer.serialize_i32(1),
1462 Self::ArtifactRegistry => serializer.serialize_i32(2),
1463 Self::UnknownValue(u) => u.0.serialize(serializer),
1464 }
1465 }
1466 }
1467
1468 impl<'de> serde::de::Deserialize<'de> for DockerRegistry {
1469 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1470 where
1471 D: serde::Deserializer<'de>,
1472 {
1473 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DockerRegistry>::new(
1474 ".google.cloud.functions.v2.BuildConfig.DockerRegistry",
1475 ))
1476 }
1477 }
1478
1479 #[derive(Clone, Debug, PartialEq)]
1481 #[non_exhaustive]
1482 pub enum RuntimeUpdatePolicy {
1483 AutomaticUpdatePolicy(std::boxed::Box<crate::model::AutomaticUpdatePolicy>),
1484 OnDeployUpdatePolicy(std::boxed::Box<crate::model::OnDeployUpdatePolicy>),
1485 }
1486}
1487
1488#[derive(Clone, Default, PartialEq)]
1491#[non_exhaustive]
1492pub struct ServiceConfig {
1493 pub service: std::string::String,
1497
1498 pub timeout_seconds: i32,
1502
1503 pub available_memory: std::string::String,
1510
1511 pub available_cpu: std::string::String,
1517
1518 pub environment_variables: std::collections::HashMap<std::string::String, std::string::String>,
1520
1521 pub max_instance_count: i32,
1534
1535 pub min_instance_count: i32,
1545
1546 pub vpc_connector: std::string::String,
1549
1550 pub vpc_connector_egress_settings: crate::model::service_config::VpcConnectorEgressSettings,
1553
1554 pub ingress_settings: crate::model::service_config::IngressSettings,
1557
1558 pub uri: std::string::String,
1560
1561 pub service_account_email: std::string::String,
1564
1565 pub all_traffic_on_latest_revision: bool,
1571
1572 pub secret_environment_variables: std::vec::Vec<crate::model::SecretEnvVar>,
1574
1575 pub secret_volumes: std::vec::Vec<crate::model::SecretVolume>,
1577
1578 pub revision: std::string::String,
1580
1581 pub max_instance_request_concurrency: i32,
1584
1585 pub security_level: crate::model::service_config::SecurityLevel,
1590
1591 pub binary_authorization_policy: std::string::String,
1594
1595 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1596}
1597
1598impl ServiceConfig {
1599 pub fn new() -> Self {
1600 std::default::Default::default()
1601 }
1602
1603 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1605 self.service = v.into();
1606 self
1607 }
1608
1609 pub fn set_timeout_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1611 self.timeout_seconds = v.into();
1612 self
1613 }
1614
1615 pub fn set_available_memory<T: std::convert::Into<std::string::String>>(
1617 mut self,
1618 v: T,
1619 ) -> Self {
1620 self.available_memory = v.into();
1621 self
1622 }
1623
1624 pub fn set_available_cpu<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1626 self.available_cpu = v.into();
1627 self
1628 }
1629
1630 pub fn set_environment_variables<T, K, V>(mut self, v: T) -> Self
1632 where
1633 T: std::iter::IntoIterator<Item = (K, V)>,
1634 K: std::convert::Into<std::string::String>,
1635 V: std::convert::Into<std::string::String>,
1636 {
1637 use std::iter::Iterator;
1638 self.environment_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1639 self
1640 }
1641
1642 pub fn set_max_instance_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1644 self.max_instance_count = v.into();
1645 self
1646 }
1647
1648 pub fn set_min_instance_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1650 self.min_instance_count = v.into();
1651 self
1652 }
1653
1654 pub fn set_vpc_connector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1656 self.vpc_connector = v.into();
1657 self
1658 }
1659
1660 pub fn set_vpc_connector_egress_settings<
1662 T: std::convert::Into<crate::model::service_config::VpcConnectorEgressSettings>,
1663 >(
1664 mut self,
1665 v: T,
1666 ) -> Self {
1667 self.vpc_connector_egress_settings = v.into();
1668 self
1669 }
1670
1671 pub fn set_ingress_settings<
1673 T: std::convert::Into<crate::model::service_config::IngressSettings>,
1674 >(
1675 mut self,
1676 v: T,
1677 ) -> Self {
1678 self.ingress_settings = v.into();
1679 self
1680 }
1681
1682 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1684 self.uri = v.into();
1685 self
1686 }
1687
1688 pub fn set_service_account_email<T: std::convert::Into<std::string::String>>(
1690 mut self,
1691 v: T,
1692 ) -> Self {
1693 self.service_account_email = v.into();
1694 self
1695 }
1696
1697 pub fn set_all_traffic_on_latest_revision<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1699 self.all_traffic_on_latest_revision = v.into();
1700 self
1701 }
1702
1703 pub fn set_secret_environment_variables<T, V>(mut self, v: T) -> Self
1705 where
1706 T: std::iter::IntoIterator<Item = V>,
1707 V: std::convert::Into<crate::model::SecretEnvVar>,
1708 {
1709 use std::iter::Iterator;
1710 self.secret_environment_variables = v.into_iter().map(|i| i.into()).collect();
1711 self
1712 }
1713
1714 pub fn set_secret_volumes<T, V>(mut self, v: T) -> Self
1716 where
1717 T: std::iter::IntoIterator<Item = V>,
1718 V: std::convert::Into<crate::model::SecretVolume>,
1719 {
1720 use std::iter::Iterator;
1721 self.secret_volumes = v.into_iter().map(|i| i.into()).collect();
1722 self
1723 }
1724
1725 pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1727 self.revision = v.into();
1728 self
1729 }
1730
1731 pub fn set_max_instance_request_concurrency<T: std::convert::Into<i32>>(
1733 mut self,
1734 v: T,
1735 ) -> Self {
1736 self.max_instance_request_concurrency = v.into();
1737 self
1738 }
1739
1740 pub fn set_security_level<
1742 T: std::convert::Into<crate::model::service_config::SecurityLevel>,
1743 >(
1744 mut self,
1745 v: T,
1746 ) -> Self {
1747 self.security_level = v.into();
1748 self
1749 }
1750
1751 pub fn set_binary_authorization_policy<T: std::convert::Into<std::string::String>>(
1753 mut self,
1754 v: T,
1755 ) -> Self {
1756 self.binary_authorization_policy = v.into();
1757 self
1758 }
1759}
1760
1761impl wkt::message::Message for ServiceConfig {
1762 fn typename() -> &'static str {
1763 "type.googleapis.com/google.cloud.functions.v2.ServiceConfig"
1764 }
1765}
1766
1767pub mod service_config {
1769 #[allow(unused_imports)]
1770 use super::*;
1771
1772 #[derive(Clone, Debug, PartialEq)]
1791 #[non_exhaustive]
1792 pub enum VpcConnectorEgressSettings {
1793 Unspecified,
1795 PrivateRangesOnly,
1797 AllTraffic,
1800 UnknownValue(vpc_connector_egress_settings::UnknownValue),
1805 }
1806
1807 #[doc(hidden)]
1808 pub mod vpc_connector_egress_settings {
1809 #[allow(unused_imports)]
1810 use super::*;
1811 #[derive(Clone, Debug, PartialEq)]
1812 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1813 }
1814
1815 impl VpcConnectorEgressSettings {
1816 pub fn value(&self) -> std::option::Option<i32> {
1821 match self {
1822 Self::Unspecified => std::option::Option::Some(0),
1823 Self::PrivateRangesOnly => std::option::Option::Some(1),
1824 Self::AllTraffic => std::option::Option::Some(2),
1825 Self::UnknownValue(u) => u.0.value(),
1826 }
1827 }
1828
1829 pub fn name(&self) -> std::option::Option<&str> {
1834 match self {
1835 Self::Unspecified => {
1836 std::option::Option::Some("VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED")
1837 }
1838 Self::PrivateRangesOnly => std::option::Option::Some("PRIVATE_RANGES_ONLY"),
1839 Self::AllTraffic => std::option::Option::Some("ALL_TRAFFIC"),
1840 Self::UnknownValue(u) => u.0.name(),
1841 }
1842 }
1843 }
1844
1845 impl std::default::Default for VpcConnectorEgressSettings {
1846 fn default() -> Self {
1847 use std::convert::From;
1848 Self::from(0)
1849 }
1850 }
1851
1852 impl std::fmt::Display for VpcConnectorEgressSettings {
1853 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1854 wkt::internal::display_enum(f, self.name(), self.value())
1855 }
1856 }
1857
1858 impl std::convert::From<i32> for VpcConnectorEgressSettings {
1859 fn from(value: i32) -> Self {
1860 match value {
1861 0 => Self::Unspecified,
1862 1 => Self::PrivateRangesOnly,
1863 2 => Self::AllTraffic,
1864 _ => Self::UnknownValue(vpc_connector_egress_settings::UnknownValue(
1865 wkt::internal::UnknownEnumValue::Integer(value),
1866 )),
1867 }
1868 }
1869 }
1870
1871 impl std::convert::From<&str> for VpcConnectorEgressSettings {
1872 fn from(value: &str) -> Self {
1873 use std::string::ToString;
1874 match value {
1875 "VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED" => Self::Unspecified,
1876 "PRIVATE_RANGES_ONLY" => Self::PrivateRangesOnly,
1877 "ALL_TRAFFIC" => Self::AllTraffic,
1878 _ => Self::UnknownValue(vpc_connector_egress_settings::UnknownValue(
1879 wkt::internal::UnknownEnumValue::String(value.to_string()),
1880 )),
1881 }
1882 }
1883 }
1884
1885 impl serde::ser::Serialize for VpcConnectorEgressSettings {
1886 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1887 where
1888 S: serde::Serializer,
1889 {
1890 match self {
1891 Self::Unspecified => serializer.serialize_i32(0),
1892 Self::PrivateRangesOnly => serializer.serialize_i32(1),
1893 Self::AllTraffic => serializer.serialize_i32(2),
1894 Self::UnknownValue(u) => u.0.serialize(serializer),
1895 }
1896 }
1897 }
1898
1899 impl<'de> serde::de::Deserialize<'de> for VpcConnectorEgressSettings {
1900 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1901 where
1902 D: serde::Deserializer<'de>,
1903 {
1904 deserializer.deserialize_any(
1905 wkt::internal::EnumVisitor::<VpcConnectorEgressSettings>::new(
1906 ".google.cloud.functions.v2.ServiceConfig.VpcConnectorEgressSettings",
1907 ),
1908 )
1909 }
1910 }
1911
1912 #[derive(Clone, Debug, PartialEq)]
1932 #[non_exhaustive]
1933 pub enum IngressSettings {
1934 Unspecified,
1936 AllowAll,
1938 AllowInternalOnly,
1940 AllowInternalAndGclb,
1942 UnknownValue(ingress_settings::UnknownValue),
1947 }
1948
1949 #[doc(hidden)]
1950 pub mod ingress_settings {
1951 #[allow(unused_imports)]
1952 use super::*;
1953 #[derive(Clone, Debug, PartialEq)]
1954 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1955 }
1956
1957 impl IngressSettings {
1958 pub fn value(&self) -> std::option::Option<i32> {
1963 match self {
1964 Self::Unspecified => std::option::Option::Some(0),
1965 Self::AllowAll => std::option::Option::Some(1),
1966 Self::AllowInternalOnly => std::option::Option::Some(2),
1967 Self::AllowInternalAndGclb => std::option::Option::Some(3),
1968 Self::UnknownValue(u) => u.0.value(),
1969 }
1970 }
1971
1972 pub fn name(&self) -> std::option::Option<&str> {
1977 match self {
1978 Self::Unspecified => std::option::Option::Some("INGRESS_SETTINGS_UNSPECIFIED"),
1979 Self::AllowAll => std::option::Option::Some("ALLOW_ALL"),
1980 Self::AllowInternalOnly => std::option::Option::Some("ALLOW_INTERNAL_ONLY"),
1981 Self::AllowInternalAndGclb => std::option::Option::Some("ALLOW_INTERNAL_AND_GCLB"),
1982 Self::UnknownValue(u) => u.0.name(),
1983 }
1984 }
1985 }
1986
1987 impl std::default::Default for IngressSettings {
1988 fn default() -> Self {
1989 use std::convert::From;
1990 Self::from(0)
1991 }
1992 }
1993
1994 impl std::fmt::Display for IngressSettings {
1995 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1996 wkt::internal::display_enum(f, self.name(), self.value())
1997 }
1998 }
1999
2000 impl std::convert::From<i32> for IngressSettings {
2001 fn from(value: i32) -> Self {
2002 match value {
2003 0 => Self::Unspecified,
2004 1 => Self::AllowAll,
2005 2 => Self::AllowInternalOnly,
2006 3 => Self::AllowInternalAndGclb,
2007 _ => Self::UnknownValue(ingress_settings::UnknownValue(
2008 wkt::internal::UnknownEnumValue::Integer(value),
2009 )),
2010 }
2011 }
2012 }
2013
2014 impl std::convert::From<&str> for IngressSettings {
2015 fn from(value: &str) -> Self {
2016 use std::string::ToString;
2017 match value {
2018 "INGRESS_SETTINGS_UNSPECIFIED" => Self::Unspecified,
2019 "ALLOW_ALL" => Self::AllowAll,
2020 "ALLOW_INTERNAL_ONLY" => Self::AllowInternalOnly,
2021 "ALLOW_INTERNAL_AND_GCLB" => Self::AllowInternalAndGclb,
2022 _ => Self::UnknownValue(ingress_settings::UnknownValue(
2023 wkt::internal::UnknownEnumValue::String(value.to_string()),
2024 )),
2025 }
2026 }
2027 }
2028
2029 impl serde::ser::Serialize for IngressSettings {
2030 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2031 where
2032 S: serde::Serializer,
2033 {
2034 match self {
2035 Self::Unspecified => serializer.serialize_i32(0),
2036 Self::AllowAll => serializer.serialize_i32(1),
2037 Self::AllowInternalOnly => serializer.serialize_i32(2),
2038 Self::AllowInternalAndGclb => serializer.serialize_i32(3),
2039 Self::UnknownValue(u) => u.0.serialize(serializer),
2040 }
2041 }
2042 }
2043
2044 impl<'de> serde::de::Deserialize<'de> for IngressSettings {
2045 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2046 where
2047 D: serde::Deserializer<'de>,
2048 {
2049 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IngressSettings>::new(
2050 ".google.cloud.functions.v2.ServiceConfig.IngressSettings",
2051 ))
2052 }
2053 }
2054
2055 #[derive(Clone, Debug, PartialEq)]
2076 #[non_exhaustive]
2077 pub enum SecurityLevel {
2078 Unspecified,
2080 SecureAlways,
2084 SecureOptional,
2088 UnknownValue(security_level::UnknownValue),
2093 }
2094
2095 #[doc(hidden)]
2096 pub mod security_level {
2097 #[allow(unused_imports)]
2098 use super::*;
2099 #[derive(Clone, Debug, PartialEq)]
2100 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2101 }
2102
2103 impl SecurityLevel {
2104 pub fn value(&self) -> std::option::Option<i32> {
2109 match self {
2110 Self::Unspecified => std::option::Option::Some(0),
2111 Self::SecureAlways => std::option::Option::Some(1),
2112 Self::SecureOptional => std::option::Option::Some(2),
2113 Self::UnknownValue(u) => u.0.value(),
2114 }
2115 }
2116
2117 pub fn name(&self) -> std::option::Option<&str> {
2122 match self {
2123 Self::Unspecified => std::option::Option::Some("SECURITY_LEVEL_UNSPECIFIED"),
2124 Self::SecureAlways => std::option::Option::Some("SECURE_ALWAYS"),
2125 Self::SecureOptional => std::option::Option::Some("SECURE_OPTIONAL"),
2126 Self::UnknownValue(u) => u.0.name(),
2127 }
2128 }
2129 }
2130
2131 impl std::default::Default for SecurityLevel {
2132 fn default() -> Self {
2133 use std::convert::From;
2134 Self::from(0)
2135 }
2136 }
2137
2138 impl std::fmt::Display for SecurityLevel {
2139 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2140 wkt::internal::display_enum(f, self.name(), self.value())
2141 }
2142 }
2143
2144 impl std::convert::From<i32> for SecurityLevel {
2145 fn from(value: i32) -> Self {
2146 match value {
2147 0 => Self::Unspecified,
2148 1 => Self::SecureAlways,
2149 2 => Self::SecureOptional,
2150 _ => Self::UnknownValue(security_level::UnknownValue(
2151 wkt::internal::UnknownEnumValue::Integer(value),
2152 )),
2153 }
2154 }
2155 }
2156
2157 impl std::convert::From<&str> for SecurityLevel {
2158 fn from(value: &str) -> Self {
2159 use std::string::ToString;
2160 match value {
2161 "SECURITY_LEVEL_UNSPECIFIED" => Self::Unspecified,
2162 "SECURE_ALWAYS" => Self::SecureAlways,
2163 "SECURE_OPTIONAL" => Self::SecureOptional,
2164 _ => Self::UnknownValue(security_level::UnknownValue(
2165 wkt::internal::UnknownEnumValue::String(value.to_string()),
2166 )),
2167 }
2168 }
2169 }
2170
2171 impl serde::ser::Serialize for SecurityLevel {
2172 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2173 where
2174 S: serde::Serializer,
2175 {
2176 match self {
2177 Self::Unspecified => serializer.serialize_i32(0),
2178 Self::SecureAlways => serializer.serialize_i32(1),
2179 Self::SecureOptional => serializer.serialize_i32(2),
2180 Self::UnknownValue(u) => u.0.serialize(serializer),
2181 }
2182 }
2183 }
2184
2185 impl<'de> serde::de::Deserialize<'de> for SecurityLevel {
2186 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2187 where
2188 D: serde::Deserializer<'de>,
2189 {
2190 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SecurityLevel>::new(
2191 ".google.cloud.functions.v2.ServiceConfig.SecurityLevel",
2192 ))
2193 }
2194 }
2195}
2196
2197#[derive(Clone, Default, PartialEq)]
2201#[non_exhaustive]
2202pub struct SecretEnvVar {
2203 pub key: std::string::String,
2205
2206 pub project_id: std::string::String,
2210
2211 pub secret: std::string::String,
2213
2214 pub version: std::string::String,
2219
2220 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2221}
2222
2223impl SecretEnvVar {
2224 pub fn new() -> Self {
2225 std::default::Default::default()
2226 }
2227
2228 pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2230 self.key = v.into();
2231 self
2232 }
2233
2234 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2236 self.project_id = v.into();
2237 self
2238 }
2239
2240 pub fn set_secret<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2242 self.secret = v.into();
2243 self
2244 }
2245
2246 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2248 self.version = v.into();
2249 self
2250 }
2251}
2252
2253impl wkt::message::Message for SecretEnvVar {
2254 fn typename() -> &'static str {
2255 "type.googleapis.com/google.cloud.functions.v2.SecretEnvVar"
2256 }
2257}
2258
2259#[derive(Clone, Default, PartialEq)]
2263#[non_exhaustive]
2264pub struct SecretVolume {
2265 pub mount_path: std::string::String,
2271
2272 pub project_id: std::string::String,
2276
2277 pub secret: std::string::String,
2279
2280 pub versions: std::vec::Vec<crate::model::secret_volume::SecretVersion>,
2284
2285 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2286}
2287
2288impl SecretVolume {
2289 pub fn new() -> Self {
2290 std::default::Default::default()
2291 }
2292
2293 pub fn set_mount_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2295 self.mount_path = v.into();
2296 self
2297 }
2298
2299 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2301 self.project_id = v.into();
2302 self
2303 }
2304
2305 pub fn set_secret<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2307 self.secret = v.into();
2308 self
2309 }
2310
2311 pub fn set_versions<T, V>(mut self, v: T) -> Self
2313 where
2314 T: std::iter::IntoIterator<Item = V>,
2315 V: std::convert::Into<crate::model::secret_volume::SecretVersion>,
2316 {
2317 use std::iter::Iterator;
2318 self.versions = v.into_iter().map(|i| i.into()).collect();
2319 self
2320 }
2321}
2322
2323impl wkt::message::Message for SecretVolume {
2324 fn typename() -> &'static str {
2325 "type.googleapis.com/google.cloud.functions.v2.SecretVolume"
2326 }
2327}
2328
2329pub mod secret_volume {
2331 #[allow(unused_imports)]
2332 use super::*;
2333
2334 #[derive(Clone, Default, PartialEq)]
2336 #[non_exhaustive]
2337 pub struct SecretVersion {
2338 pub version: std::string::String,
2342
2343 pub path: std::string::String,
2348
2349 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2350 }
2351
2352 impl SecretVersion {
2353 pub fn new() -> Self {
2354 std::default::Default::default()
2355 }
2356
2357 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2359 self.version = v.into();
2360 self
2361 }
2362
2363 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2365 self.path = v.into();
2366 self
2367 }
2368 }
2369
2370 impl wkt::message::Message for SecretVersion {
2371 fn typename() -> &'static str {
2372 "type.googleapis.com/google.cloud.functions.v2.SecretVolume.SecretVersion"
2373 }
2374 }
2375}
2376
2377#[derive(Clone, Default, PartialEq)]
2380#[non_exhaustive]
2381pub struct EventTrigger {
2382 pub trigger: std::string::String,
2385
2386 pub trigger_region: std::string::String,
2391
2392 pub event_type: std::string::String,
2396
2397 pub event_filters: std::vec::Vec<crate::model::EventFilter>,
2399
2400 pub pubsub_topic: std::string::String,
2408
2409 pub service_account_email: std::string::String,
2415
2416 pub retry_policy: crate::model::event_trigger::RetryPolicy,
2419
2420 pub channel: std::string::String,
2424
2425 pub service: std::string::String,
2434
2435 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2436}
2437
2438impl EventTrigger {
2439 pub fn new() -> Self {
2440 std::default::Default::default()
2441 }
2442
2443 pub fn set_trigger<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2445 self.trigger = v.into();
2446 self
2447 }
2448
2449 pub fn set_trigger_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2451 self.trigger_region = v.into();
2452 self
2453 }
2454
2455 pub fn set_event_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2457 self.event_type = v.into();
2458 self
2459 }
2460
2461 pub fn set_event_filters<T, V>(mut self, v: T) -> Self
2463 where
2464 T: std::iter::IntoIterator<Item = V>,
2465 V: std::convert::Into<crate::model::EventFilter>,
2466 {
2467 use std::iter::Iterator;
2468 self.event_filters = v.into_iter().map(|i| i.into()).collect();
2469 self
2470 }
2471
2472 pub fn set_pubsub_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2474 self.pubsub_topic = v.into();
2475 self
2476 }
2477
2478 pub fn set_service_account_email<T: std::convert::Into<std::string::String>>(
2480 mut self,
2481 v: T,
2482 ) -> Self {
2483 self.service_account_email = v.into();
2484 self
2485 }
2486
2487 pub fn set_retry_policy<T: std::convert::Into<crate::model::event_trigger::RetryPolicy>>(
2489 mut self,
2490 v: T,
2491 ) -> Self {
2492 self.retry_policy = v.into();
2493 self
2494 }
2495
2496 pub fn set_channel<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2498 self.channel = v.into();
2499 self
2500 }
2501
2502 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2504 self.service = v.into();
2505 self
2506 }
2507}
2508
2509impl wkt::message::Message for EventTrigger {
2510 fn typename() -> &'static str {
2511 "type.googleapis.com/google.cloud.functions.v2.EventTrigger"
2512 }
2513}
2514
2515pub mod event_trigger {
2517 #[allow(unused_imports)]
2518 use super::*;
2519
2520 #[derive(Clone, Debug, PartialEq)]
2537 #[non_exhaustive]
2538 pub enum RetryPolicy {
2539 Unspecified,
2541 DoNotRetry,
2543 Retry,
2546 UnknownValue(retry_policy::UnknownValue),
2551 }
2552
2553 #[doc(hidden)]
2554 pub mod retry_policy {
2555 #[allow(unused_imports)]
2556 use super::*;
2557 #[derive(Clone, Debug, PartialEq)]
2558 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2559 }
2560
2561 impl RetryPolicy {
2562 pub fn value(&self) -> std::option::Option<i32> {
2567 match self {
2568 Self::Unspecified => std::option::Option::Some(0),
2569 Self::DoNotRetry => std::option::Option::Some(1),
2570 Self::Retry => std::option::Option::Some(2),
2571 Self::UnknownValue(u) => u.0.value(),
2572 }
2573 }
2574
2575 pub fn name(&self) -> std::option::Option<&str> {
2580 match self {
2581 Self::Unspecified => std::option::Option::Some("RETRY_POLICY_UNSPECIFIED"),
2582 Self::DoNotRetry => std::option::Option::Some("RETRY_POLICY_DO_NOT_RETRY"),
2583 Self::Retry => std::option::Option::Some("RETRY_POLICY_RETRY"),
2584 Self::UnknownValue(u) => u.0.name(),
2585 }
2586 }
2587 }
2588
2589 impl std::default::Default for RetryPolicy {
2590 fn default() -> Self {
2591 use std::convert::From;
2592 Self::from(0)
2593 }
2594 }
2595
2596 impl std::fmt::Display for RetryPolicy {
2597 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2598 wkt::internal::display_enum(f, self.name(), self.value())
2599 }
2600 }
2601
2602 impl std::convert::From<i32> for RetryPolicy {
2603 fn from(value: i32) -> Self {
2604 match value {
2605 0 => Self::Unspecified,
2606 1 => Self::DoNotRetry,
2607 2 => Self::Retry,
2608 _ => Self::UnknownValue(retry_policy::UnknownValue(
2609 wkt::internal::UnknownEnumValue::Integer(value),
2610 )),
2611 }
2612 }
2613 }
2614
2615 impl std::convert::From<&str> for RetryPolicy {
2616 fn from(value: &str) -> Self {
2617 use std::string::ToString;
2618 match value {
2619 "RETRY_POLICY_UNSPECIFIED" => Self::Unspecified,
2620 "RETRY_POLICY_DO_NOT_RETRY" => Self::DoNotRetry,
2621 "RETRY_POLICY_RETRY" => Self::Retry,
2622 _ => Self::UnknownValue(retry_policy::UnknownValue(
2623 wkt::internal::UnknownEnumValue::String(value.to_string()),
2624 )),
2625 }
2626 }
2627 }
2628
2629 impl serde::ser::Serialize for RetryPolicy {
2630 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2631 where
2632 S: serde::Serializer,
2633 {
2634 match self {
2635 Self::Unspecified => serializer.serialize_i32(0),
2636 Self::DoNotRetry => serializer.serialize_i32(1),
2637 Self::Retry => serializer.serialize_i32(2),
2638 Self::UnknownValue(u) => u.0.serialize(serializer),
2639 }
2640 }
2641 }
2642
2643 impl<'de> serde::de::Deserialize<'de> for RetryPolicy {
2644 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2645 where
2646 D: serde::Deserializer<'de>,
2647 {
2648 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RetryPolicy>::new(
2649 ".google.cloud.functions.v2.EventTrigger.RetryPolicy",
2650 ))
2651 }
2652 }
2653}
2654
2655#[derive(Clone, Default, PartialEq)]
2657#[non_exhaustive]
2658pub struct EventFilter {
2659 pub attribute: std::string::String,
2661
2662 pub value: std::string::String,
2664
2665 pub operator: std::string::String,
2670
2671 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2672}
2673
2674impl EventFilter {
2675 pub fn new() -> Self {
2676 std::default::Default::default()
2677 }
2678
2679 pub fn set_attribute<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2681 self.attribute = v.into();
2682 self
2683 }
2684
2685 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2687 self.value = v.into();
2688 self
2689 }
2690
2691 pub fn set_operator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2693 self.operator = v.into();
2694 self
2695 }
2696}
2697
2698impl wkt::message::Message for EventFilter {
2699 fn typename() -> &'static str {
2700 "type.googleapis.com/google.cloud.functions.v2.EventFilter"
2701 }
2702}
2703
2704#[derive(Clone, Default, PartialEq)]
2706#[non_exhaustive]
2707pub struct GetFunctionRequest {
2708 pub name: std::string::String,
2710
2711 pub revision: std::string::String,
2718
2719 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2720}
2721
2722impl GetFunctionRequest {
2723 pub fn new() -> Self {
2724 std::default::Default::default()
2725 }
2726
2727 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2729 self.name = v.into();
2730 self
2731 }
2732
2733 pub fn set_revision<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2735 self.revision = v.into();
2736 self
2737 }
2738}
2739
2740impl wkt::message::Message for GetFunctionRequest {
2741 fn typename() -> &'static str {
2742 "type.googleapis.com/google.cloud.functions.v2.GetFunctionRequest"
2743 }
2744}
2745
2746#[derive(Clone, Default, PartialEq)]
2748#[non_exhaustive]
2749pub struct ListFunctionsRequest {
2750 pub parent: std::string::String,
2757
2758 pub page_size: i32,
2763
2764 pub page_token: std::string::String,
2769
2770 pub filter: std::string::String,
2773
2774 pub order_by: std::string::String,
2778
2779 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2780}
2781
2782impl ListFunctionsRequest {
2783 pub fn new() -> Self {
2784 std::default::Default::default()
2785 }
2786
2787 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2789 self.parent = v.into();
2790 self
2791 }
2792
2793 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2795 self.page_size = v.into();
2796 self
2797 }
2798
2799 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2801 self.page_token = v.into();
2802 self
2803 }
2804
2805 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2807 self.filter = v.into();
2808 self
2809 }
2810
2811 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2813 self.order_by = v.into();
2814 self
2815 }
2816}
2817
2818impl wkt::message::Message for ListFunctionsRequest {
2819 fn typename() -> &'static str {
2820 "type.googleapis.com/google.cloud.functions.v2.ListFunctionsRequest"
2821 }
2822}
2823
2824#[derive(Clone, Default, PartialEq)]
2826#[non_exhaustive]
2827pub struct ListFunctionsResponse {
2828 pub functions: std::vec::Vec<crate::model::Function>,
2830
2831 pub next_page_token: std::string::String,
2834
2835 pub unreachable: std::vec::Vec<std::string::String>,
2838
2839 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2840}
2841
2842impl ListFunctionsResponse {
2843 pub fn new() -> Self {
2844 std::default::Default::default()
2845 }
2846
2847 pub fn set_functions<T, V>(mut self, v: T) -> Self
2849 where
2850 T: std::iter::IntoIterator<Item = V>,
2851 V: std::convert::Into<crate::model::Function>,
2852 {
2853 use std::iter::Iterator;
2854 self.functions = v.into_iter().map(|i| i.into()).collect();
2855 self
2856 }
2857
2858 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2860 self.next_page_token = v.into();
2861 self
2862 }
2863
2864 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2866 where
2867 T: std::iter::IntoIterator<Item = V>,
2868 V: std::convert::Into<std::string::String>,
2869 {
2870 use std::iter::Iterator;
2871 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2872 self
2873 }
2874}
2875
2876impl wkt::message::Message for ListFunctionsResponse {
2877 fn typename() -> &'static str {
2878 "type.googleapis.com/google.cloud.functions.v2.ListFunctionsResponse"
2879 }
2880}
2881
2882#[doc(hidden)]
2883impl gax::paginator::internal::PageableResponse for ListFunctionsResponse {
2884 type PageItem = crate::model::Function;
2885
2886 fn items(self) -> std::vec::Vec<Self::PageItem> {
2887 self.functions
2888 }
2889
2890 fn next_page_token(&self) -> std::string::String {
2891 use std::clone::Clone;
2892 self.next_page_token.clone()
2893 }
2894}
2895
2896#[derive(Clone, Default, PartialEq)]
2898#[non_exhaustive]
2899pub struct CreateFunctionRequest {
2900 pub parent: std::string::String,
2903
2904 pub function: std::option::Option<crate::model::Function>,
2906
2907 pub function_id: std::string::String,
2913
2914 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2915}
2916
2917impl CreateFunctionRequest {
2918 pub fn new() -> Self {
2919 std::default::Default::default()
2920 }
2921
2922 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2924 self.parent = v.into();
2925 self
2926 }
2927
2928 pub fn set_function<T>(mut self, v: T) -> Self
2930 where
2931 T: std::convert::Into<crate::model::Function>,
2932 {
2933 self.function = std::option::Option::Some(v.into());
2934 self
2935 }
2936
2937 pub fn set_or_clear_function<T>(mut self, v: std::option::Option<T>) -> Self
2939 where
2940 T: std::convert::Into<crate::model::Function>,
2941 {
2942 self.function = v.map(|x| x.into());
2943 self
2944 }
2945
2946 pub fn set_function_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2948 self.function_id = v.into();
2949 self
2950 }
2951}
2952
2953impl wkt::message::Message for CreateFunctionRequest {
2954 fn typename() -> &'static str {
2955 "type.googleapis.com/google.cloud.functions.v2.CreateFunctionRequest"
2956 }
2957}
2958
2959#[derive(Clone, Default, PartialEq)]
2961#[non_exhaustive]
2962pub struct UpdateFunctionRequest {
2963 pub function: std::option::Option<crate::model::Function>,
2965
2966 pub update_mask: std::option::Option<wkt::FieldMask>,
2969
2970 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2971}
2972
2973impl UpdateFunctionRequest {
2974 pub fn new() -> Self {
2975 std::default::Default::default()
2976 }
2977
2978 pub fn set_function<T>(mut self, v: T) -> Self
2980 where
2981 T: std::convert::Into<crate::model::Function>,
2982 {
2983 self.function = std::option::Option::Some(v.into());
2984 self
2985 }
2986
2987 pub fn set_or_clear_function<T>(mut self, v: std::option::Option<T>) -> Self
2989 where
2990 T: std::convert::Into<crate::model::Function>,
2991 {
2992 self.function = v.map(|x| x.into());
2993 self
2994 }
2995
2996 pub fn set_update_mask<T>(mut self, v: T) -> Self
2998 where
2999 T: std::convert::Into<wkt::FieldMask>,
3000 {
3001 self.update_mask = std::option::Option::Some(v.into());
3002 self
3003 }
3004
3005 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3007 where
3008 T: std::convert::Into<wkt::FieldMask>,
3009 {
3010 self.update_mask = v.map(|x| x.into());
3011 self
3012 }
3013}
3014
3015impl wkt::message::Message for UpdateFunctionRequest {
3016 fn typename() -> &'static str {
3017 "type.googleapis.com/google.cloud.functions.v2.UpdateFunctionRequest"
3018 }
3019}
3020
3021#[derive(Clone, Default, PartialEq)]
3023#[non_exhaustive]
3024pub struct DeleteFunctionRequest {
3025 pub name: std::string::String,
3027
3028 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3029}
3030
3031impl DeleteFunctionRequest {
3032 pub fn new() -> Self {
3033 std::default::Default::default()
3034 }
3035
3036 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3038 self.name = v.into();
3039 self
3040 }
3041}
3042
3043impl wkt::message::Message for DeleteFunctionRequest {
3044 fn typename() -> &'static str {
3045 "type.googleapis.com/google.cloud.functions.v2.DeleteFunctionRequest"
3046 }
3047}
3048
3049#[derive(Clone, Default, PartialEq)]
3051#[non_exhaustive]
3052pub struct GenerateUploadUrlRequest {
3053 pub parent: std::string::String,
3056
3057 pub kms_key_name: std::string::String,
3073
3074 pub environment: crate::model::Environment,
3079
3080 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3081}
3082
3083impl GenerateUploadUrlRequest {
3084 pub fn new() -> Self {
3085 std::default::Default::default()
3086 }
3087
3088 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3090 self.parent = v.into();
3091 self
3092 }
3093
3094 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3096 self.kms_key_name = v.into();
3097 self
3098 }
3099
3100 pub fn set_environment<T: std::convert::Into<crate::model::Environment>>(
3102 mut self,
3103 v: T,
3104 ) -> Self {
3105 self.environment = v.into();
3106 self
3107 }
3108}
3109
3110impl wkt::message::Message for GenerateUploadUrlRequest {
3111 fn typename() -> &'static str {
3112 "type.googleapis.com/google.cloud.functions.v2.GenerateUploadUrlRequest"
3113 }
3114}
3115
3116#[derive(Clone, Default, PartialEq)]
3118#[non_exhaustive]
3119pub struct GenerateUploadUrlResponse {
3120 pub upload_url: std::string::String,
3124
3125 pub storage_source: std::option::Option<crate::model::StorageSource>,
3134
3135 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3136}
3137
3138impl GenerateUploadUrlResponse {
3139 pub fn new() -> Self {
3140 std::default::Default::default()
3141 }
3142
3143 pub fn set_upload_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3145 self.upload_url = v.into();
3146 self
3147 }
3148
3149 pub fn set_storage_source<T>(mut self, v: T) -> Self
3151 where
3152 T: std::convert::Into<crate::model::StorageSource>,
3153 {
3154 self.storage_source = std::option::Option::Some(v.into());
3155 self
3156 }
3157
3158 pub fn set_or_clear_storage_source<T>(mut self, v: std::option::Option<T>) -> Self
3160 where
3161 T: std::convert::Into<crate::model::StorageSource>,
3162 {
3163 self.storage_source = v.map(|x| x.into());
3164 self
3165 }
3166}
3167
3168impl wkt::message::Message for GenerateUploadUrlResponse {
3169 fn typename() -> &'static str {
3170 "type.googleapis.com/google.cloud.functions.v2.GenerateUploadUrlResponse"
3171 }
3172}
3173
3174#[derive(Clone, Default, PartialEq)]
3176#[non_exhaustive]
3177pub struct GenerateDownloadUrlRequest {
3178 pub name: std::string::String,
3181
3182 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3183}
3184
3185impl GenerateDownloadUrlRequest {
3186 pub fn new() -> Self {
3187 std::default::Default::default()
3188 }
3189
3190 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3192 self.name = v.into();
3193 self
3194 }
3195}
3196
3197impl wkt::message::Message for GenerateDownloadUrlRequest {
3198 fn typename() -> &'static str {
3199 "type.googleapis.com/google.cloud.functions.v2.GenerateDownloadUrlRequest"
3200 }
3201}
3202
3203#[derive(Clone, Default, PartialEq)]
3205#[non_exhaustive]
3206pub struct GenerateDownloadUrlResponse {
3207 pub download_url: std::string::String,
3210
3211 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3212}
3213
3214impl GenerateDownloadUrlResponse {
3215 pub fn new() -> Self {
3216 std::default::Default::default()
3217 }
3218
3219 pub fn set_download_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3221 self.download_url = v.into();
3222 self
3223 }
3224}
3225
3226impl wkt::message::Message for GenerateDownloadUrlResponse {
3227 fn typename() -> &'static str {
3228 "type.googleapis.com/google.cloud.functions.v2.GenerateDownloadUrlResponse"
3229 }
3230}
3231
3232#[derive(Clone, Default, PartialEq)]
3234#[non_exhaustive]
3235pub struct ListRuntimesRequest {
3236 pub parent: std::string::String,
3239
3240 pub filter: std::string::String,
3243
3244 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3245}
3246
3247impl ListRuntimesRequest {
3248 pub fn new() -> Self {
3249 std::default::Default::default()
3250 }
3251
3252 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3254 self.parent = v.into();
3255 self
3256 }
3257
3258 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3260 self.filter = v.into();
3261 self
3262 }
3263}
3264
3265impl wkt::message::Message for ListRuntimesRequest {
3266 fn typename() -> &'static str {
3267 "type.googleapis.com/google.cloud.functions.v2.ListRuntimesRequest"
3268 }
3269}
3270
3271#[derive(Clone, Default, PartialEq)]
3273#[non_exhaustive]
3274pub struct ListRuntimesResponse {
3275 pub runtimes: std::vec::Vec<crate::model::list_runtimes_response::Runtime>,
3277
3278 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3279}
3280
3281impl ListRuntimesResponse {
3282 pub fn new() -> Self {
3283 std::default::Default::default()
3284 }
3285
3286 pub fn set_runtimes<T, V>(mut self, v: T) -> Self
3288 where
3289 T: std::iter::IntoIterator<Item = V>,
3290 V: std::convert::Into<crate::model::list_runtimes_response::Runtime>,
3291 {
3292 use std::iter::Iterator;
3293 self.runtimes = v.into_iter().map(|i| i.into()).collect();
3294 self
3295 }
3296}
3297
3298impl wkt::message::Message for ListRuntimesResponse {
3299 fn typename() -> &'static str {
3300 "type.googleapis.com/google.cloud.functions.v2.ListRuntimesResponse"
3301 }
3302}
3303
3304pub mod list_runtimes_response {
3306 #[allow(unused_imports)]
3307 use super::*;
3308
3309 #[derive(Clone, Default, PartialEq)]
3312 #[non_exhaustive]
3313 pub struct Runtime {
3314 pub name: std::string::String,
3316
3317 pub display_name: std::string::String,
3319
3320 pub stage: crate::model::list_runtimes_response::RuntimeStage,
3322
3323 pub warnings: std::vec::Vec<std::string::String>,
3325
3326 pub environment: crate::model::Environment,
3328
3329 pub deprecation_date: std::option::Option<gtype::model::Date>,
3331
3332 pub decommission_date: std::option::Option<gtype::model::Date>,
3334
3335 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3336 }
3337
3338 impl Runtime {
3339 pub fn new() -> Self {
3340 std::default::Default::default()
3341 }
3342
3343 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3345 self.name = v.into();
3346 self
3347 }
3348
3349 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
3351 mut self,
3352 v: T,
3353 ) -> Self {
3354 self.display_name = v.into();
3355 self
3356 }
3357
3358 pub fn set_stage<
3360 T: std::convert::Into<crate::model::list_runtimes_response::RuntimeStage>,
3361 >(
3362 mut self,
3363 v: T,
3364 ) -> Self {
3365 self.stage = v.into();
3366 self
3367 }
3368
3369 pub fn set_warnings<T, V>(mut self, v: T) -> Self
3371 where
3372 T: std::iter::IntoIterator<Item = V>,
3373 V: std::convert::Into<std::string::String>,
3374 {
3375 use std::iter::Iterator;
3376 self.warnings = v.into_iter().map(|i| i.into()).collect();
3377 self
3378 }
3379
3380 pub fn set_environment<T: std::convert::Into<crate::model::Environment>>(
3382 mut self,
3383 v: T,
3384 ) -> Self {
3385 self.environment = v.into();
3386 self
3387 }
3388
3389 pub fn set_deprecation_date<T>(mut self, v: T) -> Self
3391 where
3392 T: std::convert::Into<gtype::model::Date>,
3393 {
3394 self.deprecation_date = std::option::Option::Some(v.into());
3395 self
3396 }
3397
3398 pub fn set_or_clear_deprecation_date<T>(mut self, v: std::option::Option<T>) -> Self
3400 where
3401 T: std::convert::Into<gtype::model::Date>,
3402 {
3403 self.deprecation_date = v.map(|x| x.into());
3404 self
3405 }
3406
3407 pub fn set_decommission_date<T>(mut self, v: T) -> Self
3409 where
3410 T: std::convert::Into<gtype::model::Date>,
3411 {
3412 self.decommission_date = std::option::Option::Some(v.into());
3413 self
3414 }
3415
3416 pub fn set_or_clear_decommission_date<T>(mut self, v: std::option::Option<T>) -> Self
3418 where
3419 T: std::convert::Into<gtype::model::Date>,
3420 {
3421 self.decommission_date = v.map(|x| x.into());
3422 self
3423 }
3424 }
3425
3426 impl wkt::message::Message for Runtime {
3427 fn typename() -> &'static str {
3428 "type.googleapis.com/google.cloud.functions.v2.ListRuntimesResponse.Runtime"
3429 }
3430 }
3431
3432 #[derive(Clone, Debug, PartialEq)]
3448 #[non_exhaustive]
3449 pub enum RuntimeStage {
3450 Unspecified,
3452 Development,
3454 Alpha,
3456 Beta,
3458 Ga,
3460 Deprecated,
3462 Decommissioned,
3464 UnknownValue(runtime_stage::UnknownValue),
3469 }
3470
3471 #[doc(hidden)]
3472 pub mod runtime_stage {
3473 #[allow(unused_imports)]
3474 use super::*;
3475 #[derive(Clone, Debug, PartialEq)]
3476 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3477 }
3478
3479 impl RuntimeStage {
3480 pub fn value(&self) -> std::option::Option<i32> {
3485 match self {
3486 Self::Unspecified => std::option::Option::Some(0),
3487 Self::Development => std::option::Option::Some(1),
3488 Self::Alpha => std::option::Option::Some(2),
3489 Self::Beta => std::option::Option::Some(3),
3490 Self::Ga => std::option::Option::Some(4),
3491 Self::Deprecated => std::option::Option::Some(5),
3492 Self::Decommissioned => std::option::Option::Some(6),
3493 Self::UnknownValue(u) => u.0.value(),
3494 }
3495 }
3496
3497 pub fn name(&self) -> std::option::Option<&str> {
3502 match self {
3503 Self::Unspecified => std::option::Option::Some("RUNTIME_STAGE_UNSPECIFIED"),
3504 Self::Development => std::option::Option::Some("DEVELOPMENT"),
3505 Self::Alpha => std::option::Option::Some("ALPHA"),
3506 Self::Beta => std::option::Option::Some("BETA"),
3507 Self::Ga => std::option::Option::Some("GA"),
3508 Self::Deprecated => std::option::Option::Some("DEPRECATED"),
3509 Self::Decommissioned => std::option::Option::Some("DECOMMISSIONED"),
3510 Self::UnknownValue(u) => u.0.name(),
3511 }
3512 }
3513 }
3514
3515 impl std::default::Default for RuntimeStage {
3516 fn default() -> Self {
3517 use std::convert::From;
3518 Self::from(0)
3519 }
3520 }
3521
3522 impl std::fmt::Display for RuntimeStage {
3523 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3524 wkt::internal::display_enum(f, self.name(), self.value())
3525 }
3526 }
3527
3528 impl std::convert::From<i32> for RuntimeStage {
3529 fn from(value: i32) -> Self {
3530 match value {
3531 0 => Self::Unspecified,
3532 1 => Self::Development,
3533 2 => Self::Alpha,
3534 3 => Self::Beta,
3535 4 => Self::Ga,
3536 5 => Self::Deprecated,
3537 6 => Self::Decommissioned,
3538 _ => Self::UnknownValue(runtime_stage::UnknownValue(
3539 wkt::internal::UnknownEnumValue::Integer(value),
3540 )),
3541 }
3542 }
3543 }
3544
3545 impl std::convert::From<&str> for RuntimeStage {
3546 fn from(value: &str) -> Self {
3547 use std::string::ToString;
3548 match value {
3549 "RUNTIME_STAGE_UNSPECIFIED" => Self::Unspecified,
3550 "DEVELOPMENT" => Self::Development,
3551 "ALPHA" => Self::Alpha,
3552 "BETA" => Self::Beta,
3553 "GA" => Self::Ga,
3554 "DEPRECATED" => Self::Deprecated,
3555 "DECOMMISSIONED" => Self::Decommissioned,
3556 _ => Self::UnknownValue(runtime_stage::UnknownValue(
3557 wkt::internal::UnknownEnumValue::String(value.to_string()),
3558 )),
3559 }
3560 }
3561 }
3562
3563 impl serde::ser::Serialize for RuntimeStage {
3564 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3565 where
3566 S: serde::Serializer,
3567 {
3568 match self {
3569 Self::Unspecified => serializer.serialize_i32(0),
3570 Self::Development => serializer.serialize_i32(1),
3571 Self::Alpha => serializer.serialize_i32(2),
3572 Self::Beta => serializer.serialize_i32(3),
3573 Self::Ga => serializer.serialize_i32(4),
3574 Self::Deprecated => serializer.serialize_i32(5),
3575 Self::Decommissioned => serializer.serialize_i32(6),
3576 Self::UnknownValue(u) => u.0.serialize(serializer),
3577 }
3578 }
3579 }
3580
3581 impl<'de> serde::de::Deserialize<'de> for RuntimeStage {
3582 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3583 where
3584 D: serde::Deserializer<'de>,
3585 {
3586 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RuntimeStage>::new(
3587 ".google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage",
3588 ))
3589 }
3590 }
3591}
3592
3593#[derive(Clone, Default, PartialEq)]
3596#[non_exhaustive]
3597pub struct AutomaticUpdatePolicy {
3598 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3599}
3600
3601impl AutomaticUpdatePolicy {
3602 pub fn new() -> Self {
3603 std::default::Default::default()
3604 }
3605}
3606
3607impl wkt::message::Message for AutomaticUpdatePolicy {
3608 fn typename() -> &'static str {
3609 "type.googleapis.com/google.cloud.functions.v2.AutomaticUpdatePolicy"
3610 }
3611}
3612
3613#[derive(Clone, Default, PartialEq)]
3615#[non_exhaustive]
3616pub struct OnDeployUpdatePolicy {
3617 pub runtime_version: std::string::String,
3620
3621 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3622}
3623
3624impl OnDeployUpdatePolicy {
3625 pub fn new() -> Self {
3626 std::default::Default::default()
3627 }
3628
3629 pub fn set_runtime_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3631 self.runtime_version = v.into();
3632 self
3633 }
3634}
3635
3636impl wkt::message::Message for OnDeployUpdatePolicy {
3637 fn typename() -> &'static str {
3638 "type.googleapis.com/google.cloud.functions.v2.OnDeployUpdatePolicy"
3639 }
3640}
3641
3642#[derive(Clone, Default, PartialEq)]
3644#[non_exhaustive]
3645pub struct OperationMetadata {
3646 pub create_time: std::option::Option<wkt::Timestamp>,
3648
3649 pub end_time: std::option::Option<wkt::Timestamp>,
3651
3652 pub target: std::string::String,
3654
3655 pub verb: std::string::String,
3657
3658 pub status_detail: std::string::String,
3660
3661 pub cancel_requested: bool,
3671
3672 pub api_version: std::string::String,
3674
3675 pub request_resource: std::option::Option<wkt::Any>,
3677
3678 pub stages: std::vec::Vec<crate::model::Stage>,
3680
3681 pub source_token: std::string::String,
3684
3685 pub build_name: std::string::String,
3687
3688 pub operation_type: crate::model::OperationType,
3690
3691 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3692}
3693
3694impl OperationMetadata {
3695 pub fn new() -> Self {
3696 std::default::Default::default()
3697 }
3698
3699 pub fn set_create_time<T>(mut self, v: T) -> Self
3701 where
3702 T: std::convert::Into<wkt::Timestamp>,
3703 {
3704 self.create_time = std::option::Option::Some(v.into());
3705 self
3706 }
3707
3708 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3710 where
3711 T: std::convert::Into<wkt::Timestamp>,
3712 {
3713 self.create_time = v.map(|x| x.into());
3714 self
3715 }
3716
3717 pub fn set_end_time<T>(mut self, v: T) -> Self
3719 where
3720 T: std::convert::Into<wkt::Timestamp>,
3721 {
3722 self.end_time = std::option::Option::Some(v.into());
3723 self
3724 }
3725
3726 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3728 where
3729 T: std::convert::Into<wkt::Timestamp>,
3730 {
3731 self.end_time = v.map(|x| x.into());
3732 self
3733 }
3734
3735 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3737 self.target = v.into();
3738 self
3739 }
3740
3741 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3743 self.verb = v.into();
3744 self
3745 }
3746
3747 pub fn set_status_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3749 self.status_detail = v.into();
3750 self
3751 }
3752
3753 pub fn set_cancel_requested<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3755 self.cancel_requested = v.into();
3756 self
3757 }
3758
3759 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3761 self.api_version = v.into();
3762 self
3763 }
3764
3765 pub fn set_request_resource<T>(mut self, v: T) -> Self
3767 where
3768 T: std::convert::Into<wkt::Any>,
3769 {
3770 self.request_resource = std::option::Option::Some(v.into());
3771 self
3772 }
3773
3774 pub fn set_or_clear_request_resource<T>(mut self, v: std::option::Option<T>) -> Self
3776 where
3777 T: std::convert::Into<wkt::Any>,
3778 {
3779 self.request_resource = v.map(|x| x.into());
3780 self
3781 }
3782
3783 pub fn set_stages<T, V>(mut self, v: T) -> Self
3785 where
3786 T: std::iter::IntoIterator<Item = V>,
3787 V: std::convert::Into<crate::model::Stage>,
3788 {
3789 use std::iter::Iterator;
3790 self.stages = v.into_iter().map(|i| i.into()).collect();
3791 self
3792 }
3793
3794 pub fn set_source_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3796 self.source_token = v.into();
3797 self
3798 }
3799
3800 pub fn set_build_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3802 self.build_name = v.into();
3803 self
3804 }
3805
3806 pub fn set_operation_type<T: std::convert::Into<crate::model::OperationType>>(
3808 mut self,
3809 v: T,
3810 ) -> Self {
3811 self.operation_type = v.into();
3812 self
3813 }
3814}
3815
3816impl wkt::message::Message for OperationMetadata {
3817 fn typename() -> &'static str {
3818 "type.googleapis.com/google.cloud.functions.v2.OperationMetadata"
3819 }
3820}
3821
3822#[derive(Clone, Default, PartialEq)]
3824#[non_exhaustive]
3825pub struct LocationMetadata {
3826 pub environments: std::vec::Vec<crate::model::Environment>,
3828
3829 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3830}
3831
3832impl LocationMetadata {
3833 pub fn new() -> Self {
3834 std::default::Default::default()
3835 }
3836
3837 pub fn set_environments<T, V>(mut self, v: T) -> Self
3839 where
3840 T: std::iter::IntoIterator<Item = V>,
3841 V: std::convert::Into<crate::model::Environment>,
3842 {
3843 use std::iter::Iterator;
3844 self.environments = v.into_iter().map(|i| i.into()).collect();
3845 self
3846 }
3847}
3848
3849impl wkt::message::Message for LocationMetadata {
3850 fn typename() -> &'static str {
3851 "type.googleapis.com/google.cloud.functions.v2.LocationMetadata"
3852 }
3853}
3854
3855#[derive(Clone, Default, PartialEq)]
3857#[non_exhaustive]
3858pub struct Stage {
3859 pub name: crate::model::stage::Name,
3861
3862 pub message: std::string::String,
3864
3865 pub state: crate::model::stage::State,
3867
3868 pub resource: std::string::String,
3870
3871 pub resource_uri: std::string::String,
3873
3874 pub state_messages: std::vec::Vec<crate::model::StateMessage>,
3876
3877 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3878}
3879
3880impl Stage {
3881 pub fn new() -> Self {
3882 std::default::Default::default()
3883 }
3884
3885 pub fn set_name<T: std::convert::Into<crate::model::stage::Name>>(mut self, v: T) -> Self {
3887 self.name = v.into();
3888 self
3889 }
3890
3891 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3893 self.message = v.into();
3894 self
3895 }
3896
3897 pub fn set_state<T: std::convert::Into<crate::model::stage::State>>(mut self, v: T) -> Self {
3899 self.state = v.into();
3900 self
3901 }
3902
3903 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3905 self.resource = v.into();
3906 self
3907 }
3908
3909 pub fn set_resource_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3911 self.resource_uri = v.into();
3912 self
3913 }
3914
3915 pub fn set_state_messages<T, V>(mut self, v: T) -> Self
3917 where
3918 T: std::iter::IntoIterator<Item = V>,
3919 V: std::convert::Into<crate::model::StateMessage>,
3920 {
3921 use std::iter::Iterator;
3922 self.state_messages = v.into_iter().map(|i| i.into()).collect();
3923 self
3924 }
3925}
3926
3927impl wkt::message::Message for Stage {
3928 fn typename() -> &'static str {
3929 "type.googleapis.com/google.cloud.functions.v2.Stage"
3930 }
3931}
3932
3933pub mod stage {
3935 #[allow(unused_imports)]
3936 use super::*;
3937
3938 #[derive(Clone, Debug, PartialEq)]
3954 #[non_exhaustive]
3955 pub enum Name {
3956 Unspecified,
3958 ArtifactRegistry,
3960 Build,
3962 Service,
3964 Trigger,
3966 ServiceRollback,
3968 TriggerRollback,
3970 UnknownValue(name::UnknownValue),
3975 }
3976
3977 #[doc(hidden)]
3978 pub mod name {
3979 #[allow(unused_imports)]
3980 use super::*;
3981 #[derive(Clone, Debug, PartialEq)]
3982 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3983 }
3984
3985 impl Name {
3986 pub fn value(&self) -> std::option::Option<i32> {
3991 match self {
3992 Self::Unspecified => std::option::Option::Some(0),
3993 Self::ArtifactRegistry => std::option::Option::Some(1),
3994 Self::Build => std::option::Option::Some(2),
3995 Self::Service => std::option::Option::Some(3),
3996 Self::Trigger => std::option::Option::Some(4),
3997 Self::ServiceRollback => std::option::Option::Some(5),
3998 Self::TriggerRollback => std::option::Option::Some(6),
3999 Self::UnknownValue(u) => u.0.value(),
4000 }
4001 }
4002
4003 pub fn name(&self) -> std::option::Option<&str> {
4008 match self {
4009 Self::Unspecified => std::option::Option::Some("NAME_UNSPECIFIED"),
4010 Self::ArtifactRegistry => std::option::Option::Some("ARTIFACT_REGISTRY"),
4011 Self::Build => std::option::Option::Some("BUILD"),
4012 Self::Service => std::option::Option::Some("SERVICE"),
4013 Self::Trigger => std::option::Option::Some("TRIGGER"),
4014 Self::ServiceRollback => std::option::Option::Some("SERVICE_ROLLBACK"),
4015 Self::TriggerRollback => std::option::Option::Some("TRIGGER_ROLLBACK"),
4016 Self::UnknownValue(u) => u.0.name(),
4017 }
4018 }
4019 }
4020
4021 impl std::default::Default for Name {
4022 fn default() -> Self {
4023 use std::convert::From;
4024 Self::from(0)
4025 }
4026 }
4027
4028 impl std::fmt::Display for Name {
4029 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4030 wkt::internal::display_enum(f, self.name(), self.value())
4031 }
4032 }
4033
4034 impl std::convert::From<i32> for Name {
4035 fn from(value: i32) -> Self {
4036 match value {
4037 0 => Self::Unspecified,
4038 1 => Self::ArtifactRegistry,
4039 2 => Self::Build,
4040 3 => Self::Service,
4041 4 => Self::Trigger,
4042 5 => Self::ServiceRollback,
4043 6 => Self::TriggerRollback,
4044 _ => Self::UnknownValue(name::UnknownValue(
4045 wkt::internal::UnknownEnumValue::Integer(value),
4046 )),
4047 }
4048 }
4049 }
4050
4051 impl std::convert::From<&str> for Name {
4052 fn from(value: &str) -> Self {
4053 use std::string::ToString;
4054 match value {
4055 "NAME_UNSPECIFIED" => Self::Unspecified,
4056 "ARTIFACT_REGISTRY" => Self::ArtifactRegistry,
4057 "BUILD" => Self::Build,
4058 "SERVICE" => Self::Service,
4059 "TRIGGER" => Self::Trigger,
4060 "SERVICE_ROLLBACK" => Self::ServiceRollback,
4061 "TRIGGER_ROLLBACK" => Self::TriggerRollback,
4062 _ => Self::UnknownValue(name::UnknownValue(
4063 wkt::internal::UnknownEnumValue::String(value.to_string()),
4064 )),
4065 }
4066 }
4067 }
4068
4069 impl serde::ser::Serialize for Name {
4070 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4071 where
4072 S: serde::Serializer,
4073 {
4074 match self {
4075 Self::Unspecified => serializer.serialize_i32(0),
4076 Self::ArtifactRegistry => serializer.serialize_i32(1),
4077 Self::Build => serializer.serialize_i32(2),
4078 Self::Service => serializer.serialize_i32(3),
4079 Self::Trigger => serializer.serialize_i32(4),
4080 Self::ServiceRollback => serializer.serialize_i32(5),
4081 Self::TriggerRollback => serializer.serialize_i32(6),
4082 Self::UnknownValue(u) => u.0.serialize(serializer),
4083 }
4084 }
4085 }
4086
4087 impl<'de> serde::de::Deserialize<'de> for Name {
4088 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4089 where
4090 D: serde::Deserializer<'de>,
4091 {
4092 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Name>::new(
4093 ".google.cloud.functions.v2.Stage.Name",
4094 ))
4095 }
4096 }
4097
4098 #[derive(Clone, Debug, PartialEq)]
4114 #[non_exhaustive]
4115 pub enum State {
4116 Unspecified,
4118 NotStarted,
4120 InProgress,
4122 Complete,
4124 UnknownValue(state::UnknownValue),
4129 }
4130
4131 #[doc(hidden)]
4132 pub mod state {
4133 #[allow(unused_imports)]
4134 use super::*;
4135 #[derive(Clone, Debug, PartialEq)]
4136 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4137 }
4138
4139 impl State {
4140 pub fn value(&self) -> std::option::Option<i32> {
4145 match self {
4146 Self::Unspecified => std::option::Option::Some(0),
4147 Self::NotStarted => std::option::Option::Some(1),
4148 Self::InProgress => std::option::Option::Some(2),
4149 Self::Complete => std::option::Option::Some(3),
4150 Self::UnknownValue(u) => u.0.value(),
4151 }
4152 }
4153
4154 pub fn name(&self) -> std::option::Option<&str> {
4159 match self {
4160 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4161 Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
4162 Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
4163 Self::Complete => std::option::Option::Some("COMPLETE"),
4164 Self::UnknownValue(u) => u.0.name(),
4165 }
4166 }
4167 }
4168
4169 impl std::default::Default for State {
4170 fn default() -> Self {
4171 use std::convert::From;
4172 Self::from(0)
4173 }
4174 }
4175
4176 impl std::fmt::Display for State {
4177 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4178 wkt::internal::display_enum(f, self.name(), self.value())
4179 }
4180 }
4181
4182 impl std::convert::From<i32> for State {
4183 fn from(value: i32) -> Self {
4184 match value {
4185 0 => Self::Unspecified,
4186 1 => Self::NotStarted,
4187 2 => Self::InProgress,
4188 3 => Self::Complete,
4189 _ => Self::UnknownValue(state::UnknownValue(
4190 wkt::internal::UnknownEnumValue::Integer(value),
4191 )),
4192 }
4193 }
4194 }
4195
4196 impl std::convert::From<&str> for State {
4197 fn from(value: &str) -> Self {
4198 use std::string::ToString;
4199 match value {
4200 "STATE_UNSPECIFIED" => Self::Unspecified,
4201 "NOT_STARTED" => Self::NotStarted,
4202 "IN_PROGRESS" => Self::InProgress,
4203 "COMPLETE" => Self::Complete,
4204 _ => Self::UnknownValue(state::UnknownValue(
4205 wkt::internal::UnknownEnumValue::String(value.to_string()),
4206 )),
4207 }
4208 }
4209 }
4210
4211 impl serde::ser::Serialize for State {
4212 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4213 where
4214 S: serde::Serializer,
4215 {
4216 match self {
4217 Self::Unspecified => serializer.serialize_i32(0),
4218 Self::NotStarted => serializer.serialize_i32(1),
4219 Self::InProgress => serializer.serialize_i32(2),
4220 Self::Complete => serializer.serialize_i32(3),
4221 Self::UnknownValue(u) => u.0.serialize(serializer),
4222 }
4223 }
4224 }
4225
4226 impl<'de> serde::de::Deserialize<'de> for State {
4227 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4228 where
4229 D: serde::Deserializer<'de>,
4230 {
4231 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4232 ".google.cloud.functions.v2.Stage.State",
4233 ))
4234 }
4235 }
4236}
4237
4238#[derive(Clone, Debug, PartialEq)]
4254#[non_exhaustive]
4255pub enum OperationType {
4256 OperationtypeUnspecified,
4258 CreateFunction,
4260 UpdateFunction,
4262 DeleteFunction,
4264 UnknownValue(operation_type::UnknownValue),
4269}
4270
4271#[doc(hidden)]
4272pub mod operation_type {
4273 #[allow(unused_imports)]
4274 use super::*;
4275 #[derive(Clone, Debug, PartialEq)]
4276 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4277}
4278
4279impl OperationType {
4280 pub fn value(&self) -> std::option::Option<i32> {
4285 match self {
4286 Self::OperationtypeUnspecified => std::option::Option::Some(0),
4287 Self::CreateFunction => std::option::Option::Some(1),
4288 Self::UpdateFunction => std::option::Option::Some(2),
4289 Self::DeleteFunction => std::option::Option::Some(3),
4290 Self::UnknownValue(u) => u.0.value(),
4291 }
4292 }
4293
4294 pub fn name(&self) -> std::option::Option<&str> {
4299 match self {
4300 Self::OperationtypeUnspecified => {
4301 std::option::Option::Some("OPERATIONTYPE_UNSPECIFIED")
4302 }
4303 Self::CreateFunction => std::option::Option::Some("CREATE_FUNCTION"),
4304 Self::UpdateFunction => std::option::Option::Some("UPDATE_FUNCTION"),
4305 Self::DeleteFunction => std::option::Option::Some("DELETE_FUNCTION"),
4306 Self::UnknownValue(u) => u.0.name(),
4307 }
4308 }
4309}
4310
4311impl std::default::Default for OperationType {
4312 fn default() -> Self {
4313 use std::convert::From;
4314 Self::from(0)
4315 }
4316}
4317
4318impl std::fmt::Display for OperationType {
4319 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4320 wkt::internal::display_enum(f, self.name(), self.value())
4321 }
4322}
4323
4324impl std::convert::From<i32> for OperationType {
4325 fn from(value: i32) -> Self {
4326 match value {
4327 0 => Self::OperationtypeUnspecified,
4328 1 => Self::CreateFunction,
4329 2 => Self::UpdateFunction,
4330 3 => Self::DeleteFunction,
4331 _ => Self::UnknownValue(operation_type::UnknownValue(
4332 wkt::internal::UnknownEnumValue::Integer(value),
4333 )),
4334 }
4335 }
4336}
4337
4338impl std::convert::From<&str> for OperationType {
4339 fn from(value: &str) -> Self {
4340 use std::string::ToString;
4341 match value {
4342 "OPERATIONTYPE_UNSPECIFIED" => Self::OperationtypeUnspecified,
4343 "CREATE_FUNCTION" => Self::CreateFunction,
4344 "UPDATE_FUNCTION" => Self::UpdateFunction,
4345 "DELETE_FUNCTION" => Self::DeleteFunction,
4346 _ => Self::UnknownValue(operation_type::UnknownValue(
4347 wkt::internal::UnknownEnumValue::String(value.to_string()),
4348 )),
4349 }
4350 }
4351}
4352
4353impl serde::ser::Serialize for OperationType {
4354 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4355 where
4356 S: serde::Serializer,
4357 {
4358 match self {
4359 Self::OperationtypeUnspecified => serializer.serialize_i32(0),
4360 Self::CreateFunction => serializer.serialize_i32(1),
4361 Self::UpdateFunction => serializer.serialize_i32(2),
4362 Self::DeleteFunction => serializer.serialize_i32(3),
4363 Self::UnknownValue(u) => u.0.serialize(serializer),
4364 }
4365 }
4366}
4367
4368impl<'de> serde::de::Deserialize<'de> for OperationType {
4369 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4370 where
4371 D: serde::Deserializer<'de>,
4372 {
4373 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperationType>::new(
4374 ".google.cloud.functions.v2.OperationType",
4375 ))
4376 }
4377}
4378
4379#[derive(Clone, Debug, PartialEq)]
4395#[non_exhaustive]
4396pub enum Environment {
4397 Unspecified,
4399 Gen1,
4401 Gen2,
4403 UnknownValue(environment::UnknownValue),
4408}
4409
4410#[doc(hidden)]
4411pub mod environment {
4412 #[allow(unused_imports)]
4413 use super::*;
4414 #[derive(Clone, Debug, PartialEq)]
4415 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4416}
4417
4418impl Environment {
4419 pub fn value(&self) -> std::option::Option<i32> {
4424 match self {
4425 Self::Unspecified => std::option::Option::Some(0),
4426 Self::Gen1 => std::option::Option::Some(1),
4427 Self::Gen2 => std::option::Option::Some(2),
4428 Self::UnknownValue(u) => u.0.value(),
4429 }
4430 }
4431
4432 pub fn name(&self) -> std::option::Option<&str> {
4437 match self {
4438 Self::Unspecified => std::option::Option::Some("ENVIRONMENT_UNSPECIFIED"),
4439 Self::Gen1 => std::option::Option::Some("GEN_1"),
4440 Self::Gen2 => std::option::Option::Some("GEN_2"),
4441 Self::UnknownValue(u) => u.0.name(),
4442 }
4443 }
4444}
4445
4446impl std::default::Default for Environment {
4447 fn default() -> Self {
4448 use std::convert::From;
4449 Self::from(0)
4450 }
4451}
4452
4453impl std::fmt::Display for Environment {
4454 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4455 wkt::internal::display_enum(f, self.name(), self.value())
4456 }
4457}
4458
4459impl std::convert::From<i32> for Environment {
4460 fn from(value: i32) -> Self {
4461 match value {
4462 0 => Self::Unspecified,
4463 1 => Self::Gen1,
4464 2 => Self::Gen2,
4465 _ => Self::UnknownValue(environment::UnknownValue(
4466 wkt::internal::UnknownEnumValue::Integer(value),
4467 )),
4468 }
4469 }
4470}
4471
4472impl std::convert::From<&str> for Environment {
4473 fn from(value: &str) -> Self {
4474 use std::string::ToString;
4475 match value {
4476 "ENVIRONMENT_UNSPECIFIED" => Self::Unspecified,
4477 "GEN_1" => Self::Gen1,
4478 "GEN_2" => Self::Gen2,
4479 _ => Self::UnknownValue(environment::UnknownValue(
4480 wkt::internal::UnknownEnumValue::String(value.to_string()),
4481 )),
4482 }
4483 }
4484}
4485
4486impl serde::ser::Serialize for Environment {
4487 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4488 where
4489 S: serde::Serializer,
4490 {
4491 match self {
4492 Self::Unspecified => serializer.serialize_i32(0),
4493 Self::Gen1 => serializer.serialize_i32(1),
4494 Self::Gen2 => serializer.serialize_i32(2),
4495 Self::UnknownValue(u) => u.0.serialize(serializer),
4496 }
4497 }
4498}
4499
4500impl<'de> serde::de::Deserialize<'de> for Environment {
4501 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4502 where
4503 D: serde::Deserializer<'de>,
4504 {
4505 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Environment>::new(
4506 ".google.cloud.functions.v2.Environment",
4507 ))
4508 }
4509}