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 longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37#[serde_with::serde_as]
39#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
40#[serde(default, rename_all = "camelCase")]
41#[non_exhaustive]
42pub struct AutoscalingPolicy {
43 #[serde(skip_serializing_if = "std::string::String::is_empty")]
49 pub id: std::string::String,
50
51 #[serde(skip_serializing_if = "std::string::String::is_empty")]
63 pub name: std::string::String,
64
65 #[serde(skip_serializing_if = "std::option::Option::is_none")]
67 pub worker_config: std::option::Option<crate::model::InstanceGroupAutoscalingPolicyConfig>,
68
69 #[serde(skip_serializing_if = "std::option::Option::is_none")]
71 pub secondary_worker_config:
72 std::option::Option<crate::model::InstanceGroupAutoscalingPolicyConfig>,
73
74 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
82 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
83
84 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
86 pub algorithm: std::option::Option<crate::model::autoscaling_policy::Algorithm>,
87
88 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
89 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
90}
91
92impl AutoscalingPolicy {
93 pub fn new() -> Self {
94 std::default::Default::default()
95 }
96
97 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
99 self.id = v.into();
100 self
101 }
102
103 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
105 self.name = v.into();
106 self
107 }
108
109 pub fn set_worker_config<
111 T: std::convert::Into<std::option::Option<crate::model::InstanceGroupAutoscalingPolicyConfig>>,
112 >(
113 mut self,
114 v: T,
115 ) -> Self {
116 self.worker_config = v.into();
117 self
118 }
119
120 pub fn set_secondary_worker_config<
122 T: std::convert::Into<std::option::Option<crate::model::InstanceGroupAutoscalingPolicyConfig>>,
123 >(
124 mut self,
125 v: T,
126 ) -> Self {
127 self.secondary_worker_config = v.into();
128 self
129 }
130
131 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
133 where
134 T: std::iter::IntoIterator<Item = (K, V)>,
135 K: std::convert::Into<std::string::String>,
136 V: std::convert::Into<std::string::String>,
137 {
138 use std::iter::Iterator;
139 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
140 self
141 }
142
143 pub fn set_algorithm<
148 T: std::convert::Into<std::option::Option<crate::model::autoscaling_policy::Algorithm>>,
149 >(
150 mut self,
151 v: T,
152 ) -> Self {
153 self.algorithm = v.into();
154 self
155 }
156
157 pub fn basic_algorithm(
161 &self,
162 ) -> std::option::Option<&std::boxed::Box<crate::model::BasicAutoscalingAlgorithm>> {
163 #[allow(unreachable_patterns)]
164 self.algorithm.as_ref().and_then(|v| match v {
165 crate::model::autoscaling_policy::Algorithm::BasicAlgorithm(v) => {
166 std::option::Option::Some(v)
167 }
168 _ => std::option::Option::None,
169 })
170 }
171
172 pub fn set_basic_algorithm<
178 T: std::convert::Into<std::boxed::Box<crate::model::BasicAutoscalingAlgorithm>>,
179 >(
180 mut self,
181 v: T,
182 ) -> Self {
183 self.algorithm = std::option::Option::Some(
184 crate::model::autoscaling_policy::Algorithm::BasicAlgorithm(v.into()),
185 );
186 self
187 }
188}
189
190impl wkt::message::Message for AutoscalingPolicy {
191 fn typename() -> &'static str {
192 "type.googleapis.com/google.cloud.dataproc.v1.AutoscalingPolicy"
193 }
194}
195
196pub mod autoscaling_policy {
198 #[allow(unused_imports)]
199 use super::*;
200
201 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
203 #[serde(rename_all = "camelCase")]
204 #[non_exhaustive]
205 pub enum Algorithm {
206 BasicAlgorithm(std::boxed::Box<crate::model::BasicAutoscalingAlgorithm>),
207 }
208}
209
210#[serde_with::serde_as]
212#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
213#[serde(default, rename_all = "camelCase")]
214#[non_exhaustive]
215pub struct BasicAutoscalingAlgorithm {
216 #[serde(skip_serializing_if = "std::option::Option::is_none")]
221 pub cooldown_period: std::option::Option<wkt::Duration>,
222
223 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
224 pub config: std::option::Option<crate::model::basic_autoscaling_algorithm::Config>,
225
226 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
227 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
228}
229
230impl BasicAutoscalingAlgorithm {
231 pub fn new() -> Self {
232 std::default::Default::default()
233 }
234
235 pub fn set_cooldown_period<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
237 mut self,
238 v: T,
239 ) -> Self {
240 self.cooldown_period = v.into();
241 self
242 }
243
244 pub fn set_config<
249 T: std::convert::Into<std::option::Option<crate::model::basic_autoscaling_algorithm::Config>>,
250 >(
251 mut self,
252 v: T,
253 ) -> Self {
254 self.config = v.into();
255 self
256 }
257
258 pub fn yarn_config(
262 &self,
263 ) -> std::option::Option<&std::boxed::Box<crate::model::BasicYarnAutoscalingConfig>> {
264 #[allow(unreachable_patterns)]
265 self.config.as_ref().and_then(|v| match v {
266 crate::model::basic_autoscaling_algorithm::Config::YarnConfig(v) => {
267 std::option::Option::Some(v)
268 }
269 _ => std::option::Option::None,
270 })
271 }
272
273 pub fn set_yarn_config<
279 T: std::convert::Into<std::boxed::Box<crate::model::BasicYarnAutoscalingConfig>>,
280 >(
281 mut self,
282 v: T,
283 ) -> Self {
284 self.config = std::option::Option::Some(
285 crate::model::basic_autoscaling_algorithm::Config::YarnConfig(v.into()),
286 );
287 self
288 }
289}
290
291impl wkt::message::Message for BasicAutoscalingAlgorithm {
292 fn typename() -> &'static str {
293 "type.googleapis.com/google.cloud.dataproc.v1.BasicAutoscalingAlgorithm"
294 }
295}
296
297pub mod basic_autoscaling_algorithm {
299 #[allow(unused_imports)]
300 use super::*;
301
302 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
303 #[serde(rename_all = "camelCase")]
304 #[non_exhaustive]
305 pub enum Config {
306 YarnConfig(std::boxed::Box<crate::model::BasicYarnAutoscalingConfig>),
308 }
309}
310
311#[serde_with::serde_as]
313#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
314#[serde(default, rename_all = "camelCase")]
315#[non_exhaustive]
316pub struct BasicYarnAutoscalingConfig {
317 #[serde(skip_serializing_if = "std::option::Option::is_none")]
324 pub graceful_decommission_timeout: std::option::Option<wkt::Duration>,
325
326 pub scale_up_factor: f64,
337
338 pub scale_down_factor: f64,
349
350 pub scale_up_min_worker_fraction: f64,
358
359 pub scale_down_min_worker_fraction: f64,
367
368 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
369 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
370}
371
372impl BasicYarnAutoscalingConfig {
373 pub fn new() -> Self {
374 std::default::Default::default()
375 }
376
377 pub fn set_graceful_decommission_timeout<
379 T: std::convert::Into<std::option::Option<wkt::Duration>>,
380 >(
381 mut self,
382 v: T,
383 ) -> Self {
384 self.graceful_decommission_timeout = v.into();
385 self
386 }
387
388 pub fn set_scale_up_factor<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
390 self.scale_up_factor = v.into();
391 self
392 }
393
394 pub fn set_scale_down_factor<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
396 self.scale_down_factor = v.into();
397 self
398 }
399
400 pub fn set_scale_up_min_worker_fraction<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
402 self.scale_up_min_worker_fraction = v.into();
403 self
404 }
405
406 pub fn set_scale_down_min_worker_fraction<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
408 self.scale_down_min_worker_fraction = v.into();
409 self
410 }
411}
412
413impl wkt::message::Message for BasicYarnAutoscalingConfig {
414 fn typename() -> &'static str {
415 "type.googleapis.com/google.cloud.dataproc.v1.BasicYarnAutoscalingConfig"
416 }
417}
418
419#[serde_with::serde_as]
422#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
423#[serde(default, rename_all = "camelCase")]
424#[non_exhaustive]
425pub struct InstanceGroupAutoscalingPolicyConfig {
426 pub min_instances: i32,
431
432 pub max_instances: i32,
439
440 pub weight: i32,
459
460 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
461 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
462}
463
464impl InstanceGroupAutoscalingPolicyConfig {
465 pub fn new() -> Self {
466 std::default::Default::default()
467 }
468
469 pub fn set_min_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
471 self.min_instances = v.into();
472 self
473 }
474
475 pub fn set_max_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
477 self.max_instances = v.into();
478 self
479 }
480
481 pub fn set_weight<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
483 self.weight = v.into();
484 self
485 }
486}
487
488impl wkt::message::Message for InstanceGroupAutoscalingPolicyConfig {
489 fn typename() -> &'static str {
490 "type.googleapis.com/google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig"
491 }
492}
493
494#[serde_with::serde_as]
496#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
497#[serde(default, rename_all = "camelCase")]
498#[non_exhaustive]
499pub struct CreateAutoscalingPolicyRequest {
500 #[serde(skip_serializing_if = "std::string::String::is_empty")]
512 pub parent: std::string::String,
513
514 #[serde(skip_serializing_if = "std::option::Option::is_none")]
516 pub policy: std::option::Option<crate::model::AutoscalingPolicy>,
517
518 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
519 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
520}
521
522impl CreateAutoscalingPolicyRequest {
523 pub fn new() -> Self {
524 std::default::Default::default()
525 }
526
527 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
529 self.parent = v.into();
530 self
531 }
532
533 pub fn set_policy<
535 T: std::convert::Into<std::option::Option<crate::model::AutoscalingPolicy>>,
536 >(
537 mut self,
538 v: T,
539 ) -> Self {
540 self.policy = v.into();
541 self
542 }
543}
544
545impl wkt::message::Message for CreateAutoscalingPolicyRequest {
546 fn typename() -> &'static str {
547 "type.googleapis.com/google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest"
548 }
549}
550
551#[serde_with::serde_as]
553#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
554#[serde(default, rename_all = "camelCase")]
555#[non_exhaustive]
556pub struct GetAutoscalingPolicyRequest {
557 #[serde(skip_serializing_if = "std::string::String::is_empty")]
569 pub name: std::string::String,
570
571 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
572 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
573}
574
575impl GetAutoscalingPolicyRequest {
576 pub fn new() -> Self {
577 std::default::Default::default()
578 }
579
580 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
582 self.name = v.into();
583 self
584 }
585}
586
587impl wkt::message::Message for GetAutoscalingPolicyRequest {
588 fn typename() -> &'static str {
589 "type.googleapis.com/google.cloud.dataproc.v1.GetAutoscalingPolicyRequest"
590 }
591}
592
593#[serde_with::serde_as]
595#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
596#[serde(default, rename_all = "camelCase")]
597#[non_exhaustive]
598pub struct UpdateAutoscalingPolicyRequest {
599 #[serde(skip_serializing_if = "std::option::Option::is_none")]
601 pub policy: std::option::Option<crate::model::AutoscalingPolicy>,
602
603 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
604 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
605}
606
607impl UpdateAutoscalingPolicyRequest {
608 pub fn new() -> Self {
609 std::default::Default::default()
610 }
611
612 pub fn set_policy<
614 T: std::convert::Into<std::option::Option<crate::model::AutoscalingPolicy>>,
615 >(
616 mut self,
617 v: T,
618 ) -> Self {
619 self.policy = v.into();
620 self
621 }
622}
623
624impl wkt::message::Message for UpdateAutoscalingPolicyRequest {
625 fn typename() -> &'static str {
626 "type.googleapis.com/google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest"
627 }
628}
629
630#[serde_with::serde_as]
634#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
635#[serde(default, rename_all = "camelCase")]
636#[non_exhaustive]
637pub struct DeleteAutoscalingPolicyRequest {
638 #[serde(skip_serializing_if = "std::string::String::is_empty")]
650 pub name: std::string::String,
651
652 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
653 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
654}
655
656impl DeleteAutoscalingPolicyRequest {
657 pub fn new() -> Self {
658 std::default::Default::default()
659 }
660
661 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
663 self.name = v.into();
664 self
665 }
666}
667
668impl wkt::message::Message for DeleteAutoscalingPolicyRequest {
669 fn typename() -> &'static str {
670 "type.googleapis.com/google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest"
671 }
672}
673
674#[serde_with::serde_as]
676#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
677#[serde(default, rename_all = "camelCase")]
678#[non_exhaustive]
679pub struct ListAutoscalingPoliciesRequest {
680 #[serde(skip_serializing_if = "std::string::String::is_empty")]
692 pub parent: std::string::String,
693
694 pub page_size: i32,
697
698 #[serde(skip_serializing_if = "std::string::String::is_empty")]
701 pub page_token: std::string::String,
702
703 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
704 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
705}
706
707impl ListAutoscalingPoliciesRequest {
708 pub fn new() -> Self {
709 std::default::Default::default()
710 }
711
712 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
714 self.parent = v.into();
715 self
716 }
717
718 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
720 self.page_size = v.into();
721 self
722 }
723
724 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
726 self.page_token = v.into();
727 self
728 }
729}
730
731impl wkt::message::Message for ListAutoscalingPoliciesRequest {
732 fn typename() -> &'static str {
733 "type.googleapis.com/google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest"
734 }
735}
736
737#[serde_with::serde_as]
739#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
740#[serde(default, rename_all = "camelCase")]
741#[non_exhaustive]
742pub struct ListAutoscalingPoliciesResponse {
743 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
745 pub policies: std::vec::Vec<crate::model::AutoscalingPolicy>,
746
747 #[serde(skip_serializing_if = "std::string::String::is_empty")]
750 pub next_page_token: std::string::String,
751
752 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
753 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
754}
755
756impl ListAutoscalingPoliciesResponse {
757 pub fn new() -> Self {
758 std::default::Default::default()
759 }
760
761 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
763 self.next_page_token = v.into();
764 self
765 }
766
767 pub fn set_policies<T, V>(mut self, v: T) -> Self
769 where
770 T: std::iter::IntoIterator<Item = V>,
771 V: std::convert::Into<crate::model::AutoscalingPolicy>,
772 {
773 use std::iter::Iterator;
774 self.policies = v.into_iter().map(|i| i.into()).collect();
775 self
776 }
777}
778
779impl wkt::message::Message for ListAutoscalingPoliciesResponse {
780 fn typename() -> &'static str {
781 "type.googleapis.com/google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse"
782 }
783}
784
785#[doc(hidden)]
786impl gax::paginator::internal::PageableResponse for ListAutoscalingPoliciesResponse {
787 type PageItem = crate::model::AutoscalingPolicy;
788
789 fn items(self) -> std::vec::Vec<Self::PageItem> {
790 self.policies
791 }
792
793 fn next_page_token(&self) -> std::string::String {
794 use std::clone::Clone;
795 self.next_page_token.clone()
796 }
797}
798
799#[serde_with::serde_as]
801#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
802#[serde(default, rename_all = "camelCase")]
803#[non_exhaustive]
804pub struct CreateBatchRequest {
805 #[serde(skip_serializing_if = "std::string::String::is_empty")]
807 pub parent: std::string::String,
808
809 #[serde(skip_serializing_if = "std::option::Option::is_none")]
811 pub batch: std::option::Option<crate::model::Batch>,
812
813 #[serde(skip_serializing_if = "std::string::String::is_empty")]
818 pub batch_id: std::string::String,
819
820 #[serde(skip_serializing_if = "std::string::String::is_empty")]
833 pub request_id: std::string::String,
834
835 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
836 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
837}
838
839impl CreateBatchRequest {
840 pub fn new() -> Self {
841 std::default::Default::default()
842 }
843
844 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
846 self.parent = v.into();
847 self
848 }
849
850 pub fn set_batch<T: std::convert::Into<std::option::Option<crate::model::Batch>>>(
852 mut self,
853 v: T,
854 ) -> Self {
855 self.batch = v.into();
856 self
857 }
858
859 pub fn set_batch_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
861 self.batch_id = v.into();
862 self
863 }
864
865 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
867 self.request_id = v.into();
868 self
869 }
870}
871
872impl wkt::message::Message for CreateBatchRequest {
873 fn typename() -> &'static str {
874 "type.googleapis.com/google.cloud.dataproc.v1.CreateBatchRequest"
875 }
876}
877
878#[serde_with::serde_as]
880#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
881#[serde(default, rename_all = "camelCase")]
882#[non_exhaustive]
883pub struct GetBatchRequest {
884 #[serde(skip_serializing_if = "std::string::String::is_empty")]
888 pub name: std::string::String,
889
890 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
891 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
892}
893
894impl GetBatchRequest {
895 pub fn new() -> Self {
896 std::default::Default::default()
897 }
898
899 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
901 self.name = v.into();
902 self
903 }
904}
905
906impl wkt::message::Message for GetBatchRequest {
907 fn typename() -> &'static str {
908 "type.googleapis.com/google.cloud.dataproc.v1.GetBatchRequest"
909 }
910}
911
912#[serde_with::serde_as]
914#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
915#[serde(default, rename_all = "camelCase")]
916#[non_exhaustive]
917pub struct ListBatchesRequest {
918 #[serde(skip_serializing_if = "std::string::String::is_empty")]
920 pub parent: std::string::String,
921
922 pub page_size: i32,
926
927 #[serde(skip_serializing_if = "std::string::String::is_empty")]
930 pub page_token: std::string::String,
931
932 #[serde(skip_serializing_if = "std::string::String::is_empty")]
945 pub filter: std::string::String,
946
947 #[serde(skip_serializing_if = "std::string::String::is_empty")]
954 pub order_by: std::string::String,
955
956 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
957 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
958}
959
960impl ListBatchesRequest {
961 pub fn new() -> Self {
962 std::default::Default::default()
963 }
964
965 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
967 self.parent = v.into();
968 self
969 }
970
971 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
973 self.page_size = v.into();
974 self
975 }
976
977 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
979 self.page_token = v.into();
980 self
981 }
982
983 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
985 self.filter = v.into();
986 self
987 }
988
989 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
991 self.order_by = v.into();
992 self
993 }
994}
995
996impl wkt::message::Message for ListBatchesRequest {
997 fn typename() -> &'static str {
998 "type.googleapis.com/google.cloud.dataproc.v1.ListBatchesRequest"
999 }
1000}
1001
1002#[serde_with::serde_as]
1004#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1005#[serde(default, rename_all = "camelCase")]
1006#[non_exhaustive]
1007pub struct ListBatchesResponse {
1008 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1010 pub batches: std::vec::Vec<crate::model::Batch>,
1011
1012 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1015 pub next_page_token: std::string::String,
1016
1017 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1021 pub unreachable: std::vec::Vec<std::string::String>,
1022
1023 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1024 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1025}
1026
1027impl ListBatchesResponse {
1028 pub fn new() -> Self {
1029 std::default::Default::default()
1030 }
1031
1032 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1034 self.next_page_token = v.into();
1035 self
1036 }
1037
1038 pub fn set_batches<T, V>(mut self, v: T) -> Self
1040 where
1041 T: std::iter::IntoIterator<Item = V>,
1042 V: std::convert::Into<crate::model::Batch>,
1043 {
1044 use std::iter::Iterator;
1045 self.batches = v.into_iter().map(|i| i.into()).collect();
1046 self
1047 }
1048
1049 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1051 where
1052 T: std::iter::IntoIterator<Item = V>,
1053 V: std::convert::Into<std::string::String>,
1054 {
1055 use std::iter::Iterator;
1056 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1057 self
1058 }
1059}
1060
1061impl wkt::message::Message for ListBatchesResponse {
1062 fn typename() -> &'static str {
1063 "type.googleapis.com/google.cloud.dataproc.v1.ListBatchesResponse"
1064 }
1065}
1066
1067#[doc(hidden)]
1068impl gax::paginator::internal::PageableResponse for ListBatchesResponse {
1069 type PageItem = crate::model::Batch;
1070
1071 fn items(self) -> std::vec::Vec<Self::PageItem> {
1072 self.batches
1073 }
1074
1075 fn next_page_token(&self) -> std::string::String {
1076 use std::clone::Clone;
1077 self.next_page_token.clone()
1078 }
1079}
1080
1081#[serde_with::serde_as]
1083#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1084#[serde(default, rename_all = "camelCase")]
1085#[non_exhaustive]
1086pub struct DeleteBatchRequest {
1087 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1091 pub name: std::string::String,
1092
1093 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1094 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1095}
1096
1097impl DeleteBatchRequest {
1098 pub fn new() -> Self {
1099 std::default::Default::default()
1100 }
1101
1102 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1104 self.name = v.into();
1105 self
1106 }
1107}
1108
1109impl wkt::message::Message for DeleteBatchRequest {
1110 fn typename() -> &'static str {
1111 "type.googleapis.com/google.cloud.dataproc.v1.DeleteBatchRequest"
1112 }
1113}
1114
1115#[serde_with::serde_as]
1117#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1118#[serde(default, rename_all = "camelCase")]
1119#[non_exhaustive]
1120pub struct Batch {
1121 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1123 pub name: std::string::String,
1124
1125 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1128 pub uuid: std::string::String,
1129
1130 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1132 pub create_time: std::option::Option<wkt::Timestamp>,
1133
1134 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1136 pub runtime_info: std::option::Option<crate::model::RuntimeInfo>,
1137
1138 pub state: crate::model::batch::State,
1140
1141 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1144 pub state_message: std::string::String,
1145
1146 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1148 pub state_time: std::option::Option<wkt::Timestamp>,
1149
1150 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1152 pub creator: std::string::String,
1153
1154 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1162 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1163
1164 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1166 pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
1167
1168 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1170 pub environment_config: std::option::Option<crate::model::EnvironmentConfig>,
1171
1172 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1174 pub operation: std::string::String,
1175
1176 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1178 pub state_history: std::vec::Vec<crate::model::batch::StateHistory>,
1179
1180 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
1182 pub batch_config: std::option::Option<crate::model::batch::BatchConfig>,
1183
1184 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1185 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1186}
1187
1188impl Batch {
1189 pub fn new() -> Self {
1190 std::default::Default::default()
1191 }
1192
1193 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1195 self.name = v.into();
1196 self
1197 }
1198
1199 pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1201 self.uuid = v.into();
1202 self
1203 }
1204
1205 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1207 mut self,
1208 v: T,
1209 ) -> Self {
1210 self.create_time = v.into();
1211 self
1212 }
1213
1214 pub fn set_runtime_info<
1216 T: std::convert::Into<std::option::Option<crate::model::RuntimeInfo>>,
1217 >(
1218 mut self,
1219 v: T,
1220 ) -> Self {
1221 self.runtime_info = v.into();
1222 self
1223 }
1224
1225 pub fn set_state<T: std::convert::Into<crate::model::batch::State>>(mut self, v: T) -> Self {
1227 self.state = v.into();
1228 self
1229 }
1230
1231 pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1233 self.state_message = v.into();
1234 self
1235 }
1236
1237 pub fn set_state_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1239 mut self,
1240 v: T,
1241 ) -> Self {
1242 self.state_time = v.into();
1243 self
1244 }
1245
1246 pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1248 self.creator = v.into();
1249 self
1250 }
1251
1252 pub fn set_runtime_config<
1254 T: std::convert::Into<std::option::Option<crate::model::RuntimeConfig>>,
1255 >(
1256 mut self,
1257 v: T,
1258 ) -> Self {
1259 self.runtime_config = v.into();
1260 self
1261 }
1262
1263 pub fn set_environment_config<
1265 T: std::convert::Into<std::option::Option<crate::model::EnvironmentConfig>>,
1266 >(
1267 mut self,
1268 v: T,
1269 ) -> Self {
1270 self.environment_config = v.into();
1271 self
1272 }
1273
1274 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1276 self.operation = v.into();
1277 self
1278 }
1279
1280 pub fn set_state_history<T, V>(mut self, v: T) -> Self
1282 where
1283 T: std::iter::IntoIterator<Item = V>,
1284 V: std::convert::Into<crate::model::batch::StateHistory>,
1285 {
1286 use std::iter::Iterator;
1287 self.state_history = v.into_iter().map(|i| i.into()).collect();
1288 self
1289 }
1290
1291 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1293 where
1294 T: std::iter::IntoIterator<Item = (K, V)>,
1295 K: std::convert::Into<std::string::String>,
1296 V: std::convert::Into<std::string::String>,
1297 {
1298 use std::iter::Iterator;
1299 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1300 self
1301 }
1302
1303 pub fn set_batch_config<
1308 T: std::convert::Into<std::option::Option<crate::model::batch::BatchConfig>>,
1309 >(
1310 mut self,
1311 v: T,
1312 ) -> Self {
1313 self.batch_config = v.into();
1314 self
1315 }
1316
1317 pub fn pyspark_batch(
1321 &self,
1322 ) -> std::option::Option<&std::boxed::Box<crate::model::PySparkBatch>> {
1323 #[allow(unreachable_patterns)]
1324 self.batch_config.as_ref().and_then(|v| match v {
1325 crate::model::batch::BatchConfig::PysparkBatch(v) => std::option::Option::Some(v),
1326 _ => std::option::Option::None,
1327 })
1328 }
1329
1330 pub fn spark_batch(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkBatch>> {
1334 #[allow(unreachable_patterns)]
1335 self.batch_config.as_ref().and_then(|v| match v {
1336 crate::model::batch::BatchConfig::SparkBatch(v) => std::option::Option::Some(v),
1337 _ => std::option::Option::None,
1338 })
1339 }
1340
1341 pub fn spark_r_batch(
1345 &self,
1346 ) -> std::option::Option<&std::boxed::Box<crate::model::SparkRBatch>> {
1347 #[allow(unreachable_patterns)]
1348 self.batch_config.as_ref().and_then(|v| match v {
1349 crate::model::batch::BatchConfig::SparkRBatch(v) => std::option::Option::Some(v),
1350 _ => std::option::Option::None,
1351 })
1352 }
1353
1354 pub fn spark_sql_batch(
1358 &self,
1359 ) -> std::option::Option<&std::boxed::Box<crate::model::SparkSqlBatch>> {
1360 #[allow(unreachable_patterns)]
1361 self.batch_config.as_ref().and_then(|v| match v {
1362 crate::model::batch::BatchConfig::SparkSqlBatch(v) => std::option::Option::Some(v),
1363 _ => std::option::Option::None,
1364 })
1365 }
1366
1367 pub fn set_pyspark_batch<T: std::convert::Into<std::boxed::Box<crate::model::PySparkBatch>>>(
1373 mut self,
1374 v: T,
1375 ) -> Self {
1376 self.batch_config =
1377 std::option::Option::Some(crate::model::batch::BatchConfig::PysparkBatch(v.into()));
1378 self
1379 }
1380
1381 pub fn set_spark_batch<T: std::convert::Into<std::boxed::Box<crate::model::SparkBatch>>>(
1387 mut self,
1388 v: T,
1389 ) -> Self {
1390 self.batch_config =
1391 std::option::Option::Some(crate::model::batch::BatchConfig::SparkBatch(v.into()));
1392 self
1393 }
1394
1395 pub fn set_spark_r_batch<T: std::convert::Into<std::boxed::Box<crate::model::SparkRBatch>>>(
1401 mut self,
1402 v: T,
1403 ) -> Self {
1404 self.batch_config =
1405 std::option::Option::Some(crate::model::batch::BatchConfig::SparkRBatch(v.into()));
1406 self
1407 }
1408
1409 pub fn set_spark_sql_batch<
1415 T: std::convert::Into<std::boxed::Box<crate::model::SparkSqlBatch>>,
1416 >(
1417 mut self,
1418 v: T,
1419 ) -> Self {
1420 self.batch_config =
1421 std::option::Option::Some(crate::model::batch::BatchConfig::SparkSqlBatch(v.into()));
1422 self
1423 }
1424}
1425
1426impl wkt::message::Message for Batch {
1427 fn typename() -> &'static str {
1428 "type.googleapis.com/google.cloud.dataproc.v1.Batch"
1429 }
1430}
1431
1432pub mod batch {
1434 #[allow(unused_imports)]
1435 use super::*;
1436
1437 #[serde_with::serde_as]
1439 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1440 #[serde(default, rename_all = "camelCase")]
1441 #[non_exhaustive]
1442 pub struct StateHistory {
1443 pub state: crate::model::batch::State,
1445
1446 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1448 pub state_message: std::string::String,
1449
1450 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1452 pub state_start_time: std::option::Option<wkt::Timestamp>,
1453
1454 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1455 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1456 }
1457
1458 impl StateHistory {
1459 pub fn new() -> Self {
1460 std::default::Default::default()
1461 }
1462
1463 pub fn set_state<T: std::convert::Into<crate::model::batch::State>>(
1465 mut self,
1466 v: T,
1467 ) -> Self {
1468 self.state = v.into();
1469 self
1470 }
1471
1472 pub fn set_state_message<T: std::convert::Into<std::string::String>>(
1474 mut self,
1475 v: T,
1476 ) -> Self {
1477 self.state_message = v.into();
1478 self
1479 }
1480
1481 pub fn set_state_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1483 mut self,
1484 v: T,
1485 ) -> Self {
1486 self.state_start_time = v.into();
1487 self
1488 }
1489 }
1490
1491 impl wkt::message::Message for StateHistory {
1492 fn typename() -> &'static str {
1493 "type.googleapis.com/google.cloud.dataproc.v1.Batch.StateHistory"
1494 }
1495 }
1496
1497 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1499 pub struct State(i32);
1500
1501 impl State {
1502 pub const STATE_UNSPECIFIED: State = State::new(0);
1504
1505 pub const PENDING: State = State::new(1);
1507
1508 pub const RUNNING: State = State::new(2);
1510
1511 pub const CANCELLING: State = State::new(3);
1513
1514 pub const CANCELLED: State = State::new(4);
1516
1517 pub const SUCCEEDED: State = State::new(5);
1519
1520 pub const FAILED: State = State::new(6);
1522
1523 pub(crate) const fn new(value: i32) -> Self {
1525 Self(value)
1526 }
1527
1528 pub fn value(&self) -> i32 {
1530 self.0
1531 }
1532
1533 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1535 match self.0 {
1536 0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
1537 1 => std::borrow::Cow::Borrowed("PENDING"),
1538 2 => std::borrow::Cow::Borrowed("RUNNING"),
1539 3 => std::borrow::Cow::Borrowed("CANCELLING"),
1540 4 => std::borrow::Cow::Borrowed("CANCELLED"),
1541 5 => std::borrow::Cow::Borrowed("SUCCEEDED"),
1542 6 => std::borrow::Cow::Borrowed("FAILED"),
1543 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1544 }
1545 }
1546
1547 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
1549 match name {
1550 "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
1551 "PENDING" => std::option::Option::Some(Self::PENDING),
1552 "RUNNING" => std::option::Option::Some(Self::RUNNING),
1553 "CANCELLING" => std::option::Option::Some(Self::CANCELLING),
1554 "CANCELLED" => std::option::Option::Some(Self::CANCELLED),
1555 "SUCCEEDED" => std::option::Option::Some(Self::SUCCEEDED),
1556 "FAILED" => std::option::Option::Some(Self::FAILED),
1557 _ => std::option::Option::None,
1558 }
1559 }
1560 }
1561
1562 impl std::convert::From<i32> for State {
1563 fn from(value: i32) -> Self {
1564 Self::new(value)
1565 }
1566 }
1567
1568 impl std::default::Default for State {
1569 fn default() -> Self {
1570 Self::new(0)
1571 }
1572 }
1573
1574 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1576 #[serde(rename_all = "camelCase")]
1577 #[non_exhaustive]
1578 pub enum BatchConfig {
1579 PysparkBatch(std::boxed::Box<crate::model::PySparkBatch>),
1581 SparkBatch(std::boxed::Box<crate::model::SparkBatch>),
1583 SparkRBatch(std::boxed::Box<crate::model::SparkRBatch>),
1585 SparkSqlBatch(std::boxed::Box<crate::model::SparkSqlBatch>),
1587 }
1588}
1589
1590#[serde_with::serde_as]
1595#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1596#[serde(default, rename_all = "camelCase")]
1597#[non_exhaustive]
1598pub struct PySparkBatch {
1599 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1602 pub main_python_file_uri: std::string::String,
1603
1604 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1608 pub args: std::vec::Vec<std::string::String>,
1609
1610 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1613 pub python_file_uris: std::vec::Vec<std::string::String>,
1614
1615 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1618 pub jar_file_uris: std::vec::Vec<std::string::String>,
1619
1620 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1623 pub file_uris: std::vec::Vec<std::string::String>,
1624
1625 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1629 pub archive_uris: std::vec::Vec<std::string::String>,
1630
1631 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1632 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1633}
1634
1635impl PySparkBatch {
1636 pub fn new() -> Self {
1637 std::default::Default::default()
1638 }
1639
1640 pub fn set_main_python_file_uri<T: std::convert::Into<std::string::String>>(
1642 mut self,
1643 v: T,
1644 ) -> Self {
1645 self.main_python_file_uri = v.into();
1646 self
1647 }
1648
1649 pub fn set_args<T, V>(mut self, v: T) -> Self
1651 where
1652 T: std::iter::IntoIterator<Item = V>,
1653 V: std::convert::Into<std::string::String>,
1654 {
1655 use std::iter::Iterator;
1656 self.args = v.into_iter().map(|i| i.into()).collect();
1657 self
1658 }
1659
1660 pub fn set_python_file_uris<T, V>(mut self, v: T) -> Self
1662 where
1663 T: std::iter::IntoIterator<Item = V>,
1664 V: std::convert::Into<std::string::String>,
1665 {
1666 use std::iter::Iterator;
1667 self.python_file_uris = v.into_iter().map(|i| i.into()).collect();
1668 self
1669 }
1670
1671 pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
1673 where
1674 T: std::iter::IntoIterator<Item = V>,
1675 V: std::convert::Into<std::string::String>,
1676 {
1677 use std::iter::Iterator;
1678 self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
1679 self
1680 }
1681
1682 pub fn set_file_uris<T, V>(mut self, v: T) -> Self
1684 where
1685 T: std::iter::IntoIterator<Item = V>,
1686 V: std::convert::Into<std::string::String>,
1687 {
1688 use std::iter::Iterator;
1689 self.file_uris = v.into_iter().map(|i| i.into()).collect();
1690 self
1691 }
1692
1693 pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
1695 where
1696 T: std::iter::IntoIterator<Item = V>,
1697 V: std::convert::Into<std::string::String>,
1698 {
1699 use std::iter::Iterator;
1700 self.archive_uris = v.into_iter().map(|i| i.into()).collect();
1701 self
1702 }
1703}
1704
1705impl wkt::message::Message for PySparkBatch {
1706 fn typename() -> &'static str {
1707 "type.googleapis.com/google.cloud.dataproc.v1.PySparkBatch"
1708 }
1709}
1710
1711#[serde_with::serde_as]
1714#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1715#[serde(default, rename_all = "camelCase")]
1716#[non_exhaustive]
1717pub struct SparkBatch {
1718 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1722 pub args: std::vec::Vec<std::string::String>,
1723
1724 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1727 pub jar_file_uris: std::vec::Vec<std::string::String>,
1728
1729 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1732 pub file_uris: std::vec::Vec<std::string::String>,
1733
1734 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1738 pub archive_uris: std::vec::Vec<std::string::String>,
1739
1740 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
1746 pub driver: std::option::Option<crate::model::spark_batch::Driver>,
1747
1748 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1749 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1750}
1751
1752impl SparkBatch {
1753 pub fn new() -> Self {
1754 std::default::Default::default()
1755 }
1756
1757 pub fn set_args<T, V>(mut self, v: T) -> Self
1759 where
1760 T: std::iter::IntoIterator<Item = V>,
1761 V: std::convert::Into<std::string::String>,
1762 {
1763 use std::iter::Iterator;
1764 self.args = v.into_iter().map(|i| i.into()).collect();
1765 self
1766 }
1767
1768 pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
1770 where
1771 T: std::iter::IntoIterator<Item = V>,
1772 V: std::convert::Into<std::string::String>,
1773 {
1774 use std::iter::Iterator;
1775 self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
1776 self
1777 }
1778
1779 pub fn set_file_uris<T, V>(mut self, v: T) -> Self
1781 where
1782 T: std::iter::IntoIterator<Item = V>,
1783 V: std::convert::Into<std::string::String>,
1784 {
1785 use std::iter::Iterator;
1786 self.file_uris = v.into_iter().map(|i| i.into()).collect();
1787 self
1788 }
1789
1790 pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
1792 where
1793 T: std::iter::IntoIterator<Item = V>,
1794 V: std::convert::Into<std::string::String>,
1795 {
1796 use std::iter::Iterator;
1797 self.archive_uris = v.into_iter().map(|i| i.into()).collect();
1798 self
1799 }
1800
1801 pub fn set_driver<
1806 T: std::convert::Into<std::option::Option<crate::model::spark_batch::Driver>>,
1807 >(
1808 mut self,
1809 v: T,
1810 ) -> Self {
1811 self.driver = v.into();
1812 self
1813 }
1814
1815 pub fn main_jar_file_uri(&self) -> std::option::Option<&std::string::String> {
1819 #[allow(unreachable_patterns)]
1820 self.driver.as_ref().and_then(|v| match v {
1821 crate::model::spark_batch::Driver::MainJarFileUri(v) => std::option::Option::Some(v),
1822 _ => std::option::Option::None,
1823 })
1824 }
1825
1826 pub fn main_class(&self) -> std::option::Option<&std::string::String> {
1830 #[allow(unreachable_patterns)]
1831 self.driver.as_ref().and_then(|v| match v {
1832 crate::model::spark_batch::Driver::MainClass(v) => std::option::Option::Some(v),
1833 _ => std::option::Option::None,
1834 })
1835 }
1836
1837 pub fn set_main_jar_file_uri<T: std::convert::Into<std::string::String>>(
1843 mut self,
1844 v: T,
1845 ) -> Self {
1846 self.driver =
1847 std::option::Option::Some(crate::model::spark_batch::Driver::MainJarFileUri(v.into()));
1848 self
1849 }
1850
1851 pub fn set_main_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1857 self.driver =
1858 std::option::Option::Some(crate::model::spark_batch::Driver::MainClass(v.into()));
1859 self
1860 }
1861}
1862
1863impl wkt::message::Message for SparkBatch {
1864 fn typename() -> &'static str {
1865 "type.googleapis.com/google.cloud.dataproc.v1.SparkBatch"
1866 }
1867}
1868
1869pub mod spark_batch {
1871 #[allow(unused_imports)]
1872 use super::*;
1873
1874 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1880 #[serde(rename_all = "camelCase")]
1881 #[non_exhaustive]
1882 pub enum Driver {
1883 MainJarFileUri(std::string::String),
1885 MainClass(std::string::String),
1888 }
1889}
1890
1891#[serde_with::serde_as]
1895#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1896#[serde(default, rename_all = "camelCase")]
1897#[non_exhaustive]
1898pub struct SparkRBatch {
1899 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1902 pub main_r_file_uri: std::string::String,
1903
1904 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1908 pub args: std::vec::Vec<std::string::String>,
1909
1910 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1913 pub file_uris: std::vec::Vec<std::string::String>,
1914
1915 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1919 pub archive_uris: std::vec::Vec<std::string::String>,
1920
1921 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1922 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1923}
1924
1925impl SparkRBatch {
1926 pub fn new() -> Self {
1927 std::default::Default::default()
1928 }
1929
1930 pub fn set_main_r_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1932 self.main_r_file_uri = v.into();
1933 self
1934 }
1935
1936 pub fn set_args<T, V>(mut self, v: T) -> Self
1938 where
1939 T: std::iter::IntoIterator<Item = V>,
1940 V: std::convert::Into<std::string::String>,
1941 {
1942 use std::iter::Iterator;
1943 self.args = v.into_iter().map(|i| i.into()).collect();
1944 self
1945 }
1946
1947 pub fn set_file_uris<T, V>(mut self, v: T) -> Self
1949 where
1950 T: std::iter::IntoIterator<Item = V>,
1951 V: std::convert::Into<std::string::String>,
1952 {
1953 use std::iter::Iterator;
1954 self.file_uris = v.into_iter().map(|i| i.into()).collect();
1955 self
1956 }
1957
1958 pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
1960 where
1961 T: std::iter::IntoIterator<Item = V>,
1962 V: std::convert::Into<std::string::String>,
1963 {
1964 use std::iter::Iterator;
1965 self.archive_uris = v.into_iter().map(|i| i.into()).collect();
1966 self
1967 }
1968}
1969
1970impl wkt::message::Message for SparkRBatch {
1971 fn typename() -> &'static str {
1972 "type.googleapis.com/google.cloud.dataproc.v1.SparkRBatch"
1973 }
1974}
1975
1976#[serde_with::serde_as]
1980#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1981#[serde(default, rename_all = "camelCase")]
1982#[non_exhaustive]
1983pub struct SparkSqlBatch {
1984 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1987 pub query_file_uri: std::string::String,
1988
1989 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
1992 pub query_variables: std::collections::HashMap<std::string::String, std::string::String>,
1993
1994 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1996 pub jar_file_uris: std::vec::Vec<std::string::String>,
1997
1998 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1999 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2000}
2001
2002impl SparkSqlBatch {
2003 pub fn new() -> Self {
2004 std::default::Default::default()
2005 }
2006
2007 pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2009 self.query_file_uri = v.into();
2010 self
2011 }
2012
2013 pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
2015 where
2016 T: std::iter::IntoIterator<Item = V>,
2017 V: std::convert::Into<std::string::String>,
2018 {
2019 use std::iter::Iterator;
2020 self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
2021 self
2022 }
2023
2024 pub fn set_query_variables<T, K, V>(mut self, v: T) -> Self
2026 where
2027 T: std::iter::IntoIterator<Item = (K, V)>,
2028 K: std::convert::Into<std::string::String>,
2029 V: std::convert::Into<std::string::String>,
2030 {
2031 use std::iter::Iterator;
2032 self.query_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2033 self
2034 }
2035}
2036
2037impl wkt::message::Message for SparkSqlBatch {
2038 fn typename() -> &'static str {
2039 "type.googleapis.com/google.cloud.dataproc.v1.SparkSqlBatch"
2040 }
2041}
2042
2043#[serde_with::serde_as]
2046#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2047#[serde(default, rename_all = "camelCase")]
2048#[non_exhaustive]
2049pub struct Cluster {
2050 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2052 pub project_id: std::string::String,
2053
2054 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2059 pub cluster_name: std::string::String,
2060
2061 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2067 pub config: std::option::Option<crate::model::ClusterConfig>,
2068
2069 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2082 pub virtual_cluster_config: std::option::Option<crate::model::VirtualClusterConfig>,
2083
2084 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2092 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2093
2094 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2096 pub status: std::option::Option<crate::model::ClusterStatus>,
2097
2098 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2100 pub status_history: std::vec::Vec<crate::model::ClusterStatus>,
2101
2102 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2105 pub cluster_uuid: std::string::String,
2106
2107 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2112 pub metrics: std::option::Option<crate::model::ClusterMetrics>,
2113
2114 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2115 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2116}
2117
2118impl Cluster {
2119 pub fn new() -> Self {
2120 std::default::Default::default()
2121 }
2122
2123 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2125 self.project_id = v.into();
2126 self
2127 }
2128
2129 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2131 self.cluster_name = v.into();
2132 self
2133 }
2134
2135 pub fn set_config<T: std::convert::Into<std::option::Option<crate::model::ClusterConfig>>>(
2137 mut self,
2138 v: T,
2139 ) -> Self {
2140 self.config = v.into();
2141 self
2142 }
2143
2144 pub fn set_virtual_cluster_config<
2146 T: std::convert::Into<std::option::Option<crate::model::VirtualClusterConfig>>,
2147 >(
2148 mut self,
2149 v: T,
2150 ) -> Self {
2151 self.virtual_cluster_config = v.into();
2152 self
2153 }
2154
2155 pub fn set_status<T: std::convert::Into<std::option::Option<crate::model::ClusterStatus>>>(
2157 mut self,
2158 v: T,
2159 ) -> Self {
2160 self.status = v.into();
2161 self
2162 }
2163
2164 pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2166 self.cluster_uuid = v.into();
2167 self
2168 }
2169
2170 pub fn set_metrics<T: std::convert::Into<std::option::Option<crate::model::ClusterMetrics>>>(
2172 mut self,
2173 v: T,
2174 ) -> Self {
2175 self.metrics = v.into();
2176 self
2177 }
2178
2179 pub fn set_status_history<T, V>(mut self, v: T) -> Self
2181 where
2182 T: std::iter::IntoIterator<Item = V>,
2183 V: std::convert::Into<crate::model::ClusterStatus>,
2184 {
2185 use std::iter::Iterator;
2186 self.status_history = v.into_iter().map(|i| i.into()).collect();
2187 self
2188 }
2189
2190 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2192 where
2193 T: std::iter::IntoIterator<Item = (K, V)>,
2194 K: std::convert::Into<std::string::String>,
2195 V: std::convert::Into<std::string::String>,
2196 {
2197 use std::iter::Iterator;
2198 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2199 self
2200 }
2201}
2202
2203impl wkt::message::Message for Cluster {
2204 fn typename() -> &'static str {
2205 "type.googleapis.com/google.cloud.dataproc.v1.Cluster"
2206 }
2207}
2208
2209#[serde_with::serde_as]
2211#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2212#[serde(default, rename_all = "camelCase")]
2213#[non_exhaustive]
2214pub struct ClusterConfig {
2215 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2227 pub config_bucket: std::string::String,
2228
2229 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2241 pub temp_bucket: std::string::String,
2242
2243 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2246 pub gce_cluster_config: std::option::Option<crate::model::GceClusterConfig>,
2247
2248 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2251 pub master_config: std::option::Option<crate::model::InstanceGroupConfig>,
2252
2253 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2256 pub worker_config: std::option::Option<crate::model::InstanceGroupConfig>,
2257
2258 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2261 pub secondary_worker_config: std::option::Option<crate::model::InstanceGroupConfig>,
2262
2263 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2265 pub software_config: std::option::Option<crate::model::SoftwareConfig>,
2266
2267 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2283 pub initialization_actions: std::vec::Vec<crate::model::NodeInitializationAction>,
2284
2285 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2287 pub encryption_config: std::option::Option<crate::model::EncryptionConfig>,
2288
2289 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2292 pub autoscaling_config: std::option::Option<crate::model::AutoscalingConfig>,
2293
2294 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2296 pub security_config: std::option::Option<crate::model::SecurityConfig>,
2297
2298 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2300 pub lifecycle_config: std::option::Option<crate::model::LifecycleConfig>,
2301
2302 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2304 pub endpoint_config: std::option::Option<crate::model::EndpointConfig>,
2305
2306 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2308 pub metastore_config: std::option::Option<crate::model::MetastoreConfig>,
2309
2310 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2312 pub dataproc_metric_config: std::option::Option<crate::model::DataprocMetricConfig>,
2313
2314 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2316 pub auxiliary_node_groups: std::vec::Vec<crate::model::AuxiliaryNodeGroup>,
2317
2318 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2319 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2320}
2321
2322impl ClusterConfig {
2323 pub fn new() -> Self {
2324 std::default::Default::default()
2325 }
2326
2327 pub fn set_config_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2329 self.config_bucket = v.into();
2330 self
2331 }
2332
2333 pub fn set_temp_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2335 self.temp_bucket = v.into();
2336 self
2337 }
2338
2339 pub fn set_gce_cluster_config<
2341 T: std::convert::Into<std::option::Option<crate::model::GceClusterConfig>>,
2342 >(
2343 mut self,
2344 v: T,
2345 ) -> Self {
2346 self.gce_cluster_config = v.into();
2347 self
2348 }
2349
2350 pub fn set_master_config<
2352 T: std::convert::Into<std::option::Option<crate::model::InstanceGroupConfig>>,
2353 >(
2354 mut self,
2355 v: T,
2356 ) -> Self {
2357 self.master_config = v.into();
2358 self
2359 }
2360
2361 pub fn set_worker_config<
2363 T: std::convert::Into<std::option::Option<crate::model::InstanceGroupConfig>>,
2364 >(
2365 mut self,
2366 v: T,
2367 ) -> Self {
2368 self.worker_config = v.into();
2369 self
2370 }
2371
2372 pub fn set_secondary_worker_config<
2374 T: std::convert::Into<std::option::Option<crate::model::InstanceGroupConfig>>,
2375 >(
2376 mut self,
2377 v: T,
2378 ) -> Self {
2379 self.secondary_worker_config = v.into();
2380 self
2381 }
2382
2383 pub fn set_software_config<
2385 T: std::convert::Into<std::option::Option<crate::model::SoftwareConfig>>,
2386 >(
2387 mut self,
2388 v: T,
2389 ) -> Self {
2390 self.software_config = v.into();
2391 self
2392 }
2393
2394 pub fn set_encryption_config<
2396 T: std::convert::Into<std::option::Option<crate::model::EncryptionConfig>>,
2397 >(
2398 mut self,
2399 v: T,
2400 ) -> Self {
2401 self.encryption_config = v.into();
2402 self
2403 }
2404
2405 pub fn set_autoscaling_config<
2407 T: std::convert::Into<std::option::Option<crate::model::AutoscalingConfig>>,
2408 >(
2409 mut self,
2410 v: T,
2411 ) -> Self {
2412 self.autoscaling_config = v.into();
2413 self
2414 }
2415
2416 pub fn set_security_config<
2418 T: std::convert::Into<std::option::Option<crate::model::SecurityConfig>>,
2419 >(
2420 mut self,
2421 v: T,
2422 ) -> Self {
2423 self.security_config = v.into();
2424 self
2425 }
2426
2427 pub fn set_lifecycle_config<
2429 T: std::convert::Into<std::option::Option<crate::model::LifecycleConfig>>,
2430 >(
2431 mut self,
2432 v: T,
2433 ) -> Self {
2434 self.lifecycle_config = v.into();
2435 self
2436 }
2437
2438 pub fn set_endpoint_config<
2440 T: std::convert::Into<std::option::Option<crate::model::EndpointConfig>>,
2441 >(
2442 mut self,
2443 v: T,
2444 ) -> Self {
2445 self.endpoint_config = v.into();
2446 self
2447 }
2448
2449 pub fn set_metastore_config<
2451 T: std::convert::Into<std::option::Option<crate::model::MetastoreConfig>>,
2452 >(
2453 mut self,
2454 v: T,
2455 ) -> Self {
2456 self.metastore_config = v.into();
2457 self
2458 }
2459
2460 pub fn set_dataproc_metric_config<
2462 T: std::convert::Into<std::option::Option<crate::model::DataprocMetricConfig>>,
2463 >(
2464 mut self,
2465 v: T,
2466 ) -> Self {
2467 self.dataproc_metric_config = v.into();
2468 self
2469 }
2470
2471 pub fn set_initialization_actions<T, V>(mut self, v: T) -> Self
2473 where
2474 T: std::iter::IntoIterator<Item = V>,
2475 V: std::convert::Into<crate::model::NodeInitializationAction>,
2476 {
2477 use std::iter::Iterator;
2478 self.initialization_actions = v.into_iter().map(|i| i.into()).collect();
2479 self
2480 }
2481
2482 pub fn set_auxiliary_node_groups<T, V>(mut self, v: T) -> Self
2484 where
2485 T: std::iter::IntoIterator<Item = V>,
2486 V: std::convert::Into<crate::model::AuxiliaryNodeGroup>,
2487 {
2488 use std::iter::Iterator;
2489 self.auxiliary_node_groups = v.into_iter().map(|i| i.into()).collect();
2490 self
2491 }
2492}
2493
2494impl wkt::message::Message for ClusterConfig {
2495 fn typename() -> &'static str {
2496 "type.googleapis.com/google.cloud.dataproc.v1.ClusterConfig"
2497 }
2498}
2499
2500#[serde_with::serde_as]
2504#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2505#[serde(default, rename_all = "camelCase")]
2506#[non_exhaustive]
2507pub struct VirtualClusterConfig {
2508 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2520 pub staging_bucket: std::string::String,
2521
2522 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2524 pub auxiliary_services_config: std::option::Option<crate::model::AuxiliaryServicesConfig>,
2525
2526 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
2527 pub infrastructure_config:
2528 std::option::Option<crate::model::virtual_cluster_config::InfrastructureConfig>,
2529
2530 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2531 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2532}
2533
2534impl VirtualClusterConfig {
2535 pub fn new() -> Self {
2536 std::default::Default::default()
2537 }
2538
2539 pub fn set_staging_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2541 self.staging_bucket = v.into();
2542 self
2543 }
2544
2545 pub fn set_auxiliary_services_config<
2547 T: std::convert::Into<std::option::Option<crate::model::AuxiliaryServicesConfig>>,
2548 >(
2549 mut self,
2550 v: T,
2551 ) -> Self {
2552 self.auxiliary_services_config = v.into();
2553 self
2554 }
2555
2556 pub fn set_infrastructure_config<
2561 T: std::convert::Into<
2562 std::option::Option<crate::model::virtual_cluster_config::InfrastructureConfig>,
2563 >,
2564 >(
2565 mut self,
2566 v: T,
2567 ) -> Self {
2568 self.infrastructure_config = v.into();
2569 self
2570 }
2571
2572 pub fn kubernetes_cluster_config(
2576 &self,
2577 ) -> std::option::Option<&std::boxed::Box<crate::model::KubernetesClusterConfig>> {
2578 #[allow(unreachable_patterns)]
2579 self.infrastructure_config.as_ref().and_then(|v| match v {
2580 crate::model::virtual_cluster_config::InfrastructureConfig::KubernetesClusterConfig(
2581 v,
2582 ) => std::option::Option::Some(v),
2583 _ => std::option::Option::None,
2584 })
2585 }
2586
2587 pub fn set_kubernetes_cluster_config<
2593 T: std::convert::Into<std::boxed::Box<crate::model::KubernetesClusterConfig>>,
2594 >(
2595 mut self,
2596 v: T,
2597 ) -> Self {
2598 self.infrastructure_config = std::option::Option::Some(
2599 crate::model::virtual_cluster_config::InfrastructureConfig::KubernetesClusterConfig(
2600 v.into(),
2601 ),
2602 );
2603 self
2604 }
2605}
2606
2607impl wkt::message::Message for VirtualClusterConfig {
2608 fn typename() -> &'static str {
2609 "type.googleapis.com/google.cloud.dataproc.v1.VirtualClusterConfig"
2610 }
2611}
2612
2613pub mod virtual_cluster_config {
2615 #[allow(unused_imports)]
2616 use super::*;
2617
2618 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
2619 #[serde(rename_all = "camelCase")]
2620 #[non_exhaustive]
2621 pub enum InfrastructureConfig {
2622 KubernetesClusterConfig(std::boxed::Box<crate::model::KubernetesClusterConfig>),
2625 }
2626}
2627
2628#[serde_with::serde_as]
2630#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2631#[serde(default, rename_all = "camelCase")]
2632#[non_exhaustive]
2633pub struct AuxiliaryServicesConfig {
2634 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2636 pub metastore_config: std::option::Option<crate::model::MetastoreConfig>,
2637
2638 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2640 pub spark_history_server_config: std::option::Option<crate::model::SparkHistoryServerConfig>,
2641
2642 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2643 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2644}
2645
2646impl AuxiliaryServicesConfig {
2647 pub fn new() -> Self {
2648 std::default::Default::default()
2649 }
2650
2651 pub fn set_metastore_config<
2653 T: std::convert::Into<std::option::Option<crate::model::MetastoreConfig>>,
2654 >(
2655 mut self,
2656 v: T,
2657 ) -> Self {
2658 self.metastore_config = v.into();
2659 self
2660 }
2661
2662 pub fn set_spark_history_server_config<
2664 T: std::convert::Into<std::option::Option<crate::model::SparkHistoryServerConfig>>,
2665 >(
2666 mut self,
2667 v: T,
2668 ) -> Self {
2669 self.spark_history_server_config = v.into();
2670 self
2671 }
2672}
2673
2674impl wkt::message::Message for AuxiliaryServicesConfig {
2675 fn typename() -> &'static str {
2676 "type.googleapis.com/google.cloud.dataproc.v1.AuxiliaryServicesConfig"
2677 }
2678}
2679
2680#[serde_with::serde_as]
2682#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2683#[serde(default, rename_all = "camelCase")]
2684#[non_exhaustive]
2685pub struct EndpointConfig {
2686 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2689 pub http_ports: std::collections::HashMap<std::string::String, std::string::String>,
2690
2691 pub enable_http_port_access: bool,
2694
2695 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2696 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2697}
2698
2699impl EndpointConfig {
2700 pub fn new() -> Self {
2701 std::default::Default::default()
2702 }
2703
2704 pub fn set_enable_http_port_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2706 self.enable_http_port_access = v.into();
2707 self
2708 }
2709
2710 pub fn set_http_ports<T, K, V>(mut self, v: T) -> Self
2712 where
2713 T: std::iter::IntoIterator<Item = (K, V)>,
2714 K: std::convert::Into<std::string::String>,
2715 V: std::convert::Into<std::string::String>,
2716 {
2717 use std::iter::Iterator;
2718 self.http_ports = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2719 self
2720 }
2721}
2722
2723impl wkt::message::Message for EndpointConfig {
2724 fn typename() -> &'static str {
2725 "type.googleapis.com/google.cloud.dataproc.v1.EndpointConfig"
2726 }
2727}
2728
2729#[serde_with::serde_as]
2731#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2732#[serde(default, rename_all = "camelCase")]
2733#[non_exhaustive]
2734pub struct AutoscalingConfig {
2735 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2745 pub policy_uri: std::string::String,
2746
2747 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2748 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2749}
2750
2751impl AutoscalingConfig {
2752 pub fn new() -> Self {
2753 std::default::Default::default()
2754 }
2755
2756 pub fn set_policy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2758 self.policy_uri = v.into();
2759 self
2760 }
2761}
2762
2763impl wkt::message::Message for AutoscalingConfig {
2764 fn typename() -> &'static str {
2765 "type.googleapis.com/google.cloud.dataproc.v1.AutoscalingConfig"
2766 }
2767}
2768
2769#[serde_with::serde_as]
2771#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2772#[serde(default, rename_all = "camelCase")]
2773#[non_exhaustive]
2774pub struct EncryptionConfig {
2775 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2781 pub gce_pd_kms_key_name: std::string::String,
2782
2783 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2810 pub kms_key: std::string::String,
2811
2812 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2813 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2814}
2815
2816impl EncryptionConfig {
2817 pub fn new() -> Self {
2818 std::default::Default::default()
2819 }
2820
2821 pub fn set_gce_pd_kms_key_name<T: std::convert::Into<std::string::String>>(
2823 mut self,
2824 v: T,
2825 ) -> Self {
2826 self.gce_pd_kms_key_name = v.into();
2827 self
2828 }
2829
2830 pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2832 self.kms_key = v.into();
2833 self
2834 }
2835}
2836
2837impl wkt::message::Message for EncryptionConfig {
2838 fn typename() -> &'static str {
2839 "type.googleapis.com/google.cloud.dataproc.v1.EncryptionConfig"
2840 }
2841}
2842
2843#[serde_with::serde_as]
2846#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2847#[serde(default, rename_all = "camelCase")]
2848#[non_exhaustive]
2849pub struct GceClusterConfig {
2850 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2860 pub zone_uri: std::string::String,
2861
2862 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2875 pub network_uri: std::string::String,
2876
2877 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2886 pub subnetwork_uri: std::string::String,
2887
2888 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2905 pub internal_ip_only: std::option::Option<bool>,
2906
2907 pub private_ipv6_google_access: crate::model::gce_cluster_config::PrivateIpv6GoogleAccess,
2909
2910 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2922 pub service_account: std::string::String,
2923
2924 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2939 pub service_account_scopes: std::vec::Vec<std::string::String>,
2940
2941 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2944 pub tags: std::vec::Vec<std::string::String>,
2945
2946 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
2950 pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
2951
2952 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2954 pub reservation_affinity: std::option::Option<crate::model::ReservationAffinity>,
2955
2956 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2958 pub node_group_affinity: std::option::Option<crate::model::NodeGroupAffinity>,
2959
2960 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2964 pub shielded_instance_config: std::option::Option<crate::model::ShieldedInstanceConfig>,
2965
2966 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2969 pub confidential_instance_config: std::option::Option<crate::model::ConfidentialInstanceConfig>,
2970
2971 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2972 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2973}
2974
2975impl GceClusterConfig {
2976 pub fn new() -> Self {
2977 std::default::Default::default()
2978 }
2979
2980 pub fn set_zone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2982 self.zone_uri = v.into();
2983 self
2984 }
2985
2986 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2988 self.network_uri = v.into();
2989 self
2990 }
2991
2992 pub fn set_subnetwork_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2994 self.subnetwork_uri = v.into();
2995 self
2996 }
2997
2998 pub fn set_internal_ip_only<T: std::convert::Into<std::option::Option<bool>>>(
3000 mut self,
3001 v: T,
3002 ) -> Self {
3003 self.internal_ip_only = v.into();
3004 self
3005 }
3006
3007 pub fn set_private_ipv6_google_access<
3009 T: std::convert::Into<crate::model::gce_cluster_config::PrivateIpv6GoogleAccess>,
3010 >(
3011 mut self,
3012 v: T,
3013 ) -> Self {
3014 self.private_ipv6_google_access = v.into();
3015 self
3016 }
3017
3018 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3020 self.service_account = v.into();
3021 self
3022 }
3023
3024 pub fn set_reservation_affinity<
3026 T: std::convert::Into<std::option::Option<crate::model::ReservationAffinity>>,
3027 >(
3028 mut self,
3029 v: T,
3030 ) -> Self {
3031 self.reservation_affinity = v.into();
3032 self
3033 }
3034
3035 pub fn set_node_group_affinity<
3037 T: std::convert::Into<std::option::Option<crate::model::NodeGroupAffinity>>,
3038 >(
3039 mut self,
3040 v: T,
3041 ) -> Self {
3042 self.node_group_affinity = v.into();
3043 self
3044 }
3045
3046 pub fn set_shielded_instance_config<
3048 T: std::convert::Into<std::option::Option<crate::model::ShieldedInstanceConfig>>,
3049 >(
3050 mut self,
3051 v: T,
3052 ) -> Self {
3053 self.shielded_instance_config = v.into();
3054 self
3055 }
3056
3057 pub fn set_confidential_instance_config<
3059 T: std::convert::Into<std::option::Option<crate::model::ConfidentialInstanceConfig>>,
3060 >(
3061 mut self,
3062 v: T,
3063 ) -> Self {
3064 self.confidential_instance_config = v.into();
3065 self
3066 }
3067
3068 pub fn set_service_account_scopes<T, V>(mut self, v: T) -> Self
3070 where
3071 T: std::iter::IntoIterator<Item = V>,
3072 V: std::convert::Into<std::string::String>,
3073 {
3074 use std::iter::Iterator;
3075 self.service_account_scopes = v.into_iter().map(|i| i.into()).collect();
3076 self
3077 }
3078
3079 pub fn set_tags<T, V>(mut self, v: T) -> Self
3081 where
3082 T: std::iter::IntoIterator<Item = V>,
3083 V: std::convert::Into<std::string::String>,
3084 {
3085 use std::iter::Iterator;
3086 self.tags = v.into_iter().map(|i| i.into()).collect();
3087 self
3088 }
3089
3090 pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
3092 where
3093 T: std::iter::IntoIterator<Item = (K, V)>,
3094 K: std::convert::Into<std::string::String>,
3095 V: std::convert::Into<std::string::String>,
3096 {
3097 use std::iter::Iterator;
3098 self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3099 self
3100 }
3101}
3102
3103impl wkt::message::Message for GceClusterConfig {
3104 fn typename() -> &'static str {
3105 "type.googleapis.com/google.cloud.dataproc.v1.GceClusterConfig"
3106 }
3107}
3108
3109pub mod gce_cluster_config {
3111 #[allow(unused_imports)]
3112 use super::*;
3113
3114 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3120 pub struct PrivateIpv6GoogleAccess(i32);
3121
3122 impl PrivateIpv6GoogleAccess {
3123 pub const PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED: PrivateIpv6GoogleAccess =
3129 PrivateIpv6GoogleAccess::new(0);
3130
3131 pub const INHERIT_FROM_SUBNETWORK: PrivateIpv6GoogleAccess =
3135 PrivateIpv6GoogleAccess::new(1);
3136
3137 pub const OUTBOUND: PrivateIpv6GoogleAccess = PrivateIpv6GoogleAccess::new(2);
3140
3141 pub const BIDIRECTIONAL: PrivateIpv6GoogleAccess = PrivateIpv6GoogleAccess::new(3);
3144
3145 pub(crate) const fn new(value: i32) -> Self {
3147 Self(value)
3148 }
3149
3150 pub fn value(&self) -> i32 {
3152 self.0
3153 }
3154
3155 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
3157 match self.0 {
3158 0 => std::borrow::Cow::Borrowed("PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED"),
3159 1 => std::borrow::Cow::Borrowed("INHERIT_FROM_SUBNETWORK"),
3160 2 => std::borrow::Cow::Borrowed("OUTBOUND"),
3161 3 => std::borrow::Cow::Borrowed("BIDIRECTIONAL"),
3162 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
3163 }
3164 }
3165
3166 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
3168 match name {
3169 "PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED" => {
3170 std::option::Option::Some(Self::PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED)
3171 }
3172 "INHERIT_FROM_SUBNETWORK" => {
3173 std::option::Option::Some(Self::INHERIT_FROM_SUBNETWORK)
3174 }
3175 "OUTBOUND" => std::option::Option::Some(Self::OUTBOUND),
3176 "BIDIRECTIONAL" => std::option::Option::Some(Self::BIDIRECTIONAL),
3177 _ => std::option::Option::None,
3178 }
3179 }
3180 }
3181
3182 impl std::convert::From<i32> for PrivateIpv6GoogleAccess {
3183 fn from(value: i32) -> Self {
3184 Self::new(value)
3185 }
3186 }
3187
3188 impl std::default::Default for PrivateIpv6GoogleAccess {
3189 fn default() -> Self {
3190 Self::new(0)
3191 }
3192 }
3193}
3194
3195#[serde_with::serde_as]
3201#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3202#[serde(default, rename_all = "camelCase")]
3203#[non_exhaustive]
3204pub struct NodeGroupAffinity {
3205 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3216 pub node_group_uri: std::string::String,
3217
3218 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3219 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3220}
3221
3222impl NodeGroupAffinity {
3223 pub fn new() -> Self {
3224 std::default::Default::default()
3225 }
3226
3227 pub fn set_node_group_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3229 self.node_group_uri = v.into();
3230 self
3231 }
3232}
3233
3234impl wkt::message::Message for NodeGroupAffinity {
3235 fn typename() -> &'static str {
3236 "type.googleapis.com/google.cloud.dataproc.v1.NodeGroupAffinity"
3237 }
3238}
3239
3240#[serde_with::serde_as]
3243#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3244#[serde(default, rename_all = "camelCase")]
3245#[non_exhaustive]
3246pub struct ShieldedInstanceConfig {
3247 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3249 pub enable_secure_boot: std::option::Option<bool>,
3250
3251 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3253 pub enable_vtpm: std::option::Option<bool>,
3254
3255 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3257 pub enable_integrity_monitoring: std::option::Option<bool>,
3258
3259 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3260 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3261}
3262
3263impl ShieldedInstanceConfig {
3264 pub fn new() -> Self {
3265 std::default::Default::default()
3266 }
3267
3268 pub fn set_enable_secure_boot<T: std::convert::Into<std::option::Option<bool>>>(
3270 mut self,
3271 v: T,
3272 ) -> Self {
3273 self.enable_secure_boot = v.into();
3274 self
3275 }
3276
3277 pub fn set_enable_vtpm<T: std::convert::Into<std::option::Option<bool>>>(
3279 mut self,
3280 v: T,
3281 ) -> Self {
3282 self.enable_vtpm = v.into();
3283 self
3284 }
3285
3286 pub fn set_enable_integrity_monitoring<T: std::convert::Into<std::option::Option<bool>>>(
3288 mut self,
3289 v: T,
3290 ) -> Self {
3291 self.enable_integrity_monitoring = v.into();
3292 self
3293 }
3294}
3295
3296impl wkt::message::Message for ShieldedInstanceConfig {
3297 fn typename() -> &'static str {
3298 "type.googleapis.com/google.cloud.dataproc.v1.ShieldedInstanceConfig"
3299 }
3300}
3301
3302#[serde_with::serde_as]
3305#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3306#[serde(default, rename_all = "camelCase")]
3307#[non_exhaustive]
3308pub struct ConfidentialInstanceConfig {
3309 pub enable_confidential_compute: bool,
3312
3313 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3314 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3315}
3316
3317impl ConfidentialInstanceConfig {
3318 pub fn new() -> Self {
3319 std::default::Default::default()
3320 }
3321
3322 pub fn set_enable_confidential_compute<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3324 self.enable_confidential_compute = v.into();
3325 self
3326 }
3327}
3328
3329impl wkt::message::Message for ConfidentialInstanceConfig {
3330 fn typename() -> &'static str {
3331 "type.googleapis.com/google.cloud.dataproc.v1.ConfidentialInstanceConfig"
3332 }
3333}
3334
3335#[serde_with::serde_as]
3338#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3339#[serde(default, rename_all = "camelCase")]
3340#[non_exhaustive]
3341pub struct InstanceGroupConfig {
3342 pub num_instances: i32,
3349
3350 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3353 pub instance_names: std::vec::Vec<std::string::String>,
3354
3355 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3357 pub instance_references: std::vec::Vec<crate::model::InstanceReference>,
3358
3359 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3378 pub image_uri: std::string::String,
3379
3380 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3394 pub machine_type_uri: std::string::String,
3395
3396 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3398 pub disk_config: std::option::Option<crate::model::DiskConfig>,
3399
3400 pub is_preemptible: bool,
3403
3404 pub preemptibility: crate::model::instance_group_config::Preemptibility,
3412
3413 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3417 pub managed_group_config: std::option::Option<crate::model::ManagedGroupConfig>,
3418
3419 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3422 pub accelerators: std::vec::Vec<crate::model::AcceleratorConfig>,
3423
3424 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3428 pub min_cpu_platform: std::string::String,
3429
3430 pub min_num_instances: i32,
3445
3446 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3449 pub instance_flexibility_policy: std::option::Option<crate::model::InstanceFlexibilityPolicy>,
3450
3451 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3454 pub startup_config: std::option::Option<crate::model::StartupConfig>,
3455
3456 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3457 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3458}
3459
3460impl InstanceGroupConfig {
3461 pub fn new() -> Self {
3462 std::default::Default::default()
3463 }
3464
3465 pub fn set_num_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3467 self.num_instances = v.into();
3468 self
3469 }
3470
3471 pub fn set_image_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3473 self.image_uri = v.into();
3474 self
3475 }
3476
3477 pub fn set_machine_type_uri<T: std::convert::Into<std::string::String>>(
3479 mut self,
3480 v: T,
3481 ) -> Self {
3482 self.machine_type_uri = v.into();
3483 self
3484 }
3485
3486 pub fn set_disk_config<T: std::convert::Into<std::option::Option<crate::model::DiskConfig>>>(
3488 mut self,
3489 v: T,
3490 ) -> Self {
3491 self.disk_config = v.into();
3492 self
3493 }
3494
3495 pub fn set_is_preemptible<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3497 self.is_preemptible = v.into();
3498 self
3499 }
3500
3501 pub fn set_preemptibility<
3503 T: std::convert::Into<crate::model::instance_group_config::Preemptibility>,
3504 >(
3505 mut self,
3506 v: T,
3507 ) -> Self {
3508 self.preemptibility = v.into();
3509 self
3510 }
3511
3512 pub fn set_managed_group_config<
3514 T: std::convert::Into<std::option::Option<crate::model::ManagedGroupConfig>>,
3515 >(
3516 mut self,
3517 v: T,
3518 ) -> Self {
3519 self.managed_group_config = v.into();
3520 self
3521 }
3522
3523 pub fn set_min_cpu_platform<T: std::convert::Into<std::string::String>>(
3525 mut self,
3526 v: T,
3527 ) -> Self {
3528 self.min_cpu_platform = v.into();
3529 self
3530 }
3531
3532 pub fn set_min_num_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3534 self.min_num_instances = v.into();
3535 self
3536 }
3537
3538 pub fn set_instance_flexibility_policy<
3540 T: std::convert::Into<std::option::Option<crate::model::InstanceFlexibilityPolicy>>,
3541 >(
3542 mut self,
3543 v: T,
3544 ) -> Self {
3545 self.instance_flexibility_policy = v.into();
3546 self
3547 }
3548
3549 pub fn set_startup_config<
3551 T: std::convert::Into<std::option::Option<crate::model::StartupConfig>>,
3552 >(
3553 mut self,
3554 v: T,
3555 ) -> Self {
3556 self.startup_config = v.into();
3557 self
3558 }
3559
3560 pub fn set_instance_names<T, V>(mut self, v: T) -> Self
3562 where
3563 T: std::iter::IntoIterator<Item = V>,
3564 V: std::convert::Into<std::string::String>,
3565 {
3566 use std::iter::Iterator;
3567 self.instance_names = v.into_iter().map(|i| i.into()).collect();
3568 self
3569 }
3570
3571 pub fn set_instance_references<T, V>(mut self, v: T) -> Self
3573 where
3574 T: std::iter::IntoIterator<Item = V>,
3575 V: std::convert::Into<crate::model::InstanceReference>,
3576 {
3577 use std::iter::Iterator;
3578 self.instance_references = v.into_iter().map(|i| i.into()).collect();
3579 self
3580 }
3581
3582 pub fn set_accelerators<T, V>(mut self, v: T) -> Self
3584 where
3585 T: std::iter::IntoIterator<Item = V>,
3586 V: std::convert::Into<crate::model::AcceleratorConfig>,
3587 {
3588 use std::iter::Iterator;
3589 self.accelerators = v.into_iter().map(|i| i.into()).collect();
3590 self
3591 }
3592}
3593
3594impl wkt::message::Message for InstanceGroupConfig {
3595 fn typename() -> &'static str {
3596 "type.googleapis.com/google.cloud.dataproc.v1.InstanceGroupConfig"
3597 }
3598}
3599
3600pub mod instance_group_config {
3602 #[allow(unused_imports)]
3603 use super::*;
3604
3605 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3607 pub struct Preemptibility(i32);
3608
3609 impl Preemptibility {
3610 pub const PREEMPTIBILITY_UNSPECIFIED: Preemptibility = Preemptibility::new(0);
3613
3614 pub const NON_PREEMPTIBLE: Preemptibility = Preemptibility::new(1);
3619
3620 pub const PREEMPTIBLE: Preemptibility = Preemptibility::new(2);
3627
3628 pub const SPOT: Preemptibility = Preemptibility::new(3);
3637
3638 pub(crate) const fn new(value: i32) -> Self {
3640 Self(value)
3641 }
3642
3643 pub fn value(&self) -> i32 {
3645 self.0
3646 }
3647
3648 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
3650 match self.0 {
3651 0 => std::borrow::Cow::Borrowed("PREEMPTIBILITY_UNSPECIFIED"),
3652 1 => std::borrow::Cow::Borrowed("NON_PREEMPTIBLE"),
3653 2 => std::borrow::Cow::Borrowed("PREEMPTIBLE"),
3654 3 => std::borrow::Cow::Borrowed("SPOT"),
3655 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
3656 }
3657 }
3658
3659 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
3661 match name {
3662 "PREEMPTIBILITY_UNSPECIFIED" => {
3663 std::option::Option::Some(Self::PREEMPTIBILITY_UNSPECIFIED)
3664 }
3665 "NON_PREEMPTIBLE" => std::option::Option::Some(Self::NON_PREEMPTIBLE),
3666 "PREEMPTIBLE" => std::option::Option::Some(Self::PREEMPTIBLE),
3667 "SPOT" => std::option::Option::Some(Self::SPOT),
3668 _ => std::option::Option::None,
3669 }
3670 }
3671 }
3672
3673 impl std::convert::From<i32> for Preemptibility {
3674 fn from(value: i32) -> Self {
3675 Self::new(value)
3676 }
3677 }
3678
3679 impl std::default::Default for Preemptibility {
3680 fn default() -> Self {
3681 Self::new(0)
3682 }
3683 }
3684}
3685
3686#[serde_with::serde_as]
3689#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3690#[serde(default, rename_all = "camelCase")]
3691#[non_exhaustive]
3692pub struct StartupConfig {
3693 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3700 pub required_registration_fraction: std::option::Option<f64>,
3701
3702 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3703 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3704}
3705
3706impl StartupConfig {
3707 pub fn new() -> Self {
3708 std::default::Default::default()
3709 }
3710
3711 pub fn set_required_registration_fraction<T: std::convert::Into<std::option::Option<f64>>>(
3713 mut self,
3714 v: T,
3715 ) -> Self {
3716 self.required_registration_fraction = v.into();
3717 self
3718 }
3719}
3720
3721impl wkt::message::Message for StartupConfig {
3722 fn typename() -> &'static str {
3723 "type.googleapis.com/google.cloud.dataproc.v1.StartupConfig"
3724 }
3725}
3726
3727#[serde_with::serde_as]
3729#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3730#[serde(default, rename_all = "camelCase")]
3731#[non_exhaustive]
3732pub struct InstanceReference {
3733 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3735 pub instance_name: std::string::String,
3736
3737 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3739 pub instance_id: std::string::String,
3740
3741 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3743 pub public_key: std::string::String,
3744
3745 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3747 pub public_ecies_key: std::string::String,
3748
3749 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3750 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3751}
3752
3753impl InstanceReference {
3754 pub fn new() -> Self {
3755 std::default::Default::default()
3756 }
3757
3758 pub fn set_instance_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3760 self.instance_name = v.into();
3761 self
3762 }
3763
3764 pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3766 self.instance_id = v.into();
3767 self
3768 }
3769
3770 pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3772 self.public_key = v.into();
3773 self
3774 }
3775
3776 pub fn set_public_ecies_key<T: std::convert::Into<std::string::String>>(
3778 mut self,
3779 v: T,
3780 ) -> Self {
3781 self.public_ecies_key = v.into();
3782 self
3783 }
3784}
3785
3786impl wkt::message::Message for InstanceReference {
3787 fn typename() -> &'static str {
3788 "type.googleapis.com/google.cloud.dataproc.v1.InstanceReference"
3789 }
3790}
3791
3792#[serde_with::serde_as]
3794#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3795#[serde(default, rename_all = "camelCase")]
3796#[non_exhaustive]
3797pub struct ManagedGroupConfig {
3798 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3801 pub instance_template_name: std::string::String,
3802
3803 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3805 pub instance_group_manager_name: std::string::String,
3806
3807 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3810 pub instance_group_manager_uri: std::string::String,
3811
3812 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3813 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3814}
3815
3816impl ManagedGroupConfig {
3817 pub fn new() -> Self {
3818 std::default::Default::default()
3819 }
3820
3821 pub fn set_instance_template_name<T: std::convert::Into<std::string::String>>(
3823 mut self,
3824 v: T,
3825 ) -> Self {
3826 self.instance_template_name = v.into();
3827 self
3828 }
3829
3830 pub fn set_instance_group_manager_name<T: std::convert::Into<std::string::String>>(
3832 mut self,
3833 v: T,
3834 ) -> Self {
3835 self.instance_group_manager_name = v.into();
3836 self
3837 }
3838
3839 pub fn set_instance_group_manager_uri<T: std::convert::Into<std::string::String>>(
3841 mut self,
3842 v: T,
3843 ) -> Self {
3844 self.instance_group_manager_uri = v.into();
3845 self
3846 }
3847}
3848
3849impl wkt::message::Message for ManagedGroupConfig {
3850 fn typename() -> &'static str {
3851 "type.googleapis.com/google.cloud.dataproc.v1.ManagedGroupConfig"
3852 }
3853}
3854
3855#[serde_with::serde_as]
3858#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3859#[serde(default, rename_all = "camelCase")]
3860#[non_exhaustive]
3861pub struct InstanceFlexibilityPolicy {
3862 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3865 pub provisioning_model_mix:
3866 std::option::Option<crate::model::instance_flexibility_policy::ProvisioningModelMix>,
3867
3868 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3871 pub instance_selection_list:
3872 std::vec::Vec<crate::model::instance_flexibility_policy::InstanceSelection>,
3873
3874 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
3876 pub instance_selection_results:
3877 std::vec::Vec<crate::model::instance_flexibility_policy::InstanceSelectionResult>,
3878
3879 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3880 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3881}
3882
3883impl InstanceFlexibilityPolicy {
3884 pub fn new() -> Self {
3885 std::default::Default::default()
3886 }
3887
3888 pub fn set_provisioning_model_mix<
3890 T: std::convert::Into<
3891 std::option::Option<
3892 crate::model::instance_flexibility_policy::ProvisioningModelMix,
3893 >,
3894 >,
3895 >(
3896 mut self,
3897 v: T,
3898 ) -> Self {
3899 self.provisioning_model_mix = v.into();
3900 self
3901 }
3902
3903 pub fn set_instance_selection_list<T, V>(mut self, v: T) -> Self
3905 where
3906 T: std::iter::IntoIterator<Item = V>,
3907 V: std::convert::Into<crate::model::instance_flexibility_policy::InstanceSelection>,
3908 {
3909 use std::iter::Iterator;
3910 self.instance_selection_list = v.into_iter().map(|i| i.into()).collect();
3911 self
3912 }
3913
3914 pub fn set_instance_selection_results<T, V>(mut self, v: T) -> Self
3916 where
3917 T: std::iter::IntoIterator<Item = V>,
3918 V: std::convert::Into<crate::model::instance_flexibility_policy::InstanceSelectionResult>,
3919 {
3920 use std::iter::Iterator;
3921 self.instance_selection_results = v.into_iter().map(|i| i.into()).collect();
3922 self
3923 }
3924}
3925
3926impl wkt::message::Message for InstanceFlexibilityPolicy {
3927 fn typename() -> &'static str {
3928 "type.googleapis.com/google.cloud.dataproc.v1.InstanceFlexibilityPolicy"
3929 }
3930}
3931
3932pub mod instance_flexibility_policy {
3934 #[allow(unused_imports)]
3935 use super::*;
3936
3937 #[serde_with::serde_as]
3940 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3941 #[serde(default, rename_all = "camelCase")]
3942 #[non_exhaustive]
3943 pub struct ProvisioningModelMix {
3944 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3952 pub standard_capacity_base: std::option::Option<i32>,
3953
3954 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3962 pub standard_capacity_percent_above_base: std::option::Option<i32>,
3963
3964 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3965 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3966 }
3967
3968 impl ProvisioningModelMix {
3969 pub fn new() -> Self {
3970 std::default::Default::default()
3971 }
3972
3973 pub fn set_standard_capacity_base<T: std::convert::Into<std::option::Option<i32>>>(
3975 mut self,
3976 v: T,
3977 ) -> Self {
3978 self.standard_capacity_base = v.into();
3979 self
3980 }
3981
3982 pub fn set_standard_capacity_percent_above_base<
3984 T: std::convert::Into<std::option::Option<i32>>,
3985 >(
3986 mut self,
3987 v: T,
3988 ) -> Self {
3989 self.standard_capacity_percent_above_base = v.into();
3990 self
3991 }
3992 }
3993
3994 impl wkt::message::Message for ProvisioningModelMix {
3995 fn typename() -> &'static str {
3996 "type.googleapis.com/google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix"
3997 }
3998 }
3999
4000 #[serde_with::serde_as]
4002 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4003 #[serde(default, rename_all = "camelCase")]
4004 #[non_exhaustive]
4005 pub struct InstanceSelection {
4006 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4008 pub machine_types: std::vec::Vec<std::string::String>,
4009
4010 pub rank: i32,
4016
4017 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4018 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4019 }
4020
4021 impl InstanceSelection {
4022 pub fn new() -> Self {
4023 std::default::Default::default()
4024 }
4025
4026 pub fn set_rank<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4028 self.rank = v.into();
4029 self
4030 }
4031
4032 pub fn set_machine_types<T, V>(mut self, v: T) -> Self
4034 where
4035 T: std::iter::IntoIterator<Item = V>,
4036 V: std::convert::Into<std::string::String>,
4037 {
4038 use std::iter::Iterator;
4039 self.machine_types = v.into_iter().map(|i| i.into()).collect();
4040 self
4041 }
4042 }
4043
4044 impl wkt::message::Message for InstanceSelection {
4045 fn typename() -> &'static str {
4046 "type.googleapis.com/google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection"
4047 }
4048 }
4049
4050 #[serde_with::serde_as]
4053 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4054 #[serde(default, rename_all = "camelCase")]
4055 #[non_exhaustive]
4056 pub struct InstanceSelectionResult {
4057 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4059 pub machine_type: std::option::Option<std::string::String>,
4060
4061 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4063 pub vm_count: std::option::Option<i32>,
4064
4065 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4066 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4067 }
4068
4069 impl InstanceSelectionResult {
4070 pub fn new() -> Self {
4071 std::default::Default::default()
4072 }
4073
4074 pub fn set_machine_type<T: std::convert::Into<std::option::Option<std::string::String>>>(
4076 mut self,
4077 v: T,
4078 ) -> Self {
4079 self.machine_type = v.into();
4080 self
4081 }
4082
4083 pub fn set_vm_count<T: std::convert::Into<std::option::Option<i32>>>(
4085 mut self,
4086 v: T,
4087 ) -> Self {
4088 self.vm_count = v.into();
4089 self
4090 }
4091 }
4092
4093 impl wkt::message::Message for InstanceSelectionResult {
4094 fn typename() -> &'static str {
4095 "type.googleapis.com/google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult"
4096 }
4097 }
4098}
4099
4100#[serde_with::serde_as]
4104#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4105#[serde(default, rename_all = "camelCase")]
4106#[non_exhaustive]
4107pub struct AcceleratorConfig {
4108 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4125 pub accelerator_type_uri: std::string::String,
4126
4127 pub accelerator_count: i32,
4129
4130 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4131 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4132}
4133
4134impl AcceleratorConfig {
4135 pub fn new() -> Self {
4136 std::default::Default::default()
4137 }
4138
4139 pub fn set_accelerator_type_uri<T: std::convert::Into<std::string::String>>(
4141 mut self,
4142 v: T,
4143 ) -> Self {
4144 self.accelerator_type_uri = v.into();
4145 self
4146 }
4147
4148 pub fn set_accelerator_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4150 self.accelerator_count = v.into();
4151 self
4152 }
4153}
4154
4155impl wkt::message::Message for AcceleratorConfig {
4156 fn typename() -> &'static str {
4157 "type.googleapis.com/google.cloud.dataproc.v1.AcceleratorConfig"
4158 }
4159}
4160
4161#[serde_with::serde_as]
4163#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4164#[serde(default, rename_all = "camelCase")]
4165#[non_exhaustive]
4166pub struct DiskConfig {
4167 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4173 pub boot_disk_type: std::string::String,
4174
4175 pub boot_disk_size_gb: i32,
4177
4178 pub num_local_ssds: i32,
4188
4189 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4195 pub local_ssd_interface: std::string::String,
4196
4197 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4201 #[serde_as(as = "std::option::Option<serde_with::DisplayFromStr>")]
4202 pub boot_disk_provisioned_iops: std::option::Option<i64>,
4203
4204 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4209 #[serde_as(as = "std::option::Option<serde_with::DisplayFromStr>")]
4210 pub boot_disk_provisioned_throughput: std::option::Option<i64>,
4211
4212 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4213 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4214}
4215
4216impl DiskConfig {
4217 pub fn new() -> Self {
4218 std::default::Default::default()
4219 }
4220
4221 pub fn set_boot_disk_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4223 self.boot_disk_type = v.into();
4224 self
4225 }
4226
4227 pub fn set_boot_disk_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4229 self.boot_disk_size_gb = v.into();
4230 self
4231 }
4232
4233 pub fn set_num_local_ssds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4235 self.num_local_ssds = v.into();
4236 self
4237 }
4238
4239 pub fn set_local_ssd_interface<T: std::convert::Into<std::string::String>>(
4241 mut self,
4242 v: T,
4243 ) -> Self {
4244 self.local_ssd_interface = v.into();
4245 self
4246 }
4247
4248 pub fn set_boot_disk_provisioned_iops<T: std::convert::Into<std::option::Option<i64>>>(
4250 mut self,
4251 v: T,
4252 ) -> Self {
4253 self.boot_disk_provisioned_iops = v.into();
4254 self
4255 }
4256
4257 pub fn set_boot_disk_provisioned_throughput<T: std::convert::Into<std::option::Option<i64>>>(
4259 mut self,
4260 v: T,
4261 ) -> Self {
4262 self.boot_disk_provisioned_throughput = v.into();
4263 self
4264 }
4265}
4266
4267impl wkt::message::Message for DiskConfig {
4268 fn typename() -> &'static str {
4269 "type.googleapis.com/google.cloud.dataproc.v1.DiskConfig"
4270 }
4271}
4272
4273#[serde_with::serde_as]
4275#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4276#[serde(default, rename_all = "camelCase")]
4277#[non_exhaustive]
4278pub struct AuxiliaryNodeGroup {
4279 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4281 pub node_group: std::option::Option<crate::model::NodeGroup>,
4282
4283 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4289 pub node_group_id: std::string::String,
4290
4291 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4292 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4293}
4294
4295impl AuxiliaryNodeGroup {
4296 pub fn new() -> Self {
4297 std::default::Default::default()
4298 }
4299
4300 pub fn set_node_group<T: std::convert::Into<std::option::Option<crate::model::NodeGroup>>>(
4302 mut self,
4303 v: T,
4304 ) -> Self {
4305 self.node_group = v.into();
4306 self
4307 }
4308
4309 pub fn set_node_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4311 self.node_group_id = v.into();
4312 self
4313 }
4314}
4315
4316impl wkt::message::Message for AuxiliaryNodeGroup {
4317 fn typename() -> &'static str {
4318 "type.googleapis.com/google.cloud.dataproc.v1.AuxiliaryNodeGroup"
4319 }
4320}
4321
4322#[serde_with::serde_as]
4329#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4330#[serde(default, rename_all = "camelCase")]
4331#[non_exhaustive]
4332pub struct NodeGroup {
4333 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4335 pub name: std::string::String,
4336
4337 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
4339 pub roles: std::vec::Vec<crate::model::node_group::Role>,
4340
4341 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4343 pub node_group_config: std::option::Option<crate::model::InstanceGroupConfig>,
4344
4345 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
4354 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4355
4356 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4357 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4358}
4359
4360impl NodeGroup {
4361 pub fn new() -> Self {
4362 std::default::Default::default()
4363 }
4364
4365 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4367 self.name = v.into();
4368 self
4369 }
4370
4371 pub fn set_node_group_config<
4373 T: std::convert::Into<std::option::Option<crate::model::InstanceGroupConfig>>,
4374 >(
4375 mut self,
4376 v: T,
4377 ) -> Self {
4378 self.node_group_config = v.into();
4379 self
4380 }
4381
4382 pub fn set_roles<T, V>(mut self, v: T) -> Self
4384 where
4385 T: std::iter::IntoIterator<Item = V>,
4386 V: std::convert::Into<crate::model::node_group::Role>,
4387 {
4388 use std::iter::Iterator;
4389 self.roles = v.into_iter().map(|i| i.into()).collect();
4390 self
4391 }
4392
4393 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4395 where
4396 T: std::iter::IntoIterator<Item = (K, V)>,
4397 K: std::convert::Into<std::string::String>,
4398 V: std::convert::Into<std::string::String>,
4399 {
4400 use std::iter::Iterator;
4401 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4402 self
4403 }
4404}
4405
4406impl wkt::message::Message for NodeGroup {
4407 fn typename() -> &'static str {
4408 "type.googleapis.com/google.cloud.dataproc.v1.NodeGroup"
4409 }
4410}
4411
4412pub mod node_group {
4414 #[allow(unused_imports)]
4415 use super::*;
4416
4417 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
4419 pub struct Role(i32);
4420
4421 impl Role {
4422 pub const ROLE_UNSPECIFIED: Role = Role::new(0);
4424
4425 pub const DRIVER: Role = Role::new(1);
4427
4428 pub(crate) const fn new(value: i32) -> Self {
4430 Self(value)
4431 }
4432
4433 pub fn value(&self) -> i32 {
4435 self.0
4436 }
4437
4438 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
4440 match self.0 {
4441 0 => std::borrow::Cow::Borrowed("ROLE_UNSPECIFIED"),
4442 1 => std::borrow::Cow::Borrowed("DRIVER"),
4443 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
4444 }
4445 }
4446
4447 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
4449 match name {
4450 "ROLE_UNSPECIFIED" => std::option::Option::Some(Self::ROLE_UNSPECIFIED),
4451 "DRIVER" => std::option::Option::Some(Self::DRIVER),
4452 _ => std::option::Option::None,
4453 }
4454 }
4455 }
4456
4457 impl std::convert::From<i32> for Role {
4458 fn from(value: i32) -> Self {
4459 Self::new(value)
4460 }
4461 }
4462
4463 impl std::default::Default for Role {
4464 fn default() -> Self {
4465 Self::new(0)
4466 }
4467 }
4468}
4469
4470#[serde_with::serde_as]
4473#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4474#[serde(default, rename_all = "camelCase")]
4475#[non_exhaustive]
4476pub struct NodeInitializationAction {
4477 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4479 pub executable_file: std::string::String,
4480
4481 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4489 pub execution_timeout: std::option::Option<wkt::Duration>,
4490
4491 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4492 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4493}
4494
4495impl NodeInitializationAction {
4496 pub fn new() -> Self {
4497 std::default::Default::default()
4498 }
4499
4500 pub fn set_executable_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4502 self.executable_file = v.into();
4503 self
4504 }
4505
4506 pub fn set_execution_timeout<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
4508 mut self,
4509 v: T,
4510 ) -> Self {
4511 self.execution_timeout = v.into();
4512 self
4513 }
4514}
4515
4516impl wkt::message::Message for NodeInitializationAction {
4517 fn typename() -> &'static str {
4518 "type.googleapis.com/google.cloud.dataproc.v1.NodeInitializationAction"
4519 }
4520}
4521
4522#[serde_with::serde_as]
4524#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4525#[serde(default, rename_all = "camelCase")]
4526#[non_exhaustive]
4527pub struct ClusterStatus {
4528 pub state: crate::model::cluster_status::State,
4530
4531 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4533 pub detail: std::string::String,
4534
4535 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4538 pub state_start_time: std::option::Option<wkt::Timestamp>,
4539
4540 pub substate: crate::model::cluster_status::Substate,
4543
4544 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4545 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4546}
4547
4548impl ClusterStatus {
4549 pub fn new() -> Self {
4550 std::default::Default::default()
4551 }
4552
4553 pub fn set_state<T: std::convert::Into<crate::model::cluster_status::State>>(
4555 mut self,
4556 v: T,
4557 ) -> Self {
4558 self.state = v.into();
4559 self
4560 }
4561
4562 pub fn set_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4564 self.detail = v.into();
4565 self
4566 }
4567
4568 pub fn set_state_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
4570 mut self,
4571 v: T,
4572 ) -> Self {
4573 self.state_start_time = v.into();
4574 self
4575 }
4576
4577 pub fn set_substate<T: std::convert::Into<crate::model::cluster_status::Substate>>(
4579 mut self,
4580 v: T,
4581 ) -> Self {
4582 self.substate = v.into();
4583 self
4584 }
4585}
4586
4587impl wkt::message::Message for ClusterStatus {
4588 fn typename() -> &'static str {
4589 "type.googleapis.com/google.cloud.dataproc.v1.ClusterStatus"
4590 }
4591}
4592
4593pub mod cluster_status {
4595 #[allow(unused_imports)]
4596 use super::*;
4597
4598 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
4600 pub struct State(i32);
4601
4602 impl State {
4603 pub const UNKNOWN: State = State::new(0);
4605
4606 pub const CREATING: State = State::new(1);
4608
4609 pub const RUNNING: State = State::new(2);
4615
4616 pub const ERROR: State = State::new(3);
4618
4619 pub const ERROR_DUE_TO_UPDATE: State = State::new(9);
4622
4623 pub const DELETING: State = State::new(4);
4625
4626 pub const UPDATING: State = State::new(5);
4628
4629 pub const STOPPING: State = State::new(6);
4631
4632 pub const STOPPED: State = State::new(7);
4634
4635 pub const STARTING: State = State::new(8);
4637
4638 pub const REPAIRING: State = State::new(10);
4640
4641 pub(crate) const fn new(value: i32) -> Self {
4643 Self(value)
4644 }
4645
4646 pub fn value(&self) -> i32 {
4648 self.0
4649 }
4650
4651 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
4653 match self.0 {
4654 0 => std::borrow::Cow::Borrowed("UNKNOWN"),
4655 1 => std::borrow::Cow::Borrowed("CREATING"),
4656 2 => std::borrow::Cow::Borrowed("RUNNING"),
4657 3 => std::borrow::Cow::Borrowed("ERROR"),
4658 4 => std::borrow::Cow::Borrowed("DELETING"),
4659 5 => std::borrow::Cow::Borrowed("UPDATING"),
4660 6 => std::borrow::Cow::Borrowed("STOPPING"),
4661 7 => std::borrow::Cow::Borrowed("STOPPED"),
4662 8 => std::borrow::Cow::Borrowed("STARTING"),
4663 9 => std::borrow::Cow::Borrowed("ERROR_DUE_TO_UPDATE"),
4664 10 => std::borrow::Cow::Borrowed("REPAIRING"),
4665 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
4666 }
4667 }
4668
4669 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
4671 match name {
4672 "UNKNOWN" => std::option::Option::Some(Self::UNKNOWN),
4673 "CREATING" => std::option::Option::Some(Self::CREATING),
4674 "RUNNING" => std::option::Option::Some(Self::RUNNING),
4675 "ERROR" => std::option::Option::Some(Self::ERROR),
4676 "ERROR_DUE_TO_UPDATE" => std::option::Option::Some(Self::ERROR_DUE_TO_UPDATE),
4677 "DELETING" => std::option::Option::Some(Self::DELETING),
4678 "UPDATING" => std::option::Option::Some(Self::UPDATING),
4679 "STOPPING" => std::option::Option::Some(Self::STOPPING),
4680 "STOPPED" => std::option::Option::Some(Self::STOPPED),
4681 "STARTING" => std::option::Option::Some(Self::STARTING),
4682 "REPAIRING" => std::option::Option::Some(Self::REPAIRING),
4683 _ => std::option::Option::None,
4684 }
4685 }
4686 }
4687
4688 impl std::convert::From<i32> for State {
4689 fn from(value: i32) -> Self {
4690 Self::new(value)
4691 }
4692 }
4693
4694 impl std::default::Default for State {
4695 fn default() -> Self {
4696 Self::new(0)
4697 }
4698 }
4699
4700 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
4702 pub struct Substate(i32);
4703
4704 impl Substate {
4705 pub const UNSPECIFIED: Substate = Substate::new(0);
4707
4708 pub const UNHEALTHY: Substate = Substate::new(1);
4714
4715 pub const STALE_STATUS: Substate = Substate::new(2);
4720
4721 pub(crate) const fn new(value: i32) -> Self {
4723 Self(value)
4724 }
4725
4726 pub fn value(&self) -> i32 {
4728 self.0
4729 }
4730
4731 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
4733 match self.0 {
4734 0 => std::borrow::Cow::Borrowed("UNSPECIFIED"),
4735 1 => std::borrow::Cow::Borrowed("UNHEALTHY"),
4736 2 => std::borrow::Cow::Borrowed("STALE_STATUS"),
4737 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
4738 }
4739 }
4740
4741 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
4743 match name {
4744 "UNSPECIFIED" => std::option::Option::Some(Self::UNSPECIFIED),
4745 "UNHEALTHY" => std::option::Option::Some(Self::UNHEALTHY),
4746 "STALE_STATUS" => std::option::Option::Some(Self::STALE_STATUS),
4747 _ => std::option::Option::None,
4748 }
4749 }
4750 }
4751
4752 impl std::convert::From<i32> for Substate {
4753 fn from(value: i32) -> Self {
4754 Self::new(value)
4755 }
4756 }
4757
4758 impl std::default::Default for Substate {
4759 fn default() -> Self {
4760 Self::new(0)
4761 }
4762 }
4763}
4764
4765#[serde_with::serde_as]
4767#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4768#[serde(default, rename_all = "camelCase")]
4769#[non_exhaustive]
4770pub struct SecurityConfig {
4771 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4773 pub kerberos_config: std::option::Option<crate::model::KerberosConfig>,
4774
4775 #[serde(skip_serializing_if = "std::option::Option::is_none")]
4778 pub identity_config: std::option::Option<crate::model::IdentityConfig>,
4779
4780 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4781 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4782}
4783
4784impl SecurityConfig {
4785 pub fn new() -> Self {
4786 std::default::Default::default()
4787 }
4788
4789 pub fn set_kerberos_config<
4791 T: std::convert::Into<std::option::Option<crate::model::KerberosConfig>>,
4792 >(
4793 mut self,
4794 v: T,
4795 ) -> Self {
4796 self.kerberos_config = v.into();
4797 self
4798 }
4799
4800 pub fn set_identity_config<
4802 T: std::convert::Into<std::option::Option<crate::model::IdentityConfig>>,
4803 >(
4804 mut self,
4805 v: T,
4806 ) -> Self {
4807 self.identity_config = v.into();
4808 self
4809 }
4810}
4811
4812impl wkt::message::Message for SecurityConfig {
4813 fn typename() -> &'static str {
4814 "type.googleapis.com/google.cloud.dataproc.v1.SecurityConfig"
4815 }
4816}
4817
4818#[serde_with::serde_as]
4820#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
4821#[serde(default, rename_all = "camelCase")]
4822#[non_exhaustive]
4823pub struct KerberosConfig {
4824 pub enable_kerberos: bool,
4827
4828 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4831 pub root_principal_password_uri: std::string::String,
4832
4833 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4836 pub kms_key_uri: std::string::String,
4837
4838 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4842 pub keystore_uri: std::string::String,
4843
4844 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4848 pub truststore_uri: std::string::String,
4849
4850 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4854 pub keystore_password_uri: std::string::String,
4855
4856 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4860 pub key_password_uri: std::string::String,
4861
4862 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4866 pub truststore_password_uri: std::string::String,
4867
4868 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4871 pub cross_realm_trust_realm: std::string::String,
4872
4873 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4876 pub cross_realm_trust_kdc: std::string::String,
4877
4878 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4881 pub cross_realm_trust_admin_server: std::string::String,
4882
4883 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4887 pub cross_realm_trust_shared_password_uri: std::string::String,
4888
4889 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4892 pub kdc_db_key_uri: std::string::String,
4893
4894 pub tgt_lifetime_hours: i32,
4898
4899 #[serde(skip_serializing_if = "std::string::String::is_empty")]
4902 pub realm: std::string::String,
4903
4904 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
4905 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4906}
4907
4908impl KerberosConfig {
4909 pub fn new() -> Self {
4910 std::default::Default::default()
4911 }
4912
4913 pub fn set_enable_kerberos<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4915 self.enable_kerberos = v.into();
4916 self
4917 }
4918
4919 pub fn set_root_principal_password_uri<T: std::convert::Into<std::string::String>>(
4921 mut self,
4922 v: T,
4923 ) -> Self {
4924 self.root_principal_password_uri = v.into();
4925 self
4926 }
4927
4928 pub fn set_kms_key_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4930 self.kms_key_uri = v.into();
4931 self
4932 }
4933
4934 pub fn set_keystore_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4936 self.keystore_uri = v.into();
4937 self
4938 }
4939
4940 pub fn set_truststore_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4942 self.truststore_uri = v.into();
4943 self
4944 }
4945
4946 pub fn set_keystore_password_uri<T: std::convert::Into<std::string::String>>(
4948 mut self,
4949 v: T,
4950 ) -> Self {
4951 self.keystore_password_uri = v.into();
4952 self
4953 }
4954
4955 pub fn set_key_password_uri<T: std::convert::Into<std::string::String>>(
4957 mut self,
4958 v: T,
4959 ) -> Self {
4960 self.key_password_uri = v.into();
4961 self
4962 }
4963
4964 pub fn set_truststore_password_uri<T: std::convert::Into<std::string::String>>(
4966 mut self,
4967 v: T,
4968 ) -> Self {
4969 self.truststore_password_uri = v.into();
4970 self
4971 }
4972
4973 pub fn set_cross_realm_trust_realm<T: std::convert::Into<std::string::String>>(
4975 mut self,
4976 v: T,
4977 ) -> Self {
4978 self.cross_realm_trust_realm = v.into();
4979 self
4980 }
4981
4982 pub fn set_cross_realm_trust_kdc<T: std::convert::Into<std::string::String>>(
4984 mut self,
4985 v: T,
4986 ) -> Self {
4987 self.cross_realm_trust_kdc = v.into();
4988 self
4989 }
4990
4991 pub fn set_cross_realm_trust_admin_server<T: std::convert::Into<std::string::String>>(
4993 mut self,
4994 v: T,
4995 ) -> Self {
4996 self.cross_realm_trust_admin_server = v.into();
4997 self
4998 }
4999
5000 pub fn set_cross_realm_trust_shared_password_uri<T: std::convert::Into<std::string::String>>(
5002 mut self,
5003 v: T,
5004 ) -> Self {
5005 self.cross_realm_trust_shared_password_uri = v.into();
5006 self
5007 }
5008
5009 pub fn set_kdc_db_key_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5011 self.kdc_db_key_uri = v.into();
5012 self
5013 }
5014
5015 pub fn set_tgt_lifetime_hours<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5017 self.tgt_lifetime_hours = v.into();
5018 self
5019 }
5020
5021 pub fn set_realm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5023 self.realm = v.into();
5024 self
5025 }
5026}
5027
5028impl wkt::message::Message for KerberosConfig {
5029 fn typename() -> &'static str {
5030 "type.googleapis.com/google.cloud.dataproc.v1.KerberosConfig"
5031 }
5032}
5033
5034#[serde_with::serde_as]
5037#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5038#[serde(default, rename_all = "camelCase")]
5039#[non_exhaustive]
5040pub struct IdentityConfig {
5041 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
5043 pub user_service_account_mapping:
5044 std::collections::HashMap<std::string::String, std::string::String>,
5045
5046 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5047 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5048}
5049
5050impl IdentityConfig {
5051 pub fn new() -> Self {
5052 std::default::Default::default()
5053 }
5054
5055 pub fn set_user_service_account_mapping<T, K, V>(mut self, v: T) -> Self
5057 where
5058 T: std::iter::IntoIterator<Item = (K, V)>,
5059 K: std::convert::Into<std::string::String>,
5060 V: std::convert::Into<std::string::String>,
5061 {
5062 use std::iter::Iterator;
5063 self.user_service_account_mapping =
5064 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5065 self
5066 }
5067}
5068
5069impl wkt::message::Message for IdentityConfig {
5070 fn typename() -> &'static str {
5071 "type.googleapis.com/google.cloud.dataproc.v1.IdentityConfig"
5072 }
5073}
5074
5075#[serde_with::serde_as]
5077#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5078#[serde(default, rename_all = "camelCase")]
5079#[non_exhaustive]
5080pub struct SoftwareConfig {
5081 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5089 pub image_version: std::string::String,
5090
5091 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
5110 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
5111
5112 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5114 pub optional_components: std::vec::Vec<crate::model::Component>,
5115
5116 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5117 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5118}
5119
5120impl SoftwareConfig {
5121 pub fn new() -> Self {
5122 std::default::Default::default()
5123 }
5124
5125 pub fn set_image_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5127 self.image_version = v.into();
5128 self
5129 }
5130
5131 pub fn set_optional_components<T, V>(mut self, v: T) -> Self
5133 where
5134 T: std::iter::IntoIterator<Item = V>,
5135 V: std::convert::Into<crate::model::Component>,
5136 {
5137 use std::iter::Iterator;
5138 self.optional_components = v.into_iter().map(|i| i.into()).collect();
5139 self
5140 }
5141
5142 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
5144 where
5145 T: std::iter::IntoIterator<Item = (K, V)>,
5146 K: std::convert::Into<std::string::String>,
5147 V: std::convert::Into<std::string::String>,
5148 {
5149 use std::iter::Iterator;
5150 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5151 self
5152 }
5153}
5154
5155impl wkt::message::Message for SoftwareConfig {
5156 fn typename() -> &'static str {
5157 "type.googleapis.com/google.cloud.dataproc.v1.SoftwareConfig"
5158 }
5159}
5160
5161#[serde_with::serde_as]
5163#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5164#[serde(default, rename_all = "camelCase")]
5165#[non_exhaustive]
5166pub struct LifecycleConfig {
5167 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5173 pub idle_delete_ttl: std::option::Option<wkt::Duration>,
5174
5175 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5180 pub idle_start_time: std::option::Option<wkt::Timestamp>,
5181
5182 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
5185 pub ttl: std::option::Option<crate::model::lifecycle_config::Ttl>,
5186
5187 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5188 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5189}
5190
5191impl LifecycleConfig {
5192 pub fn new() -> Self {
5193 std::default::Default::default()
5194 }
5195
5196 pub fn set_idle_delete_ttl<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
5198 mut self,
5199 v: T,
5200 ) -> Self {
5201 self.idle_delete_ttl = v.into();
5202 self
5203 }
5204
5205 pub fn set_idle_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
5207 mut self,
5208 v: T,
5209 ) -> Self {
5210 self.idle_start_time = v.into();
5211 self
5212 }
5213
5214 pub fn set_ttl<
5219 T: std::convert::Into<std::option::Option<crate::model::lifecycle_config::Ttl>>,
5220 >(
5221 mut self,
5222 v: T,
5223 ) -> Self {
5224 self.ttl = v.into();
5225 self
5226 }
5227
5228 pub fn auto_delete_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
5232 #[allow(unreachable_patterns)]
5233 self.ttl.as_ref().and_then(|v| match v {
5234 crate::model::lifecycle_config::Ttl::AutoDeleteTime(v) => std::option::Option::Some(v),
5235 _ => std::option::Option::None,
5236 })
5237 }
5238
5239 pub fn auto_delete_ttl(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
5243 #[allow(unreachable_patterns)]
5244 self.ttl.as_ref().and_then(|v| match v {
5245 crate::model::lifecycle_config::Ttl::AutoDeleteTtl(v) => std::option::Option::Some(v),
5246 _ => std::option::Option::None,
5247 })
5248 }
5249
5250 pub fn set_auto_delete_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
5256 mut self,
5257 v: T,
5258 ) -> Self {
5259 self.ttl = std::option::Option::Some(crate::model::lifecycle_config::Ttl::AutoDeleteTime(
5260 v.into(),
5261 ));
5262 self
5263 }
5264
5265 pub fn set_auto_delete_ttl<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
5271 mut self,
5272 v: T,
5273 ) -> Self {
5274 self.ttl =
5275 std::option::Option::Some(crate::model::lifecycle_config::Ttl::AutoDeleteTtl(v.into()));
5276 self
5277 }
5278}
5279
5280impl wkt::message::Message for LifecycleConfig {
5281 fn typename() -> &'static str {
5282 "type.googleapis.com/google.cloud.dataproc.v1.LifecycleConfig"
5283 }
5284}
5285
5286pub mod lifecycle_config {
5288 #[allow(unused_imports)]
5289 use super::*;
5290
5291 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5294 #[serde(rename_all = "camelCase")]
5295 #[non_exhaustive]
5296 pub enum Ttl {
5297 AutoDeleteTime(std::boxed::Box<wkt::Timestamp>),
5301 AutoDeleteTtl(std::boxed::Box<wkt::Duration>),
5306 }
5307}
5308
5309#[serde_with::serde_as]
5311#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5312#[serde(default, rename_all = "camelCase")]
5313#[non_exhaustive]
5314pub struct MetastoreConfig {
5315 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5321 pub dataproc_metastore_service: std::string::String,
5322
5323 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5324 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5325}
5326
5327impl MetastoreConfig {
5328 pub fn new() -> Self {
5329 std::default::Default::default()
5330 }
5331
5332 pub fn set_dataproc_metastore_service<T: std::convert::Into<std::string::String>>(
5334 mut self,
5335 v: T,
5336 ) -> Self {
5337 self.dataproc_metastore_service = v.into();
5338 self
5339 }
5340}
5341
5342impl wkt::message::Message for MetastoreConfig {
5343 fn typename() -> &'static str {
5344 "type.googleapis.com/google.cloud.dataproc.v1.MetastoreConfig"
5345 }
5346}
5347
5348#[serde_with::serde_as]
5353#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5354#[serde(default, rename_all = "camelCase")]
5355#[non_exhaustive]
5356pub struct ClusterMetrics {
5357 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
5359 #[serde_as(as = "std::collections::HashMap<_, serde_with::DisplayFromStr>")]
5360 pub hdfs_metrics: std::collections::HashMap<std::string::String, i64>,
5361
5362 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
5364 #[serde_as(as = "std::collections::HashMap<_, serde_with::DisplayFromStr>")]
5365 pub yarn_metrics: std::collections::HashMap<std::string::String, i64>,
5366
5367 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5368 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5369}
5370
5371impl ClusterMetrics {
5372 pub fn new() -> Self {
5373 std::default::Default::default()
5374 }
5375
5376 pub fn set_hdfs_metrics<T, K, V>(mut self, v: T) -> Self
5378 where
5379 T: std::iter::IntoIterator<Item = (K, V)>,
5380 K: std::convert::Into<std::string::String>,
5381 V: std::convert::Into<i64>,
5382 {
5383 use std::iter::Iterator;
5384 self.hdfs_metrics = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5385 self
5386 }
5387
5388 pub fn set_yarn_metrics<T, K, V>(mut self, v: T) -> Self
5390 where
5391 T: std::iter::IntoIterator<Item = (K, V)>,
5392 K: std::convert::Into<std::string::String>,
5393 V: std::convert::Into<i64>,
5394 {
5395 use std::iter::Iterator;
5396 self.yarn_metrics = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5397 self
5398 }
5399}
5400
5401impl wkt::message::Message for ClusterMetrics {
5402 fn typename() -> &'static str {
5403 "type.googleapis.com/google.cloud.dataproc.v1.ClusterMetrics"
5404 }
5405}
5406
5407#[serde_with::serde_as]
5409#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5410#[serde(default, rename_all = "camelCase")]
5411#[non_exhaustive]
5412pub struct DataprocMetricConfig {
5413 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5415 pub metrics: std::vec::Vec<crate::model::dataproc_metric_config::Metric>,
5416
5417 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5418 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5419}
5420
5421impl DataprocMetricConfig {
5422 pub fn new() -> Self {
5423 std::default::Default::default()
5424 }
5425
5426 pub fn set_metrics<T, V>(mut self, v: T) -> Self
5428 where
5429 T: std::iter::IntoIterator<Item = V>,
5430 V: std::convert::Into<crate::model::dataproc_metric_config::Metric>,
5431 {
5432 use std::iter::Iterator;
5433 self.metrics = v.into_iter().map(|i| i.into()).collect();
5434 self
5435 }
5436}
5437
5438impl wkt::message::Message for DataprocMetricConfig {
5439 fn typename() -> &'static str {
5440 "type.googleapis.com/google.cloud.dataproc.v1.DataprocMetricConfig"
5441 }
5442}
5443
5444pub mod dataproc_metric_config {
5446 #[allow(unused_imports)]
5447 use super::*;
5448
5449 #[serde_with::serde_as]
5451 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5452 #[serde(default, rename_all = "camelCase")]
5453 #[non_exhaustive]
5454 pub struct Metric {
5455 pub metric_source: crate::model::dataproc_metric_config::MetricSource,
5460
5461 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
5491 pub metric_overrides: std::vec::Vec<std::string::String>,
5492
5493 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5494 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5495 }
5496
5497 impl Metric {
5498 pub fn new() -> Self {
5499 std::default::Default::default()
5500 }
5501
5502 pub fn set_metric_source<
5504 T: std::convert::Into<crate::model::dataproc_metric_config::MetricSource>,
5505 >(
5506 mut self,
5507 v: T,
5508 ) -> Self {
5509 self.metric_source = v.into();
5510 self
5511 }
5512
5513 pub fn set_metric_overrides<T, V>(mut self, v: T) -> Self
5515 where
5516 T: std::iter::IntoIterator<Item = V>,
5517 V: std::convert::Into<std::string::String>,
5518 {
5519 use std::iter::Iterator;
5520 self.metric_overrides = v.into_iter().map(|i| i.into()).collect();
5521 self
5522 }
5523 }
5524
5525 impl wkt::message::Message for Metric {
5526 fn typename() -> &'static str {
5527 "type.googleapis.com/google.cloud.dataproc.v1.DataprocMetricConfig.Metric"
5528 }
5529 }
5530
5531 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
5535 pub struct MetricSource(i32);
5536
5537 impl MetricSource {
5538 pub const METRIC_SOURCE_UNSPECIFIED: MetricSource = MetricSource::new(0);
5540
5541 pub const MONITORING_AGENT_DEFAULTS: MetricSource = MetricSource::new(1);
5546
5547 pub const HDFS: MetricSource = MetricSource::new(2);
5549
5550 pub const SPARK: MetricSource = MetricSource::new(3);
5552
5553 pub const YARN: MetricSource = MetricSource::new(4);
5555
5556 pub const SPARK_HISTORY_SERVER: MetricSource = MetricSource::new(5);
5558
5559 pub const HIVESERVER2: MetricSource = MetricSource::new(6);
5561
5562 pub const HIVEMETASTORE: MetricSource = MetricSource::new(7);
5564
5565 pub const FLINK: MetricSource = MetricSource::new(8);
5567
5568 pub(crate) const fn new(value: i32) -> Self {
5570 Self(value)
5571 }
5572
5573 pub fn value(&self) -> i32 {
5575 self.0
5576 }
5577
5578 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
5580 match self.0 {
5581 0 => std::borrow::Cow::Borrowed("METRIC_SOURCE_UNSPECIFIED"),
5582 1 => std::borrow::Cow::Borrowed("MONITORING_AGENT_DEFAULTS"),
5583 2 => std::borrow::Cow::Borrowed("HDFS"),
5584 3 => std::borrow::Cow::Borrowed("SPARK"),
5585 4 => std::borrow::Cow::Borrowed("YARN"),
5586 5 => std::borrow::Cow::Borrowed("SPARK_HISTORY_SERVER"),
5587 6 => std::borrow::Cow::Borrowed("HIVESERVER2"),
5588 7 => std::borrow::Cow::Borrowed("HIVEMETASTORE"),
5589 8 => std::borrow::Cow::Borrowed("FLINK"),
5590 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
5591 }
5592 }
5593
5594 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
5596 match name {
5597 "METRIC_SOURCE_UNSPECIFIED" => {
5598 std::option::Option::Some(Self::METRIC_SOURCE_UNSPECIFIED)
5599 }
5600 "MONITORING_AGENT_DEFAULTS" => {
5601 std::option::Option::Some(Self::MONITORING_AGENT_DEFAULTS)
5602 }
5603 "HDFS" => std::option::Option::Some(Self::HDFS),
5604 "SPARK" => std::option::Option::Some(Self::SPARK),
5605 "YARN" => std::option::Option::Some(Self::YARN),
5606 "SPARK_HISTORY_SERVER" => std::option::Option::Some(Self::SPARK_HISTORY_SERVER),
5607 "HIVESERVER2" => std::option::Option::Some(Self::HIVESERVER2),
5608 "HIVEMETASTORE" => std::option::Option::Some(Self::HIVEMETASTORE),
5609 "FLINK" => std::option::Option::Some(Self::FLINK),
5610 _ => std::option::Option::None,
5611 }
5612 }
5613 }
5614
5615 impl std::convert::From<i32> for MetricSource {
5616 fn from(value: i32) -> Self {
5617 Self::new(value)
5618 }
5619 }
5620
5621 impl std::default::Default for MetricSource {
5622 fn default() -> Self {
5623 Self::new(0)
5624 }
5625 }
5626}
5627
5628#[serde_with::serde_as]
5630#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5631#[serde(default, rename_all = "camelCase")]
5632#[non_exhaustive]
5633pub struct CreateClusterRequest {
5634 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5637 pub project_id: std::string::String,
5638
5639 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5641 pub region: std::string::String,
5642
5643 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5645 pub cluster: std::option::Option<crate::model::Cluster>,
5646
5647 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5662 pub request_id: std::string::String,
5663
5664 pub action_on_failed_primary_workers: crate::model::FailureAction,
5666
5667 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5668 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5669}
5670
5671impl CreateClusterRequest {
5672 pub fn new() -> Self {
5673 std::default::Default::default()
5674 }
5675
5676 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5678 self.project_id = v.into();
5679 self
5680 }
5681
5682 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5684 self.region = v.into();
5685 self
5686 }
5687
5688 pub fn set_cluster<T: std::convert::Into<std::option::Option<crate::model::Cluster>>>(
5690 mut self,
5691 v: T,
5692 ) -> Self {
5693 self.cluster = v.into();
5694 self
5695 }
5696
5697 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5699 self.request_id = v.into();
5700 self
5701 }
5702
5703 pub fn set_action_on_failed_primary_workers<
5705 T: std::convert::Into<crate::model::FailureAction>,
5706 >(
5707 mut self,
5708 v: T,
5709 ) -> Self {
5710 self.action_on_failed_primary_workers = v.into();
5711 self
5712 }
5713}
5714
5715impl wkt::message::Message for CreateClusterRequest {
5716 fn typename() -> &'static str {
5717 "type.googleapis.com/google.cloud.dataproc.v1.CreateClusterRequest"
5718 }
5719}
5720
5721#[serde_with::serde_as]
5723#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5724#[serde(default, rename_all = "camelCase")]
5725#[non_exhaustive]
5726pub struct UpdateClusterRequest {
5727 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5730 pub project_id: std::string::String,
5731
5732 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5734 pub region: std::string::String,
5735
5736 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5738 pub cluster_name: std::string::String,
5739
5740 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5742 pub cluster: std::option::Option<crate::model::Cluster>,
5743
5744 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5754 pub graceful_decommission_timeout: std::option::Option<wkt::Duration>,
5755
5756 #[serde(skip_serializing_if = "std::option::Option::is_none")]
5789 pub update_mask: std::option::Option<wkt::FieldMask>,
5790
5791 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5806 pub request_id: std::string::String,
5807
5808 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5809 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5810}
5811
5812impl UpdateClusterRequest {
5813 pub fn new() -> Self {
5814 std::default::Default::default()
5815 }
5816
5817 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5819 self.project_id = v.into();
5820 self
5821 }
5822
5823 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5825 self.region = v.into();
5826 self
5827 }
5828
5829 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5831 self.cluster_name = v.into();
5832 self
5833 }
5834
5835 pub fn set_cluster<T: std::convert::Into<std::option::Option<crate::model::Cluster>>>(
5837 mut self,
5838 v: T,
5839 ) -> Self {
5840 self.cluster = v.into();
5841 self
5842 }
5843
5844 pub fn set_graceful_decommission_timeout<
5846 T: std::convert::Into<std::option::Option<wkt::Duration>>,
5847 >(
5848 mut self,
5849 v: T,
5850 ) -> Self {
5851 self.graceful_decommission_timeout = v.into();
5852 self
5853 }
5854
5855 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
5857 mut self,
5858 v: T,
5859 ) -> Self {
5860 self.update_mask = v.into();
5861 self
5862 }
5863
5864 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5866 self.request_id = v.into();
5867 self
5868 }
5869}
5870
5871impl wkt::message::Message for UpdateClusterRequest {
5872 fn typename() -> &'static str {
5873 "type.googleapis.com/google.cloud.dataproc.v1.UpdateClusterRequest"
5874 }
5875}
5876
5877#[serde_with::serde_as]
5879#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5880#[serde(default, rename_all = "camelCase")]
5881#[non_exhaustive]
5882pub struct StopClusterRequest {
5883 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5886 pub project_id: std::string::String,
5887
5888 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5890 pub region: std::string::String,
5891
5892 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5894 pub cluster_name: std::string::String,
5895
5896 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5899 pub cluster_uuid: std::string::String,
5900
5901 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5916 pub request_id: std::string::String,
5917
5918 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
5919 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5920}
5921
5922impl StopClusterRequest {
5923 pub fn new() -> Self {
5924 std::default::Default::default()
5925 }
5926
5927 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5929 self.project_id = v.into();
5930 self
5931 }
5932
5933 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5935 self.region = v.into();
5936 self
5937 }
5938
5939 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5941 self.cluster_name = v.into();
5942 self
5943 }
5944
5945 pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5947 self.cluster_uuid = v.into();
5948 self
5949 }
5950
5951 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5953 self.request_id = v.into();
5954 self
5955 }
5956}
5957
5958impl wkt::message::Message for StopClusterRequest {
5959 fn typename() -> &'static str {
5960 "type.googleapis.com/google.cloud.dataproc.v1.StopClusterRequest"
5961 }
5962}
5963
5964#[serde_with::serde_as]
5966#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
5967#[serde(default, rename_all = "camelCase")]
5968#[non_exhaustive]
5969pub struct StartClusterRequest {
5970 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5973 pub project_id: std::string::String,
5974
5975 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5977 pub region: std::string::String,
5978
5979 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5981 pub cluster_name: std::string::String,
5982
5983 #[serde(skip_serializing_if = "std::string::String::is_empty")]
5986 pub cluster_uuid: std::string::String,
5987
5988 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6003 pub request_id: std::string::String,
6004
6005 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6006 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6007}
6008
6009impl StartClusterRequest {
6010 pub fn new() -> Self {
6011 std::default::Default::default()
6012 }
6013
6014 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6016 self.project_id = v.into();
6017 self
6018 }
6019
6020 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6022 self.region = v.into();
6023 self
6024 }
6025
6026 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6028 self.cluster_name = v.into();
6029 self
6030 }
6031
6032 pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6034 self.cluster_uuid = v.into();
6035 self
6036 }
6037
6038 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6040 self.request_id = v.into();
6041 self
6042 }
6043}
6044
6045impl wkt::message::Message for StartClusterRequest {
6046 fn typename() -> &'static str {
6047 "type.googleapis.com/google.cloud.dataproc.v1.StartClusterRequest"
6048 }
6049}
6050
6051#[serde_with::serde_as]
6053#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6054#[serde(default, rename_all = "camelCase")]
6055#[non_exhaustive]
6056pub struct DeleteClusterRequest {
6057 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6060 pub project_id: std::string::String,
6061
6062 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6064 pub region: std::string::String,
6065
6066 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6068 pub cluster_name: std::string::String,
6069
6070 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6073 pub cluster_uuid: std::string::String,
6074
6075 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6090 pub request_id: std::string::String,
6091
6092 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6093 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6094}
6095
6096impl DeleteClusterRequest {
6097 pub fn new() -> Self {
6098 std::default::Default::default()
6099 }
6100
6101 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6103 self.project_id = v.into();
6104 self
6105 }
6106
6107 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6109 self.region = v.into();
6110 self
6111 }
6112
6113 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6115 self.cluster_name = v.into();
6116 self
6117 }
6118
6119 pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6121 self.cluster_uuid = v.into();
6122 self
6123 }
6124
6125 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6127 self.request_id = v.into();
6128 self
6129 }
6130}
6131
6132impl wkt::message::Message for DeleteClusterRequest {
6133 fn typename() -> &'static str {
6134 "type.googleapis.com/google.cloud.dataproc.v1.DeleteClusterRequest"
6135 }
6136}
6137
6138#[serde_with::serde_as]
6140#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6141#[serde(default, rename_all = "camelCase")]
6142#[non_exhaustive]
6143pub struct GetClusterRequest {
6144 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6147 pub project_id: std::string::String,
6148
6149 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6151 pub region: std::string::String,
6152
6153 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6155 pub cluster_name: std::string::String,
6156
6157 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6158 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6159}
6160
6161impl GetClusterRequest {
6162 pub fn new() -> Self {
6163 std::default::Default::default()
6164 }
6165
6166 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6168 self.project_id = v.into();
6169 self
6170 }
6171
6172 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6174 self.region = v.into();
6175 self
6176 }
6177
6178 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6180 self.cluster_name = v.into();
6181 self
6182 }
6183}
6184
6185impl wkt::message::Message for GetClusterRequest {
6186 fn typename() -> &'static str {
6187 "type.googleapis.com/google.cloud.dataproc.v1.GetClusterRequest"
6188 }
6189}
6190
6191#[serde_with::serde_as]
6193#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6194#[serde(default, rename_all = "camelCase")]
6195#[non_exhaustive]
6196pub struct ListClustersRequest {
6197 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6200 pub project_id: std::string::String,
6201
6202 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6204 pub region: std::string::String,
6205
6206 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6226 pub filter: std::string::String,
6227
6228 pub page_size: i32,
6230
6231 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6233 pub page_token: std::string::String,
6234
6235 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6236 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6237}
6238
6239impl ListClustersRequest {
6240 pub fn new() -> Self {
6241 std::default::Default::default()
6242 }
6243
6244 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6246 self.project_id = v.into();
6247 self
6248 }
6249
6250 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6252 self.region = v.into();
6253 self
6254 }
6255
6256 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6258 self.filter = v.into();
6259 self
6260 }
6261
6262 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6264 self.page_size = v.into();
6265 self
6266 }
6267
6268 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6270 self.page_token = v.into();
6271 self
6272 }
6273}
6274
6275impl wkt::message::Message for ListClustersRequest {
6276 fn typename() -> &'static str {
6277 "type.googleapis.com/google.cloud.dataproc.v1.ListClustersRequest"
6278 }
6279}
6280
6281#[serde_with::serde_as]
6283#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6284#[serde(default, rename_all = "camelCase")]
6285#[non_exhaustive]
6286pub struct ListClustersResponse {
6287 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6289 pub clusters: std::vec::Vec<crate::model::Cluster>,
6290
6291 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6295 pub next_page_token: std::string::String,
6296
6297 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6298 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6299}
6300
6301impl ListClustersResponse {
6302 pub fn new() -> Self {
6303 std::default::Default::default()
6304 }
6305
6306 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6308 self.next_page_token = v.into();
6309 self
6310 }
6311
6312 pub fn set_clusters<T, V>(mut self, v: T) -> Self
6314 where
6315 T: std::iter::IntoIterator<Item = V>,
6316 V: std::convert::Into<crate::model::Cluster>,
6317 {
6318 use std::iter::Iterator;
6319 self.clusters = v.into_iter().map(|i| i.into()).collect();
6320 self
6321 }
6322}
6323
6324impl wkt::message::Message for ListClustersResponse {
6325 fn typename() -> &'static str {
6326 "type.googleapis.com/google.cloud.dataproc.v1.ListClustersResponse"
6327 }
6328}
6329
6330#[doc(hidden)]
6331impl gax::paginator::internal::PageableResponse for ListClustersResponse {
6332 type PageItem = crate::model::Cluster;
6333
6334 fn items(self) -> std::vec::Vec<Self::PageItem> {
6335 self.clusters
6336 }
6337
6338 fn next_page_token(&self) -> std::string::String {
6339 use std::clone::Clone;
6340 self.next_page_token.clone()
6341 }
6342}
6343
6344#[serde_with::serde_as]
6346#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6347#[serde(default, rename_all = "camelCase")]
6348#[non_exhaustive]
6349pub struct DiagnoseClusterRequest {
6350 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6353 pub project_id: std::string::String,
6354
6355 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6357 pub region: std::string::String,
6358
6359 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6361 pub cluster_name: std::string::String,
6362
6363 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6367 pub tarball_gcs_dir: std::string::String,
6368
6369 pub tarball_access: crate::model::diagnose_cluster_request::TarballAccess,
6372
6373 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6376 pub diagnosis_interval: std::option::Option<gtype::model::Interval>,
6377
6378 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6381 pub jobs: std::vec::Vec<std::string::String>,
6382
6383 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6386 pub yarn_application_ids: std::vec::Vec<std::string::String>,
6387
6388 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6389 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6390}
6391
6392impl DiagnoseClusterRequest {
6393 pub fn new() -> Self {
6394 std::default::Default::default()
6395 }
6396
6397 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6399 self.project_id = v.into();
6400 self
6401 }
6402
6403 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6405 self.region = v.into();
6406 self
6407 }
6408
6409 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6411 self.cluster_name = v.into();
6412 self
6413 }
6414
6415 pub fn set_tarball_gcs_dir<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6417 self.tarball_gcs_dir = v.into();
6418 self
6419 }
6420
6421 pub fn set_tarball_access<
6423 T: std::convert::Into<crate::model::diagnose_cluster_request::TarballAccess>,
6424 >(
6425 mut self,
6426 v: T,
6427 ) -> Self {
6428 self.tarball_access = v.into();
6429 self
6430 }
6431
6432 pub fn set_diagnosis_interval<
6434 T: std::convert::Into<std::option::Option<gtype::model::Interval>>,
6435 >(
6436 mut self,
6437 v: T,
6438 ) -> Self {
6439 self.diagnosis_interval = v.into();
6440 self
6441 }
6442
6443 pub fn set_jobs<T, V>(mut self, v: T) -> Self
6445 where
6446 T: std::iter::IntoIterator<Item = V>,
6447 V: std::convert::Into<std::string::String>,
6448 {
6449 use std::iter::Iterator;
6450 self.jobs = v.into_iter().map(|i| i.into()).collect();
6451 self
6452 }
6453
6454 pub fn set_yarn_application_ids<T, V>(mut self, v: T) -> Self
6456 where
6457 T: std::iter::IntoIterator<Item = V>,
6458 V: std::convert::Into<std::string::String>,
6459 {
6460 use std::iter::Iterator;
6461 self.yarn_application_ids = v.into_iter().map(|i| i.into()).collect();
6462 self
6463 }
6464}
6465
6466impl wkt::message::Message for DiagnoseClusterRequest {
6467 fn typename() -> &'static str {
6468 "type.googleapis.com/google.cloud.dataproc.v1.DiagnoseClusterRequest"
6469 }
6470}
6471
6472pub mod diagnose_cluster_request {
6474 #[allow(unused_imports)]
6475 use super::*;
6476
6477 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
6479 pub struct TarballAccess(i32);
6480
6481 impl TarballAccess {
6482 pub const TARBALL_ACCESS_UNSPECIFIED: TarballAccess = TarballAccess::new(0);
6484
6485 pub const GOOGLE_CLOUD_SUPPORT: TarballAccess = TarballAccess::new(1);
6488
6489 pub const GOOGLE_DATAPROC_DIAGNOSE: TarballAccess = TarballAccess::new(2);
6492
6493 pub(crate) const fn new(value: i32) -> Self {
6495 Self(value)
6496 }
6497
6498 pub fn value(&self) -> i32 {
6500 self.0
6501 }
6502
6503 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
6505 match self.0 {
6506 0 => std::borrow::Cow::Borrowed("TARBALL_ACCESS_UNSPECIFIED"),
6507 1 => std::borrow::Cow::Borrowed("GOOGLE_CLOUD_SUPPORT"),
6508 2 => std::borrow::Cow::Borrowed("GOOGLE_DATAPROC_DIAGNOSE"),
6509 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
6510 }
6511 }
6512
6513 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
6515 match name {
6516 "TARBALL_ACCESS_UNSPECIFIED" => {
6517 std::option::Option::Some(Self::TARBALL_ACCESS_UNSPECIFIED)
6518 }
6519 "GOOGLE_CLOUD_SUPPORT" => std::option::Option::Some(Self::GOOGLE_CLOUD_SUPPORT),
6520 "GOOGLE_DATAPROC_DIAGNOSE" => {
6521 std::option::Option::Some(Self::GOOGLE_DATAPROC_DIAGNOSE)
6522 }
6523 _ => std::option::Option::None,
6524 }
6525 }
6526 }
6527
6528 impl std::convert::From<i32> for TarballAccess {
6529 fn from(value: i32) -> Self {
6530 Self::new(value)
6531 }
6532 }
6533
6534 impl std::default::Default for TarballAccess {
6535 fn default() -> Self {
6536 Self::new(0)
6537 }
6538 }
6539}
6540
6541#[serde_with::serde_as]
6543#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6544#[serde(default, rename_all = "camelCase")]
6545#[non_exhaustive]
6546pub struct DiagnoseClusterResults {
6547 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6551 pub output_uri: std::string::String,
6552
6553 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6554 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6555}
6556
6557impl DiagnoseClusterResults {
6558 pub fn new() -> Self {
6559 std::default::Default::default()
6560 }
6561
6562 pub fn set_output_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6564 self.output_uri = v.into();
6565 self
6566 }
6567}
6568
6569impl wkt::message::Message for DiagnoseClusterResults {
6570 fn typename() -> &'static str {
6571 "type.googleapis.com/google.cloud.dataproc.v1.DiagnoseClusterResults"
6572 }
6573}
6574
6575#[serde_with::serde_as]
6577#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6578#[serde(default, rename_all = "camelCase")]
6579#[non_exhaustive]
6580pub struct ReservationAffinity {
6581 pub consume_reservation_type: crate::model::reservation_affinity::Type,
6583
6584 #[serde(skip_serializing_if = "std::string::String::is_empty")]
6586 pub key: std::string::String,
6587
6588 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6590 pub values: std::vec::Vec<std::string::String>,
6591
6592 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6593 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6594}
6595
6596impl ReservationAffinity {
6597 pub fn new() -> Self {
6598 std::default::Default::default()
6599 }
6600
6601 pub fn set_consume_reservation_type<
6603 T: std::convert::Into<crate::model::reservation_affinity::Type>,
6604 >(
6605 mut self,
6606 v: T,
6607 ) -> Self {
6608 self.consume_reservation_type = v.into();
6609 self
6610 }
6611
6612 pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6614 self.key = v.into();
6615 self
6616 }
6617
6618 pub fn set_values<T, V>(mut self, v: T) -> Self
6620 where
6621 T: std::iter::IntoIterator<Item = V>,
6622 V: std::convert::Into<std::string::String>,
6623 {
6624 use std::iter::Iterator;
6625 self.values = v.into_iter().map(|i| i.into()).collect();
6626 self
6627 }
6628}
6629
6630impl wkt::message::Message for ReservationAffinity {
6631 fn typename() -> &'static str {
6632 "type.googleapis.com/google.cloud.dataproc.v1.ReservationAffinity"
6633 }
6634}
6635
6636pub mod reservation_affinity {
6638 #[allow(unused_imports)]
6639 use super::*;
6640
6641 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
6643 pub struct Type(i32);
6644
6645 impl Type {
6646 pub const TYPE_UNSPECIFIED: Type = Type::new(0);
6647
6648 pub const NO_RESERVATION: Type = Type::new(1);
6650
6651 pub const ANY_RESERVATION: Type = Type::new(2);
6653
6654 pub const SPECIFIC_RESERVATION: Type = Type::new(3);
6657
6658 pub(crate) const fn new(value: i32) -> Self {
6660 Self(value)
6661 }
6662
6663 pub fn value(&self) -> i32 {
6665 self.0
6666 }
6667
6668 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
6670 match self.0 {
6671 0 => std::borrow::Cow::Borrowed("TYPE_UNSPECIFIED"),
6672 1 => std::borrow::Cow::Borrowed("NO_RESERVATION"),
6673 2 => std::borrow::Cow::Borrowed("ANY_RESERVATION"),
6674 3 => std::borrow::Cow::Borrowed("SPECIFIC_RESERVATION"),
6675 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
6676 }
6677 }
6678
6679 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
6681 match name {
6682 "TYPE_UNSPECIFIED" => std::option::Option::Some(Self::TYPE_UNSPECIFIED),
6683 "NO_RESERVATION" => std::option::Option::Some(Self::NO_RESERVATION),
6684 "ANY_RESERVATION" => std::option::Option::Some(Self::ANY_RESERVATION),
6685 "SPECIFIC_RESERVATION" => std::option::Option::Some(Self::SPECIFIC_RESERVATION),
6686 _ => std::option::Option::None,
6687 }
6688 }
6689 }
6690
6691 impl std::convert::From<i32> for Type {
6692 fn from(value: i32) -> Self {
6693 Self::new(value)
6694 }
6695 }
6696
6697 impl std::default::Default for Type {
6698 fn default() -> Self {
6699 Self::new(0)
6700 }
6701 }
6702}
6703
6704#[serde_with::serde_as]
6706#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6707#[serde(default, rename_all = "camelCase")]
6708#[non_exhaustive]
6709pub struct LoggingConfig {
6710 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
6718 pub driver_log_levels:
6719 std::collections::HashMap<std::string::String, crate::model::logging_config::Level>,
6720
6721 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6722 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6723}
6724
6725impl LoggingConfig {
6726 pub fn new() -> Self {
6727 std::default::Default::default()
6728 }
6729
6730 pub fn set_driver_log_levels<T, K, V>(mut self, v: T) -> Self
6732 where
6733 T: std::iter::IntoIterator<Item = (K, V)>,
6734 K: std::convert::Into<std::string::String>,
6735 V: std::convert::Into<crate::model::logging_config::Level>,
6736 {
6737 use std::iter::Iterator;
6738 self.driver_log_levels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6739 self
6740 }
6741}
6742
6743impl wkt::message::Message for LoggingConfig {
6744 fn typename() -> &'static str {
6745 "type.googleapis.com/google.cloud.dataproc.v1.LoggingConfig"
6746 }
6747}
6748
6749pub mod logging_config {
6751 #[allow(unused_imports)]
6752 use super::*;
6753
6754 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
6758 pub struct Level(i32);
6759
6760 impl Level {
6761 pub const LEVEL_UNSPECIFIED: Level = Level::new(0);
6763
6764 pub const ALL: Level = Level::new(1);
6766
6767 pub const TRACE: Level = Level::new(2);
6769
6770 pub const DEBUG: Level = Level::new(3);
6772
6773 pub const INFO: Level = Level::new(4);
6775
6776 pub const WARN: Level = Level::new(5);
6778
6779 pub const ERROR: Level = Level::new(6);
6781
6782 pub const FATAL: Level = Level::new(7);
6784
6785 pub const OFF: Level = Level::new(8);
6787
6788 pub(crate) const fn new(value: i32) -> Self {
6790 Self(value)
6791 }
6792
6793 pub fn value(&self) -> i32 {
6795 self.0
6796 }
6797
6798 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
6800 match self.0 {
6801 0 => std::borrow::Cow::Borrowed("LEVEL_UNSPECIFIED"),
6802 1 => std::borrow::Cow::Borrowed("ALL"),
6803 2 => std::borrow::Cow::Borrowed("TRACE"),
6804 3 => std::borrow::Cow::Borrowed("DEBUG"),
6805 4 => std::borrow::Cow::Borrowed("INFO"),
6806 5 => std::borrow::Cow::Borrowed("WARN"),
6807 6 => std::borrow::Cow::Borrowed("ERROR"),
6808 7 => std::borrow::Cow::Borrowed("FATAL"),
6809 8 => std::borrow::Cow::Borrowed("OFF"),
6810 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
6811 }
6812 }
6813
6814 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
6816 match name {
6817 "LEVEL_UNSPECIFIED" => std::option::Option::Some(Self::LEVEL_UNSPECIFIED),
6818 "ALL" => std::option::Option::Some(Self::ALL),
6819 "TRACE" => std::option::Option::Some(Self::TRACE),
6820 "DEBUG" => std::option::Option::Some(Self::DEBUG),
6821 "INFO" => std::option::Option::Some(Self::INFO),
6822 "WARN" => std::option::Option::Some(Self::WARN),
6823 "ERROR" => std::option::Option::Some(Self::ERROR),
6824 "FATAL" => std::option::Option::Some(Self::FATAL),
6825 "OFF" => std::option::Option::Some(Self::OFF),
6826 _ => std::option::Option::None,
6827 }
6828 }
6829 }
6830
6831 impl std::convert::From<i32> for Level {
6832 fn from(value: i32) -> Self {
6833 Self::new(value)
6834 }
6835 }
6836
6837 impl std::default::Default for Level {
6838 fn default() -> Self {
6839 Self::new(0)
6840 }
6841 }
6842}
6843
6844#[serde_with::serde_as]
6850#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6851#[serde(default, rename_all = "camelCase")]
6852#[non_exhaustive]
6853pub struct HadoopJob {
6854 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6859 pub args: std::vec::Vec<std::string::String>,
6860
6861 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6864 pub jar_file_uris: std::vec::Vec<std::string::String>,
6865
6866 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6870 pub file_uris: std::vec::Vec<std::string::String>,
6871
6872 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
6876 pub archive_uris: std::vec::Vec<std::string::String>,
6877
6878 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
6883 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
6884
6885 #[serde(skip_serializing_if = "std::option::Option::is_none")]
6887 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
6888
6889 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
6894 pub driver: std::option::Option<crate::model::hadoop_job::Driver>,
6895
6896 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
6897 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6898}
6899
6900impl HadoopJob {
6901 pub fn new() -> Self {
6902 std::default::Default::default()
6903 }
6904
6905 pub fn set_logging_config<
6907 T: std::convert::Into<std::option::Option<crate::model::LoggingConfig>>,
6908 >(
6909 mut self,
6910 v: T,
6911 ) -> Self {
6912 self.logging_config = v.into();
6913 self
6914 }
6915
6916 pub fn set_args<T, V>(mut self, v: T) -> Self
6918 where
6919 T: std::iter::IntoIterator<Item = V>,
6920 V: std::convert::Into<std::string::String>,
6921 {
6922 use std::iter::Iterator;
6923 self.args = v.into_iter().map(|i| i.into()).collect();
6924 self
6925 }
6926
6927 pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
6929 where
6930 T: std::iter::IntoIterator<Item = V>,
6931 V: std::convert::Into<std::string::String>,
6932 {
6933 use std::iter::Iterator;
6934 self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
6935 self
6936 }
6937
6938 pub fn set_file_uris<T, V>(mut self, v: T) -> Self
6940 where
6941 T: std::iter::IntoIterator<Item = V>,
6942 V: std::convert::Into<std::string::String>,
6943 {
6944 use std::iter::Iterator;
6945 self.file_uris = v.into_iter().map(|i| i.into()).collect();
6946 self
6947 }
6948
6949 pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
6951 where
6952 T: std::iter::IntoIterator<Item = V>,
6953 V: std::convert::Into<std::string::String>,
6954 {
6955 use std::iter::Iterator;
6956 self.archive_uris = v.into_iter().map(|i| i.into()).collect();
6957 self
6958 }
6959
6960 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
6962 where
6963 T: std::iter::IntoIterator<Item = (K, V)>,
6964 K: std::convert::Into<std::string::String>,
6965 V: std::convert::Into<std::string::String>,
6966 {
6967 use std::iter::Iterator;
6968 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6969 self
6970 }
6971
6972 pub fn set_driver<
6977 T: std::convert::Into<std::option::Option<crate::model::hadoop_job::Driver>>,
6978 >(
6979 mut self,
6980 v: T,
6981 ) -> Self {
6982 self.driver = v.into();
6983 self
6984 }
6985
6986 pub fn main_jar_file_uri(&self) -> std::option::Option<&std::string::String> {
6990 #[allow(unreachable_patterns)]
6991 self.driver.as_ref().and_then(|v| match v {
6992 crate::model::hadoop_job::Driver::MainJarFileUri(v) => std::option::Option::Some(v),
6993 _ => std::option::Option::None,
6994 })
6995 }
6996
6997 pub fn main_class(&self) -> std::option::Option<&std::string::String> {
7001 #[allow(unreachable_patterns)]
7002 self.driver.as_ref().and_then(|v| match v {
7003 crate::model::hadoop_job::Driver::MainClass(v) => std::option::Option::Some(v),
7004 _ => std::option::Option::None,
7005 })
7006 }
7007
7008 pub fn set_main_jar_file_uri<T: std::convert::Into<std::string::String>>(
7014 mut self,
7015 v: T,
7016 ) -> Self {
7017 self.driver =
7018 std::option::Option::Some(crate::model::hadoop_job::Driver::MainJarFileUri(v.into()));
7019 self
7020 }
7021
7022 pub fn set_main_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7028 self.driver =
7029 std::option::Option::Some(crate::model::hadoop_job::Driver::MainClass(v.into()));
7030 self
7031 }
7032}
7033
7034impl wkt::message::Message for HadoopJob {
7035 fn typename() -> &'static str {
7036 "type.googleapis.com/google.cloud.dataproc.v1.HadoopJob"
7037 }
7038}
7039
7040pub mod hadoop_job {
7042 #[allow(unused_imports)]
7043 use super::*;
7044
7045 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7050 #[serde(rename_all = "camelCase")]
7051 #[non_exhaustive]
7052 pub enum Driver {
7053 MainJarFileUri(std::string::String),
7059 MainClass(std::string::String),
7062 }
7063}
7064
7065#[serde_with::serde_as]
7068#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7069#[serde(default, rename_all = "camelCase")]
7070#[non_exhaustive]
7071pub struct SparkJob {
7072 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7076 pub args: std::vec::Vec<std::string::String>,
7077
7078 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7081 pub jar_file_uris: std::vec::Vec<std::string::String>,
7082
7083 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7086 pub file_uris: std::vec::Vec<std::string::String>,
7087
7088 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7092 pub archive_uris: std::vec::Vec<std::string::String>,
7093
7094 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
7099 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
7100
7101 #[serde(skip_serializing_if = "std::option::Option::is_none")]
7103 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
7104
7105 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
7115 pub driver: std::option::Option<crate::model::spark_job::Driver>,
7116
7117 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7118 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7119}
7120
7121impl SparkJob {
7122 pub fn new() -> Self {
7123 std::default::Default::default()
7124 }
7125
7126 pub fn set_logging_config<
7128 T: std::convert::Into<std::option::Option<crate::model::LoggingConfig>>,
7129 >(
7130 mut self,
7131 v: T,
7132 ) -> Self {
7133 self.logging_config = v.into();
7134 self
7135 }
7136
7137 pub fn set_args<T, V>(mut self, v: T) -> Self
7139 where
7140 T: std::iter::IntoIterator<Item = V>,
7141 V: std::convert::Into<std::string::String>,
7142 {
7143 use std::iter::Iterator;
7144 self.args = v.into_iter().map(|i| i.into()).collect();
7145 self
7146 }
7147
7148 pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
7150 where
7151 T: std::iter::IntoIterator<Item = V>,
7152 V: std::convert::Into<std::string::String>,
7153 {
7154 use std::iter::Iterator;
7155 self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
7156 self
7157 }
7158
7159 pub fn set_file_uris<T, V>(mut self, v: T) -> Self
7161 where
7162 T: std::iter::IntoIterator<Item = V>,
7163 V: std::convert::Into<std::string::String>,
7164 {
7165 use std::iter::Iterator;
7166 self.file_uris = v.into_iter().map(|i| i.into()).collect();
7167 self
7168 }
7169
7170 pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
7172 where
7173 T: std::iter::IntoIterator<Item = V>,
7174 V: std::convert::Into<std::string::String>,
7175 {
7176 use std::iter::Iterator;
7177 self.archive_uris = v.into_iter().map(|i| i.into()).collect();
7178 self
7179 }
7180
7181 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
7183 where
7184 T: std::iter::IntoIterator<Item = (K, V)>,
7185 K: std::convert::Into<std::string::String>,
7186 V: std::convert::Into<std::string::String>,
7187 {
7188 use std::iter::Iterator;
7189 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7190 self
7191 }
7192
7193 pub fn set_driver<
7198 T: std::convert::Into<std::option::Option<crate::model::spark_job::Driver>>,
7199 >(
7200 mut self,
7201 v: T,
7202 ) -> Self {
7203 self.driver = v.into();
7204 self
7205 }
7206
7207 pub fn main_jar_file_uri(&self) -> std::option::Option<&std::string::String> {
7211 #[allow(unreachable_patterns)]
7212 self.driver.as_ref().and_then(|v| match v {
7213 crate::model::spark_job::Driver::MainJarFileUri(v) => std::option::Option::Some(v),
7214 _ => std::option::Option::None,
7215 })
7216 }
7217
7218 pub fn main_class(&self) -> std::option::Option<&std::string::String> {
7222 #[allow(unreachable_patterns)]
7223 self.driver.as_ref().and_then(|v| match v {
7224 crate::model::spark_job::Driver::MainClass(v) => std::option::Option::Some(v),
7225 _ => std::option::Option::None,
7226 })
7227 }
7228
7229 pub fn set_main_jar_file_uri<T: std::convert::Into<std::string::String>>(
7235 mut self,
7236 v: T,
7237 ) -> Self {
7238 self.driver =
7239 std::option::Option::Some(crate::model::spark_job::Driver::MainJarFileUri(v.into()));
7240 self
7241 }
7242
7243 pub fn set_main_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7249 self.driver =
7250 std::option::Option::Some(crate::model::spark_job::Driver::MainClass(v.into()));
7251 self
7252 }
7253}
7254
7255impl wkt::message::Message for SparkJob {
7256 fn typename() -> &'static str {
7257 "type.googleapis.com/google.cloud.dataproc.v1.SparkJob"
7258 }
7259}
7260
7261pub mod spark_job {
7263 #[allow(unused_imports)]
7264 use super::*;
7265
7266 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7276 #[serde(rename_all = "camelCase")]
7277 #[non_exhaustive]
7278 pub enum Driver {
7279 MainJarFileUri(std::string::String),
7281 MainClass(std::string::String),
7285 }
7286}
7287
7288#[serde_with::serde_as]
7293#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7294#[serde(default, rename_all = "camelCase")]
7295#[non_exhaustive]
7296pub struct PySparkJob {
7297 #[serde(skip_serializing_if = "std::string::String::is_empty")]
7300 pub main_python_file_uri: std::string::String,
7301
7302 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7306 pub args: std::vec::Vec<std::string::String>,
7307
7308 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7311 pub python_file_uris: std::vec::Vec<std::string::String>,
7312
7313 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7316 pub jar_file_uris: std::vec::Vec<std::string::String>,
7317
7318 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7321 pub file_uris: std::vec::Vec<std::string::String>,
7322
7323 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7327 pub archive_uris: std::vec::Vec<std::string::String>,
7328
7329 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
7334 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
7335
7336 #[serde(skip_serializing_if = "std::option::Option::is_none")]
7338 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
7339
7340 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7341 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7342}
7343
7344impl PySparkJob {
7345 pub fn new() -> Self {
7346 std::default::Default::default()
7347 }
7348
7349 pub fn set_main_python_file_uri<T: std::convert::Into<std::string::String>>(
7351 mut self,
7352 v: T,
7353 ) -> Self {
7354 self.main_python_file_uri = v.into();
7355 self
7356 }
7357
7358 pub fn set_logging_config<
7360 T: std::convert::Into<std::option::Option<crate::model::LoggingConfig>>,
7361 >(
7362 mut self,
7363 v: T,
7364 ) -> Self {
7365 self.logging_config = v.into();
7366 self
7367 }
7368
7369 pub fn set_args<T, V>(mut self, v: T) -> Self
7371 where
7372 T: std::iter::IntoIterator<Item = V>,
7373 V: std::convert::Into<std::string::String>,
7374 {
7375 use std::iter::Iterator;
7376 self.args = v.into_iter().map(|i| i.into()).collect();
7377 self
7378 }
7379
7380 pub fn set_python_file_uris<T, V>(mut self, v: T) -> Self
7382 where
7383 T: std::iter::IntoIterator<Item = V>,
7384 V: std::convert::Into<std::string::String>,
7385 {
7386 use std::iter::Iterator;
7387 self.python_file_uris = v.into_iter().map(|i| i.into()).collect();
7388 self
7389 }
7390
7391 pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
7393 where
7394 T: std::iter::IntoIterator<Item = V>,
7395 V: std::convert::Into<std::string::String>,
7396 {
7397 use std::iter::Iterator;
7398 self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
7399 self
7400 }
7401
7402 pub fn set_file_uris<T, V>(mut self, v: T) -> Self
7404 where
7405 T: std::iter::IntoIterator<Item = V>,
7406 V: std::convert::Into<std::string::String>,
7407 {
7408 use std::iter::Iterator;
7409 self.file_uris = v.into_iter().map(|i| i.into()).collect();
7410 self
7411 }
7412
7413 pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
7415 where
7416 T: std::iter::IntoIterator<Item = V>,
7417 V: std::convert::Into<std::string::String>,
7418 {
7419 use std::iter::Iterator;
7420 self.archive_uris = v.into_iter().map(|i| i.into()).collect();
7421 self
7422 }
7423
7424 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
7426 where
7427 T: std::iter::IntoIterator<Item = (K, V)>,
7428 K: std::convert::Into<std::string::String>,
7429 V: std::convert::Into<std::string::String>,
7430 {
7431 use std::iter::Iterator;
7432 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7433 self
7434 }
7435}
7436
7437impl wkt::message::Message for PySparkJob {
7438 fn typename() -> &'static str {
7439 "type.googleapis.com/google.cloud.dataproc.v1.PySparkJob"
7440 }
7441}
7442
7443#[serde_with::serde_as]
7445#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7446#[serde(default, rename_all = "camelCase")]
7447#[non_exhaustive]
7448pub struct QueryList {
7449 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7466 pub queries: std::vec::Vec<std::string::String>,
7467
7468 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7469 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7470}
7471
7472impl QueryList {
7473 pub fn new() -> Self {
7474 std::default::Default::default()
7475 }
7476
7477 pub fn set_queries<T, V>(mut self, v: T) -> Self
7479 where
7480 T: std::iter::IntoIterator<Item = V>,
7481 V: std::convert::Into<std::string::String>,
7482 {
7483 use std::iter::Iterator;
7484 self.queries = v.into_iter().map(|i| i.into()).collect();
7485 self
7486 }
7487}
7488
7489impl wkt::message::Message for QueryList {
7490 fn typename() -> &'static str {
7491 "type.googleapis.com/google.cloud.dataproc.v1.QueryList"
7492 }
7493}
7494
7495#[serde_with::serde_as]
7498#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7499#[serde(default, rename_all = "camelCase")]
7500#[non_exhaustive]
7501pub struct HiveJob {
7502 pub continue_on_failure: bool,
7506
7507 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
7510 pub script_variables: std::collections::HashMap<std::string::String, std::string::String>,
7511
7512 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
7517 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
7518
7519 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7523 pub jar_file_uris: std::vec::Vec<std::string::String>,
7524
7525 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
7528 pub queries: std::option::Option<crate::model::hive_job::Queries>,
7529
7530 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7531 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7532}
7533
7534impl HiveJob {
7535 pub fn new() -> Self {
7536 std::default::Default::default()
7537 }
7538
7539 pub fn set_continue_on_failure<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7541 self.continue_on_failure = v.into();
7542 self
7543 }
7544
7545 pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
7547 where
7548 T: std::iter::IntoIterator<Item = V>,
7549 V: std::convert::Into<std::string::String>,
7550 {
7551 use std::iter::Iterator;
7552 self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
7553 self
7554 }
7555
7556 pub fn set_script_variables<T, K, V>(mut self, v: T) -> Self
7558 where
7559 T: std::iter::IntoIterator<Item = (K, V)>,
7560 K: std::convert::Into<std::string::String>,
7561 V: std::convert::Into<std::string::String>,
7562 {
7563 use std::iter::Iterator;
7564 self.script_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7565 self
7566 }
7567
7568 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
7570 where
7571 T: std::iter::IntoIterator<Item = (K, V)>,
7572 K: std::convert::Into<std::string::String>,
7573 V: std::convert::Into<std::string::String>,
7574 {
7575 use std::iter::Iterator;
7576 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7577 self
7578 }
7579
7580 pub fn set_queries<
7585 T: std::convert::Into<std::option::Option<crate::model::hive_job::Queries>>,
7586 >(
7587 mut self,
7588 v: T,
7589 ) -> Self {
7590 self.queries = v.into();
7591 self
7592 }
7593
7594 pub fn query_file_uri(&self) -> std::option::Option<&std::string::String> {
7598 #[allow(unreachable_patterns)]
7599 self.queries.as_ref().and_then(|v| match v {
7600 crate::model::hive_job::Queries::QueryFileUri(v) => std::option::Option::Some(v),
7601 _ => std::option::Option::None,
7602 })
7603 }
7604
7605 pub fn query_list(&self) -> std::option::Option<&std::boxed::Box<crate::model::QueryList>> {
7609 #[allow(unreachable_patterns)]
7610 self.queries.as_ref().and_then(|v| match v {
7611 crate::model::hive_job::Queries::QueryList(v) => std::option::Option::Some(v),
7612 _ => std::option::Option::None,
7613 })
7614 }
7615
7616 pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7622 self.queries =
7623 std::option::Option::Some(crate::model::hive_job::Queries::QueryFileUri(v.into()));
7624 self
7625 }
7626
7627 pub fn set_query_list<T: std::convert::Into<std::boxed::Box<crate::model::QueryList>>>(
7633 mut self,
7634 v: T,
7635 ) -> Self {
7636 self.queries =
7637 std::option::Option::Some(crate::model::hive_job::Queries::QueryList(v.into()));
7638 self
7639 }
7640}
7641
7642impl wkt::message::Message for HiveJob {
7643 fn typename() -> &'static str {
7644 "type.googleapis.com/google.cloud.dataproc.v1.HiveJob"
7645 }
7646}
7647
7648pub mod hive_job {
7650 #[allow(unused_imports)]
7651 use super::*;
7652
7653 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7656 #[serde(rename_all = "camelCase")]
7657 #[non_exhaustive]
7658 pub enum Queries {
7659 QueryFileUri(std::string::String),
7661 QueryList(std::boxed::Box<crate::model::QueryList>),
7663 }
7664}
7665
7666#[serde_with::serde_as]
7669#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7670#[serde(default, rename_all = "camelCase")]
7671#[non_exhaustive]
7672pub struct SparkSqlJob {
7673 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
7676 pub script_variables: std::collections::HashMap<std::string::String, std::string::String>,
7677
7678 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
7682 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
7683
7684 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7686 pub jar_file_uris: std::vec::Vec<std::string::String>,
7687
7688 #[serde(skip_serializing_if = "std::option::Option::is_none")]
7690 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
7691
7692 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
7695 pub queries: std::option::Option<crate::model::spark_sql_job::Queries>,
7696
7697 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7698 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7699}
7700
7701impl SparkSqlJob {
7702 pub fn new() -> Self {
7703 std::default::Default::default()
7704 }
7705
7706 pub fn set_logging_config<
7708 T: std::convert::Into<std::option::Option<crate::model::LoggingConfig>>,
7709 >(
7710 mut self,
7711 v: T,
7712 ) -> Self {
7713 self.logging_config = v.into();
7714 self
7715 }
7716
7717 pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
7719 where
7720 T: std::iter::IntoIterator<Item = V>,
7721 V: std::convert::Into<std::string::String>,
7722 {
7723 use std::iter::Iterator;
7724 self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
7725 self
7726 }
7727
7728 pub fn set_script_variables<T, K, V>(mut self, v: T) -> Self
7730 where
7731 T: std::iter::IntoIterator<Item = (K, V)>,
7732 K: std::convert::Into<std::string::String>,
7733 V: std::convert::Into<std::string::String>,
7734 {
7735 use std::iter::Iterator;
7736 self.script_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7737 self
7738 }
7739
7740 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
7742 where
7743 T: std::iter::IntoIterator<Item = (K, V)>,
7744 K: std::convert::Into<std::string::String>,
7745 V: std::convert::Into<std::string::String>,
7746 {
7747 use std::iter::Iterator;
7748 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7749 self
7750 }
7751
7752 pub fn set_queries<
7757 T: std::convert::Into<std::option::Option<crate::model::spark_sql_job::Queries>>,
7758 >(
7759 mut self,
7760 v: T,
7761 ) -> Self {
7762 self.queries = v.into();
7763 self
7764 }
7765
7766 pub fn query_file_uri(&self) -> std::option::Option<&std::string::String> {
7770 #[allow(unreachable_patterns)]
7771 self.queries.as_ref().and_then(|v| match v {
7772 crate::model::spark_sql_job::Queries::QueryFileUri(v) => std::option::Option::Some(v),
7773 _ => std::option::Option::None,
7774 })
7775 }
7776
7777 pub fn query_list(&self) -> std::option::Option<&std::boxed::Box<crate::model::QueryList>> {
7781 #[allow(unreachable_patterns)]
7782 self.queries.as_ref().and_then(|v| match v {
7783 crate::model::spark_sql_job::Queries::QueryList(v) => std::option::Option::Some(v),
7784 _ => std::option::Option::None,
7785 })
7786 }
7787
7788 pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7794 self.queries =
7795 std::option::Option::Some(crate::model::spark_sql_job::Queries::QueryFileUri(v.into()));
7796 self
7797 }
7798
7799 pub fn set_query_list<T: std::convert::Into<std::boxed::Box<crate::model::QueryList>>>(
7805 mut self,
7806 v: T,
7807 ) -> Self {
7808 self.queries =
7809 std::option::Option::Some(crate::model::spark_sql_job::Queries::QueryList(v.into()));
7810 self
7811 }
7812}
7813
7814impl wkt::message::Message for SparkSqlJob {
7815 fn typename() -> &'static str {
7816 "type.googleapis.com/google.cloud.dataproc.v1.SparkSqlJob"
7817 }
7818}
7819
7820pub mod spark_sql_job {
7822 #[allow(unused_imports)]
7823 use super::*;
7824
7825 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
7828 #[serde(rename_all = "camelCase")]
7829 #[non_exhaustive]
7830 pub enum Queries {
7831 QueryFileUri(std::string::String),
7833 QueryList(std::boxed::Box<crate::model::QueryList>),
7835 }
7836}
7837
7838#[serde_with::serde_as]
7841#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
7842#[serde(default, rename_all = "camelCase")]
7843#[non_exhaustive]
7844pub struct PigJob {
7845 pub continue_on_failure: bool,
7849
7850 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
7853 pub script_variables: std::collections::HashMap<std::string::String, std::string::String>,
7854
7855 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
7860 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
7861
7862 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
7865 pub jar_file_uris: std::vec::Vec<std::string::String>,
7866
7867 #[serde(skip_serializing_if = "std::option::Option::is_none")]
7869 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
7870
7871 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
7874 pub queries: std::option::Option<crate::model::pig_job::Queries>,
7875
7876 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
7877 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7878}
7879
7880impl PigJob {
7881 pub fn new() -> Self {
7882 std::default::Default::default()
7883 }
7884
7885 pub fn set_continue_on_failure<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7887 self.continue_on_failure = v.into();
7888 self
7889 }
7890
7891 pub fn set_logging_config<
7893 T: std::convert::Into<std::option::Option<crate::model::LoggingConfig>>,
7894 >(
7895 mut self,
7896 v: T,
7897 ) -> Self {
7898 self.logging_config = v.into();
7899 self
7900 }
7901
7902 pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
7904 where
7905 T: std::iter::IntoIterator<Item = V>,
7906 V: std::convert::Into<std::string::String>,
7907 {
7908 use std::iter::Iterator;
7909 self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
7910 self
7911 }
7912
7913 pub fn set_script_variables<T, K, V>(mut self, v: T) -> Self
7915 where
7916 T: std::iter::IntoIterator<Item = (K, V)>,
7917 K: std::convert::Into<std::string::String>,
7918 V: std::convert::Into<std::string::String>,
7919 {
7920 use std::iter::Iterator;
7921 self.script_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7922 self
7923 }
7924
7925 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
7927 where
7928 T: std::iter::IntoIterator<Item = (K, V)>,
7929 K: std::convert::Into<std::string::String>,
7930 V: std::convert::Into<std::string::String>,
7931 {
7932 use std::iter::Iterator;
7933 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7934 self
7935 }
7936
7937 pub fn set_queries<
7942 T: std::convert::Into<std::option::Option<crate::model::pig_job::Queries>>,
7943 >(
7944 mut self,
7945 v: T,
7946 ) -> Self {
7947 self.queries = v.into();
7948 self
7949 }
7950
7951 pub fn query_file_uri(&self) -> std::option::Option<&std::string::String> {
7955 #[allow(unreachable_patterns)]
7956 self.queries.as_ref().and_then(|v| match v {
7957 crate::model::pig_job::Queries::QueryFileUri(v) => std::option::Option::Some(v),
7958 _ => std::option::Option::None,
7959 })
7960 }
7961
7962 pub fn query_list(&self) -> std::option::Option<&std::boxed::Box<crate::model::QueryList>> {
7966 #[allow(unreachable_patterns)]
7967 self.queries.as_ref().and_then(|v| match v {
7968 crate::model::pig_job::Queries::QueryList(v) => std::option::Option::Some(v),
7969 _ => std::option::Option::None,
7970 })
7971 }
7972
7973 pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7979 self.queries =
7980 std::option::Option::Some(crate::model::pig_job::Queries::QueryFileUri(v.into()));
7981 self
7982 }
7983
7984 pub fn set_query_list<T: std::convert::Into<std::boxed::Box<crate::model::QueryList>>>(
7990 mut self,
7991 v: T,
7992 ) -> Self {
7993 self.queries =
7994 std::option::Option::Some(crate::model::pig_job::Queries::QueryList(v.into()));
7995 self
7996 }
7997}
7998
7999impl wkt::message::Message for PigJob {
8000 fn typename() -> &'static str {
8001 "type.googleapis.com/google.cloud.dataproc.v1.PigJob"
8002 }
8003}
8004
8005pub mod pig_job {
8007 #[allow(unused_imports)]
8008 use super::*;
8009
8010 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8013 #[serde(rename_all = "camelCase")]
8014 #[non_exhaustive]
8015 pub enum Queries {
8016 QueryFileUri(std::string::String),
8018 QueryList(std::boxed::Box<crate::model::QueryList>),
8020 }
8021}
8022
8023#[serde_with::serde_as]
8027#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8028#[serde(default, rename_all = "camelCase")]
8029#[non_exhaustive]
8030pub struct SparkRJob {
8031 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8034 pub main_r_file_uri: std::string::String,
8035
8036 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8040 pub args: std::vec::Vec<std::string::String>,
8041
8042 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8045 pub file_uris: std::vec::Vec<std::string::String>,
8046
8047 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8051 pub archive_uris: std::vec::Vec<std::string::String>,
8052
8053 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8058 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
8059
8060 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8062 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
8063
8064 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8065 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8066}
8067
8068impl SparkRJob {
8069 pub fn new() -> Self {
8070 std::default::Default::default()
8071 }
8072
8073 pub fn set_main_r_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8075 self.main_r_file_uri = v.into();
8076 self
8077 }
8078
8079 pub fn set_logging_config<
8081 T: std::convert::Into<std::option::Option<crate::model::LoggingConfig>>,
8082 >(
8083 mut self,
8084 v: T,
8085 ) -> Self {
8086 self.logging_config = v.into();
8087 self
8088 }
8089
8090 pub fn set_args<T, V>(mut self, v: T) -> Self
8092 where
8093 T: std::iter::IntoIterator<Item = V>,
8094 V: std::convert::Into<std::string::String>,
8095 {
8096 use std::iter::Iterator;
8097 self.args = v.into_iter().map(|i| i.into()).collect();
8098 self
8099 }
8100
8101 pub fn set_file_uris<T, V>(mut self, v: T) -> Self
8103 where
8104 T: std::iter::IntoIterator<Item = V>,
8105 V: std::convert::Into<std::string::String>,
8106 {
8107 use std::iter::Iterator;
8108 self.file_uris = v.into_iter().map(|i| i.into()).collect();
8109 self
8110 }
8111
8112 pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
8114 where
8115 T: std::iter::IntoIterator<Item = V>,
8116 V: std::convert::Into<std::string::String>,
8117 {
8118 use std::iter::Iterator;
8119 self.archive_uris = v.into_iter().map(|i| i.into()).collect();
8120 self
8121 }
8122
8123 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
8125 where
8126 T: std::iter::IntoIterator<Item = (K, V)>,
8127 K: std::convert::Into<std::string::String>,
8128 V: std::convert::Into<std::string::String>,
8129 {
8130 use std::iter::Iterator;
8131 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8132 self
8133 }
8134}
8135
8136impl wkt::message::Message for SparkRJob {
8137 fn typename() -> &'static str {
8138 "type.googleapis.com/google.cloud.dataproc.v1.SparkRJob"
8139 }
8140}
8141
8142#[serde_with::serde_as]
8148#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8149#[serde(default, rename_all = "camelCase")]
8150#[non_exhaustive]
8151pub struct PrestoJob {
8152 pub continue_on_failure: bool,
8156
8157 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8160 pub output_format: std::string::String,
8161
8162 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8164 pub client_tags: std::vec::Vec<std::string::String>,
8165
8166 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8170 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
8171
8172 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8174 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
8175
8176 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
8179 pub queries: std::option::Option<crate::model::presto_job::Queries>,
8180
8181 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8182 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8183}
8184
8185impl PrestoJob {
8186 pub fn new() -> Self {
8187 std::default::Default::default()
8188 }
8189
8190 pub fn set_continue_on_failure<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8192 self.continue_on_failure = v.into();
8193 self
8194 }
8195
8196 pub fn set_output_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8198 self.output_format = v.into();
8199 self
8200 }
8201
8202 pub fn set_logging_config<
8204 T: std::convert::Into<std::option::Option<crate::model::LoggingConfig>>,
8205 >(
8206 mut self,
8207 v: T,
8208 ) -> Self {
8209 self.logging_config = v.into();
8210 self
8211 }
8212
8213 pub fn set_client_tags<T, V>(mut self, v: T) -> Self
8215 where
8216 T: std::iter::IntoIterator<Item = V>,
8217 V: std::convert::Into<std::string::String>,
8218 {
8219 use std::iter::Iterator;
8220 self.client_tags = v.into_iter().map(|i| i.into()).collect();
8221 self
8222 }
8223
8224 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
8226 where
8227 T: std::iter::IntoIterator<Item = (K, V)>,
8228 K: std::convert::Into<std::string::String>,
8229 V: std::convert::Into<std::string::String>,
8230 {
8231 use std::iter::Iterator;
8232 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8233 self
8234 }
8235
8236 pub fn set_queries<
8241 T: std::convert::Into<std::option::Option<crate::model::presto_job::Queries>>,
8242 >(
8243 mut self,
8244 v: T,
8245 ) -> Self {
8246 self.queries = v.into();
8247 self
8248 }
8249
8250 pub fn query_file_uri(&self) -> std::option::Option<&std::string::String> {
8254 #[allow(unreachable_patterns)]
8255 self.queries.as_ref().and_then(|v| match v {
8256 crate::model::presto_job::Queries::QueryFileUri(v) => std::option::Option::Some(v),
8257 _ => std::option::Option::None,
8258 })
8259 }
8260
8261 pub fn query_list(&self) -> std::option::Option<&std::boxed::Box<crate::model::QueryList>> {
8265 #[allow(unreachable_patterns)]
8266 self.queries.as_ref().and_then(|v| match v {
8267 crate::model::presto_job::Queries::QueryList(v) => std::option::Option::Some(v),
8268 _ => std::option::Option::None,
8269 })
8270 }
8271
8272 pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8278 self.queries =
8279 std::option::Option::Some(crate::model::presto_job::Queries::QueryFileUri(v.into()));
8280 self
8281 }
8282
8283 pub fn set_query_list<T: std::convert::Into<std::boxed::Box<crate::model::QueryList>>>(
8289 mut self,
8290 v: T,
8291 ) -> Self {
8292 self.queries =
8293 std::option::Option::Some(crate::model::presto_job::Queries::QueryList(v.into()));
8294 self
8295 }
8296}
8297
8298impl wkt::message::Message for PrestoJob {
8299 fn typename() -> &'static str {
8300 "type.googleapis.com/google.cloud.dataproc.v1.PrestoJob"
8301 }
8302}
8303
8304pub mod presto_job {
8306 #[allow(unused_imports)]
8307 use super::*;
8308
8309 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8312 #[serde(rename_all = "camelCase")]
8313 #[non_exhaustive]
8314 pub enum Queries {
8315 QueryFileUri(std::string::String),
8317 QueryList(std::boxed::Box<crate::model::QueryList>),
8319 }
8320}
8321
8322#[serde_with::serde_as]
8328#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8329#[serde(default, rename_all = "camelCase")]
8330#[non_exhaustive]
8331pub struct TrinoJob {
8332 pub continue_on_failure: bool,
8336
8337 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8340 pub output_format: std::string::String,
8341
8342 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8344 pub client_tags: std::vec::Vec<std::string::String>,
8345
8346 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8350 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
8351
8352 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8354 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
8355
8356 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
8359 pub queries: std::option::Option<crate::model::trino_job::Queries>,
8360
8361 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8362 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8363}
8364
8365impl TrinoJob {
8366 pub fn new() -> Self {
8367 std::default::Default::default()
8368 }
8369
8370 pub fn set_continue_on_failure<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8372 self.continue_on_failure = v.into();
8373 self
8374 }
8375
8376 pub fn set_output_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8378 self.output_format = v.into();
8379 self
8380 }
8381
8382 pub fn set_logging_config<
8384 T: std::convert::Into<std::option::Option<crate::model::LoggingConfig>>,
8385 >(
8386 mut self,
8387 v: T,
8388 ) -> Self {
8389 self.logging_config = v.into();
8390 self
8391 }
8392
8393 pub fn set_client_tags<T, V>(mut self, v: T) -> Self
8395 where
8396 T: std::iter::IntoIterator<Item = V>,
8397 V: std::convert::Into<std::string::String>,
8398 {
8399 use std::iter::Iterator;
8400 self.client_tags = v.into_iter().map(|i| i.into()).collect();
8401 self
8402 }
8403
8404 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
8406 where
8407 T: std::iter::IntoIterator<Item = (K, V)>,
8408 K: std::convert::Into<std::string::String>,
8409 V: std::convert::Into<std::string::String>,
8410 {
8411 use std::iter::Iterator;
8412 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8413 self
8414 }
8415
8416 pub fn set_queries<
8421 T: std::convert::Into<std::option::Option<crate::model::trino_job::Queries>>,
8422 >(
8423 mut self,
8424 v: T,
8425 ) -> Self {
8426 self.queries = v.into();
8427 self
8428 }
8429
8430 pub fn query_file_uri(&self) -> std::option::Option<&std::string::String> {
8434 #[allow(unreachable_patterns)]
8435 self.queries.as_ref().and_then(|v| match v {
8436 crate::model::trino_job::Queries::QueryFileUri(v) => std::option::Option::Some(v),
8437 _ => std::option::Option::None,
8438 })
8439 }
8440
8441 pub fn query_list(&self) -> std::option::Option<&std::boxed::Box<crate::model::QueryList>> {
8445 #[allow(unreachable_patterns)]
8446 self.queries.as_ref().and_then(|v| match v {
8447 crate::model::trino_job::Queries::QueryList(v) => std::option::Option::Some(v),
8448 _ => std::option::Option::None,
8449 })
8450 }
8451
8452 pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8458 self.queries =
8459 std::option::Option::Some(crate::model::trino_job::Queries::QueryFileUri(v.into()));
8460 self
8461 }
8462
8463 pub fn set_query_list<T: std::convert::Into<std::boxed::Box<crate::model::QueryList>>>(
8469 mut self,
8470 v: T,
8471 ) -> Self {
8472 self.queries =
8473 std::option::Option::Some(crate::model::trino_job::Queries::QueryList(v.into()));
8474 self
8475 }
8476}
8477
8478impl wkt::message::Message for TrinoJob {
8479 fn typename() -> &'static str {
8480 "type.googleapis.com/google.cloud.dataproc.v1.TrinoJob"
8481 }
8482}
8483
8484pub mod trino_job {
8486 #[allow(unused_imports)]
8487 use super::*;
8488
8489 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8492 #[serde(rename_all = "camelCase")]
8493 #[non_exhaustive]
8494 pub enum Queries {
8495 QueryFileUri(std::string::String),
8497 QueryList(std::boxed::Box<crate::model::QueryList>),
8499 }
8500}
8501
8502#[serde_with::serde_as]
8504#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8505#[serde(default, rename_all = "camelCase")]
8506#[non_exhaustive]
8507pub struct FlinkJob {
8508 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8512 pub args: std::vec::Vec<std::string::String>,
8513
8514 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
8517 pub jar_file_uris: std::vec::Vec<std::string::String>,
8518
8519 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8522 pub savepoint_uri: std::string::String,
8523
8524 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8529 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
8530
8531 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8533 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
8534
8535 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
8545 pub driver: std::option::Option<crate::model::flink_job::Driver>,
8546
8547 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8548 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8549}
8550
8551impl FlinkJob {
8552 pub fn new() -> Self {
8553 std::default::Default::default()
8554 }
8555
8556 pub fn set_savepoint_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8558 self.savepoint_uri = v.into();
8559 self
8560 }
8561
8562 pub fn set_logging_config<
8564 T: std::convert::Into<std::option::Option<crate::model::LoggingConfig>>,
8565 >(
8566 mut self,
8567 v: T,
8568 ) -> Self {
8569 self.logging_config = v.into();
8570 self
8571 }
8572
8573 pub fn set_args<T, V>(mut self, v: T) -> Self
8575 where
8576 T: std::iter::IntoIterator<Item = V>,
8577 V: std::convert::Into<std::string::String>,
8578 {
8579 use std::iter::Iterator;
8580 self.args = v.into_iter().map(|i| i.into()).collect();
8581 self
8582 }
8583
8584 pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
8586 where
8587 T: std::iter::IntoIterator<Item = V>,
8588 V: std::convert::Into<std::string::String>,
8589 {
8590 use std::iter::Iterator;
8591 self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
8592 self
8593 }
8594
8595 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
8597 where
8598 T: std::iter::IntoIterator<Item = (K, V)>,
8599 K: std::convert::Into<std::string::String>,
8600 V: std::convert::Into<std::string::String>,
8601 {
8602 use std::iter::Iterator;
8603 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8604 self
8605 }
8606
8607 pub fn set_driver<
8612 T: std::convert::Into<std::option::Option<crate::model::flink_job::Driver>>,
8613 >(
8614 mut self,
8615 v: T,
8616 ) -> Self {
8617 self.driver = v.into();
8618 self
8619 }
8620
8621 pub fn main_jar_file_uri(&self) -> std::option::Option<&std::string::String> {
8625 #[allow(unreachable_patterns)]
8626 self.driver.as_ref().and_then(|v| match v {
8627 crate::model::flink_job::Driver::MainJarFileUri(v) => std::option::Option::Some(v),
8628 _ => std::option::Option::None,
8629 })
8630 }
8631
8632 pub fn main_class(&self) -> std::option::Option<&std::string::String> {
8636 #[allow(unreachable_patterns)]
8637 self.driver.as_ref().and_then(|v| match v {
8638 crate::model::flink_job::Driver::MainClass(v) => std::option::Option::Some(v),
8639 _ => std::option::Option::None,
8640 })
8641 }
8642
8643 pub fn set_main_jar_file_uri<T: std::convert::Into<std::string::String>>(
8649 mut self,
8650 v: T,
8651 ) -> Self {
8652 self.driver =
8653 std::option::Option::Some(crate::model::flink_job::Driver::MainJarFileUri(v.into()));
8654 self
8655 }
8656
8657 pub fn set_main_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8663 self.driver =
8664 std::option::Option::Some(crate::model::flink_job::Driver::MainClass(v.into()));
8665 self
8666 }
8667}
8668
8669impl wkt::message::Message for FlinkJob {
8670 fn typename() -> &'static str {
8671 "type.googleapis.com/google.cloud.dataproc.v1.FlinkJob"
8672 }
8673}
8674
8675pub mod flink_job {
8677 #[allow(unused_imports)]
8678 use super::*;
8679
8680 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8690 #[serde(rename_all = "camelCase")]
8691 #[non_exhaustive]
8692 pub enum Driver {
8693 MainJarFileUri(std::string::String),
8695 MainClass(std::string::String),
8701 }
8702}
8703
8704#[serde_with::serde_as]
8706#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8707#[serde(default, rename_all = "camelCase")]
8708#[non_exhaustive]
8709pub struct JobPlacement {
8710 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8712 pub cluster_name: std::string::String,
8713
8714 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8717 pub cluster_uuid: std::string::String,
8718
8719 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
8722 pub cluster_labels: std::collections::HashMap<std::string::String, std::string::String>,
8723
8724 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8725 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8726}
8727
8728impl JobPlacement {
8729 pub fn new() -> Self {
8730 std::default::Default::default()
8731 }
8732
8733 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8735 self.cluster_name = v.into();
8736 self
8737 }
8738
8739 pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8741 self.cluster_uuid = v.into();
8742 self
8743 }
8744
8745 pub fn set_cluster_labels<T, K, V>(mut self, v: T) -> Self
8747 where
8748 T: std::iter::IntoIterator<Item = (K, V)>,
8749 K: std::convert::Into<std::string::String>,
8750 V: std::convert::Into<std::string::String>,
8751 {
8752 use std::iter::Iterator;
8753 self.cluster_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8754 self
8755 }
8756}
8757
8758impl wkt::message::Message for JobPlacement {
8759 fn typename() -> &'static str {
8760 "type.googleapis.com/google.cloud.dataproc.v1.JobPlacement"
8761 }
8762}
8763
8764#[serde_with::serde_as]
8766#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
8767#[serde(default, rename_all = "camelCase")]
8768#[non_exhaustive]
8769pub struct JobStatus {
8770 pub state: crate::model::job_status::State,
8772
8773 #[serde(skip_serializing_if = "std::string::String::is_empty")]
8776 pub details: std::string::String,
8777
8778 #[serde(skip_serializing_if = "std::option::Option::is_none")]
8780 pub state_start_time: std::option::Option<wkt::Timestamp>,
8781
8782 pub substate: crate::model::job_status::Substate,
8785
8786 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
8787 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8788}
8789
8790impl JobStatus {
8791 pub fn new() -> Self {
8792 std::default::Default::default()
8793 }
8794
8795 pub fn set_state<T: std::convert::Into<crate::model::job_status::State>>(
8797 mut self,
8798 v: T,
8799 ) -> Self {
8800 self.state = v.into();
8801 self
8802 }
8803
8804 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8806 self.details = v.into();
8807 self
8808 }
8809
8810 pub fn set_state_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
8812 mut self,
8813 v: T,
8814 ) -> Self {
8815 self.state_start_time = v.into();
8816 self
8817 }
8818
8819 pub fn set_substate<T: std::convert::Into<crate::model::job_status::Substate>>(
8821 mut self,
8822 v: T,
8823 ) -> Self {
8824 self.substate = v.into();
8825 self
8826 }
8827}
8828
8829impl wkt::message::Message for JobStatus {
8830 fn typename() -> &'static str {
8831 "type.googleapis.com/google.cloud.dataproc.v1.JobStatus"
8832 }
8833}
8834
8835pub mod job_status {
8837 #[allow(unused_imports)]
8838 use super::*;
8839
8840 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8842 pub struct State(i32);
8843
8844 impl State {
8845 pub const STATE_UNSPECIFIED: State = State::new(0);
8847
8848 pub const PENDING: State = State::new(1);
8850
8851 pub const SETUP_DONE: State = State::new(8);
8854
8855 pub const RUNNING: State = State::new(2);
8857
8858 pub const CANCEL_PENDING: State = State::new(3);
8860
8861 pub const CANCEL_STARTED: State = State::new(7);
8864
8865 pub const CANCELLED: State = State::new(4);
8867
8868 pub const DONE: State = State::new(5);
8870
8871 pub const ERROR: State = State::new(6);
8873
8874 pub const ATTEMPT_FAILURE: State = State::new(9);
8879
8880 pub(crate) const fn new(value: i32) -> Self {
8882 Self(value)
8883 }
8884
8885 pub fn value(&self) -> i32 {
8887 self.0
8888 }
8889
8890 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
8892 match self.0 {
8893 0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
8894 1 => std::borrow::Cow::Borrowed("PENDING"),
8895 2 => std::borrow::Cow::Borrowed("RUNNING"),
8896 3 => std::borrow::Cow::Borrowed("CANCEL_PENDING"),
8897 4 => std::borrow::Cow::Borrowed("CANCELLED"),
8898 5 => std::borrow::Cow::Borrowed("DONE"),
8899 6 => std::borrow::Cow::Borrowed("ERROR"),
8900 7 => std::borrow::Cow::Borrowed("CANCEL_STARTED"),
8901 8 => std::borrow::Cow::Borrowed("SETUP_DONE"),
8902 9 => std::borrow::Cow::Borrowed("ATTEMPT_FAILURE"),
8903 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
8904 }
8905 }
8906
8907 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
8909 match name {
8910 "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
8911 "PENDING" => std::option::Option::Some(Self::PENDING),
8912 "SETUP_DONE" => std::option::Option::Some(Self::SETUP_DONE),
8913 "RUNNING" => std::option::Option::Some(Self::RUNNING),
8914 "CANCEL_PENDING" => std::option::Option::Some(Self::CANCEL_PENDING),
8915 "CANCEL_STARTED" => std::option::Option::Some(Self::CANCEL_STARTED),
8916 "CANCELLED" => std::option::Option::Some(Self::CANCELLED),
8917 "DONE" => std::option::Option::Some(Self::DONE),
8918 "ERROR" => std::option::Option::Some(Self::ERROR),
8919 "ATTEMPT_FAILURE" => std::option::Option::Some(Self::ATTEMPT_FAILURE),
8920 _ => std::option::Option::None,
8921 }
8922 }
8923 }
8924
8925 impl std::convert::From<i32> for State {
8926 fn from(value: i32) -> Self {
8927 Self::new(value)
8928 }
8929 }
8930
8931 impl std::default::Default for State {
8932 fn default() -> Self {
8933 Self::new(0)
8934 }
8935 }
8936
8937 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
8939 pub struct Substate(i32);
8940
8941 impl Substate {
8942 pub const UNSPECIFIED: Substate = Substate::new(0);
8944
8945 pub const SUBMITTED: Substate = Substate::new(1);
8949
8950 pub const QUEUED: Substate = Substate::new(2);
8956
8957 pub const STALE_STATUS: Substate = Substate::new(3);
8963
8964 pub(crate) const fn new(value: i32) -> Self {
8966 Self(value)
8967 }
8968
8969 pub fn value(&self) -> i32 {
8971 self.0
8972 }
8973
8974 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
8976 match self.0 {
8977 0 => std::borrow::Cow::Borrowed("UNSPECIFIED"),
8978 1 => std::borrow::Cow::Borrowed("SUBMITTED"),
8979 2 => std::borrow::Cow::Borrowed("QUEUED"),
8980 3 => std::borrow::Cow::Borrowed("STALE_STATUS"),
8981 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
8982 }
8983 }
8984
8985 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
8987 match name {
8988 "UNSPECIFIED" => std::option::Option::Some(Self::UNSPECIFIED),
8989 "SUBMITTED" => std::option::Option::Some(Self::SUBMITTED),
8990 "QUEUED" => std::option::Option::Some(Self::QUEUED),
8991 "STALE_STATUS" => std::option::Option::Some(Self::STALE_STATUS),
8992 _ => std::option::Option::None,
8993 }
8994 }
8995 }
8996
8997 impl std::convert::From<i32> for Substate {
8998 fn from(value: i32) -> Self {
8999 Self::new(value)
9000 }
9001 }
9002
9003 impl std::default::Default for Substate {
9004 fn default() -> Self {
9005 Self::new(0)
9006 }
9007 }
9008}
9009
9010#[serde_with::serde_as]
9012#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9013#[serde(default, rename_all = "camelCase")]
9014#[non_exhaustive]
9015pub struct JobReference {
9016 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9019 pub project_id: std::string::String,
9020
9021 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9028 pub job_id: std::string::String,
9029
9030 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9031 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9032}
9033
9034impl JobReference {
9035 pub fn new() -> Self {
9036 std::default::Default::default()
9037 }
9038
9039 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9041 self.project_id = v.into();
9042 self
9043 }
9044
9045 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9047 self.job_id = v.into();
9048 self
9049 }
9050}
9051
9052impl wkt::message::Message for JobReference {
9053 fn typename() -> &'static str {
9054 "type.googleapis.com/google.cloud.dataproc.v1.JobReference"
9055 }
9056}
9057
9058#[serde_with::serde_as]
9064#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9065#[serde(default, rename_all = "camelCase")]
9066#[non_exhaustive]
9067pub struct YarnApplication {
9068 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9070 pub name: std::string::String,
9071
9072 pub state: crate::model::yarn_application::State,
9074
9075 pub progress: f32,
9077
9078 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9083 pub tracking_url: std::string::String,
9084
9085 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9086 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9087}
9088
9089impl YarnApplication {
9090 pub fn new() -> Self {
9091 std::default::Default::default()
9092 }
9093
9094 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9096 self.name = v.into();
9097 self
9098 }
9099
9100 pub fn set_state<T: std::convert::Into<crate::model::yarn_application::State>>(
9102 mut self,
9103 v: T,
9104 ) -> Self {
9105 self.state = v.into();
9106 self
9107 }
9108
9109 pub fn set_progress<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
9111 self.progress = v.into();
9112 self
9113 }
9114
9115 pub fn set_tracking_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9117 self.tracking_url = v.into();
9118 self
9119 }
9120}
9121
9122impl wkt::message::Message for YarnApplication {
9123 fn typename() -> &'static str {
9124 "type.googleapis.com/google.cloud.dataproc.v1.YarnApplication"
9125 }
9126}
9127
9128pub mod yarn_application {
9130 #[allow(unused_imports)]
9131 use super::*;
9132
9133 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9136 pub struct State(i32);
9137
9138 impl State {
9139 pub const STATE_UNSPECIFIED: State = State::new(0);
9141
9142 pub const NEW: State = State::new(1);
9144
9145 pub const NEW_SAVING: State = State::new(2);
9147
9148 pub const SUBMITTED: State = State::new(3);
9150
9151 pub const ACCEPTED: State = State::new(4);
9153
9154 pub const RUNNING: State = State::new(5);
9156
9157 pub const FINISHED: State = State::new(6);
9159
9160 pub const FAILED: State = State::new(7);
9162
9163 pub const KILLED: State = State::new(8);
9165
9166 pub(crate) const fn new(value: i32) -> Self {
9168 Self(value)
9169 }
9170
9171 pub fn value(&self) -> i32 {
9173 self.0
9174 }
9175
9176 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
9178 match self.0 {
9179 0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
9180 1 => std::borrow::Cow::Borrowed("NEW"),
9181 2 => std::borrow::Cow::Borrowed("NEW_SAVING"),
9182 3 => std::borrow::Cow::Borrowed("SUBMITTED"),
9183 4 => std::borrow::Cow::Borrowed("ACCEPTED"),
9184 5 => std::borrow::Cow::Borrowed("RUNNING"),
9185 6 => std::borrow::Cow::Borrowed("FINISHED"),
9186 7 => std::borrow::Cow::Borrowed("FAILED"),
9187 8 => std::borrow::Cow::Borrowed("KILLED"),
9188 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
9189 }
9190 }
9191
9192 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
9194 match name {
9195 "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
9196 "NEW" => std::option::Option::Some(Self::NEW),
9197 "NEW_SAVING" => std::option::Option::Some(Self::NEW_SAVING),
9198 "SUBMITTED" => std::option::Option::Some(Self::SUBMITTED),
9199 "ACCEPTED" => std::option::Option::Some(Self::ACCEPTED),
9200 "RUNNING" => std::option::Option::Some(Self::RUNNING),
9201 "FINISHED" => std::option::Option::Some(Self::FINISHED),
9202 "FAILED" => std::option::Option::Some(Self::FAILED),
9203 "KILLED" => std::option::Option::Some(Self::KILLED),
9204 _ => std::option::Option::None,
9205 }
9206 }
9207 }
9208
9209 impl std::convert::From<i32> for State {
9210 fn from(value: i32) -> Self {
9211 Self::new(value)
9212 }
9213 }
9214
9215 impl std::default::Default for State {
9216 fn default() -> Self {
9217 Self::new(0)
9218 }
9219 }
9220}
9221
9222#[serde_with::serde_as]
9224#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9225#[serde(default, rename_all = "camelCase")]
9226#[non_exhaustive]
9227pub struct Job {
9228 #[serde(skip_serializing_if = "std::option::Option::is_none")]
9233 pub reference: std::option::Option<crate::model::JobReference>,
9234
9235 #[serde(skip_serializing_if = "std::option::Option::is_none")]
9238 pub placement: std::option::Option<crate::model::JobPlacement>,
9239
9240 #[serde(skip_serializing_if = "std::option::Option::is_none")]
9244 pub status: std::option::Option<crate::model::JobStatus>,
9245
9246 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
9248 pub status_history: std::vec::Vec<crate::model::JobStatus>,
9249
9250 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
9255 pub yarn_applications: std::vec::Vec<crate::model::YarnApplication>,
9256
9257 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9260 pub driver_output_resource_uri: std::string::String,
9261
9262 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9266 pub driver_control_files_uri: std::string::String,
9267
9268 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
9276 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9277
9278 #[serde(skip_serializing_if = "std::option::Option::is_none")]
9280 pub scheduling: std::option::Option<crate::model::JobScheduling>,
9281
9282 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9286 pub job_uuid: std::string::String,
9287
9288 pub done: bool,
9293
9294 #[serde(skip_serializing_if = "std::option::Option::is_none")]
9296 pub driver_scheduling_config: std::option::Option<crate::model::DriverSchedulingConfig>,
9297
9298 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
9300 pub type_job: std::option::Option<crate::model::job::TypeJob>,
9301
9302 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9303 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9304}
9305
9306impl Job {
9307 pub fn new() -> Self {
9308 std::default::Default::default()
9309 }
9310
9311 pub fn set_reference<T: std::convert::Into<std::option::Option<crate::model::JobReference>>>(
9313 mut self,
9314 v: T,
9315 ) -> Self {
9316 self.reference = v.into();
9317 self
9318 }
9319
9320 pub fn set_placement<T: std::convert::Into<std::option::Option<crate::model::JobPlacement>>>(
9322 mut self,
9323 v: T,
9324 ) -> Self {
9325 self.placement = v.into();
9326 self
9327 }
9328
9329 pub fn set_status<T: std::convert::Into<std::option::Option<crate::model::JobStatus>>>(
9331 mut self,
9332 v: T,
9333 ) -> Self {
9334 self.status = v.into();
9335 self
9336 }
9337
9338 pub fn set_driver_output_resource_uri<T: std::convert::Into<std::string::String>>(
9340 mut self,
9341 v: T,
9342 ) -> Self {
9343 self.driver_output_resource_uri = v.into();
9344 self
9345 }
9346
9347 pub fn set_driver_control_files_uri<T: std::convert::Into<std::string::String>>(
9349 mut self,
9350 v: T,
9351 ) -> Self {
9352 self.driver_control_files_uri = v.into();
9353 self
9354 }
9355
9356 pub fn set_scheduling<
9358 T: std::convert::Into<std::option::Option<crate::model::JobScheduling>>,
9359 >(
9360 mut self,
9361 v: T,
9362 ) -> Self {
9363 self.scheduling = v.into();
9364 self
9365 }
9366
9367 pub fn set_job_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9369 self.job_uuid = v.into();
9370 self
9371 }
9372
9373 pub fn set_done<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9375 self.done = v.into();
9376 self
9377 }
9378
9379 pub fn set_driver_scheduling_config<
9381 T: std::convert::Into<std::option::Option<crate::model::DriverSchedulingConfig>>,
9382 >(
9383 mut self,
9384 v: T,
9385 ) -> Self {
9386 self.driver_scheduling_config = v.into();
9387 self
9388 }
9389
9390 pub fn set_status_history<T, V>(mut self, v: T) -> Self
9392 where
9393 T: std::iter::IntoIterator<Item = V>,
9394 V: std::convert::Into<crate::model::JobStatus>,
9395 {
9396 use std::iter::Iterator;
9397 self.status_history = v.into_iter().map(|i| i.into()).collect();
9398 self
9399 }
9400
9401 pub fn set_yarn_applications<T, V>(mut self, v: T) -> Self
9403 where
9404 T: std::iter::IntoIterator<Item = V>,
9405 V: std::convert::Into<crate::model::YarnApplication>,
9406 {
9407 use std::iter::Iterator;
9408 self.yarn_applications = v.into_iter().map(|i| i.into()).collect();
9409 self
9410 }
9411
9412 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9414 where
9415 T: std::iter::IntoIterator<Item = (K, V)>,
9416 K: std::convert::Into<std::string::String>,
9417 V: std::convert::Into<std::string::String>,
9418 {
9419 use std::iter::Iterator;
9420 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9421 self
9422 }
9423
9424 pub fn set_type_job<T: std::convert::Into<std::option::Option<crate::model::job::TypeJob>>>(
9429 mut self,
9430 v: T,
9431 ) -> Self {
9432 self.type_job = v.into();
9433 self
9434 }
9435
9436 pub fn hadoop_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::HadoopJob>> {
9440 #[allow(unreachable_patterns)]
9441 self.type_job.as_ref().and_then(|v| match v {
9442 crate::model::job::TypeJob::HadoopJob(v) => std::option::Option::Some(v),
9443 _ => std::option::Option::None,
9444 })
9445 }
9446
9447 pub fn spark_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkJob>> {
9451 #[allow(unreachable_patterns)]
9452 self.type_job.as_ref().and_then(|v| match v {
9453 crate::model::job::TypeJob::SparkJob(v) => std::option::Option::Some(v),
9454 _ => std::option::Option::None,
9455 })
9456 }
9457
9458 pub fn pyspark_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PySparkJob>> {
9462 #[allow(unreachable_patterns)]
9463 self.type_job.as_ref().and_then(|v| match v {
9464 crate::model::job::TypeJob::PysparkJob(v) => std::option::Option::Some(v),
9465 _ => std::option::Option::None,
9466 })
9467 }
9468
9469 pub fn hive_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::HiveJob>> {
9473 #[allow(unreachable_patterns)]
9474 self.type_job.as_ref().and_then(|v| match v {
9475 crate::model::job::TypeJob::HiveJob(v) => std::option::Option::Some(v),
9476 _ => std::option::Option::None,
9477 })
9478 }
9479
9480 pub fn pig_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PigJob>> {
9484 #[allow(unreachable_patterns)]
9485 self.type_job.as_ref().and_then(|v| match v {
9486 crate::model::job::TypeJob::PigJob(v) => std::option::Option::Some(v),
9487 _ => std::option::Option::None,
9488 })
9489 }
9490
9491 pub fn spark_r_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkRJob>> {
9495 #[allow(unreachable_patterns)]
9496 self.type_job.as_ref().and_then(|v| match v {
9497 crate::model::job::TypeJob::SparkRJob(v) => std::option::Option::Some(v),
9498 _ => std::option::Option::None,
9499 })
9500 }
9501
9502 pub fn spark_sql_job(
9506 &self,
9507 ) -> std::option::Option<&std::boxed::Box<crate::model::SparkSqlJob>> {
9508 #[allow(unreachable_patterns)]
9509 self.type_job.as_ref().and_then(|v| match v {
9510 crate::model::job::TypeJob::SparkSqlJob(v) => std::option::Option::Some(v),
9511 _ => std::option::Option::None,
9512 })
9513 }
9514
9515 pub fn presto_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PrestoJob>> {
9519 #[allow(unreachable_patterns)]
9520 self.type_job.as_ref().and_then(|v| match v {
9521 crate::model::job::TypeJob::PrestoJob(v) => std::option::Option::Some(v),
9522 _ => std::option::Option::None,
9523 })
9524 }
9525
9526 pub fn trino_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::TrinoJob>> {
9530 #[allow(unreachable_patterns)]
9531 self.type_job.as_ref().and_then(|v| match v {
9532 crate::model::job::TypeJob::TrinoJob(v) => std::option::Option::Some(v),
9533 _ => std::option::Option::None,
9534 })
9535 }
9536
9537 pub fn flink_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::FlinkJob>> {
9541 #[allow(unreachable_patterns)]
9542 self.type_job.as_ref().and_then(|v| match v {
9543 crate::model::job::TypeJob::FlinkJob(v) => std::option::Option::Some(v),
9544 _ => std::option::Option::None,
9545 })
9546 }
9547
9548 pub fn set_hadoop_job<T: std::convert::Into<std::boxed::Box<crate::model::HadoopJob>>>(
9554 mut self,
9555 v: T,
9556 ) -> Self {
9557 self.type_job = std::option::Option::Some(crate::model::job::TypeJob::HadoopJob(v.into()));
9558 self
9559 }
9560
9561 pub fn set_spark_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkJob>>>(
9567 mut self,
9568 v: T,
9569 ) -> Self {
9570 self.type_job = std::option::Option::Some(crate::model::job::TypeJob::SparkJob(v.into()));
9571 self
9572 }
9573
9574 pub fn set_pyspark_job<T: std::convert::Into<std::boxed::Box<crate::model::PySparkJob>>>(
9580 mut self,
9581 v: T,
9582 ) -> Self {
9583 self.type_job = std::option::Option::Some(crate::model::job::TypeJob::PysparkJob(v.into()));
9584 self
9585 }
9586
9587 pub fn set_hive_job<T: std::convert::Into<std::boxed::Box<crate::model::HiveJob>>>(
9593 mut self,
9594 v: T,
9595 ) -> Self {
9596 self.type_job = std::option::Option::Some(crate::model::job::TypeJob::HiveJob(v.into()));
9597 self
9598 }
9599
9600 pub fn set_pig_job<T: std::convert::Into<std::boxed::Box<crate::model::PigJob>>>(
9606 mut self,
9607 v: T,
9608 ) -> Self {
9609 self.type_job = std::option::Option::Some(crate::model::job::TypeJob::PigJob(v.into()));
9610 self
9611 }
9612
9613 pub fn set_spark_r_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkRJob>>>(
9619 mut self,
9620 v: T,
9621 ) -> Self {
9622 self.type_job = std::option::Option::Some(crate::model::job::TypeJob::SparkRJob(v.into()));
9623 self
9624 }
9625
9626 pub fn set_spark_sql_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkSqlJob>>>(
9632 mut self,
9633 v: T,
9634 ) -> Self {
9635 self.type_job =
9636 std::option::Option::Some(crate::model::job::TypeJob::SparkSqlJob(v.into()));
9637 self
9638 }
9639
9640 pub fn set_presto_job<T: std::convert::Into<std::boxed::Box<crate::model::PrestoJob>>>(
9646 mut self,
9647 v: T,
9648 ) -> Self {
9649 self.type_job = std::option::Option::Some(crate::model::job::TypeJob::PrestoJob(v.into()));
9650 self
9651 }
9652
9653 pub fn set_trino_job<T: std::convert::Into<std::boxed::Box<crate::model::TrinoJob>>>(
9659 mut self,
9660 v: T,
9661 ) -> Self {
9662 self.type_job = std::option::Option::Some(crate::model::job::TypeJob::TrinoJob(v.into()));
9663 self
9664 }
9665
9666 pub fn set_flink_job<T: std::convert::Into<std::boxed::Box<crate::model::FlinkJob>>>(
9672 mut self,
9673 v: T,
9674 ) -> Self {
9675 self.type_job = std::option::Option::Some(crate::model::job::TypeJob::FlinkJob(v.into()));
9676 self
9677 }
9678}
9679
9680impl wkt::message::Message for Job {
9681 fn typename() -> &'static str {
9682 "type.googleapis.com/google.cloud.dataproc.v1.Job"
9683 }
9684}
9685
9686pub mod job {
9688 #[allow(unused_imports)]
9689 use super::*;
9690
9691 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
9693 #[serde(rename_all = "camelCase")]
9694 #[non_exhaustive]
9695 pub enum TypeJob {
9696 HadoopJob(std::boxed::Box<crate::model::HadoopJob>),
9698 SparkJob(std::boxed::Box<crate::model::SparkJob>),
9700 PysparkJob(std::boxed::Box<crate::model::PySparkJob>),
9702 HiveJob(std::boxed::Box<crate::model::HiveJob>),
9704 PigJob(std::boxed::Box<crate::model::PigJob>),
9706 SparkRJob(std::boxed::Box<crate::model::SparkRJob>),
9708 SparkSqlJob(std::boxed::Box<crate::model::SparkSqlJob>),
9710 PrestoJob(std::boxed::Box<crate::model::PrestoJob>),
9712 TrinoJob(std::boxed::Box<crate::model::TrinoJob>),
9714 FlinkJob(std::boxed::Box<crate::model::FlinkJob>),
9716 }
9717}
9718
9719#[serde_with::serde_as]
9721#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9722#[serde(default, rename_all = "camelCase")]
9723#[non_exhaustive]
9724pub struct DriverSchedulingConfig {
9725 pub memory_mb: i32,
9727
9728 pub vcores: i32,
9730
9731 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9732 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9733}
9734
9735impl DriverSchedulingConfig {
9736 pub fn new() -> Self {
9737 std::default::Default::default()
9738 }
9739
9740 pub fn set_memory_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9742 self.memory_mb = v.into();
9743 self
9744 }
9745
9746 pub fn set_vcores<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9748 self.vcores = v.into();
9749 self
9750 }
9751}
9752
9753impl wkt::message::Message for DriverSchedulingConfig {
9754 fn typename() -> &'static str {
9755 "type.googleapis.com/google.cloud.dataproc.v1.DriverSchedulingConfig"
9756 }
9757}
9758
9759#[serde_with::serde_as]
9761#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9762#[serde(default, rename_all = "camelCase")]
9763#[non_exhaustive]
9764pub struct JobScheduling {
9765 pub max_failures_per_hour: i32,
9778
9779 pub max_failures_total: i32,
9790
9791 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9792 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9793}
9794
9795impl JobScheduling {
9796 pub fn new() -> Self {
9797 std::default::Default::default()
9798 }
9799
9800 pub fn set_max_failures_per_hour<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9802 self.max_failures_per_hour = v.into();
9803 self
9804 }
9805
9806 pub fn set_max_failures_total<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9808 self.max_failures_total = v.into();
9809 self
9810 }
9811}
9812
9813impl wkt::message::Message for JobScheduling {
9814 fn typename() -> &'static str {
9815 "type.googleapis.com/google.cloud.dataproc.v1.JobScheduling"
9816 }
9817}
9818
9819#[serde_with::serde_as]
9821#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9822#[serde(default, rename_all = "camelCase")]
9823#[non_exhaustive]
9824pub struct SubmitJobRequest {
9825 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9828 pub project_id: std::string::String,
9829
9830 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9832 pub region: std::string::String,
9833
9834 #[serde(skip_serializing_if = "std::option::Option::is_none")]
9836 pub job: std::option::Option<crate::model::Job>,
9837
9838 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9853 pub request_id: std::string::String,
9854
9855 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9856 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9857}
9858
9859impl SubmitJobRequest {
9860 pub fn new() -> Self {
9861 std::default::Default::default()
9862 }
9863
9864 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9866 self.project_id = v.into();
9867 self
9868 }
9869
9870 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9872 self.region = v.into();
9873 self
9874 }
9875
9876 pub fn set_job<T: std::convert::Into<std::option::Option<crate::model::Job>>>(
9878 mut self,
9879 v: T,
9880 ) -> Self {
9881 self.job = v.into();
9882 self
9883 }
9884
9885 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9887 self.request_id = v.into();
9888 self
9889 }
9890}
9891
9892impl wkt::message::Message for SubmitJobRequest {
9893 fn typename() -> &'static str {
9894 "type.googleapis.com/google.cloud.dataproc.v1.SubmitJobRequest"
9895 }
9896}
9897
9898#[serde_with::serde_as]
9900#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9901#[serde(default, rename_all = "camelCase")]
9902#[non_exhaustive]
9903pub struct JobMetadata {
9904 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9906 pub job_id: std::string::String,
9907
9908 #[serde(skip_serializing_if = "std::option::Option::is_none")]
9910 pub status: std::option::Option<crate::model::JobStatus>,
9911
9912 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9914 pub operation_type: std::string::String,
9915
9916 #[serde(skip_serializing_if = "std::option::Option::is_none")]
9918 pub start_time: std::option::Option<wkt::Timestamp>,
9919
9920 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9921 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9922}
9923
9924impl JobMetadata {
9925 pub fn new() -> Self {
9926 std::default::Default::default()
9927 }
9928
9929 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9931 self.job_id = v.into();
9932 self
9933 }
9934
9935 pub fn set_status<T: std::convert::Into<std::option::Option<crate::model::JobStatus>>>(
9937 mut self,
9938 v: T,
9939 ) -> Self {
9940 self.status = v.into();
9941 self
9942 }
9943
9944 pub fn set_operation_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9946 self.operation_type = v.into();
9947 self
9948 }
9949
9950 pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
9952 mut self,
9953 v: T,
9954 ) -> Self {
9955 self.start_time = v.into();
9956 self
9957 }
9958}
9959
9960impl wkt::message::Message for JobMetadata {
9961 fn typename() -> &'static str {
9962 "type.googleapis.com/google.cloud.dataproc.v1.JobMetadata"
9963 }
9964}
9965
9966#[serde_with::serde_as]
9968#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
9969#[serde(default, rename_all = "camelCase")]
9970#[non_exhaustive]
9971pub struct GetJobRequest {
9972 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9975 pub project_id: std::string::String,
9976
9977 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9979 pub region: std::string::String,
9980
9981 #[serde(skip_serializing_if = "std::string::String::is_empty")]
9983 pub job_id: std::string::String,
9984
9985 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
9986 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9987}
9988
9989impl GetJobRequest {
9990 pub fn new() -> Self {
9991 std::default::Default::default()
9992 }
9993
9994 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9996 self.project_id = v.into();
9997 self
9998 }
9999
10000 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10002 self.region = v.into();
10003 self
10004 }
10005
10006 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10008 self.job_id = v.into();
10009 self
10010 }
10011}
10012
10013impl wkt::message::Message for GetJobRequest {
10014 fn typename() -> &'static str {
10015 "type.googleapis.com/google.cloud.dataproc.v1.GetJobRequest"
10016 }
10017}
10018
10019#[serde_with::serde_as]
10021#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10022#[serde(default, rename_all = "camelCase")]
10023#[non_exhaustive]
10024pub struct ListJobsRequest {
10025 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10028 pub project_id: std::string::String,
10029
10030 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10032 pub region: std::string::String,
10033
10034 pub page_size: i32,
10036
10037 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10040 pub page_token: std::string::String,
10041
10042 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10045 pub cluster_name: std::string::String,
10046
10047 pub job_state_matcher: crate::model::list_jobs_request::JobStateMatcher,
10052
10053 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10068 pub filter: std::string::String,
10069
10070 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10071 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10072}
10073
10074impl ListJobsRequest {
10075 pub fn new() -> Self {
10076 std::default::Default::default()
10077 }
10078
10079 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10081 self.project_id = v.into();
10082 self
10083 }
10084
10085 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10087 self.region = v.into();
10088 self
10089 }
10090
10091 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10093 self.page_size = v.into();
10094 self
10095 }
10096
10097 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10099 self.page_token = v.into();
10100 self
10101 }
10102
10103 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10105 self.cluster_name = v.into();
10106 self
10107 }
10108
10109 pub fn set_job_state_matcher<
10111 T: std::convert::Into<crate::model::list_jobs_request::JobStateMatcher>,
10112 >(
10113 mut self,
10114 v: T,
10115 ) -> Self {
10116 self.job_state_matcher = v.into();
10117 self
10118 }
10119
10120 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10122 self.filter = v.into();
10123 self
10124 }
10125}
10126
10127impl wkt::message::Message for ListJobsRequest {
10128 fn typename() -> &'static str {
10129 "type.googleapis.com/google.cloud.dataproc.v1.ListJobsRequest"
10130 }
10131}
10132
10133pub mod list_jobs_request {
10135 #[allow(unused_imports)]
10136 use super::*;
10137
10138 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
10140 pub struct JobStateMatcher(i32);
10141
10142 impl JobStateMatcher {
10143 pub const ALL: JobStateMatcher = JobStateMatcher::new(0);
10145
10146 pub const ACTIVE: JobStateMatcher = JobStateMatcher::new(1);
10149
10150 pub const NON_ACTIVE: JobStateMatcher = JobStateMatcher::new(2);
10152
10153 pub(crate) const fn new(value: i32) -> Self {
10155 Self(value)
10156 }
10157
10158 pub fn value(&self) -> i32 {
10160 self.0
10161 }
10162
10163 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
10165 match self.0 {
10166 0 => std::borrow::Cow::Borrowed("ALL"),
10167 1 => std::borrow::Cow::Borrowed("ACTIVE"),
10168 2 => std::borrow::Cow::Borrowed("NON_ACTIVE"),
10169 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
10170 }
10171 }
10172
10173 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
10175 match name {
10176 "ALL" => std::option::Option::Some(Self::ALL),
10177 "ACTIVE" => std::option::Option::Some(Self::ACTIVE),
10178 "NON_ACTIVE" => std::option::Option::Some(Self::NON_ACTIVE),
10179 _ => std::option::Option::None,
10180 }
10181 }
10182 }
10183
10184 impl std::convert::From<i32> for JobStateMatcher {
10185 fn from(value: i32) -> Self {
10186 Self::new(value)
10187 }
10188 }
10189
10190 impl std::default::Default for JobStateMatcher {
10191 fn default() -> Self {
10192 Self::new(0)
10193 }
10194 }
10195}
10196
10197#[serde_with::serde_as]
10199#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10200#[serde(default, rename_all = "camelCase")]
10201#[non_exhaustive]
10202pub struct UpdateJobRequest {
10203 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10206 pub project_id: std::string::String,
10207
10208 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10210 pub region: std::string::String,
10211
10212 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10214 pub job_id: std::string::String,
10215
10216 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10218 pub job: std::option::Option<crate::model::Job>,
10219
10220 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10227 pub update_mask: std::option::Option<wkt::FieldMask>,
10228
10229 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10230 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10231}
10232
10233impl UpdateJobRequest {
10234 pub fn new() -> Self {
10235 std::default::Default::default()
10236 }
10237
10238 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10240 self.project_id = v.into();
10241 self
10242 }
10243
10244 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10246 self.region = v.into();
10247 self
10248 }
10249
10250 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10252 self.job_id = v.into();
10253 self
10254 }
10255
10256 pub fn set_job<T: std::convert::Into<std::option::Option<crate::model::Job>>>(
10258 mut self,
10259 v: T,
10260 ) -> Self {
10261 self.job = v.into();
10262 self
10263 }
10264
10265 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
10267 mut self,
10268 v: T,
10269 ) -> Self {
10270 self.update_mask = v.into();
10271 self
10272 }
10273}
10274
10275impl wkt::message::Message for UpdateJobRequest {
10276 fn typename() -> &'static str {
10277 "type.googleapis.com/google.cloud.dataproc.v1.UpdateJobRequest"
10278 }
10279}
10280
10281#[serde_with::serde_as]
10283#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10284#[serde(default, rename_all = "camelCase")]
10285#[non_exhaustive]
10286pub struct ListJobsResponse {
10287 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
10289 pub jobs: std::vec::Vec<crate::model::Job>,
10290
10291 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10295 pub next_page_token: std::string::String,
10296
10297 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
10304 pub unreachable: std::vec::Vec<std::string::String>,
10305
10306 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10307 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10308}
10309
10310impl ListJobsResponse {
10311 pub fn new() -> Self {
10312 std::default::Default::default()
10313 }
10314
10315 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10317 self.next_page_token = v.into();
10318 self
10319 }
10320
10321 pub fn set_jobs<T, V>(mut self, v: T) -> Self
10323 where
10324 T: std::iter::IntoIterator<Item = V>,
10325 V: std::convert::Into<crate::model::Job>,
10326 {
10327 use std::iter::Iterator;
10328 self.jobs = v.into_iter().map(|i| i.into()).collect();
10329 self
10330 }
10331
10332 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10334 where
10335 T: std::iter::IntoIterator<Item = V>,
10336 V: std::convert::Into<std::string::String>,
10337 {
10338 use std::iter::Iterator;
10339 self.unreachable = v.into_iter().map(|i| i.into()).collect();
10340 self
10341 }
10342}
10343
10344impl wkt::message::Message for ListJobsResponse {
10345 fn typename() -> &'static str {
10346 "type.googleapis.com/google.cloud.dataproc.v1.ListJobsResponse"
10347 }
10348}
10349
10350#[doc(hidden)]
10351impl gax::paginator::internal::PageableResponse for ListJobsResponse {
10352 type PageItem = crate::model::Job;
10353
10354 fn items(self) -> std::vec::Vec<Self::PageItem> {
10355 self.jobs
10356 }
10357
10358 fn next_page_token(&self) -> std::string::String {
10359 use std::clone::Clone;
10360 self.next_page_token.clone()
10361 }
10362}
10363
10364#[serde_with::serde_as]
10366#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10367#[serde(default, rename_all = "camelCase")]
10368#[non_exhaustive]
10369pub struct CancelJobRequest {
10370 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10373 pub project_id: std::string::String,
10374
10375 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10377 pub region: std::string::String,
10378
10379 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10381 pub job_id: std::string::String,
10382
10383 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10384 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10385}
10386
10387impl CancelJobRequest {
10388 pub fn new() -> Self {
10389 std::default::Default::default()
10390 }
10391
10392 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10394 self.project_id = v.into();
10395 self
10396 }
10397
10398 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10400 self.region = v.into();
10401 self
10402 }
10403
10404 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10406 self.job_id = v.into();
10407 self
10408 }
10409}
10410
10411impl wkt::message::Message for CancelJobRequest {
10412 fn typename() -> &'static str {
10413 "type.googleapis.com/google.cloud.dataproc.v1.CancelJobRequest"
10414 }
10415}
10416
10417#[serde_with::serde_as]
10419#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10420#[serde(default, rename_all = "camelCase")]
10421#[non_exhaustive]
10422pub struct DeleteJobRequest {
10423 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10426 pub project_id: std::string::String,
10427
10428 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10430 pub region: std::string::String,
10431
10432 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10434 pub job_id: std::string::String,
10435
10436 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10437 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10438}
10439
10440impl DeleteJobRequest {
10441 pub fn new() -> Self {
10442 std::default::Default::default()
10443 }
10444
10445 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10447 self.project_id = v.into();
10448 self
10449 }
10450
10451 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10453 self.region = v.into();
10454 self
10455 }
10456
10457 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10459 self.job_id = v.into();
10460 self
10461 }
10462}
10463
10464impl wkt::message::Message for DeleteJobRequest {
10465 fn typename() -> &'static str {
10466 "type.googleapis.com/google.cloud.dataproc.v1.DeleteJobRequest"
10467 }
10468}
10469
10470#[serde_with::serde_as]
10472#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10473#[serde(default, rename_all = "camelCase")]
10474#[non_exhaustive]
10475pub struct CreateNodeGroupRequest {
10476 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10479 pub parent: std::string::String,
10480
10481 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10483 pub node_group: std::option::Option<crate::model::NodeGroup>,
10484
10485 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10491 pub node_group_id: std::string::String,
10492
10493 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10508 pub request_id: std::string::String,
10509
10510 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10511 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10512}
10513
10514impl CreateNodeGroupRequest {
10515 pub fn new() -> Self {
10516 std::default::Default::default()
10517 }
10518
10519 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10521 self.parent = v.into();
10522 self
10523 }
10524
10525 pub fn set_node_group<T: std::convert::Into<std::option::Option<crate::model::NodeGroup>>>(
10527 mut self,
10528 v: T,
10529 ) -> Self {
10530 self.node_group = v.into();
10531 self
10532 }
10533
10534 pub fn set_node_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10536 self.node_group_id = v.into();
10537 self
10538 }
10539
10540 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10542 self.request_id = v.into();
10543 self
10544 }
10545}
10546
10547impl wkt::message::Message for CreateNodeGroupRequest {
10548 fn typename() -> &'static str {
10549 "type.googleapis.com/google.cloud.dataproc.v1.CreateNodeGroupRequest"
10550 }
10551}
10552
10553#[serde_with::serde_as]
10555#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10556#[serde(default, rename_all = "camelCase")]
10557#[non_exhaustive]
10558pub struct ResizeNodeGroupRequest {
10559 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10563 pub name: std::string::String,
10564
10565 pub size: i32,
10569
10570 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10585 pub request_id: std::string::String,
10586
10587 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10600 pub graceful_decommission_timeout: std::option::Option<wkt::Duration>,
10601
10602 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10603 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10604}
10605
10606impl ResizeNodeGroupRequest {
10607 pub fn new() -> Self {
10608 std::default::Default::default()
10609 }
10610
10611 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10613 self.name = v.into();
10614 self
10615 }
10616
10617 pub fn set_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10619 self.size = v.into();
10620 self
10621 }
10622
10623 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10625 self.request_id = v.into();
10626 self
10627 }
10628
10629 pub fn set_graceful_decommission_timeout<
10631 T: std::convert::Into<std::option::Option<wkt::Duration>>,
10632 >(
10633 mut self,
10634 v: T,
10635 ) -> Self {
10636 self.graceful_decommission_timeout = v.into();
10637 self
10638 }
10639}
10640
10641impl wkt::message::Message for ResizeNodeGroupRequest {
10642 fn typename() -> &'static str {
10643 "type.googleapis.com/google.cloud.dataproc.v1.ResizeNodeGroupRequest"
10644 }
10645}
10646
10647#[serde_with::serde_as]
10649#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10650#[serde(default, rename_all = "camelCase")]
10651#[non_exhaustive]
10652pub struct GetNodeGroupRequest {
10653 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10657 pub name: std::string::String,
10658
10659 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10660 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10661}
10662
10663impl GetNodeGroupRequest {
10664 pub fn new() -> Self {
10665 std::default::Default::default()
10666 }
10667
10668 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10670 self.name = v.into();
10671 self
10672 }
10673}
10674
10675impl wkt::message::Message for GetNodeGroupRequest {
10676 fn typename() -> &'static str {
10677 "type.googleapis.com/google.cloud.dataproc.v1.GetNodeGroupRequest"
10678 }
10679}
10680
10681#[serde_with::serde_as]
10683#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10684#[serde(default, rename_all = "camelCase")]
10685#[non_exhaustive]
10686pub struct BatchOperationMetadata {
10687 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10689 pub batch: std::string::String,
10690
10691 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10693 pub batch_uuid: std::string::String,
10694
10695 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10697 pub create_time: std::option::Option<wkt::Timestamp>,
10698
10699 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10701 pub done_time: std::option::Option<wkt::Timestamp>,
10702
10703 pub operation_type: crate::model::batch_operation_metadata::BatchOperationType,
10705
10706 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10708 pub description: std::string::String,
10709
10710 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
10712 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10713
10714 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
10716 pub warnings: std::vec::Vec<std::string::String>,
10717
10718 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10719 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10720}
10721
10722impl BatchOperationMetadata {
10723 pub fn new() -> Self {
10724 std::default::Default::default()
10725 }
10726
10727 pub fn set_batch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10729 self.batch = v.into();
10730 self
10731 }
10732
10733 pub fn set_batch_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10735 self.batch_uuid = v.into();
10736 self
10737 }
10738
10739 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
10741 mut self,
10742 v: T,
10743 ) -> Self {
10744 self.create_time = v.into();
10745 self
10746 }
10747
10748 pub fn set_done_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
10750 mut self,
10751 v: T,
10752 ) -> Self {
10753 self.done_time = v.into();
10754 self
10755 }
10756
10757 pub fn set_operation_type<
10759 T: std::convert::Into<crate::model::batch_operation_metadata::BatchOperationType>,
10760 >(
10761 mut self,
10762 v: T,
10763 ) -> Self {
10764 self.operation_type = v.into();
10765 self
10766 }
10767
10768 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10770 self.description = v.into();
10771 self
10772 }
10773
10774 pub fn set_warnings<T, V>(mut self, v: T) -> Self
10776 where
10777 T: std::iter::IntoIterator<Item = V>,
10778 V: std::convert::Into<std::string::String>,
10779 {
10780 use std::iter::Iterator;
10781 self.warnings = v.into_iter().map(|i| i.into()).collect();
10782 self
10783 }
10784
10785 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
10787 where
10788 T: std::iter::IntoIterator<Item = (K, V)>,
10789 K: std::convert::Into<std::string::String>,
10790 V: std::convert::Into<std::string::String>,
10791 {
10792 use std::iter::Iterator;
10793 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10794 self
10795 }
10796}
10797
10798impl wkt::message::Message for BatchOperationMetadata {
10799 fn typename() -> &'static str {
10800 "type.googleapis.com/google.cloud.dataproc.v1.BatchOperationMetadata"
10801 }
10802}
10803
10804pub mod batch_operation_metadata {
10806 #[allow(unused_imports)]
10807 use super::*;
10808
10809 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
10811 pub struct BatchOperationType(i32);
10812
10813 impl BatchOperationType {
10814 pub const BATCH_OPERATION_TYPE_UNSPECIFIED: BatchOperationType = BatchOperationType::new(0);
10816
10817 pub const BATCH: BatchOperationType = BatchOperationType::new(1);
10819
10820 pub(crate) const fn new(value: i32) -> Self {
10822 Self(value)
10823 }
10824
10825 pub fn value(&self) -> i32 {
10827 self.0
10828 }
10829
10830 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
10832 match self.0 {
10833 0 => std::borrow::Cow::Borrowed("BATCH_OPERATION_TYPE_UNSPECIFIED"),
10834 1 => std::borrow::Cow::Borrowed("BATCH"),
10835 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
10836 }
10837 }
10838
10839 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
10841 match name {
10842 "BATCH_OPERATION_TYPE_UNSPECIFIED" => {
10843 std::option::Option::Some(Self::BATCH_OPERATION_TYPE_UNSPECIFIED)
10844 }
10845 "BATCH" => std::option::Option::Some(Self::BATCH),
10846 _ => std::option::Option::None,
10847 }
10848 }
10849 }
10850
10851 impl std::convert::From<i32> for BatchOperationType {
10852 fn from(value: i32) -> Self {
10853 Self::new(value)
10854 }
10855 }
10856
10857 impl std::default::Default for BatchOperationType {
10858 fn default() -> Self {
10859 Self::new(0)
10860 }
10861 }
10862}
10863
10864#[serde_with::serde_as]
10866#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
10867#[serde(default, rename_all = "camelCase")]
10868#[non_exhaustive]
10869pub struct SessionOperationMetadata {
10870 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10872 pub session: std::string::String,
10873
10874 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10876 pub session_uuid: std::string::String,
10877
10878 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10880 pub create_time: std::option::Option<wkt::Timestamp>,
10881
10882 #[serde(skip_serializing_if = "std::option::Option::is_none")]
10884 pub done_time: std::option::Option<wkt::Timestamp>,
10885
10886 pub operation_type: crate::model::session_operation_metadata::SessionOperationType,
10888
10889 #[serde(skip_serializing_if = "std::string::String::is_empty")]
10891 pub description: std::string::String,
10892
10893 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
10895 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10896
10897 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
10899 pub warnings: std::vec::Vec<std::string::String>,
10900
10901 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
10902 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10903}
10904
10905impl SessionOperationMetadata {
10906 pub fn new() -> Self {
10907 std::default::Default::default()
10908 }
10909
10910 pub fn set_session<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10912 self.session = v.into();
10913 self
10914 }
10915
10916 pub fn set_session_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10918 self.session_uuid = v.into();
10919 self
10920 }
10921
10922 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
10924 mut self,
10925 v: T,
10926 ) -> Self {
10927 self.create_time = v.into();
10928 self
10929 }
10930
10931 pub fn set_done_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
10933 mut self,
10934 v: T,
10935 ) -> Self {
10936 self.done_time = v.into();
10937 self
10938 }
10939
10940 pub fn set_operation_type<
10942 T: std::convert::Into<crate::model::session_operation_metadata::SessionOperationType>,
10943 >(
10944 mut self,
10945 v: T,
10946 ) -> Self {
10947 self.operation_type = v.into();
10948 self
10949 }
10950
10951 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10953 self.description = v.into();
10954 self
10955 }
10956
10957 pub fn set_warnings<T, V>(mut self, v: T) -> Self
10959 where
10960 T: std::iter::IntoIterator<Item = V>,
10961 V: std::convert::Into<std::string::String>,
10962 {
10963 use std::iter::Iterator;
10964 self.warnings = v.into_iter().map(|i| i.into()).collect();
10965 self
10966 }
10967
10968 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
10970 where
10971 T: std::iter::IntoIterator<Item = (K, V)>,
10972 K: std::convert::Into<std::string::String>,
10973 V: std::convert::Into<std::string::String>,
10974 {
10975 use std::iter::Iterator;
10976 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10977 self
10978 }
10979}
10980
10981impl wkt::message::Message for SessionOperationMetadata {
10982 fn typename() -> &'static str {
10983 "type.googleapis.com/google.cloud.dataproc.v1.SessionOperationMetadata"
10984 }
10985}
10986
10987pub mod session_operation_metadata {
10989 #[allow(unused_imports)]
10990 use super::*;
10991
10992 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
10994 pub struct SessionOperationType(i32);
10995
10996 impl SessionOperationType {
10997 pub const SESSION_OPERATION_TYPE_UNSPECIFIED: SessionOperationType =
10999 SessionOperationType::new(0);
11000
11001 pub const CREATE: SessionOperationType = SessionOperationType::new(1);
11003
11004 pub const TERMINATE: SessionOperationType = SessionOperationType::new(2);
11006
11007 pub const DELETE: SessionOperationType = SessionOperationType::new(3);
11009
11010 pub(crate) const fn new(value: i32) -> Self {
11012 Self(value)
11013 }
11014
11015 pub fn value(&self) -> i32 {
11017 self.0
11018 }
11019
11020 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
11022 match self.0 {
11023 0 => std::borrow::Cow::Borrowed("SESSION_OPERATION_TYPE_UNSPECIFIED"),
11024 1 => std::borrow::Cow::Borrowed("CREATE"),
11025 2 => std::borrow::Cow::Borrowed("TERMINATE"),
11026 3 => std::borrow::Cow::Borrowed("DELETE"),
11027 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
11028 }
11029 }
11030
11031 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
11033 match name {
11034 "SESSION_OPERATION_TYPE_UNSPECIFIED" => {
11035 std::option::Option::Some(Self::SESSION_OPERATION_TYPE_UNSPECIFIED)
11036 }
11037 "CREATE" => std::option::Option::Some(Self::CREATE),
11038 "TERMINATE" => std::option::Option::Some(Self::TERMINATE),
11039 "DELETE" => std::option::Option::Some(Self::DELETE),
11040 _ => std::option::Option::None,
11041 }
11042 }
11043 }
11044
11045 impl std::convert::From<i32> for SessionOperationType {
11046 fn from(value: i32) -> Self {
11047 Self::new(value)
11048 }
11049 }
11050
11051 impl std::default::Default for SessionOperationType {
11052 fn default() -> Self {
11053 Self::new(0)
11054 }
11055 }
11056}
11057
11058#[serde_with::serde_as]
11060#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11061#[serde(default, rename_all = "camelCase")]
11062#[non_exhaustive]
11063pub struct ClusterOperationStatus {
11064 pub state: crate::model::cluster_operation_status::State,
11066
11067 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11069 pub inner_state: std::string::String,
11070
11071 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11073 pub details: std::string::String,
11074
11075 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11077 pub state_start_time: std::option::Option<wkt::Timestamp>,
11078
11079 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11080 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11081}
11082
11083impl ClusterOperationStatus {
11084 pub fn new() -> Self {
11085 std::default::Default::default()
11086 }
11087
11088 pub fn set_state<T: std::convert::Into<crate::model::cluster_operation_status::State>>(
11090 mut self,
11091 v: T,
11092 ) -> Self {
11093 self.state = v.into();
11094 self
11095 }
11096
11097 pub fn set_inner_state<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11099 self.inner_state = v.into();
11100 self
11101 }
11102
11103 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11105 self.details = v.into();
11106 self
11107 }
11108
11109 pub fn set_state_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
11111 mut self,
11112 v: T,
11113 ) -> Self {
11114 self.state_start_time = v.into();
11115 self
11116 }
11117}
11118
11119impl wkt::message::Message for ClusterOperationStatus {
11120 fn typename() -> &'static str {
11121 "type.googleapis.com/google.cloud.dataproc.v1.ClusterOperationStatus"
11122 }
11123}
11124
11125pub mod cluster_operation_status {
11127 #[allow(unused_imports)]
11128 use super::*;
11129
11130 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
11132 pub struct State(i32);
11133
11134 impl State {
11135 pub const UNKNOWN: State = State::new(0);
11137
11138 pub const PENDING: State = State::new(1);
11140
11141 pub const RUNNING: State = State::new(2);
11143
11144 pub const DONE: State = State::new(3);
11146
11147 pub(crate) const fn new(value: i32) -> Self {
11149 Self(value)
11150 }
11151
11152 pub fn value(&self) -> i32 {
11154 self.0
11155 }
11156
11157 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
11159 match self.0 {
11160 0 => std::borrow::Cow::Borrowed("UNKNOWN"),
11161 1 => std::borrow::Cow::Borrowed("PENDING"),
11162 2 => std::borrow::Cow::Borrowed("RUNNING"),
11163 3 => std::borrow::Cow::Borrowed("DONE"),
11164 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
11165 }
11166 }
11167
11168 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
11170 match name {
11171 "UNKNOWN" => std::option::Option::Some(Self::UNKNOWN),
11172 "PENDING" => std::option::Option::Some(Self::PENDING),
11173 "RUNNING" => std::option::Option::Some(Self::RUNNING),
11174 "DONE" => std::option::Option::Some(Self::DONE),
11175 _ => std::option::Option::None,
11176 }
11177 }
11178 }
11179
11180 impl std::convert::From<i32> for State {
11181 fn from(value: i32) -> Self {
11182 Self::new(value)
11183 }
11184 }
11185
11186 impl std::default::Default for State {
11187 fn default() -> Self {
11188 Self::new(0)
11189 }
11190 }
11191}
11192
11193#[serde_with::serde_as]
11195#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11196#[serde(default, rename_all = "camelCase")]
11197#[non_exhaustive]
11198pub struct ClusterOperationMetadata {
11199 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11201 pub cluster_name: std::string::String,
11202
11203 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11205 pub cluster_uuid: std::string::String,
11206
11207 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11209 pub status: std::option::Option<crate::model::ClusterOperationStatus>,
11210
11211 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
11213 pub status_history: std::vec::Vec<crate::model::ClusterOperationStatus>,
11214
11215 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11217 pub operation_type: std::string::String,
11218
11219 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11221 pub description: std::string::String,
11222
11223 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
11225 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11226
11227 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
11229 pub warnings: std::vec::Vec<std::string::String>,
11230
11231 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
11233 pub child_operation_ids: std::vec::Vec<std::string::String>,
11234
11235 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11236 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11237}
11238
11239impl ClusterOperationMetadata {
11240 pub fn new() -> Self {
11241 std::default::Default::default()
11242 }
11243
11244 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11246 self.cluster_name = v.into();
11247 self
11248 }
11249
11250 pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11252 self.cluster_uuid = v.into();
11253 self
11254 }
11255
11256 pub fn set_status<
11258 T: std::convert::Into<std::option::Option<crate::model::ClusterOperationStatus>>,
11259 >(
11260 mut self,
11261 v: T,
11262 ) -> Self {
11263 self.status = v.into();
11264 self
11265 }
11266
11267 pub fn set_operation_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11269 self.operation_type = v.into();
11270 self
11271 }
11272
11273 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11275 self.description = v.into();
11276 self
11277 }
11278
11279 pub fn set_status_history<T, V>(mut self, v: T) -> Self
11281 where
11282 T: std::iter::IntoIterator<Item = V>,
11283 V: std::convert::Into<crate::model::ClusterOperationStatus>,
11284 {
11285 use std::iter::Iterator;
11286 self.status_history = v.into_iter().map(|i| i.into()).collect();
11287 self
11288 }
11289
11290 pub fn set_warnings<T, V>(mut self, v: T) -> Self
11292 where
11293 T: std::iter::IntoIterator<Item = V>,
11294 V: std::convert::Into<std::string::String>,
11295 {
11296 use std::iter::Iterator;
11297 self.warnings = v.into_iter().map(|i| i.into()).collect();
11298 self
11299 }
11300
11301 pub fn set_child_operation_ids<T, V>(mut self, v: T) -> Self
11303 where
11304 T: std::iter::IntoIterator<Item = V>,
11305 V: std::convert::Into<std::string::String>,
11306 {
11307 use std::iter::Iterator;
11308 self.child_operation_ids = v.into_iter().map(|i| i.into()).collect();
11309 self
11310 }
11311
11312 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11314 where
11315 T: std::iter::IntoIterator<Item = (K, V)>,
11316 K: std::convert::Into<std::string::String>,
11317 V: std::convert::Into<std::string::String>,
11318 {
11319 use std::iter::Iterator;
11320 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11321 self
11322 }
11323}
11324
11325impl wkt::message::Message for ClusterOperationMetadata {
11326 fn typename() -> &'static str {
11327 "type.googleapis.com/google.cloud.dataproc.v1.ClusterOperationMetadata"
11328 }
11329}
11330
11331#[serde_with::serde_as]
11333#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11334#[serde(default, rename_all = "camelCase")]
11335#[non_exhaustive]
11336pub struct NodeGroupOperationMetadata {
11337 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11339 pub node_group_id: std::string::String,
11340
11341 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11343 pub cluster_uuid: std::string::String,
11344
11345 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11347 pub status: std::option::Option<crate::model::ClusterOperationStatus>,
11348
11349 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
11351 pub status_history: std::vec::Vec<crate::model::ClusterOperationStatus>,
11352
11353 pub operation_type: crate::model::node_group_operation_metadata::NodeGroupOperationType,
11355
11356 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11358 pub description: std::string::String,
11359
11360 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
11362 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11363
11364 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
11366 pub warnings: std::vec::Vec<std::string::String>,
11367
11368 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11369 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11370}
11371
11372impl NodeGroupOperationMetadata {
11373 pub fn new() -> Self {
11374 std::default::Default::default()
11375 }
11376
11377 pub fn set_node_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11379 self.node_group_id = v.into();
11380 self
11381 }
11382
11383 pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11385 self.cluster_uuid = v.into();
11386 self
11387 }
11388
11389 pub fn set_status<
11391 T: std::convert::Into<std::option::Option<crate::model::ClusterOperationStatus>>,
11392 >(
11393 mut self,
11394 v: T,
11395 ) -> Self {
11396 self.status = v.into();
11397 self
11398 }
11399
11400 pub fn set_operation_type<
11402 T: std::convert::Into<crate::model::node_group_operation_metadata::NodeGroupOperationType>,
11403 >(
11404 mut self,
11405 v: T,
11406 ) -> Self {
11407 self.operation_type = v.into();
11408 self
11409 }
11410
11411 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11413 self.description = v.into();
11414 self
11415 }
11416
11417 pub fn set_status_history<T, V>(mut self, v: T) -> Self
11419 where
11420 T: std::iter::IntoIterator<Item = V>,
11421 V: std::convert::Into<crate::model::ClusterOperationStatus>,
11422 {
11423 use std::iter::Iterator;
11424 self.status_history = v.into_iter().map(|i| i.into()).collect();
11425 self
11426 }
11427
11428 pub fn set_warnings<T, V>(mut self, v: T) -> Self
11430 where
11431 T: std::iter::IntoIterator<Item = V>,
11432 V: std::convert::Into<std::string::String>,
11433 {
11434 use std::iter::Iterator;
11435 self.warnings = v.into_iter().map(|i| i.into()).collect();
11436 self
11437 }
11438
11439 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11441 where
11442 T: std::iter::IntoIterator<Item = (K, V)>,
11443 K: std::convert::Into<std::string::String>,
11444 V: std::convert::Into<std::string::String>,
11445 {
11446 use std::iter::Iterator;
11447 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11448 self
11449 }
11450}
11451
11452impl wkt::message::Message for NodeGroupOperationMetadata {
11453 fn typename() -> &'static str {
11454 "type.googleapis.com/google.cloud.dataproc.v1.NodeGroupOperationMetadata"
11455 }
11456}
11457
11458pub mod node_group_operation_metadata {
11460 #[allow(unused_imports)]
11461 use super::*;
11462
11463 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
11465 pub struct NodeGroupOperationType(i32);
11466
11467 impl NodeGroupOperationType {
11468 pub const NODE_GROUP_OPERATION_TYPE_UNSPECIFIED: NodeGroupOperationType =
11470 NodeGroupOperationType::new(0);
11471
11472 pub const CREATE: NodeGroupOperationType = NodeGroupOperationType::new(1);
11474
11475 pub const UPDATE: NodeGroupOperationType = NodeGroupOperationType::new(2);
11477
11478 pub const DELETE: NodeGroupOperationType = NodeGroupOperationType::new(3);
11480
11481 pub const RESIZE: NodeGroupOperationType = NodeGroupOperationType::new(4);
11483
11484 pub(crate) const fn new(value: i32) -> Self {
11486 Self(value)
11487 }
11488
11489 pub fn value(&self) -> i32 {
11491 self.0
11492 }
11493
11494 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
11496 match self.0 {
11497 0 => std::borrow::Cow::Borrowed("NODE_GROUP_OPERATION_TYPE_UNSPECIFIED"),
11498 1 => std::borrow::Cow::Borrowed("CREATE"),
11499 2 => std::borrow::Cow::Borrowed("UPDATE"),
11500 3 => std::borrow::Cow::Borrowed("DELETE"),
11501 4 => std::borrow::Cow::Borrowed("RESIZE"),
11502 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
11503 }
11504 }
11505
11506 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
11508 match name {
11509 "NODE_GROUP_OPERATION_TYPE_UNSPECIFIED" => {
11510 std::option::Option::Some(Self::NODE_GROUP_OPERATION_TYPE_UNSPECIFIED)
11511 }
11512 "CREATE" => std::option::Option::Some(Self::CREATE),
11513 "UPDATE" => std::option::Option::Some(Self::UPDATE),
11514 "DELETE" => std::option::Option::Some(Self::DELETE),
11515 "RESIZE" => std::option::Option::Some(Self::RESIZE),
11516 _ => std::option::Option::None,
11517 }
11518 }
11519 }
11520
11521 impl std::convert::From<i32> for NodeGroupOperationType {
11522 fn from(value: i32) -> Self {
11523 Self::new(value)
11524 }
11525 }
11526
11527 impl std::default::Default for NodeGroupOperationType {
11528 fn default() -> Self {
11529 Self::new(0)
11530 }
11531 }
11532}
11533
11534#[serde_with::serde_as]
11536#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11537#[serde(default, rename_all = "camelCase")]
11538#[non_exhaustive]
11539pub struct CreateSessionTemplateRequest {
11540 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11542 pub parent: std::string::String,
11543
11544 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11546 pub session_template: std::option::Option<crate::model::SessionTemplate>,
11547
11548 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11549 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11550}
11551
11552impl CreateSessionTemplateRequest {
11553 pub fn new() -> Self {
11554 std::default::Default::default()
11555 }
11556
11557 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11559 self.parent = v.into();
11560 self
11561 }
11562
11563 pub fn set_session_template<
11565 T: std::convert::Into<std::option::Option<crate::model::SessionTemplate>>,
11566 >(
11567 mut self,
11568 v: T,
11569 ) -> Self {
11570 self.session_template = v.into();
11571 self
11572 }
11573}
11574
11575impl wkt::message::Message for CreateSessionTemplateRequest {
11576 fn typename() -> &'static str {
11577 "type.googleapis.com/google.cloud.dataproc.v1.CreateSessionTemplateRequest"
11578 }
11579}
11580
11581#[serde_with::serde_as]
11583#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11584#[serde(default, rename_all = "camelCase")]
11585#[non_exhaustive]
11586pub struct UpdateSessionTemplateRequest {
11587 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11589 pub session_template: std::option::Option<crate::model::SessionTemplate>,
11590
11591 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11592 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11593}
11594
11595impl UpdateSessionTemplateRequest {
11596 pub fn new() -> Self {
11597 std::default::Default::default()
11598 }
11599
11600 pub fn set_session_template<
11602 T: std::convert::Into<std::option::Option<crate::model::SessionTemplate>>,
11603 >(
11604 mut self,
11605 v: T,
11606 ) -> Self {
11607 self.session_template = v.into();
11608 self
11609 }
11610}
11611
11612impl wkt::message::Message for UpdateSessionTemplateRequest {
11613 fn typename() -> &'static str {
11614 "type.googleapis.com/google.cloud.dataproc.v1.UpdateSessionTemplateRequest"
11615 }
11616}
11617
11618#[serde_with::serde_as]
11620#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11621#[serde(default, rename_all = "camelCase")]
11622#[non_exhaustive]
11623pub struct GetSessionTemplateRequest {
11624 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11626 pub name: std::string::String,
11627
11628 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11629 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11630}
11631
11632impl GetSessionTemplateRequest {
11633 pub fn new() -> Self {
11634 std::default::Default::default()
11635 }
11636
11637 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11639 self.name = v.into();
11640 self
11641 }
11642}
11643
11644impl wkt::message::Message for GetSessionTemplateRequest {
11645 fn typename() -> &'static str {
11646 "type.googleapis.com/google.cloud.dataproc.v1.GetSessionTemplateRequest"
11647 }
11648}
11649
11650#[serde_with::serde_as]
11652#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11653#[serde(default, rename_all = "camelCase")]
11654#[non_exhaustive]
11655pub struct ListSessionTemplatesRequest {
11656 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11658 pub parent: std::string::String,
11659
11660 pub page_size: i32,
11663
11664 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11667 pub page_token: std::string::String,
11668
11669 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11674 pub filter: std::string::String,
11675
11676 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11677 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11678}
11679
11680impl ListSessionTemplatesRequest {
11681 pub fn new() -> Self {
11682 std::default::Default::default()
11683 }
11684
11685 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11687 self.parent = v.into();
11688 self
11689 }
11690
11691 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11693 self.page_size = v.into();
11694 self
11695 }
11696
11697 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11699 self.page_token = v.into();
11700 self
11701 }
11702
11703 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11705 self.filter = v.into();
11706 self
11707 }
11708}
11709
11710impl wkt::message::Message for ListSessionTemplatesRequest {
11711 fn typename() -> &'static str {
11712 "type.googleapis.com/google.cloud.dataproc.v1.ListSessionTemplatesRequest"
11713 }
11714}
11715
11716#[serde_with::serde_as]
11718#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11719#[serde(default, rename_all = "camelCase")]
11720#[non_exhaustive]
11721pub struct ListSessionTemplatesResponse {
11722 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
11724 pub session_templates: std::vec::Vec<crate::model::SessionTemplate>,
11725
11726 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11729 pub next_page_token: std::string::String,
11730
11731 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11732 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11733}
11734
11735impl ListSessionTemplatesResponse {
11736 pub fn new() -> Self {
11737 std::default::Default::default()
11738 }
11739
11740 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11742 self.next_page_token = v.into();
11743 self
11744 }
11745
11746 pub fn set_session_templates<T, V>(mut self, v: T) -> Self
11748 where
11749 T: std::iter::IntoIterator<Item = V>,
11750 V: std::convert::Into<crate::model::SessionTemplate>,
11751 {
11752 use std::iter::Iterator;
11753 self.session_templates = v.into_iter().map(|i| i.into()).collect();
11754 self
11755 }
11756}
11757
11758impl wkt::message::Message for ListSessionTemplatesResponse {
11759 fn typename() -> &'static str {
11760 "type.googleapis.com/google.cloud.dataproc.v1.ListSessionTemplatesResponse"
11761 }
11762}
11763
11764#[doc(hidden)]
11765impl gax::paginator::internal::PageableResponse for ListSessionTemplatesResponse {
11766 type PageItem = crate::model::SessionTemplate;
11767
11768 fn items(self) -> std::vec::Vec<Self::PageItem> {
11769 self.session_templates
11770 }
11771
11772 fn next_page_token(&self) -> std::string::String {
11773 use std::clone::Clone;
11774 self.next_page_token.clone()
11775 }
11776}
11777
11778#[serde_with::serde_as]
11780#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11781#[serde(default, rename_all = "camelCase")]
11782#[non_exhaustive]
11783pub struct DeleteSessionTemplateRequest {
11784 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11786 pub name: std::string::String,
11787
11788 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11789 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11790}
11791
11792impl DeleteSessionTemplateRequest {
11793 pub fn new() -> Self {
11794 std::default::Default::default()
11795 }
11796
11797 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11799 self.name = v.into();
11800 self
11801 }
11802}
11803
11804impl wkt::message::Message for DeleteSessionTemplateRequest {
11805 fn typename() -> &'static str {
11806 "type.googleapis.com/google.cloud.dataproc.v1.DeleteSessionTemplateRequest"
11807 }
11808}
11809
11810#[serde_with::serde_as]
11812#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
11813#[serde(default, rename_all = "camelCase")]
11814#[non_exhaustive]
11815pub struct SessionTemplate {
11816 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11818 pub name: std::string::String,
11819
11820 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11822 pub description: std::string::String,
11823
11824 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11826 pub create_time: std::option::Option<wkt::Timestamp>,
11827
11828 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11830 pub creator: std::string::String,
11831
11832 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
11840 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11841
11842 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11844 pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
11845
11846 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11848 pub environment_config: std::option::Option<crate::model::EnvironmentConfig>,
11849
11850 #[serde(skip_serializing_if = "std::option::Option::is_none")]
11852 pub update_time: std::option::Option<wkt::Timestamp>,
11853
11854 #[serde(skip_serializing_if = "std::string::String::is_empty")]
11857 pub uuid: std::string::String,
11858
11859 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
11861 pub session_config: std::option::Option<crate::model::session_template::SessionConfig>,
11862
11863 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
11864 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11865}
11866
11867impl SessionTemplate {
11868 pub fn new() -> Self {
11869 std::default::Default::default()
11870 }
11871
11872 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11874 self.name = v.into();
11875 self
11876 }
11877
11878 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11880 self.description = v.into();
11881 self
11882 }
11883
11884 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
11886 mut self,
11887 v: T,
11888 ) -> Self {
11889 self.create_time = v.into();
11890 self
11891 }
11892
11893 pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11895 self.creator = v.into();
11896 self
11897 }
11898
11899 pub fn set_runtime_config<
11901 T: std::convert::Into<std::option::Option<crate::model::RuntimeConfig>>,
11902 >(
11903 mut self,
11904 v: T,
11905 ) -> Self {
11906 self.runtime_config = v.into();
11907 self
11908 }
11909
11910 pub fn set_environment_config<
11912 T: std::convert::Into<std::option::Option<crate::model::EnvironmentConfig>>,
11913 >(
11914 mut self,
11915 v: T,
11916 ) -> Self {
11917 self.environment_config = v.into();
11918 self
11919 }
11920
11921 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
11923 mut self,
11924 v: T,
11925 ) -> Self {
11926 self.update_time = v.into();
11927 self
11928 }
11929
11930 pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11932 self.uuid = v.into();
11933 self
11934 }
11935
11936 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11938 where
11939 T: std::iter::IntoIterator<Item = (K, V)>,
11940 K: std::convert::Into<std::string::String>,
11941 V: std::convert::Into<std::string::String>,
11942 {
11943 use std::iter::Iterator;
11944 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11945 self
11946 }
11947
11948 pub fn set_session_config<
11953 T: std::convert::Into<std::option::Option<crate::model::session_template::SessionConfig>>,
11954 >(
11955 mut self,
11956 v: T,
11957 ) -> Self {
11958 self.session_config = v.into();
11959 self
11960 }
11961
11962 pub fn jupyter_session(
11966 &self,
11967 ) -> std::option::Option<&std::boxed::Box<crate::model::JupyterConfig>> {
11968 #[allow(unreachable_patterns)]
11969 self.session_config.as_ref().and_then(|v| match v {
11970 crate::model::session_template::SessionConfig::JupyterSession(v) => {
11971 std::option::Option::Some(v)
11972 }
11973 _ => std::option::Option::None,
11974 })
11975 }
11976
11977 pub fn spark_connect_session(
11981 &self,
11982 ) -> std::option::Option<&std::boxed::Box<crate::model::SparkConnectConfig>> {
11983 #[allow(unreachable_patterns)]
11984 self.session_config.as_ref().and_then(|v| match v {
11985 crate::model::session_template::SessionConfig::SparkConnectSession(v) => {
11986 std::option::Option::Some(v)
11987 }
11988 _ => std::option::Option::None,
11989 })
11990 }
11991
11992 pub fn set_jupyter_session<
11998 T: std::convert::Into<std::boxed::Box<crate::model::JupyterConfig>>,
11999 >(
12000 mut self,
12001 v: T,
12002 ) -> Self {
12003 self.session_config = std::option::Option::Some(
12004 crate::model::session_template::SessionConfig::JupyterSession(v.into()),
12005 );
12006 self
12007 }
12008
12009 pub fn set_spark_connect_session<
12015 T: std::convert::Into<std::boxed::Box<crate::model::SparkConnectConfig>>,
12016 >(
12017 mut self,
12018 v: T,
12019 ) -> Self {
12020 self.session_config = std::option::Option::Some(
12021 crate::model::session_template::SessionConfig::SparkConnectSession(v.into()),
12022 );
12023 self
12024 }
12025}
12026
12027impl wkt::message::Message for SessionTemplate {
12028 fn typename() -> &'static str {
12029 "type.googleapis.com/google.cloud.dataproc.v1.SessionTemplate"
12030 }
12031}
12032
12033pub mod session_template {
12035 #[allow(unused_imports)]
12036 use super::*;
12037
12038 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
12040 #[serde(rename_all = "camelCase")]
12041 #[non_exhaustive]
12042 pub enum SessionConfig {
12043 JupyterSession(std::boxed::Box<crate::model::JupyterConfig>),
12045 SparkConnectSession(std::boxed::Box<crate::model::SparkConnectConfig>),
12047 }
12048}
12049
12050#[serde_with::serde_as]
12052#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12053#[serde(default, rename_all = "camelCase")]
12054#[non_exhaustive]
12055pub struct CreateSessionRequest {
12056 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12058 pub parent: std::string::String,
12059
12060 #[serde(skip_serializing_if = "std::option::Option::is_none")]
12062 pub session: std::option::Option<crate::model::Session>,
12063
12064 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12070 pub session_id: std::string::String,
12071
12072 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12087 pub request_id: std::string::String,
12088
12089 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12090 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12091}
12092
12093impl CreateSessionRequest {
12094 pub fn new() -> Self {
12095 std::default::Default::default()
12096 }
12097
12098 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12100 self.parent = v.into();
12101 self
12102 }
12103
12104 pub fn set_session<T: std::convert::Into<std::option::Option<crate::model::Session>>>(
12106 mut self,
12107 v: T,
12108 ) -> Self {
12109 self.session = v.into();
12110 self
12111 }
12112
12113 pub fn set_session_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12115 self.session_id = v.into();
12116 self
12117 }
12118
12119 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12121 self.request_id = v.into();
12122 self
12123 }
12124}
12125
12126impl wkt::message::Message for CreateSessionRequest {
12127 fn typename() -> &'static str {
12128 "type.googleapis.com/google.cloud.dataproc.v1.CreateSessionRequest"
12129 }
12130}
12131
12132#[serde_with::serde_as]
12134#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12135#[serde(default, rename_all = "camelCase")]
12136#[non_exhaustive]
12137pub struct GetSessionRequest {
12138 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12140 pub name: std::string::String,
12141
12142 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12143 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12144}
12145
12146impl GetSessionRequest {
12147 pub fn new() -> Self {
12148 std::default::Default::default()
12149 }
12150
12151 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12153 self.name = v.into();
12154 self
12155 }
12156}
12157
12158impl wkt::message::Message for GetSessionRequest {
12159 fn typename() -> &'static str {
12160 "type.googleapis.com/google.cloud.dataproc.v1.GetSessionRequest"
12161 }
12162}
12163
12164#[serde_with::serde_as]
12166#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12167#[serde(default, rename_all = "camelCase")]
12168#[non_exhaustive]
12169pub struct ListSessionsRequest {
12170 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12172 pub parent: std::string::String,
12173
12174 pub page_size: i32,
12177
12178 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12181 pub page_token: std::string::String,
12182
12183 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12199 pub filter: std::string::String,
12200
12201 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12202 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12203}
12204
12205impl ListSessionsRequest {
12206 pub fn new() -> Self {
12207 std::default::Default::default()
12208 }
12209
12210 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12212 self.parent = v.into();
12213 self
12214 }
12215
12216 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12218 self.page_size = v.into();
12219 self
12220 }
12221
12222 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12224 self.page_token = v.into();
12225 self
12226 }
12227
12228 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12230 self.filter = v.into();
12231 self
12232 }
12233}
12234
12235impl wkt::message::Message for ListSessionsRequest {
12236 fn typename() -> &'static str {
12237 "type.googleapis.com/google.cloud.dataproc.v1.ListSessionsRequest"
12238 }
12239}
12240
12241#[serde_with::serde_as]
12243#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12244#[serde(default, rename_all = "camelCase")]
12245#[non_exhaustive]
12246pub struct ListSessionsResponse {
12247 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
12249 pub sessions: std::vec::Vec<crate::model::Session>,
12250
12251 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12254 pub next_page_token: std::string::String,
12255
12256 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12257 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12258}
12259
12260impl ListSessionsResponse {
12261 pub fn new() -> Self {
12262 std::default::Default::default()
12263 }
12264
12265 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12267 self.next_page_token = v.into();
12268 self
12269 }
12270
12271 pub fn set_sessions<T, V>(mut self, v: T) -> Self
12273 where
12274 T: std::iter::IntoIterator<Item = V>,
12275 V: std::convert::Into<crate::model::Session>,
12276 {
12277 use std::iter::Iterator;
12278 self.sessions = v.into_iter().map(|i| i.into()).collect();
12279 self
12280 }
12281}
12282
12283impl wkt::message::Message for ListSessionsResponse {
12284 fn typename() -> &'static str {
12285 "type.googleapis.com/google.cloud.dataproc.v1.ListSessionsResponse"
12286 }
12287}
12288
12289#[doc(hidden)]
12290impl gax::paginator::internal::PageableResponse for ListSessionsResponse {
12291 type PageItem = crate::model::Session;
12292
12293 fn items(self) -> std::vec::Vec<Self::PageItem> {
12294 self.sessions
12295 }
12296
12297 fn next_page_token(&self) -> std::string::String {
12298 use std::clone::Clone;
12299 self.next_page_token.clone()
12300 }
12301}
12302
12303#[serde_with::serde_as]
12305#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12306#[serde(default, rename_all = "camelCase")]
12307#[non_exhaustive]
12308pub struct TerminateSessionRequest {
12309 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12311 pub name: std::string::String,
12312
12313 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12324 pub request_id: std::string::String,
12325
12326 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12327 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12328}
12329
12330impl TerminateSessionRequest {
12331 pub fn new() -> Self {
12332 std::default::Default::default()
12333 }
12334
12335 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12337 self.name = v.into();
12338 self
12339 }
12340
12341 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12343 self.request_id = v.into();
12344 self
12345 }
12346}
12347
12348impl wkt::message::Message for TerminateSessionRequest {
12349 fn typename() -> &'static str {
12350 "type.googleapis.com/google.cloud.dataproc.v1.TerminateSessionRequest"
12351 }
12352}
12353
12354#[serde_with::serde_as]
12356#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12357#[serde(default, rename_all = "camelCase")]
12358#[non_exhaustive]
12359pub struct DeleteSessionRequest {
12360 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12362 pub name: std::string::String,
12363
12364 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12375 pub request_id: std::string::String,
12376
12377 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12378 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12379}
12380
12381impl DeleteSessionRequest {
12382 pub fn new() -> Self {
12383 std::default::Default::default()
12384 }
12385
12386 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12388 self.name = v.into();
12389 self
12390 }
12391
12392 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12394 self.request_id = v.into();
12395 self
12396 }
12397}
12398
12399impl wkt::message::Message for DeleteSessionRequest {
12400 fn typename() -> &'static str {
12401 "type.googleapis.com/google.cloud.dataproc.v1.DeleteSessionRequest"
12402 }
12403}
12404
12405#[serde_with::serde_as]
12407#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12408#[serde(default, rename_all = "camelCase")]
12409#[non_exhaustive]
12410pub struct Session {
12411 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12413 pub name: std::string::String,
12414
12415 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12418 pub uuid: std::string::String,
12419
12420 #[serde(skip_serializing_if = "std::option::Option::is_none")]
12422 pub create_time: std::option::Option<wkt::Timestamp>,
12423
12424 #[serde(skip_serializing_if = "std::option::Option::is_none")]
12426 pub runtime_info: std::option::Option<crate::model::RuntimeInfo>,
12427
12428 pub state: crate::model::session::State,
12430
12431 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12434 pub state_message: std::string::String,
12435
12436 #[serde(skip_serializing_if = "std::option::Option::is_none")]
12438 pub state_time: std::option::Option<wkt::Timestamp>,
12439
12440 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12442 pub creator: std::string::String,
12443
12444 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
12452 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12453
12454 #[serde(skip_serializing_if = "std::option::Option::is_none")]
12456 pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
12457
12458 #[serde(skip_serializing_if = "std::option::Option::is_none")]
12460 pub environment_config: std::option::Option<crate::model::EnvironmentConfig>,
12461
12462 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12464 pub user: std::string::String,
12465
12466 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
12468 pub state_history: std::vec::Vec<crate::model::session::SessionStateHistory>,
12469
12470 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12482 pub session_template: std::string::String,
12483
12484 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
12486 pub session_config: std::option::Option<crate::model::session::SessionConfig>,
12487
12488 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12489 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12490}
12491
12492impl Session {
12493 pub fn new() -> Self {
12494 std::default::Default::default()
12495 }
12496
12497 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12499 self.name = v.into();
12500 self
12501 }
12502
12503 pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12505 self.uuid = v.into();
12506 self
12507 }
12508
12509 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
12511 mut self,
12512 v: T,
12513 ) -> Self {
12514 self.create_time = v.into();
12515 self
12516 }
12517
12518 pub fn set_runtime_info<
12520 T: std::convert::Into<std::option::Option<crate::model::RuntimeInfo>>,
12521 >(
12522 mut self,
12523 v: T,
12524 ) -> Self {
12525 self.runtime_info = v.into();
12526 self
12527 }
12528
12529 pub fn set_state<T: std::convert::Into<crate::model::session::State>>(mut self, v: T) -> Self {
12531 self.state = v.into();
12532 self
12533 }
12534
12535 pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12537 self.state_message = v.into();
12538 self
12539 }
12540
12541 pub fn set_state_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
12543 mut self,
12544 v: T,
12545 ) -> Self {
12546 self.state_time = v.into();
12547 self
12548 }
12549
12550 pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12552 self.creator = v.into();
12553 self
12554 }
12555
12556 pub fn set_runtime_config<
12558 T: std::convert::Into<std::option::Option<crate::model::RuntimeConfig>>,
12559 >(
12560 mut self,
12561 v: T,
12562 ) -> Self {
12563 self.runtime_config = v.into();
12564 self
12565 }
12566
12567 pub fn set_environment_config<
12569 T: std::convert::Into<std::option::Option<crate::model::EnvironmentConfig>>,
12570 >(
12571 mut self,
12572 v: T,
12573 ) -> Self {
12574 self.environment_config = v.into();
12575 self
12576 }
12577
12578 pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12580 self.user = v.into();
12581 self
12582 }
12583
12584 pub fn set_session_template<T: std::convert::Into<std::string::String>>(
12586 mut self,
12587 v: T,
12588 ) -> Self {
12589 self.session_template = v.into();
12590 self
12591 }
12592
12593 pub fn set_state_history<T, V>(mut self, v: T) -> Self
12595 where
12596 T: std::iter::IntoIterator<Item = V>,
12597 V: std::convert::Into<crate::model::session::SessionStateHistory>,
12598 {
12599 use std::iter::Iterator;
12600 self.state_history = v.into_iter().map(|i| i.into()).collect();
12601 self
12602 }
12603
12604 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12606 where
12607 T: std::iter::IntoIterator<Item = (K, V)>,
12608 K: std::convert::Into<std::string::String>,
12609 V: std::convert::Into<std::string::String>,
12610 {
12611 use std::iter::Iterator;
12612 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12613 self
12614 }
12615
12616 pub fn set_session_config<
12621 T: std::convert::Into<std::option::Option<crate::model::session::SessionConfig>>,
12622 >(
12623 mut self,
12624 v: T,
12625 ) -> Self {
12626 self.session_config = v.into();
12627 self
12628 }
12629
12630 pub fn jupyter_session(
12634 &self,
12635 ) -> std::option::Option<&std::boxed::Box<crate::model::JupyterConfig>> {
12636 #[allow(unreachable_patterns)]
12637 self.session_config.as_ref().and_then(|v| match v {
12638 crate::model::session::SessionConfig::JupyterSession(v) => std::option::Option::Some(v),
12639 _ => std::option::Option::None,
12640 })
12641 }
12642
12643 pub fn spark_connect_session(
12647 &self,
12648 ) -> std::option::Option<&std::boxed::Box<crate::model::SparkConnectConfig>> {
12649 #[allow(unreachable_patterns)]
12650 self.session_config.as_ref().and_then(|v| match v {
12651 crate::model::session::SessionConfig::SparkConnectSession(v) => {
12652 std::option::Option::Some(v)
12653 }
12654 _ => std::option::Option::None,
12655 })
12656 }
12657
12658 pub fn set_jupyter_session<
12664 T: std::convert::Into<std::boxed::Box<crate::model::JupyterConfig>>,
12665 >(
12666 mut self,
12667 v: T,
12668 ) -> Self {
12669 self.session_config = std::option::Option::Some(
12670 crate::model::session::SessionConfig::JupyterSession(v.into()),
12671 );
12672 self
12673 }
12674
12675 pub fn set_spark_connect_session<
12681 T: std::convert::Into<std::boxed::Box<crate::model::SparkConnectConfig>>,
12682 >(
12683 mut self,
12684 v: T,
12685 ) -> Self {
12686 self.session_config = std::option::Option::Some(
12687 crate::model::session::SessionConfig::SparkConnectSession(v.into()),
12688 );
12689 self
12690 }
12691}
12692
12693impl wkt::message::Message for Session {
12694 fn typename() -> &'static str {
12695 "type.googleapis.com/google.cloud.dataproc.v1.Session"
12696 }
12697}
12698
12699pub mod session {
12701 #[allow(unused_imports)]
12702 use super::*;
12703
12704 #[serde_with::serde_as]
12706 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12707 #[serde(default, rename_all = "camelCase")]
12708 #[non_exhaustive]
12709 pub struct SessionStateHistory {
12710 pub state: crate::model::session::State,
12713
12714 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12717 pub state_message: std::string::String,
12718
12719 #[serde(skip_serializing_if = "std::option::Option::is_none")]
12721 pub state_start_time: std::option::Option<wkt::Timestamp>,
12722
12723 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12724 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12725 }
12726
12727 impl SessionStateHistory {
12728 pub fn new() -> Self {
12729 std::default::Default::default()
12730 }
12731
12732 pub fn set_state<T: std::convert::Into<crate::model::session::State>>(
12734 mut self,
12735 v: T,
12736 ) -> Self {
12737 self.state = v.into();
12738 self
12739 }
12740
12741 pub fn set_state_message<T: std::convert::Into<std::string::String>>(
12743 mut self,
12744 v: T,
12745 ) -> Self {
12746 self.state_message = v.into();
12747 self
12748 }
12749
12750 pub fn set_state_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
12752 mut self,
12753 v: T,
12754 ) -> Self {
12755 self.state_start_time = v.into();
12756 self
12757 }
12758 }
12759
12760 impl wkt::message::Message for SessionStateHistory {
12761 fn typename() -> &'static str {
12762 "type.googleapis.com/google.cloud.dataproc.v1.Session.SessionStateHistory"
12763 }
12764 }
12765
12766 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
12768 pub struct State(i32);
12769
12770 impl State {
12771 pub const STATE_UNSPECIFIED: State = State::new(0);
12773
12774 pub const CREATING: State = State::new(1);
12776
12777 pub const ACTIVE: State = State::new(2);
12779
12780 pub const TERMINATING: State = State::new(3);
12782
12783 pub const TERMINATED: State = State::new(4);
12785
12786 pub const FAILED: State = State::new(5);
12788
12789 pub(crate) const fn new(value: i32) -> Self {
12791 Self(value)
12792 }
12793
12794 pub fn value(&self) -> i32 {
12796 self.0
12797 }
12798
12799 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
12801 match self.0 {
12802 0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
12803 1 => std::borrow::Cow::Borrowed("CREATING"),
12804 2 => std::borrow::Cow::Borrowed("ACTIVE"),
12805 3 => std::borrow::Cow::Borrowed("TERMINATING"),
12806 4 => std::borrow::Cow::Borrowed("TERMINATED"),
12807 5 => std::borrow::Cow::Borrowed("FAILED"),
12808 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
12809 }
12810 }
12811
12812 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
12814 match name {
12815 "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
12816 "CREATING" => std::option::Option::Some(Self::CREATING),
12817 "ACTIVE" => std::option::Option::Some(Self::ACTIVE),
12818 "TERMINATING" => std::option::Option::Some(Self::TERMINATING),
12819 "TERMINATED" => std::option::Option::Some(Self::TERMINATED),
12820 "FAILED" => std::option::Option::Some(Self::FAILED),
12821 _ => std::option::Option::None,
12822 }
12823 }
12824 }
12825
12826 impl std::convert::From<i32> for State {
12827 fn from(value: i32) -> Self {
12828 Self::new(value)
12829 }
12830 }
12831
12832 impl std::default::Default for State {
12833 fn default() -> Self {
12834 Self::new(0)
12835 }
12836 }
12837
12838 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
12840 #[serde(rename_all = "camelCase")]
12841 #[non_exhaustive]
12842 pub enum SessionConfig {
12843 JupyterSession(std::boxed::Box<crate::model::JupyterConfig>),
12845 SparkConnectSession(std::boxed::Box<crate::model::SparkConnectConfig>),
12847 }
12848}
12849
12850#[serde_with::serde_as]
12852#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12853#[serde(default, rename_all = "camelCase")]
12854#[non_exhaustive]
12855pub struct JupyterConfig {
12856 pub kernel: crate::model::jupyter_config::Kernel,
12858
12859 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12861 pub display_name: std::string::String,
12862
12863 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12864 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12865}
12866
12867impl JupyterConfig {
12868 pub fn new() -> Self {
12869 std::default::Default::default()
12870 }
12871
12872 pub fn set_kernel<T: std::convert::Into<crate::model::jupyter_config::Kernel>>(
12874 mut self,
12875 v: T,
12876 ) -> Self {
12877 self.kernel = v.into();
12878 self
12879 }
12880
12881 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12883 self.display_name = v.into();
12884 self
12885 }
12886}
12887
12888impl wkt::message::Message for JupyterConfig {
12889 fn typename() -> &'static str {
12890 "type.googleapis.com/google.cloud.dataproc.v1.JupyterConfig"
12891 }
12892}
12893
12894pub mod jupyter_config {
12896 #[allow(unused_imports)]
12897 use super::*;
12898
12899 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
12901 pub struct Kernel(i32);
12902
12903 impl Kernel {
12904 pub const KERNEL_UNSPECIFIED: Kernel = Kernel::new(0);
12906
12907 pub const PYTHON: Kernel = Kernel::new(1);
12909
12910 pub const SCALA: Kernel = Kernel::new(2);
12912
12913 pub(crate) const fn new(value: i32) -> Self {
12915 Self(value)
12916 }
12917
12918 pub fn value(&self) -> i32 {
12920 self.0
12921 }
12922
12923 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
12925 match self.0 {
12926 0 => std::borrow::Cow::Borrowed("KERNEL_UNSPECIFIED"),
12927 1 => std::borrow::Cow::Borrowed("PYTHON"),
12928 2 => std::borrow::Cow::Borrowed("SCALA"),
12929 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
12930 }
12931 }
12932
12933 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
12935 match name {
12936 "KERNEL_UNSPECIFIED" => std::option::Option::Some(Self::KERNEL_UNSPECIFIED),
12937 "PYTHON" => std::option::Option::Some(Self::PYTHON),
12938 "SCALA" => std::option::Option::Some(Self::SCALA),
12939 _ => std::option::Option::None,
12940 }
12941 }
12942 }
12943
12944 impl std::convert::From<i32> for Kernel {
12945 fn from(value: i32) -> Self {
12946 Self::new(value)
12947 }
12948 }
12949
12950 impl std::default::Default for Kernel {
12951 fn default() -> Self {
12952 Self::new(0)
12953 }
12954 }
12955}
12956
12957#[serde_with::serde_as]
12959#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12960#[serde(default, rename_all = "camelCase")]
12961#[non_exhaustive]
12962pub struct SparkConnectConfig {
12963 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
12964 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12965}
12966
12967impl SparkConnectConfig {
12968 pub fn new() -> Self {
12969 std::default::Default::default()
12970 }
12971}
12972
12973impl wkt::message::Message for SparkConnectConfig {
12974 fn typename() -> &'static str {
12975 "type.googleapis.com/google.cloud.dataproc.v1.SparkConnectConfig"
12976 }
12977}
12978
12979#[serde_with::serde_as]
12981#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
12982#[serde(default, rename_all = "camelCase")]
12983#[non_exhaustive]
12984pub struct RuntimeConfig {
12985 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12987 pub version: std::string::String,
12988
12989 #[serde(skip_serializing_if = "std::string::String::is_empty")]
12992 pub container_image: std::string::String,
12993
12994 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
12997 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
12998
12999 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13001 pub repository_config: std::option::Option<crate::model::RepositoryConfig>,
13002
13003 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13005 pub autotuning_config: std::option::Option<crate::model::AutotuningConfig>,
13006
13007 #[serde(skip_serializing_if = "std::string::String::is_empty")]
13010 pub cohort: std::string::String,
13011
13012 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13013 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13014}
13015
13016impl RuntimeConfig {
13017 pub fn new() -> Self {
13018 std::default::Default::default()
13019 }
13020
13021 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13023 self.version = v.into();
13024 self
13025 }
13026
13027 pub fn set_container_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13029 self.container_image = v.into();
13030 self
13031 }
13032
13033 pub fn set_repository_config<
13035 T: std::convert::Into<std::option::Option<crate::model::RepositoryConfig>>,
13036 >(
13037 mut self,
13038 v: T,
13039 ) -> Self {
13040 self.repository_config = v.into();
13041 self
13042 }
13043
13044 pub fn set_autotuning_config<
13046 T: std::convert::Into<std::option::Option<crate::model::AutotuningConfig>>,
13047 >(
13048 mut self,
13049 v: T,
13050 ) -> Self {
13051 self.autotuning_config = v.into();
13052 self
13053 }
13054
13055 pub fn set_cohort<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13057 self.cohort = v.into();
13058 self
13059 }
13060
13061 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
13063 where
13064 T: std::iter::IntoIterator<Item = (K, V)>,
13065 K: std::convert::Into<std::string::String>,
13066 V: std::convert::Into<std::string::String>,
13067 {
13068 use std::iter::Iterator;
13069 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13070 self
13071 }
13072}
13073
13074impl wkt::message::Message for RuntimeConfig {
13075 fn typename() -> &'static str {
13076 "type.googleapis.com/google.cloud.dataproc.v1.RuntimeConfig"
13077 }
13078}
13079
13080#[serde_with::serde_as]
13082#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13083#[serde(default, rename_all = "camelCase")]
13084#[non_exhaustive]
13085pub struct EnvironmentConfig {
13086 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13088 pub execution_config: std::option::Option<crate::model::ExecutionConfig>,
13089
13090 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13092 pub peripherals_config: std::option::Option<crate::model::PeripheralsConfig>,
13093
13094 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13095 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13096}
13097
13098impl EnvironmentConfig {
13099 pub fn new() -> Self {
13100 std::default::Default::default()
13101 }
13102
13103 pub fn set_execution_config<
13105 T: std::convert::Into<std::option::Option<crate::model::ExecutionConfig>>,
13106 >(
13107 mut self,
13108 v: T,
13109 ) -> Self {
13110 self.execution_config = v.into();
13111 self
13112 }
13113
13114 pub fn set_peripherals_config<
13116 T: std::convert::Into<std::option::Option<crate::model::PeripheralsConfig>>,
13117 >(
13118 mut self,
13119 v: T,
13120 ) -> Self {
13121 self.peripherals_config = v.into();
13122 self
13123 }
13124}
13125
13126impl wkt::message::Message for EnvironmentConfig {
13127 fn typename() -> &'static str {
13128 "type.googleapis.com/google.cloud.dataproc.v1.EnvironmentConfig"
13129 }
13130}
13131
13132#[serde_with::serde_as]
13134#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13135#[serde(default, rename_all = "camelCase")]
13136#[non_exhaustive]
13137pub struct ExecutionConfig {
13138 #[serde(skip_serializing_if = "std::string::String::is_empty")]
13140 pub service_account: std::string::String,
13141
13142 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
13144 pub network_tags: std::vec::Vec<std::string::String>,
13145
13146 #[serde(skip_serializing_if = "std::string::String::is_empty")]
13148 pub kms_key: std::string::String,
13149
13150 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13161 pub idle_ttl: std::option::Option<wkt::Duration>,
13162
13163 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13178 pub ttl: std::option::Option<wkt::Duration>,
13179
13180 #[serde(skip_serializing_if = "std::string::String::is_empty")]
13189 pub staging_bucket: std::string::String,
13190
13191 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13196 pub authentication_config: std::option::Option<crate::model::AuthenticationConfig>,
13197
13198 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
13200 pub network: std::option::Option<crate::model::execution_config::Network>,
13201
13202 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13203 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13204}
13205
13206impl ExecutionConfig {
13207 pub fn new() -> Self {
13208 std::default::Default::default()
13209 }
13210
13211 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13213 self.service_account = v.into();
13214 self
13215 }
13216
13217 pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13219 self.kms_key = v.into();
13220 self
13221 }
13222
13223 pub fn set_idle_ttl<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
13225 mut self,
13226 v: T,
13227 ) -> Self {
13228 self.idle_ttl = v.into();
13229 self
13230 }
13231
13232 pub fn set_ttl<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
13234 mut self,
13235 v: T,
13236 ) -> Self {
13237 self.ttl = v.into();
13238 self
13239 }
13240
13241 pub fn set_staging_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13243 self.staging_bucket = v.into();
13244 self
13245 }
13246
13247 pub fn set_authentication_config<
13249 T: std::convert::Into<std::option::Option<crate::model::AuthenticationConfig>>,
13250 >(
13251 mut self,
13252 v: T,
13253 ) -> Self {
13254 self.authentication_config = v.into();
13255 self
13256 }
13257
13258 pub fn set_network_tags<T, V>(mut self, v: T) -> Self
13260 where
13261 T: std::iter::IntoIterator<Item = V>,
13262 V: std::convert::Into<std::string::String>,
13263 {
13264 use std::iter::Iterator;
13265 self.network_tags = v.into_iter().map(|i| i.into()).collect();
13266 self
13267 }
13268
13269 pub fn set_network<
13274 T: std::convert::Into<std::option::Option<crate::model::execution_config::Network>>,
13275 >(
13276 mut self,
13277 v: T,
13278 ) -> Self {
13279 self.network = v.into();
13280 self
13281 }
13282
13283 pub fn network_uri(&self) -> std::option::Option<&std::string::String> {
13287 #[allow(unreachable_patterns)]
13288 self.network.as_ref().and_then(|v| match v {
13289 crate::model::execution_config::Network::NetworkUri(v) => std::option::Option::Some(v),
13290 _ => std::option::Option::None,
13291 })
13292 }
13293
13294 pub fn subnetwork_uri(&self) -> std::option::Option<&std::string::String> {
13298 #[allow(unreachable_patterns)]
13299 self.network.as_ref().and_then(|v| match v {
13300 crate::model::execution_config::Network::SubnetworkUri(v) => {
13301 std::option::Option::Some(v)
13302 }
13303 _ => std::option::Option::None,
13304 })
13305 }
13306
13307 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13313 self.network = std::option::Option::Some(
13314 crate::model::execution_config::Network::NetworkUri(v.into()),
13315 );
13316 self
13317 }
13318
13319 pub fn set_subnetwork_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13325 self.network = std::option::Option::Some(
13326 crate::model::execution_config::Network::SubnetworkUri(v.into()),
13327 );
13328 self
13329 }
13330}
13331
13332impl wkt::message::Message for ExecutionConfig {
13333 fn typename() -> &'static str {
13334 "type.googleapis.com/google.cloud.dataproc.v1.ExecutionConfig"
13335 }
13336}
13337
13338pub mod execution_config {
13340 #[allow(unused_imports)]
13341 use super::*;
13342
13343 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
13345 #[serde(rename_all = "camelCase")]
13346 #[non_exhaustive]
13347 pub enum Network {
13348 NetworkUri(std::string::String),
13350 SubnetworkUri(std::string::String),
13352 }
13353}
13354
13355#[serde_with::serde_as]
13357#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13358#[serde(default, rename_all = "camelCase")]
13359#[non_exhaustive]
13360pub struct SparkHistoryServerConfig {
13361 #[serde(skip_serializing_if = "std::string::String::is_empty")]
13368 pub dataproc_cluster: std::string::String,
13369
13370 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13371 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13372}
13373
13374impl SparkHistoryServerConfig {
13375 pub fn new() -> Self {
13376 std::default::Default::default()
13377 }
13378
13379 pub fn set_dataproc_cluster<T: std::convert::Into<std::string::String>>(
13381 mut self,
13382 v: T,
13383 ) -> Self {
13384 self.dataproc_cluster = v.into();
13385 self
13386 }
13387}
13388
13389impl wkt::message::Message for SparkHistoryServerConfig {
13390 fn typename() -> &'static str {
13391 "type.googleapis.com/google.cloud.dataproc.v1.SparkHistoryServerConfig"
13392 }
13393}
13394
13395#[serde_with::serde_as]
13397#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13398#[serde(default, rename_all = "camelCase")]
13399#[non_exhaustive]
13400pub struct PeripheralsConfig {
13401 #[serde(skip_serializing_if = "std::string::String::is_empty")]
13407 pub metastore_service: std::string::String,
13408
13409 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13411 pub spark_history_server_config: std::option::Option<crate::model::SparkHistoryServerConfig>,
13412
13413 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13414 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13415}
13416
13417impl PeripheralsConfig {
13418 pub fn new() -> Self {
13419 std::default::Default::default()
13420 }
13421
13422 pub fn set_metastore_service<T: std::convert::Into<std::string::String>>(
13424 mut self,
13425 v: T,
13426 ) -> Self {
13427 self.metastore_service = v.into();
13428 self
13429 }
13430
13431 pub fn set_spark_history_server_config<
13433 T: std::convert::Into<std::option::Option<crate::model::SparkHistoryServerConfig>>,
13434 >(
13435 mut self,
13436 v: T,
13437 ) -> Self {
13438 self.spark_history_server_config = v.into();
13439 self
13440 }
13441}
13442
13443impl wkt::message::Message for PeripheralsConfig {
13444 fn typename() -> &'static str {
13445 "type.googleapis.com/google.cloud.dataproc.v1.PeripheralsConfig"
13446 }
13447}
13448
13449#[serde_with::serde_as]
13451#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13452#[serde(default, rename_all = "camelCase")]
13453#[non_exhaustive]
13454pub struct RuntimeInfo {
13455 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
13458 pub endpoints: std::collections::HashMap<std::string::String, std::string::String>,
13459
13460 #[serde(skip_serializing_if = "std::string::String::is_empty")]
13463 pub output_uri: std::string::String,
13464
13465 #[serde(skip_serializing_if = "std::string::String::is_empty")]
13467 pub diagnostic_output_uri: std::string::String,
13468
13469 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13481 pub approximate_usage: std::option::Option<crate::model::UsageMetrics>,
13482
13483 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13485 pub current_usage: std::option::Option<crate::model::UsageSnapshot>,
13486
13487 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13488 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13489}
13490
13491impl RuntimeInfo {
13492 pub fn new() -> Self {
13493 std::default::Default::default()
13494 }
13495
13496 pub fn set_output_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13498 self.output_uri = v.into();
13499 self
13500 }
13501
13502 pub fn set_diagnostic_output_uri<T: std::convert::Into<std::string::String>>(
13504 mut self,
13505 v: T,
13506 ) -> Self {
13507 self.diagnostic_output_uri = v.into();
13508 self
13509 }
13510
13511 pub fn set_approximate_usage<
13513 T: std::convert::Into<std::option::Option<crate::model::UsageMetrics>>,
13514 >(
13515 mut self,
13516 v: T,
13517 ) -> Self {
13518 self.approximate_usage = v.into();
13519 self
13520 }
13521
13522 pub fn set_current_usage<
13524 T: std::convert::Into<std::option::Option<crate::model::UsageSnapshot>>,
13525 >(
13526 mut self,
13527 v: T,
13528 ) -> Self {
13529 self.current_usage = v.into();
13530 self
13531 }
13532
13533 pub fn set_endpoints<T, K, V>(mut self, v: T) -> Self
13535 where
13536 T: std::iter::IntoIterator<Item = (K, V)>,
13537 K: std::convert::Into<std::string::String>,
13538 V: std::convert::Into<std::string::String>,
13539 {
13540 use std::iter::Iterator;
13541 self.endpoints = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13542 self
13543 }
13544}
13545
13546impl wkt::message::Message for RuntimeInfo {
13547 fn typename() -> &'static str {
13548 "type.googleapis.com/google.cloud.dataproc.v1.RuntimeInfo"
13549 }
13550}
13551
13552#[serde_with::serde_as]
13554#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13555#[serde(default, rename_all = "camelCase")]
13556#[non_exhaustive]
13557pub struct UsageMetrics {
13558 #[serde_as(as = "serde_with::DisplayFromStr")]
13562 pub milli_dcu_seconds: i64,
13563
13564 #[serde_as(as = "serde_with::DisplayFromStr")]
13568 pub shuffle_storage_gb_seconds: i64,
13569
13570 #[serde_as(as = "serde_with::DisplayFromStr")]
13574 pub milli_accelerator_seconds: i64,
13575
13576 #[serde(skip_serializing_if = "std::string::String::is_empty")]
13578 pub accelerator_type: std::string::String,
13579
13580 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13581 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13582}
13583
13584impl UsageMetrics {
13585 pub fn new() -> Self {
13586 std::default::Default::default()
13587 }
13588
13589 pub fn set_milli_dcu_seconds<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13591 self.milli_dcu_seconds = v.into();
13592 self
13593 }
13594
13595 pub fn set_shuffle_storage_gb_seconds<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13597 self.shuffle_storage_gb_seconds = v.into();
13598 self
13599 }
13600
13601 pub fn set_milli_accelerator_seconds<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13603 self.milli_accelerator_seconds = v.into();
13604 self
13605 }
13606
13607 pub fn set_accelerator_type<T: std::convert::Into<std::string::String>>(
13609 mut self,
13610 v: T,
13611 ) -> Self {
13612 self.accelerator_type = v.into();
13613 self
13614 }
13615}
13616
13617impl wkt::message::Message for UsageMetrics {
13618 fn typename() -> &'static str {
13619 "type.googleapis.com/google.cloud.dataproc.v1.UsageMetrics"
13620 }
13621}
13622
13623#[serde_with::serde_as]
13626#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13627#[serde(default, rename_all = "camelCase")]
13628#[non_exhaustive]
13629pub struct UsageSnapshot {
13630 #[serde_as(as = "serde_with::DisplayFromStr")]
13634 pub milli_dcu: i64,
13635
13636 #[serde_as(as = "serde_with::DisplayFromStr")]
13639 pub shuffle_storage_gb: i64,
13640
13641 #[serde_as(as = "serde_with::DisplayFromStr")]
13645 pub milli_dcu_premium: i64,
13646
13647 #[serde_as(as = "serde_with::DisplayFromStr")]
13651 pub shuffle_storage_gb_premium: i64,
13652
13653 #[serde_as(as = "serde_with::DisplayFromStr")]
13656 pub milli_accelerator: i64,
13657
13658 #[serde(skip_serializing_if = "std::string::String::is_empty")]
13660 pub accelerator_type: std::string::String,
13661
13662 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13664 pub snapshot_time: std::option::Option<wkt::Timestamp>,
13665
13666 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13667 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13668}
13669
13670impl UsageSnapshot {
13671 pub fn new() -> Self {
13672 std::default::Default::default()
13673 }
13674
13675 pub fn set_milli_dcu<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13677 self.milli_dcu = v.into();
13678 self
13679 }
13680
13681 pub fn set_shuffle_storage_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13683 self.shuffle_storage_gb = v.into();
13684 self
13685 }
13686
13687 pub fn set_milli_dcu_premium<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13689 self.milli_dcu_premium = v.into();
13690 self
13691 }
13692
13693 pub fn set_shuffle_storage_gb_premium<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13695 self.shuffle_storage_gb_premium = v.into();
13696 self
13697 }
13698
13699 pub fn set_milli_accelerator<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13701 self.milli_accelerator = v.into();
13702 self
13703 }
13704
13705 pub fn set_accelerator_type<T: std::convert::Into<std::string::String>>(
13707 mut self,
13708 v: T,
13709 ) -> Self {
13710 self.accelerator_type = v.into();
13711 self
13712 }
13713
13714 pub fn set_snapshot_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
13716 mut self,
13717 v: T,
13718 ) -> Self {
13719 self.snapshot_time = v.into();
13720 self
13721 }
13722}
13723
13724impl wkt::message::Message for UsageSnapshot {
13725 fn typename() -> &'static str {
13726 "type.googleapis.com/google.cloud.dataproc.v1.UsageSnapshot"
13727 }
13728}
13729
13730#[serde_with::serde_as]
13732#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13733#[serde(default, rename_all = "camelCase")]
13734#[non_exhaustive]
13735pub struct GkeClusterConfig {
13736 #[serde(skip_serializing_if = "std::string::String::is_empty")]
13741 pub gke_cluster_target: std::string::String,
13742
13743 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
13752 pub node_pool_target: std::vec::Vec<crate::model::GkeNodePoolTarget>,
13753
13754 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13755 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13756}
13757
13758impl GkeClusterConfig {
13759 pub fn new() -> Self {
13760 std::default::Default::default()
13761 }
13762
13763 pub fn set_gke_cluster_target<T: std::convert::Into<std::string::String>>(
13765 mut self,
13766 v: T,
13767 ) -> Self {
13768 self.gke_cluster_target = v.into();
13769 self
13770 }
13771
13772 pub fn set_node_pool_target<T, V>(mut self, v: T) -> Self
13774 where
13775 T: std::iter::IntoIterator<Item = V>,
13776 V: std::convert::Into<crate::model::GkeNodePoolTarget>,
13777 {
13778 use std::iter::Iterator;
13779 self.node_pool_target = v.into_iter().map(|i| i.into()).collect();
13780 self
13781 }
13782}
13783
13784impl wkt::message::Message for GkeClusterConfig {
13785 fn typename() -> &'static str {
13786 "type.googleapis.com/google.cloud.dataproc.v1.GkeClusterConfig"
13787 }
13788}
13789
13790#[serde_with::serde_as]
13792#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13793#[serde(default, rename_all = "camelCase")]
13794#[non_exhaustive]
13795pub struct KubernetesClusterConfig {
13796 #[serde(skip_serializing_if = "std::string::String::is_empty")]
13801 pub kubernetes_namespace: std::string::String,
13802
13803 #[serde(skip_serializing_if = "std::option::Option::is_none")]
13806 pub kubernetes_software_config: std::option::Option<crate::model::KubernetesSoftwareConfig>,
13807
13808 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
13809 pub config: std::option::Option<crate::model::kubernetes_cluster_config::Config>,
13810
13811 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13812 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13813}
13814
13815impl KubernetesClusterConfig {
13816 pub fn new() -> Self {
13817 std::default::Default::default()
13818 }
13819
13820 pub fn set_kubernetes_namespace<T: std::convert::Into<std::string::String>>(
13822 mut self,
13823 v: T,
13824 ) -> Self {
13825 self.kubernetes_namespace = v.into();
13826 self
13827 }
13828
13829 pub fn set_kubernetes_software_config<
13831 T: std::convert::Into<std::option::Option<crate::model::KubernetesSoftwareConfig>>,
13832 >(
13833 mut self,
13834 v: T,
13835 ) -> Self {
13836 self.kubernetes_software_config = v.into();
13837 self
13838 }
13839
13840 pub fn set_config<
13845 T: std::convert::Into<std::option::Option<crate::model::kubernetes_cluster_config::Config>>,
13846 >(
13847 mut self,
13848 v: T,
13849 ) -> Self {
13850 self.config = v.into();
13851 self
13852 }
13853
13854 pub fn gke_cluster_config(
13858 &self,
13859 ) -> std::option::Option<&std::boxed::Box<crate::model::GkeClusterConfig>> {
13860 #[allow(unreachable_patterns)]
13861 self.config.as_ref().and_then(|v| match v {
13862 crate::model::kubernetes_cluster_config::Config::GkeClusterConfig(v) => {
13863 std::option::Option::Some(v)
13864 }
13865 _ => std::option::Option::None,
13866 })
13867 }
13868
13869 pub fn set_gke_cluster_config<
13875 T: std::convert::Into<std::boxed::Box<crate::model::GkeClusterConfig>>,
13876 >(
13877 mut self,
13878 v: T,
13879 ) -> Self {
13880 self.config = std::option::Option::Some(
13881 crate::model::kubernetes_cluster_config::Config::GkeClusterConfig(v.into()),
13882 );
13883 self
13884 }
13885}
13886
13887impl wkt::message::Message for KubernetesClusterConfig {
13888 fn typename() -> &'static str {
13889 "type.googleapis.com/google.cloud.dataproc.v1.KubernetesClusterConfig"
13890 }
13891}
13892
13893pub mod kubernetes_cluster_config {
13895 #[allow(unused_imports)]
13896 use super::*;
13897
13898 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
13899 #[serde(rename_all = "camelCase")]
13900 #[non_exhaustive]
13901 pub enum Config {
13902 GkeClusterConfig(std::boxed::Box<crate::model::GkeClusterConfig>),
13904 }
13905}
13906
13907#[serde_with::serde_as]
13909#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13910#[serde(default, rename_all = "camelCase")]
13911#[non_exhaustive]
13912pub struct KubernetesSoftwareConfig {
13913 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
13918 pub component_version: std::collections::HashMap<std::string::String, std::string::String>,
13919
13920 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
13931 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
13932
13933 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
13934 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13935}
13936
13937impl KubernetesSoftwareConfig {
13938 pub fn new() -> Self {
13939 std::default::Default::default()
13940 }
13941
13942 pub fn set_component_version<T, K, V>(mut self, v: T) -> Self
13944 where
13945 T: std::iter::IntoIterator<Item = (K, V)>,
13946 K: std::convert::Into<std::string::String>,
13947 V: std::convert::Into<std::string::String>,
13948 {
13949 use std::iter::Iterator;
13950 self.component_version = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13951 self
13952 }
13953
13954 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
13956 where
13957 T: std::iter::IntoIterator<Item = (K, V)>,
13958 K: std::convert::Into<std::string::String>,
13959 V: std::convert::Into<std::string::String>,
13960 {
13961 use std::iter::Iterator;
13962 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13963 self
13964 }
13965}
13966
13967impl wkt::message::Message for KubernetesSoftwareConfig {
13968 fn typename() -> &'static str {
13969 "type.googleapis.com/google.cloud.dataproc.v1.KubernetesSoftwareConfig"
13970 }
13971}
13972
13973#[serde_with::serde_as]
13975#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
13976#[serde(default, rename_all = "camelCase")]
13977#[non_exhaustive]
13978pub struct GkeNodePoolTarget {
13979 #[serde(skip_serializing_if = "std::string::String::is_empty")]
13983 pub node_pool: std::string::String,
13984
13985 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
13987 pub roles: std::vec::Vec<crate::model::gke_node_pool_target::Role>,
13988
13989 #[serde(skip_serializing_if = "std::option::Option::is_none")]
14002 pub node_pool_config: std::option::Option<crate::model::GkeNodePoolConfig>,
14003
14004 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14005 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14006}
14007
14008impl GkeNodePoolTarget {
14009 pub fn new() -> Self {
14010 std::default::Default::default()
14011 }
14012
14013 pub fn set_node_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14015 self.node_pool = v.into();
14016 self
14017 }
14018
14019 pub fn set_node_pool_config<
14021 T: std::convert::Into<std::option::Option<crate::model::GkeNodePoolConfig>>,
14022 >(
14023 mut self,
14024 v: T,
14025 ) -> Self {
14026 self.node_pool_config = v.into();
14027 self
14028 }
14029
14030 pub fn set_roles<T, V>(mut self, v: T) -> Self
14032 where
14033 T: std::iter::IntoIterator<Item = V>,
14034 V: std::convert::Into<crate::model::gke_node_pool_target::Role>,
14035 {
14036 use std::iter::Iterator;
14037 self.roles = v.into_iter().map(|i| i.into()).collect();
14038 self
14039 }
14040}
14041
14042impl wkt::message::Message for GkeNodePoolTarget {
14043 fn typename() -> &'static str {
14044 "type.googleapis.com/google.cloud.dataproc.v1.GkeNodePoolTarget"
14045 }
14046}
14047
14048pub mod gke_node_pool_target {
14050 #[allow(unused_imports)]
14051 use super::*;
14052
14053 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
14061 pub struct Role(i32);
14062
14063 impl Role {
14064 pub const ROLE_UNSPECIFIED: Role = Role::new(0);
14066
14067 pub const DEFAULT: Role = Role::new(1);
14073
14074 pub const CONTROLLER: Role = Role::new(2);
14077
14078 pub const SPARK_DRIVER: Role = Role::new(3);
14080
14081 pub const SPARK_EXECUTOR: Role = Role::new(4);
14083
14084 pub(crate) const fn new(value: i32) -> Self {
14086 Self(value)
14087 }
14088
14089 pub fn value(&self) -> i32 {
14091 self.0
14092 }
14093
14094 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
14096 match self.0 {
14097 0 => std::borrow::Cow::Borrowed("ROLE_UNSPECIFIED"),
14098 1 => std::borrow::Cow::Borrowed("DEFAULT"),
14099 2 => std::borrow::Cow::Borrowed("CONTROLLER"),
14100 3 => std::borrow::Cow::Borrowed("SPARK_DRIVER"),
14101 4 => std::borrow::Cow::Borrowed("SPARK_EXECUTOR"),
14102 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
14103 }
14104 }
14105
14106 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
14108 match name {
14109 "ROLE_UNSPECIFIED" => std::option::Option::Some(Self::ROLE_UNSPECIFIED),
14110 "DEFAULT" => std::option::Option::Some(Self::DEFAULT),
14111 "CONTROLLER" => std::option::Option::Some(Self::CONTROLLER),
14112 "SPARK_DRIVER" => std::option::Option::Some(Self::SPARK_DRIVER),
14113 "SPARK_EXECUTOR" => std::option::Option::Some(Self::SPARK_EXECUTOR),
14114 _ => std::option::Option::None,
14115 }
14116 }
14117 }
14118
14119 impl std::convert::From<i32> for Role {
14120 fn from(value: i32) -> Self {
14121 Self::new(value)
14122 }
14123 }
14124
14125 impl std::default::Default for Role {
14126 fn default() -> Self {
14127 Self::new(0)
14128 }
14129 }
14130}
14131
14132#[serde_with::serde_as]
14135#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14136#[serde(default, rename_all = "camelCase")]
14137#[non_exhaustive]
14138pub struct GkeNodePoolConfig {
14139 #[serde(skip_serializing_if = "std::option::Option::is_none")]
14141 pub config: std::option::Option<crate::model::gke_node_pool_config::GkeNodeConfig>,
14142
14143 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
14155 pub locations: std::vec::Vec<std::string::String>,
14156
14157 #[serde(skip_serializing_if = "std::option::Option::is_none")]
14160 pub autoscaling:
14161 std::option::Option<crate::model::gke_node_pool_config::GkeNodePoolAutoscalingConfig>,
14162
14163 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14164 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14165}
14166
14167impl GkeNodePoolConfig {
14168 pub fn new() -> Self {
14169 std::default::Default::default()
14170 }
14171
14172 pub fn set_config<
14174 T: std::convert::Into<std::option::Option<crate::model::gke_node_pool_config::GkeNodeConfig>>,
14175 >(
14176 mut self,
14177 v: T,
14178 ) -> Self {
14179 self.config = v.into();
14180 self
14181 }
14182
14183 pub fn set_autoscaling<
14185 T: std::convert::Into<
14186 std::option::Option<
14187 crate::model::gke_node_pool_config::GkeNodePoolAutoscalingConfig,
14188 >,
14189 >,
14190 >(
14191 mut self,
14192 v: T,
14193 ) -> Self {
14194 self.autoscaling = v.into();
14195 self
14196 }
14197
14198 pub fn set_locations<T, V>(mut self, v: T) -> Self
14200 where
14201 T: std::iter::IntoIterator<Item = V>,
14202 V: std::convert::Into<std::string::String>,
14203 {
14204 use std::iter::Iterator;
14205 self.locations = v.into_iter().map(|i| i.into()).collect();
14206 self
14207 }
14208}
14209
14210impl wkt::message::Message for GkeNodePoolConfig {
14211 fn typename() -> &'static str {
14212 "type.googleapis.com/google.cloud.dataproc.v1.GkeNodePoolConfig"
14213 }
14214}
14215
14216pub mod gke_node_pool_config {
14218 #[allow(unused_imports)]
14219 use super::*;
14220
14221 #[serde_with::serde_as]
14223 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14224 #[serde(default, rename_all = "camelCase")]
14225 #[non_exhaustive]
14226 pub struct GkeNodeConfig {
14227 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14230 pub machine_type: std::string::String,
14231
14232 pub local_ssd_count: i32,
14236
14237 pub preemptible: bool,
14250
14251 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
14255 pub accelerators:
14256 std::vec::Vec<crate::model::gke_node_pool_config::GkeNodePoolAcceleratorConfig>,
14257
14258 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14264 pub min_cpu_platform: std::string::String,
14265
14266 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14272 pub boot_disk_kms_key: std::string::String,
14273
14274 pub spot: bool,
14287
14288 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14289 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14290 }
14291
14292 impl GkeNodeConfig {
14293 pub fn new() -> Self {
14294 std::default::Default::default()
14295 }
14296
14297 pub fn set_machine_type<T: std::convert::Into<std::string::String>>(
14299 mut self,
14300 v: T,
14301 ) -> Self {
14302 self.machine_type = v.into();
14303 self
14304 }
14305
14306 pub fn set_local_ssd_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14308 self.local_ssd_count = v.into();
14309 self
14310 }
14311
14312 pub fn set_preemptible<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14314 self.preemptible = v.into();
14315 self
14316 }
14317
14318 pub fn set_min_cpu_platform<T: std::convert::Into<std::string::String>>(
14320 mut self,
14321 v: T,
14322 ) -> Self {
14323 self.min_cpu_platform = v.into();
14324 self
14325 }
14326
14327 pub fn set_boot_disk_kms_key<T: std::convert::Into<std::string::String>>(
14329 mut self,
14330 v: T,
14331 ) -> Self {
14332 self.boot_disk_kms_key = v.into();
14333 self
14334 }
14335
14336 pub fn set_spot<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14338 self.spot = v.into();
14339 self
14340 }
14341
14342 pub fn set_accelerators<T, V>(mut self, v: T) -> Self
14344 where
14345 T: std::iter::IntoIterator<Item = V>,
14346 V: std::convert::Into<crate::model::gke_node_pool_config::GkeNodePoolAcceleratorConfig>,
14347 {
14348 use std::iter::Iterator;
14349 self.accelerators = v.into_iter().map(|i| i.into()).collect();
14350 self
14351 }
14352 }
14353
14354 impl wkt::message::Message for GkeNodeConfig {
14355 fn typename() -> &'static str {
14356 "type.googleapis.com/google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig"
14357 }
14358 }
14359
14360 #[serde_with::serde_as]
14363 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14364 #[serde(default, rename_all = "camelCase")]
14365 #[non_exhaustive]
14366 pub struct GkeNodePoolAcceleratorConfig {
14367 #[serde_as(as = "serde_with::DisplayFromStr")]
14369 pub accelerator_count: i64,
14370
14371 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14373 pub accelerator_type: std::string::String,
14374
14375 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14379 pub gpu_partition_size: std::string::String,
14380
14381 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14382 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14383 }
14384
14385 impl GkeNodePoolAcceleratorConfig {
14386 pub fn new() -> Self {
14387 std::default::Default::default()
14388 }
14389
14390 pub fn set_accelerator_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14392 self.accelerator_count = v.into();
14393 self
14394 }
14395
14396 pub fn set_accelerator_type<T: std::convert::Into<std::string::String>>(
14398 mut self,
14399 v: T,
14400 ) -> Self {
14401 self.accelerator_type = v.into();
14402 self
14403 }
14404
14405 pub fn set_gpu_partition_size<T: std::convert::Into<std::string::String>>(
14407 mut self,
14408 v: T,
14409 ) -> Self {
14410 self.gpu_partition_size = v.into();
14411 self
14412 }
14413 }
14414
14415 impl wkt::message::Message for GkeNodePoolAcceleratorConfig {
14416 fn typename() -> &'static str {
14417 "type.googleapis.com/google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig"
14418 }
14419 }
14420
14421 #[serde_with::serde_as]
14424 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14425 #[serde(default, rename_all = "camelCase")]
14426 #[non_exhaustive]
14427 pub struct GkeNodePoolAutoscalingConfig {
14428 pub min_node_count: i32,
14431
14432 pub max_node_count: i32,
14436
14437 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14438 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14439 }
14440
14441 impl GkeNodePoolAutoscalingConfig {
14442 pub fn new() -> Self {
14443 std::default::Default::default()
14444 }
14445
14446 pub fn set_min_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14448 self.min_node_count = v.into();
14449 self
14450 }
14451
14452 pub fn set_max_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14454 self.max_node_count = v.into();
14455 self
14456 }
14457 }
14458
14459 impl wkt::message::Message for GkeNodePoolAutoscalingConfig {
14460 fn typename() -> &'static str {
14461 "type.googleapis.com/google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig"
14462 }
14463 }
14464}
14465
14466#[serde_with::serde_as]
14471#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14472#[serde(default, rename_all = "camelCase")]
14473#[non_exhaustive]
14474pub struct AuthenticationConfig {
14475 pub user_workload_authentication_type: crate::model::authentication_config::AuthenticationType,
14477
14478 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14479 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14480}
14481
14482impl AuthenticationConfig {
14483 pub fn new() -> Self {
14484 std::default::Default::default()
14485 }
14486
14487 pub fn set_user_workload_authentication_type<
14489 T: std::convert::Into<crate::model::authentication_config::AuthenticationType>,
14490 >(
14491 mut self,
14492 v: T,
14493 ) -> Self {
14494 self.user_workload_authentication_type = v.into();
14495 self
14496 }
14497}
14498
14499impl wkt::message::Message for AuthenticationConfig {
14500 fn typename() -> &'static str {
14501 "type.googleapis.com/google.cloud.dataproc.v1.AuthenticationConfig"
14502 }
14503}
14504
14505pub mod authentication_config {
14507 #[allow(unused_imports)]
14508 use super::*;
14509
14510 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
14512 pub struct AuthenticationType(i32);
14513
14514 impl AuthenticationType {
14515 pub const AUTHENTICATION_TYPE_UNSPECIFIED: AuthenticationType = AuthenticationType::new(0);
14519
14520 pub const SERVICE_ACCOUNT: AuthenticationType = AuthenticationType::new(1);
14522
14523 pub const END_USER_CREDENTIALS: AuthenticationType = AuthenticationType::new(2);
14526
14527 pub(crate) const fn new(value: i32) -> Self {
14529 Self(value)
14530 }
14531
14532 pub fn value(&self) -> i32 {
14534 self.0
14535 }
14536
14537 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
14539 match self.0 {
14540 0 => std::borrow::Cow::Borrowed("AUTHENTICATION_TYPE_UNSPECIFIED"),
14541 1 => std::borrow::Cow::Borrowed("SERVICE_ACCOUNT"),
14542 2 => std::borrow::Cow::Borrowed("END_USER_CREDENTIALS"),
14543 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
14544 }
14545 }
14546
14547 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
14549 match name {
14550 "AUTHENTICATION_TYPE_UNSPECIFIED" => {
14551 std::option::Option::Some(Self::AUTHENTICATION_TYPE_UNSPECIFIED)
14552 }
14553 "SERVICE_ACCOUNT" => std::option::Option::Some(Self::SERVICE_ACCOUNT),
14554 "END_USER_CREDENTIALS" => std::option::Option::Some(Self::END_USER_CREDENTIALS),
14555 _ => std::option::Option::None,
14556 }
14557 }
14558 }
14559
14560 impl std::convert::From<i32> for AuthenticationType {
14561 fn from(value: i32) -> Self {
14562 Self::new(value)
14563 }
14564 }
14565
14566 impl std::default::Default for AuthenticationType {
14567 fn default() -> Self {
14568 Self::new(0)
14569 }
14570 }
14571}
14572
14573#[serde_with::serde_as]
14575#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14576#[serde(default, rename_all = "camelCase")]
14577#[non_exhaustive]
14578pub struct AutotuningConfig {
14579 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
14581 pub scenarios: std::vec::Vec<crate::model::autotuning_config::Scenario>,
14582
14583 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14584 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14585}
14586
14587impl AutotuningConfig {
14588 pub fn new() -> Self {
14589 std::default::Default::default()
14590 }
14591
14592 pub fn set_scenarios<T, V>(mut self, v: T) -> Self
14594 where
14595 T: std::iter::IntoIterator<Item = V>,
14596 V: std::convert::Into<crate::model::autotuning_config::Scenario>,
14597 {
14598 use std::iter::Iterator;
14599 self.scenarios = v.into_iter().map(|i| i.into()).collect();
14600 self
14601 }
14602}
14603
14604impl wkt::message::Message for AutotuningConfig {
14605 fn typename() -> &'static str {
14606 "type.googleapis.com/google.cloud.dataproc.v1.AutotuningConfig"
14607 }
14608}
14609
14610pub mod autotuning_config {
14612 #[allow(unused_imports)]
14613 use super::*;
14614
14615 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
14618 pub struct Scenario(i32);
14619
14620 impl Scenario {
14621 pub const SCENARIO_UNSPECIFIED: Scenario = Scenario::new(0);
14623
14624 pub const SCALING: Scenario = Scenario::new(2);
14626
14627 pub const BROADCAST_HASH_JOIN: Scenario = Scenario::new(3);
14629
14630 pub const MEMORY: Scenario = Scenario::new(4);
14632
14633 pub(crate) const fn new(value: i32) -> Self {
14635 Self(value)
14636 }
14637
14638 pub fn value(&self) -> i32 {
14640 self.0
14641 }
14642
14643 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
14645 match self.0 {
14646 0 => std::borrow::Cow::Borrowed("SCENARIO_UNSPECIFIED"),
14647 2 => std::borrow::Cow::Borrowed("SCALING"),
14648 3 => std::borrow::Cow::Borrowed("BROADCAST_HASH_JOIN"),
14649 4 => std::borrow::Cow::Borrowed("MEMORY"),
14650 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
14651 }
14652 }
14653
14654 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
14656 match name {
14657 "SCENARIO_UNSPECIFIED" => std::option::Option::Some(Self::SCENARIO_UNSPECIFIED),
14658 "SCALING" => std::option::Option::Some(Self::SCALING),
14659 "BROADCAST_HASH_JOIN" => std::option::Option::Some(Self::BROADCAST_HASH_JOIN),
14660 "MEMORY" => std::option::Option::Some(Self::MEMORY),
14661 _ => std::option::Option::None,
14662 }
14663 }
14664 }
14665
14666 impl std::convert::From<i32> for Scenario {
14667 fn from(value: i32) -> Self {
14668 Self::new(value)
14669 }
14670 }
14671
14672 impl std::default::Default for Scenario {
14673 fn default() -> Self {
14674 Self::new(0)
14675 }
14676 }
14677}
14678
14679#[serde_with::serde_as]
14681#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14682#[serde(default, rename_all = "camelCase")]
14683#[non_exhaustive]
14684pub struct RepositoryConfig {
14685 #[serde(skip_serializing_if = "std::option::Option::is_none")]
14687 pub pypi_repository_config: std::option::Option<crate::model::PyPiRepositoryConfig>,
14688
14689 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14690 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14691}
14692
14693impl RepositoryConfig {
14694 pub fn new() -> Self {
14695 std::default::Default::default()
14696 }
14697
14698 pub fn set_pypi_repository_config<
14700 T: std::convert::Into<std::option::Option<crate::model::PyPiRepositoryConfig>>,
14701 >(
14702 mut self,
14703 v: T,
14704 ) -> Self {
14705 self.pypi_repository_config = v.into();
14706 self
14707 }
14708}
14709
14710impl wkt::message::Message for RepositoryConfig {
14711 fn typename() -> &'static str {
14712 "type.googleapis.com/google.cloud.dataproc.v1.RepositoryConfig"
14713 }
14714}
14715
14716#[serde_with::serde_as]
14718#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14719#[serde(default, rename_all = "camelCase")]
14720#[non_exhaustive]
14721pub struct PyPiRepositoryConfig {
14722 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14724 pub pypi_repository: std::string::String,
14725
14726 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14727 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14728}
14729
14730impl PyPiRepositoryConfig {
14731 pub fn new() -> Self {
14732 std::default::Default::default()
14733 }
14734
14735 pub fn set_pypi_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14737 self.pypi_repository = v.into();
14738 self
14739 }
14740}
14741
14742impl wkt::message::Message for PyPiRepositoryConfig {
14743 fn typename() -> &'static str {
14744 "type.googleapis.com/google.cloud.dataproc.v1.PyPiRepositoryConfig"
14745 }
14746}
14747
14748#[serde_with::serde_as]
14750#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14751#[serde(default, rename_all = "camelCase")]
14752#[non_exhaustive]
14753pub struct WorkflowTemplate {
14754 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14755 pub id: std::string::String,
14756
14757 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14769 pub name: std::string::String,
14770
14771 pub version: i32,
14781
14782 #[serde(skip_serializing_if = "std::option::Option::is_none")]
14784 pub create_time: std::option::Option<wkt::Timestamp>,
14785
14786 #[serde(skip_serializing_if = "std::option::Option::is_none")]
14788 pub update_time: std::option::Option<wkt::Timestamp>,
14789
14790 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
14803 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
14804
14805 #[serde(skip_serializing_if = "std::option::Option::is_none")]
14807 pub placement: std::option::Option<crate::model::WorkflowTemplatePlacement>,
14808
14809 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
14811 pub jobs: std::vec::Vec<crate::model::OrderedJob>,
14812
14813 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
14817 pub parameters: std::vec::Vec<crate::model::TemplateParameter>,
14818
14819 #[serde(skip_serializing_if = "std::option::Option::is_none")]
14830 pub dag_timeout: std::option::Option<wkt::Duration>,
14831
14832 #[serde(skip_serializing_if = "std::option::Option::is_none")]
14835 pub encryption_config: std::option::Option<crate::model::workflow_template::EncryptionConfig>,
14836
14837 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14838 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14839}
14840
14841impl WorkflowTemplate {
14842 pub fn new() -> Self {
14843 std::default::Default::default()
14844 }
14845
14846 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14848 self.id = v.into();
14849 self
14850 }
14851
14852 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14854 self.name = v.into();
14855 self
14856 }
14857
14858 pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14860 self.version = v.into();
14861 self
14862 }
14863
14864 pub fn set_create_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
14866 mut self,
14867 v: T,
14868 ) -> Self {
14869 self.create_time = v.into();
14870 self
14871 }
14872
14873 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
14875 mut self,
14876 v: T,
14877 ) -> Self {
14878 self.update_time = v.into();
14879 self
14880 }
14881
14882 pub fn set_placement<
14884 T: std::convert::Into<std::option::Option<crate::model::WorkflowTemplatePlacement>>,
14885 >(
14886 mut self,
14887 v: T,
14888 ) -> Self {
14889 self.placement = v.into();
14890 self
14891 }
14892
14893 pub fn set_dag_timeout<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
14895 mut self,
14896 v: T,
14897 ) -> Self {
14898 self.dag_timeout = v.into();
14899 self
14900 }
14901
14902 pub fn set_encryption_config<
14904 T: std::convert::Into<std::option::Option<crate::model::workflow_template::EncryptionConfig>>,
14905 >(
14906 mut self,
14907 v: T,
14908 ) -> Self {
14909 self.encryption_config = v.into();
14910 self
14911 }
14912
14913 pub fn set_jobs<T, V>(mut self, v: T) -> Self
14915 where
14916 T: std::iter::IntoIterator<Item = V>,
14917 V: std::convert::Into<crate::model::OrderedJob>,
14918 {
14919 use std::iter::Iterator;
14920 self.jobs = v.into_iter().map(|i| i.into()).collect();
14921 self
14922 }
14923
14924 pub fn set_parameters<T, V>(mut self, v: T) -> Self
14926 where
14927 T: std::iter::IntoIterator<Item = V>,
14928 V: std::convert::Into<crate::model::TemplateParameter>,
14929 {
14930 use std::iter::Iterator;
14931 self.parameters = v.into_iter().map(|i| i.into()).collect();
14932 self
14933 }
14934
14935 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
14937 where
14938 T: std::iter::IntoIterator<Item = (K, V)>,
14939 K: std::convert::Into<std::string::String>,
14940 V: std::convert::Into<std::string::String>,
14941 {
14942 use std::iter::Iterator;
14943 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14944 self
14945 }
14946}
14947
14948impl wkt::message::Message for WorkflowTemplate {
14949 fn typename() -> &'static str {
14950 "type.googleapis.com/google.cloud.dataproc.v1.WorkflowTemplate"
14951 }
14952}
14953
14954pub mod workflow_template {
14956 #[allow(unused_imports)]
14957 use super::*;
14958
14959 #[serde_with::serde_as]
14961 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
14962 #[serde(default, rename_all = "camelCase")]
14963 #[non_exhaustive]
14964 pub struct EncryptionConfig {
14965 #[serde(skip_serializing_if = "std::string::String::is_empty")]
14994 pub kms_key: std::string::String,
14995
14996 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
14997 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14998 }
14999
15000 impl EncryptionConfig {
15001 pub fn new() -> Self {
15002 std::default::Default::default()
15003 }
15004
15005 pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15007 self.kms_key = v.into();
15008 self
15009 }
15010 }
15011
15012 impl wkt::message::Message for EncryptionConfig {
15013 fn typename() -> &'static str {
15014 "type.googleapis.com/google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig"
15015 }
15016 }
15017}
15018
15019#[serde_with::serde_as]
15023#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15024#[serde(default, rename_all = "camelCase")]
15025#[non_exhaustive]
15026pub struct WorkflowTemplatePlacement {
15027 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
15030 pub placement: std::option::Option<crate::model::workflow_template_placement::Placement>,
15031
15032 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15033 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15034}
15035
15036impl WorkflowTemplatePlacement {
15037 pub fn new() -> Self {
15038 std::default::Default::default()
15039 }
15040
15041 pub fn set_placement<
15046 T: std::convert::Into<
15047 std::option::Option<crate::model::workflow_template_placement::Placement>,
15048 >,
15049 >(
15050 mut self,
15051 v: T,
15052 ) -> Self {
15053 self.placement = v.into();
15054 self
15055 }
15056
15057 pub fn managed_cluster(
15061 &self,
15062 ) -> std::option::Option<&std::boxed::Box<crate::model::ManagedCluster>> {
15063 #[allow(unreachable_patterns)]
15064 self.placement.as_ref().and_then(|v| match v {
15065 crate::model::workflow_template_placement::Placement::ManagedCluster(v) => {
15066 std::option::Option::Some(v)
15067 }
15068 _ => std::option::Option::None,
15069 })
15070 }
15071
15072 pub fn cluster_selector(
15076 &self,
15077 ) -> std::option::Option<&std::boxed::Box<crate::model::ClusterSelector>> {
15078 #[allow(unreachable_patterns)]
15079 self.placement.as_ref().and_then(|v| match v {
15080 crate::model::workflow_template_placement::Placement::ClusterSelector(v) => {
15081 std::option::Option::Some(v)
15082 }
15083 _ => std::option::Option::None,
15084 })
15085 }
15086
15087 pub fn set_managed_cluster<
15093 T: std::convert::Into<std::boxed::Box<crate::model::ManagedCluster>>,
15094 >(
15095 mut self,
15096 v: T,
15097 ) -> Self {
15098 self.placement = std::option::Option::Some(
15099 crate::model::workflow_template_placement::Placement::ManagedCluster(v.into()),
15100 );
15101 self
15102 }
15103
15104 pub fn set_cluster_selector<
15110 T: std::convert::Into<std::boxed::Box<crate::model::ClusterSelector>>,
15111 >(
15112 mut self,
15113 v: T,
15114 ) -> Self {
15115 self.placement = std::option::Option::Some(
15116 crate::model::workflow_template_placement::Placement::ClusterSelector(v.into()),
15117 );
15118 self
15119 }
15120}
15121
15122impl wkt::message::Message for WorkflowTemplatePlacement {
15123 fn typename() -> &'static str {
15124 "type.googleapis.com/google.cloud.dataproc.v1.WorkflowTemplatePlacement"
15125 }
15126}
15127
15128pub mod workflow_template_placement {
15130 #[allow(unused_imports)]
15131 use super::*;
15132
15133 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
15136 #[serde(rename_all = "camelCase")]
15137 #[non_exhaustive]
15138 pub enum Placement {
15139 ManagedCluster(std::boxed::Box<crate::model::ManagedCluster>),
15141 ClusterSelector(std::boxed::Box<crate::model::ClusterSelector>),
15146 }
15147}
15148
15149#[serde_with::serde_as]
15151#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15152#[serde(default, rename_all = "camelCase")]
15153#[non_exhaustive]
15154pub struct ManagedCluster {
15155 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15162 pub cluster_name: std::string::String,
15163
15164 #[serde(skip_serializing_if = "std::option::Option::is_none")]
15166 pub config: std::option::Option<crate::model::ClusterConfig>,
15167
15168 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
15179 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
15180
15181 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15182 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15183}
15184
15185impl ManagedCluster {
15186 pub fn new() -> Self {
15187 std::default::Default::default()
15188 }
15189
15190 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15192 self.cluster_name = v.into();
15193 self
15194 }
15195
15196 pub fn set_config<T: std::convert::Into<std::option::Option<crate::model::ClusterConfig>>>(
15198 mut self,
15199 v: T,
15200 ) -> Self {
15201 self.config = v.into();
15202 self
15203 }
15204
15205 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
15207 where
15208 T: std::iter::IntoIterator<Item = (K, V)>,
15209 K: std::convert::Into<std::string::String>,
15210 V: std::convert::Into<std::string::String>,
15211 {
15212 use std::iter::Iterator;
15213 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15214 self
15215 }
15216}
15217
15218impl wkt::message::Message for ManagedCluster {
15219 fn typename() -> &'static str {
15220 "type.googleapis.com/google.cloud.dataproc.v1.ManagedCluster"
15221 }
15222}
15223
15224#[serde_with::serde_as]
15226#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15227#[serde(default, rename_all = "camelCase")]
15228#[non_exhaustive]
15229pub struct ClusterSelector {
15230 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15236 pub zone: std::string::String,
15237
15238 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
15241 pub cluster_labels: std::collections::HashMap<std::string::String, std::string::String>,
15242
15243 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15244 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15245}
15246
15247impl ClusterSelector {
15248 pub fn new() -> Self {
15249 std::default::Default::default()
15250 }
15251
15252 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15254 self.zone = v.into();
15255 self
15256 }
15257
15258 pub fn set_cluster_labels<T, K, V>(mut self, v: T) -> Self
15260 where
15261 T: std::iter::IntoIterator<Item = (K, V)>,
15262 K: std::convert::Into<std::string::String>,
15263 V: std::convert::Into<std::string::String>,
15264 {
15265 use std::iter::Iterator;
15266 self.cluster_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15267 self
15268 }
15269}
15270
15271impl wkt::message::Message for ClusterSelector {
15272 fn typename() -> &'static str {
15273 "type.googleapis.com/google.cloud.dataproc.v1.ClusterSelector"
15274 }
15275}
15276
15277#[serde_with::serde_as]
15279#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15280#[serde(default, rename_all = "camelCase")]
15281#[non_exhaustive]
15282pub struct OrderedJob {
15283 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15297 pub step_id: std::string::String,
15298
15299 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
15310 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
15311
15312 #[serde(skip_serializing_if = "std::option::Option::is_none")]
15314 pub scheduling: std::option::Option<crate::model::JobScheduling>,
15315
15316 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
15319 pub prerequisite_step_ids: std::vec::Vec<std::string::String>,
15320
15321 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
15323 pub job_type: std::option::Option<crate::model::ordered_job::JobType>,
15324
15325 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15326 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15327}
15328
15329impl OrderedJob {
15330 pub fn new() -> Self {
15331 std::default::Default::default()
15332 }
15333
15334 pub fn set_step_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15336 self.step_id = v.into();
15337 self
15338 }
15339
15340 pub fn set_scheduling<
15342 T: std::convert::Into<std::option::Option<crate::model::JobScheduling>>,
15343 >(
15344 mut self,
15345 v: T,
15346 ) -> Self {
15347 self.scheduling = v.into();
15348 self
15349 }
15350
15351 pub fn set_prerequisite_step_ids<T, V>(mut self, v: T) -> Self
15353 where
15354 T: std::iter::IntoIterator<Item = V>,
15355 V: std::convert::Into<std::string::String>,
15356 {
15357 use std::iter::Iterator;
15358 self.prerequisite_step_ids = v.into_iter().map(|i| i.into()).collect();
15359 self
15360 }
15361
15362 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
15364 where
15365 T: std::iter::IntoIterator<Item = (K, V)>,
15366 K: std::convert::Into<std::string::String>,
15367 V: std::convert::Into<std::string::String>,
15368 {
15369 use std::iter::Iterator;
15370 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15371 self
15372 }
15373
15374 pub fn set_job_type<
15379 T: std::convert::Into<std::option::Option<crate::model::ordered_job::JobType>>,
15380 >(
15381 mut self,
15382 v: T,
15383 ) -> Self {
15384 self.job_type = v.into();
15385 self
15386 }
15387
15388 pub fn hadoop_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::HadoopJob>> {
15392 #[allow(unreachable_patterns)]
15393 self.job_type.as_ref().and_then(|v| match v {
15394 crate::model::ordered_job::JobType::HadoopJob(v) => std::option::Option::Some(v),
15395 _ => std::option::Option::None,
15396 })
15397 }
15398
15399 pub fn spark_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkJob>> {
15403 #[allow(unreachable_patterns)]
15404 self.job_type.as_ref().and_then(|v| match v {
15405 crate::model::ordered_job::JobType::SparkJob(v) => std::option::Option::Some(v),
15406 _ => std::option::Option::None,
15407 })
15408 }
15409
15410 pub fn pyspark_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PySparkJob>> {
15414 #[allow(unreachable_patterns)]
15415 self.job_type.as_ref().and_then(|v| match v {
15416 crate::model::ordered_job::JobType::PysparkJob(v) => std::option::Option::Some(v),
15417 _ => std::option::Option::None,
15418 })
15419 }
15420
15421 pub fn hive_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::HiveJob>> {
15425 #[allow(unreachable_patterns)]
15426 self.job_type.as_ref().and_then(|v| match v {
15427 crate::model::ordered_job::JobType::HiveJob(v) => std::option::Option::Some(v),
15428 _ => std::option::Option::None,
15429 })
15430 }
15431
15432 pub fn pig_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PigJob>> {
15436 #[allow(unreachable_patterns)]
15437 self.job_type.as_ref().and_then(|v| match v {
15438 crate::model::ordered_job::JobType::PigJob(v) => std::option::Option::Some(v),
15439 _ => std::option::Option::None,
15440 })
15441 }
15442
15443 pub fn spark_r_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkRJob>> {
15447 #[allow(unreachable_patterns)]
15448 self.job_type.as_ref().and_then(|v| match v {
15449 crate::model::ordered_job::JobType::SparkRJob(v) => std::option::Option::Some(v),
15450 _ => std::option::Option::None,
15451 })
15452 }
15453
15454 pub fn spark_sql_job(
15458 &self,
15459 ) -> std::option::Option<&std::boxed::Box<crate::model::SparkSqlJob>> {
15460 #[allow(unreachable_patterns)]
15461 self.job_type.as_ref().and_then(|v| match v {
15462 crate::model::ordered_job::JobType::SparkSqlJob(v) => std::option::Option::Some(v),
15463 _ => std::option::Option::None,
15464 })
15465 }
15466
15467 pub fn presto_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PrestoJob>> {
15471 #[allow(unreachable_patterns)]
15472 self.job_type.as_ref().and_then(|v| match v {
15473 crate::model::ordered_job::JobType::PrestoJob(v) => std::option::Option::Some(v),
15474 _ => std::option::Option::None,
15475 })
15476 }
15477
15478 pub fn trino_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::TrinoJob>> {
15482 #[allow(unreachable_patterns)]
15483 self.job_type.as_ref().and_then(|v| match v {
15484 crate::model::ordered_job::JobType::TrinoJob(v) => std::option::Option::Some(v),
15485 _ => std::option::Option::None,
15486 })
15487 }
15488
15489 pub fn flink_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::FlinkJob>> {
15493 #[allow(unreachable_patterns)]
15494 self.job_type.as_ref().and_then(|v| match v {
15495 crate::model::ordered_job::JobType::FlinkJob(v) => std::option::Option::Some(v),
15496 _ => std::option::Option::None,
15497 })
15498 }
15499
15500 pub fn set_hadoop_job<T: std::convert::Into<std::boxed::Box<crate::model::HadoopJob>>>(
15506 mut self,
15507 v: T,
15508 ) -> Self {
15509 self.job_type =
15510 std::option::Option::Some(crate::model::ordered_job::JobType::HadoopJob(v.into()));
15511 self
15512 }
15513
15514 pub fn set_spark_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkJob>>>(
15520 mut self,
15521 v: T,
15522 ) -> Self {
15523 self.job_type =
15524 std::option::Option::Some(crate::model::ordered_job::JobType::SparkJob(v.into()));
15525 self
15526 }
15527
15528 pub fn set_pyspark_job<T: std::convert::Into<std::boxed::Box<crate::model::PySparkJob>>>(
15534 mut self,
15535 v: T,
15536 ) -> Self {
15537 self.job_type =
15538 std::option::Option::Some(crate::model::ordered_job::JobType::PysparkJob(v.into()));
15539 self
15540 }
15541
15542 pub fn set_hive_job<T: std::convert::Into<std::boxed::Box<crate::model::HiveJob>>>(
15548 mut self,
15549 v: T,
15550 ) -> Self {
15551 self.job_type =
15552 std::option::Option::Some(crate::model::ordered_job::JobType::HiveJob(v.into()));
15553 self
15554 }
15555
15556 pub fn set_pig_job<T: std::convert::Into<std::boxed::Box<crate::model::PigJob>>>(
15562 mut self,
15563 v: T,
15564 ) -> Self {
15565 self.job_type =
15566 std::option::Option::Some(crate::model::ordered_job::JobType::PigJob(v.into()));
15567 self
15568 }
15569
15570 pub fn set_spark_r_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkRJob>>>(
15576 mut self,
15577 v: T,
15578 ) -> Self {
15579 self.job_type =
15580 std::option::Option::Some(crate::model::ordered_job::JobType::SparkRJob(v.into()));
15581 self
15582 }
15583
15584 pub fn set_spark_sql_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkSqlJob>>>(
15590 mut self,
15591 v: T,
15592 ) -> Self {
15593 self.job_type =
15594 std::option::Option::Some(crate::model::ordered_job::JobType::SparkSqlJob(v.into()));
15595 self
15596 }
15597
15598 pub fn set_presto_job<T: std::convert::Into<std::boxed::Box<crate::model::PrestoJob>>>(
15604 mut self,
15605 v: T,
15606 ) -> Self {
15607 self.job_type =
15608 std::option::Option::Some(crate::model::ordered_job::JobType::PrestoJob(v.into()));
15609 self
15610 }
15611
15612 pub fn set_trino_job<T: std::convert::Into<std::boxed::Box<crate::model::TrinoJob>>>(
15618 mut self,
15619 v: T,
15620 ) -> Self {
15621 self.job_type =
15622 std::option::Option::Some(crate::model::ordered_job::JobType::TrinoJob(v.into()));
15623 self
15624 }
15625
15626 pub fn set_flink_job<T: std::convert::Into<std::boxed::Box<crate::model::FlinkJob>>>(
15632 mut self,
15633 v: T,
15634 ) -> Self {
15635 self.job_type =
15636 std::option::Option::Some(crate::model::ordered_job::JobType::FlinkJob(v.into()));
15637 self
15638 }
15639}
15640
15641impl wkt::message::Message for OrderedJob {
15642 fn typename() -> &'static str {
15643 "type.googleapis.com/google.cloud.dataproc.v1.OrderedJob"
15644 }
15645}
15646
15647pub mod ordered_job {
15649 #[allow(unused_imports)]
15650 use super::*;
15651
15652 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
15654 #[serde(rename_all = "camelCase")]
15655 #[non_exhaustive]
15656 pub enum JobType {
15657 HadoopJob(std::boxed::Box<crate::model::HadoopJob>),
15659 SparkJob(std::boxed::Box<crate::model::SparkJob>),
15661 PysparkJob(std::boxed::Box<crate::model::PySparkJob>),
15663 HiveJob(std::boxed::Box<crate::model::HiveJob>),
15665 PigJob(std::boxed::Box<crate::model::PigJob>),
15667 SparkRJob(std::boxed::Box<crate::model::SparkRJob>),
15669 SparkSqlJob(std::boxed::Box<crate::model::SparkSqlJob>),
15671 PrestoJob(std::boxed::Box<crate::model::PrestoJob>),
15673 TrinoJob(std::boxed::Box<crate::model::TrinoJob>),
15675 FlinkJob(std::boxed::Box<crate::model::FlinkJob>),
15677 }
15678}
15679
15680#[serde_with::serde_as]
15691#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15692#[serde(default, rename_all = "camelCase")]
15693#[non_exhaustive]
15694pub struct TemplateParameter {
15695 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15703 pub name: std::string::String,
15704
15705 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
15753 pub fields: std::vec::Vec<std::string::String>,
15754
15755 #[serde(skip_serializing_if = "std::string::String::is_empty")]
15758 pub description: std::string::String,
15759
15760 #[serde(skip_serializing_if = "std::option::Option::is_none")]
15762 pub validation: std::option::Option<crate::model::ParameterValidation>,
15763
15764 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15765 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15766}
15767
15768impl TemplateParameter {
15769 pub fn new() -> Self {
15770 std::default::Default::default()
15771 }
15772
15773 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15775 self.name = v.into();
15776 self
15777 }
15778
15779 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15781 self.description = v.into();
15782 self
15783 }
15784
15785 pub fn set_validation<
15787 T: std::convert::Into<std::option::Option<crate::model::ParameterValidation>>,
15788 >(
15789 mut self,
15790 v: T,
15791 ) -> Self {
15792 self.validation = v.into();
15793 self
15794 }
15795
15796 pub fn set_fields<T, V>(mut self, v: T) -> Self
15798 where
15799 T: std::iter::IntoIterator<Item = V>,
15800 V: std::convert::Into<std::string::String>,
15801 {
15802 use std::iter::Iterator;
15803 self.fields = v.into_iter().map(|i| i.into()).collect();
15804 self
15805 }
15806}
15807
15808impl wkt::message::Message for TemplateParameter {
15809 fn typename() -> &'static str {
15810 "type.googleapis.com/google.cloud.dataproc.v1.TemplateParameter"
15811 }
15812}
15813
15814#[serde_with::serde_as]
15816#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15817#[serde(default, rename_all = "camelCase")]
15818#[non_exhaustive]
15819pub struct ParameterValidation {
15820 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
15822 pub validation_type: std::option::Option<crate::model::parameter_validation::ValidationType>,
15823
15824 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15825 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15826}
15827
15828impl ParameterValidation {
15829 pub fn new() -> Self {
15830 std::default::Default::default()
15831 }
15832
15833 pub fn set_validation_type<
15838 T: std::convert::Into<std::option::Option<crate::model::parameter_validation::ValidationType>>,
15839 >(
15840 mut self,
15841 v: T,
15842 ) -> Self {
15843 self.validation_type = v.into();
15844 self
15845 }
15846
15847 pub fn regex(&self) -> std::option::Option<&std::boxed::Box<crate::model::RegexValidation>> {
15851 #[allow(unreachable_patterns)]
15852 self.validation_type.as_ref().and_then(|v| match v {
15853 crate::model::parameter_validation::ValidationType::Regex(v) => {
15854 std::option::Option::Some(v)
15855 }
15856 _ => std::option::Option::None,
15857 })
15858 }
15859
15860 pub fn values(&self) -> std::option::Option<&std::boxed::Box<crate::model::ValueValidation>> {
15864 #[allow(unreachable_patterns)]
15865 self.validation_type.as_ref().and_then(|v| match v {
15866 crate::model::parameter_validation::ValidationType::Values(v) => {
15867 std::option::Option::Some(v)
15868 }
15869 _ => std::option::Option::None,
15870 })
15871 }
15872
15873 pub fn set_regex<T: std::convert::Into<std::boxed::Box<crate::model::RegexValidation>>>(
15879 mut self,
15880 v: T,
15881 ) -> Self {
15882 self.validation_type = std::option::Option::Some(
15883 crate::model::parameter_validation::ValidationType::Regex(v.into()),
15884 );
15885 self
15886 }
15887
15888 pub fn set_values<T: std::convert::Into<std::boxed::Box<crate::model::ValueValidation>>>(
15894 mut self,
15895 v: T,
15896 ) -> Self {
15897 self.validation_type = std::option::Option::Some(
15898 crate::model::parameter_validation::ValidationType::Values(v.into()),
15899 );
15900 self
15901 }
15902}
15903
15904impl wkt::message::Message for ParameterValidation {
15905 fn typename() -> &'static str {
15906 "type.googleapis.com/google.cloud.dataproc.v1.ParameterValidation"
15907 }
15908}
15909
15910pub mod parameter_validation {
15912 #[allow(unused_imports)]
15913 use super::*;
15914
15915 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
15917 #[serde(rename_all = "camelCase")]
15918 #[non_exhaustive]
15919 pub enum ValidationType {
15920 Regex(std::boxed::Box<crate::model::RegexValidation>),
15922 Values(std::boxed::Box<crate::model::ValueValidation>),
15924 }
15925}
15926
15927#[serde_with::serde_as]
15929#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15930#[serde(default, rename_all = "camelCase")]
15931#[non_exhaustive]
15932pub struct RegexValidation {
15933 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
15937 pub regexes: std::vec::Vec<std::string::String>,
15938
15939 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15940 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15941}
15942
15943impl RegexValidation {
15944 pub fn new() -> Self {
15945 std::default::Default::default()
15946 }
15947
15948 pub fn set_regexes<T, V>(mut self, v: T) -> Self
15950 where
15951 T: std::iter::IntoIterator<Item = V>,
15952 V: std::convert::Into<std::string::String>,
15953 {
15954 use std::iter::Iterator;
15955 self.regexes = v.into_iter().map(|i| i.into()).collect();
15956 self
15957 }
15958}
15959
15960impl wkt::message::Message for RegexValidation {
15961 fn typename() -> &'static str {
15962 "type.googleapis.com/google.cloud.dataproc.v1.RegexValidation"
15963 }
15964}
15965
15966#[serde_with::serde_as]
15968#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
15969#[serde(default, rename_all = "camelCase")]
15970#[non_exhaustive]
15971pub struct ValueValidation {
15972 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
15974 pub values: std::vec::Vec<std::string::String>,
15975
15976 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
15977 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15978}
15979
15980impl ValueValidation {
15981 pub fn new() -> Self {
15982 std::default::Default::default()
15983 }
15984
15985 pub fn set_values<T, V>(mut self, v: T) -> Self
15987 where
15988 T: std::iter::IntoIterator<Item = V>,
15989 V: std::convert::Into<std::string::String>,
15990 {
15991 use std::iter::Iterator;
15992 self.values = v.into_iter().map(|i| i.into()).collect();
15993 self
15994 }
15995}
15996
15997impl wkt::message::Message for ValueValidation {
15998 fn typename() -> &'static str {
15999 "type.googleapis.com/google.cloud.dataproc.v1.ValueValidation"
16000 }
16001}
16002
16003#[serde_with::serde_as]
16005#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16006#[serde(default, rename_all = "camelCase")]
16007#[non_exhaustive]
16008pub struct WorkflowMetadata {
16009 #[serde(skip_serializing_if = "std::string::String::is_empty")]
16021 pub template: std::string::String,
16022
16023 pub version: i32,
16026
16027 #[serde(skip_serializing_if = "std::option::Option::is_none")]
16029 pub create_cluster: std::option::Option<crate::model::ClusterOperation>,
16030
16031 #[serde(skip_serializing_if = "std::option::Option::is_none")]
16033 pub graph: std::option::Option<crate::model::WorkflowGraph>,
16034
16035 #[serde(skip_serializing_if = "std::option::Option::is_none")]
16037 pub delete_cluster: std::option::Option<crate::model::ClusterOperation>,
16038
16039 pub state: crate::model::workflow_metadata::State,
16041
16042 #[serde(skip_serializing_if = "std::string::String::is_empty")]
16044 pub cluster_name: std::string::String,
16045
16046 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
16048 pub parameters: std::collections::HashMap<std::string::String, std::string::String>,
16049
16050 #[serde(skip_serializing_if = "std::option::Option::is_none")]
16052 pub start_time: std::option::Option<wkt::Timestamp>,
16053
16054 #[serde(skip_serializing_if = "std::option::Option::is_none")]
16056 pub end_time: std::option::Option<wkt::Timestamp>,
16057
16058 #[serde(skip_serializing_if = "std::string::String::is_empty")]
16060 pub cluster_uuid: std::string::String,
16061
16062 #[serde(skip_serializing_if = "std::option::Option::is_none")]
16066 pub dag_timeout: std::option::Option<wkt::Duration>,
16067
16068 #[serde(skip_serializing_if = "std::option::Option::is_none")]
16074 pub dag_start_time: std::option::Option<wkt::Timestamp>,
16075
16076 #[serde(skip_serializing_if = "std::option::Option::is_none")]
16082 pub dag_end_time: std::option::Option<wkt::Timestamp>,
16083
16084 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16085 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16086}
16087
16088impl WorkflowMetadata {
16089 pub fn new() -> Self {
16090 std::default::Default::default()
16091 }
16092
16093 pub fn set_template<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16095 self.template = v.into();
16096 self
16097 }
16098
16099 pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16101 self.version = v.into();
16102 self
16103 }
16104
16105 pub fn set_create_cluster<
16107 T: std::convert::Into<std::option::Option<crate::model::ClusterOperation>>,
16108 >(
16109 mut self,
16110 v: T,
16111 ) -> Self {
16112 self.create_cluster = v.into();
16113 self
16114 }
16115
16116 pub fn set_graph<T: std::convert::Into<std::option::Option<crate::model::WorkflowGraph>>>(
16118 mut self,
16119 v: T,
16120 ) -> Self {
16121 self.graph = v.into();
16122 self
16123 }
16124
16125 pub fn set_delete_cluster<
16127 T: std::convert::Into<std::option::Option<crate::model::ClusterOperation>>,
16128 >(
16129 mut self,
16130 v: T,
16131 ) -> Self {
16132 self.delete_cluster = v.into();
16133 self
16134 }
16135
16136 pub fn set_state<T: std::convert::Into<crate::model::workflow_metadata::State>>(
16138 mut self,
16139 v: T,
16140 ) -> Self {
16141 self.state = v.into();
16142 self
16143 }
16144
16145 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16147 self.cluster_name = v.into();
16148 self
16149 }
16150
16151 pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
16153 mut self,
16154 v: T,
16155 ) -> Self {
16156 self.start_time = v.into();
16157 self
16158 }
16159
16160 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
16162 mut self,
16163 v: T,
16164 ) -> Self {
16165 self.end_time = v.into();
16166 self
16167 }
16168
16169 pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16171 self.cluster_uuid = v.into();
16172 self
16173 }
16174
16175 pub fn set_dag_timeout<T: std::convert::Into<std::option::Option<wkt::Duration>>>(
16177 mut self,
16178 v: T,
16179 ) -> Self {
16180 self.dag_timeout = v.into();
16181 self
16182 }
16183
16184 pub fn set_dag_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
16186 mut self,
16187 v: T,
16188 ) -> Self {
16189 self.dag_start_time = v.into();
16190 self
16191 }
16192
16193 pub fn set_dag_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
16195 mut self,
16196 v: T,
16197 ) -> Self {
16198 self.dag_end_time = v.into();
16199 self
16200 }
16201
16202 pub fn set_parameters<T, K, V>(mut self, v: T) -> Self
16204 where
16205 T: std::iter::IntoIterator<Item = (K, V)>,
16206 K: std::convert::Into<std::string::String>,
16207 V: std::convert::Into<std::string::String>,
16208 {
16209 use std::iter::Iterator;
16210 self.parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16211 self
16212 }
16213}
16214
16215impl wkt::message::Message for WorkflowMetadata {
16216 fn typename() -> &'static str {
16217 "type.googleapis.com/google.cloud.dataproc.v1.WorkflowMetadata"
16218 }
16219}
16220
16221pub mod workflow_metadata {
16223 #[allow(unused_imports)]
16224 use super::*;
16225
16226 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
16228 pub struct State(i32);
16229
16230 impl State {
16231 pub const UNKNOWN: State = State::new(0);
16233
16234 pub const PENDING: State = State::new(1);
16236
16237 pub const RUNNING: State = State::new(2);
16239
16240 pub const DONE: State = State::new(3);
16242
16243 pub(crate) const fn new(value: i32) -> Self {
16245 Self(value)
16246 }
16247
16248 pub fn value(&self) -> i32 {
16250 self.0
16251 }
16252
16253 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
16255 match self.0 {
16256 0 => std::borrow::Cow::Borrowed("UNKNOWN"),
16257 1 => std::borrow::Cow::Borrowed("PENDING"),
16258 2 => std::borrow::Cow::Borrowed("RUNNING"),
16259 3 => std::borrow::Cow::Borrowed("DONE"),
16260 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
16261 }
16262 }
16263
16264 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
16266 match name {
16267 "UNKNOWN" => std::option::Option::Some(Self::UNKNOWN),
16268 "PENDING" => std::option::Option::Some(Self::PENDING),
16269 "RUNNING" => std::option::Option::Some(Self::RUNNING),
16270 "DONE" => std::option::Option::Some(Self::DONE),
16271 _ => std::option::Option::None,
16272 }
16273 }
16274 }
16275
16276 impl std::convert::From<i32> for State {
16277 fn from(value: i32) -> Self {
16278 Self::new(value)
16279 }
16280 }
16281
16282 impl std::default::Default for State {
16283 fn default() -> Self {
16284 Self::new(0)
16285 }
16286 }
16287}
16288
16289#[serde_with::serde_as]
16291#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16292#[serde(default, rename_all = "camelCase")]
16293#[non_exhaustive]
16294pub struct ClusterOperation {
16295 #[serde(skip_serializing_if = "std::string::String::is_empty")]
16297 pub operation_id: std::string::String,
16298
16299 #[serde(skip_serializing_if = "std::string::String::is_empty")]
16301 pub error: std::string::String,
16302
16303 pub done: bool,
16305
16306 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16307 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16308}
16309
16310impl ClusterOperation {
16311 pub fn new() -> Self {
16312 std::default::Default::default()
16313 }
16314
16315 pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16317 self.operation_id = v.into();
16318 self
16319 }
16320
16321 pub fn set_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16323 self.error = v.into();
16324 self
16325 }
16326
16327 pub fn set_done<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16329 self.done = v.into();
16330 self
16331 }
16332}
16333
16334impl wkt::message::Message for ClusterOperation {
16335 fn typename() -> &'static str {
16336 "type.googleapis.com/google.cloud.dataproc.v1.ClusterOperation"
16337 }
16338}
16339
16340#[serde_with::serde_as]
16342#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16343#[serde(default, rename_all = "camelCase")]
16344#[non_exhaustive]
16345pub struct WorkflowGraph {
16346 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
16348 pub nodes: std::vec::Vec<crate::model::WorkflowNode>,
16349
16350 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16351 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16352}
16353
16354impl WorkflowGraph {
16355 pub fn new() -> Self {
16356 std::default::Default::default()
16357 }
16358
16359 pub fn set_nodes<T, V>(mut self, v: T) -> Self
16361 where
16362 T: std::iter::IntoIterator<Item = V>,
16363 V: std::convert::Into<crate::model::WorkflowNode>,
16364 {
16365 use std::iter::Iterator;
16366 self.nodes = v.into_iter().map(|i| i.into()).collect();
16367 self
16368 }
16369}
16370
16371impl wkt::message::Message for WorkflowGraph {
16372 fn typename() -> &'static str {
16373 "type.googleapis.com/google.cloud.dataproc.v1.WorkflowGraph"
16374 }
16375}
16376
16377#[serde_with::serde_as]
16379#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16380#[serde(default, rename_all = "camelCase")]
16381#[non_exhaustive]
16382pub struct WorkflowNode {
16383 #[serde(skip_serializing_if = "std::string::String::is_empty")]
16385 pub step_id: std::string::String,
16386
16387 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
16389 pub prerequisite_step_ids: std::vec::Vec<std::string::String>,
16390
16391 #[serde(skip_serializing_if = "std::string::String::is_empty")]
16393 pub job_id: std::string::String,
16394
16395 pub state: crate::model::workflow_node::NodeState,
16397
16398 #[serde(skip_serializing_if = "std::string::String::is_empty")]
16400 pub error: std::string::String,
16401
16402 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16403 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16404}
16405
16406impl WorkflowNode {
16407 pub fn new() -> Self {
16408 std::default::Default::default()
16409 }
16410
16411 pub fn set_step_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16413 self.step_id = v.into();
16414 self
16415 }
16416
16417 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16419 self.job_id = v.into();
16420 self
16421 }
16422
16423 pub fn set_state<T: std::convert::Into<crate::model::workflow_node::NodeState>>(
16425 mut self,
16426 v: T,
16427 ) -> Self {
16428 self.state = v.into();
16429 self
16430 }
16431
16432 pub fn set_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16434 self.error = v.into();
16435 self
16436 }
16437
16438 pub fn set_prerequisite_step_ids<T, V>(mut self, v: T) -> Self
16440 where
16441 T: std::iter::IntoIterator<Item = V>,
16442 V: std::convert::Into<std::string::String>,
16443 {
16444 use std::iter::Iterator;
16445 self.prerequisite_step_ids = v.into_iter().map(|i| i.into()).collect();
16446 self
16447 }
16448}
16449
16450impl wkt::message::Message for WorkflowNode {
16451 fn typename() -> &'static str {
16452 "type.googleapis.com/google.cloud.dataproc.v1.WorkflowNode"
16453 }
16454}
16455
16456pub mod workflow_node {
16458 #[allow(unused_imports)]
16459 use super::*;
16460
16461 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
16463 pub struct NodeState(i32);
16464
16465 impl NodeState {
16466 pub const NODE_STATE_UNSPECIFIED: NodeState = NodeState::new(0);
16468
16469 pub const BLOCKED: NodeState = NodeState::new(1);
16471
16472 pub const RUNNABLE: NodeState = NodeState::new(2);
16474
16475 pub const RUNNING: NodeState = NodeState::new(3);
16477
16478 pub const COMPLETED: NodeState = NodeState::new(4);
16480
16481 pub const FAILED: NodeState = NodeState::new(5);
16484
16485 pub(crate) const fn new(value: i32) -> Self {
16487 Self(value)
16488 }
16489
16490 pub fn value(&self) -> i32 {
16492 self.0
16493 }
16494
16495 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
16497 match self.0 {
16498 0 => std::borrow::Cow::Borrowed("NODE_STATE_UNSPECIFIED"),
16499 1 => std::borrow::Cow::Borrowed("BLOCKED"),
16500 2 => std::borrow::Cow::Borrowed("RUNNABLE"),
16501 3 => std::borrow::Cow::Borrowed("RUNNING"),
16502 4 => std::borrow::Cow::Borrowed("COMPLETED"),
16503 5 => std::borrow::Cow::Borrowed("FAILED"),
16504 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
16505 }
16506 }
16507
16508 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
16510 match name {
16511 "NODE_STATE_UNSPECIFIED" => std::option::Option::Some(Self::NODE_STATE_UNSPECIFIED),
16512 "BLOCKED" => std::option::Option::Some(Self::BLOCKED),
16513 "RUNNABLE" => std::option::Option::Some(Self::RUNNABLE),
16514 "RUNNING" => std::option::Option::Some(Self::RUNNING),
16515 "COMPLETED" => std::option::Option::Some(Self::COMPLETED),
16516 "FAILED" => std::option::Option::Some(Self::FAILED),
16517 _ => std::option::Option::None,
16518 }
16519 }
16520 }
16521
16522 impl std::convert::From<i32> for NodeState {
16523 fn from(value: i32) -> Self {
16524 Self::new(value)
16525 }
16526 }
16527
16528 impl std::default::Default for NodeState {
16529 fn default() -> Self {
16530 Self::new(0)
16531 }
16532 }
16533}
16534
16535#[serde_with::serde_as]
16537#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16538#[serde(default, rename_all = "camelCase")]
16539#[non_exhaustive]
16540pub struct CreateWorkflowTemplateRequest {
16541 #[serde(skip_serializing_if = "std::string::String::is_empty")]
16553 pub parent: std::string::String,
16554
16555 #[serde(skip_serializing_if = "std::option::Option::is_none")]
16557 pub template: std::option::Option<crate::model::WorkflowTemplate>,
16558
16559 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16560 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16561}
16562
16563impl CreateWorkflowTemplateRequest {
16564 pub fn new() -> Self {
16565 std::default::Default::default()
16566 }
16567
16568 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16570 self.parent = v.into();
16571 self
16572 }
16573
16574 pub fn set_template<
16576 T: std::convert::Into<std::option::Option<crate::model::WorkflowTemplate>>,
16577 >(
16578 mut self,
16579 v: T,
16580 ) -> Self {
16581 self.template = v.into();
16582 self
16583 }
16584}
16585
16586impl wkt::message::Message for CreateWorkflowTemplateRequest {
16587 fn typename() -> &'static str {
16588 "type.googleapis.com/google.cloud.dataproc.v1.CreateWorkflowTemplateRequest"
16589 }
16590}
16591
16592#[serde_with::serde_as]
16594#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16595#[serde(default, rename_all = "camelCase")]
16596#[non_exhaustive]
16597pub struct GetWorkflowTemplateRequest {
16598 #[serde(skip_serializing_if = "std::string::String::is_empty")]
16610 pub name: std::string::String,
16611
16612 pub version: i32,
16617
16618 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16619 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16620}
16621
16622impl GetWorkflowTemplateRequest {
16623 pub fn new() -> Self {
16624 std::default::Default::default()
16625 }
16626
16627 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16629 self.name = v.into();
16630 self
16631 }
16632
16633 pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16635 self.version = v.into();
16636 self
16637 }
16638}
16639
16640impl wkt::message::Message for GetWorkflowTemplateRequest {
16641 fn typename() -> &'static str {
16642 "type.googleapis.com/google.cloud.dataproc.v1.GetWorkflowTemplateRequest"
16643 }
16644}
16645
16646#[serde_with::serde_as]
16648#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16649#[serde(default, rename_all = "camelCase")]
16650#[non_exhaustive]
16651pub struct InstantiateWorkflowTemplateRequest {
16652 #[serde(skip_serializing_if = "std::string::String::is_empty")]
16664 pub name: std::string::String,
16665
16666 pub version: i32,
16673
16674 #[serde(skip_serializing_if = "std::string::String::is_empty")]
16684 pub request_id: std::string::String,
16685
16686 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
16689 pub parameters: std::collections::HashMap<std::string::String, std::string::String>,
16690
16691 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16692 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16693}
16694
16695impl InstantiateWorkflowTemplateRequest {
16696 pub fn new() -> Self {
16697 std::default::Default::default()
16698 }
16699
16700 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16702 self.name = v.into();
16703 self
16704 }
16705
16706 pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16708 self.version = v.into();
16709 self
16710 }
16711
16712 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16714 self.request_id = v.into();
16715 self
16716 }
16717
16718 pub fn set_parameters<T, K, V>(mut self, v: T) -> Self
16720 where
16721 T: std::iter::IntoIterator<Item = (K, V)>,
16722 K: std::convert::Into<std::string::String>,
16723 V: std::convert::Into<std::string::String>,
16724 {
16725 use std::iter::Iterator;
16726 self.parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16727 self
16728 }
16729}
16730
16731impl wkt::message::Message for InstantiateWorkflowTemplateRequest {
16732 fn typename() -> &'static str {
16733 "type.googleapis.com/google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest"
16734 }
16735}
16736
16737#[serde_with::serde_as]
16739#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16740#[serde(default, rename_all = "camelCase")]
16741#[non_exhaustive]
16742pub struct InstantiateInlineWorkflowTemplateRequest {
16743 #[serde(skip_serializing_if = "std::string::String::is_empty")]
16755 pub parent: std::string::String,
16756
16757 #[serde(skip_serializing_if = "std::option::Option::is_none")]
16759 pub template: std::option::Option<crate::model::WorkflowTemplate>,
16760
16761 #[serde(skip_serializing_if = "std::string::String::is_empty")]
16771 pub request_id: std::string::String,
16772
16773 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16774 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16775}
16776
16777impl InstantiateInlineWorkflowTemplateRequest {
16778 pub fn new() -> Self {
16779 std::default::Default::default()
16780 }
16781
16782 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16784 self.parent = v.into();
16785 self
16786 }
16787
16788 pub fn set_template<
16790 T: std::convert::Into<std::option::Option<crate::model::WorkflowTemplate>>,
16791 >(
16792 mut self,
16793 v: T,
16794 ) -> Self {
16795 self.template = v.into();
16796 self
16797 }
16798
16799 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16801 self.request_id = v.into();
16802 self
16803 }
16804}
16805
16806impl wkt::message::Message for InstantiateInlineWorkflowTemplateRequest {
16807 fn typename() -> &'static str {
16808 "type.googleapis.com/google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest"
16809 }
16810}
16811
16812#[serde_with::serde_as]
16814#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16815#[serde(default, rename_all = "camelCase")]
16816#[non_exhaustive]
16817pub struct UpdateWorkflowTemplateRequest {
16818 #[serde(skip_serializing_if = "std::option::Option::is_none")]
16822 pub template: std::option::Option<crate::model::WorkflowTemplate>,
16823
16824 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16825 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16826}
16827
16828impl UpdateWorkflowTemplateRequest {
16829 pub fn new() -> Self {
16830 std::default::Default::default()
16831 }
16832
16833 pub fn set_template<
16835 T: std::convert::Into<std::option::Option<crate::model::WorkflowTemplate>>,
16836 >(
16837 mut self,
16838 v: T,
16839 ) -> Self {
16840 self.template = v.into();
16841 self
16842 }
16843}
16844
16845impl wkt::message::Message for UpdateWorkflowTemplateRequest {
16846 fn typename() -> &'static str {
16847 "type.googleapis.com/google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest"
16848 }
16849}
16850
16851#[serde_with::serde_as]
16853#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16854#[serde(default, rename_all = "camelCase")]
16855#[non_exhaustive]
16856pub struct ListWorkflowTemplatesRequest {
16857 #[serde(skip_serializing_if = "std::string::String::is_empty")]
16869 pub parent: std::string::String,
16870
16871 pub page_size: i32,
16873
16874 #[serde(skip_serializing_if = "std::string::String::is_empty")]
16877 pub page_token: std::string::String,
16878
16879 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16880 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16881}
16882
16883impl ListWorkflowTemplatesRequest {
16884 pub fn new() -> Self {
16885 std::default::Default::default()
16886 }
16887
16888 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16890 self.parent = v.into();
16891 self
16892 }
16893
16894 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16896 self.page_size = v.into();
16897 self
16898 }
16899
16900 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16902 self.page_token = v.into();
16903 self
16904 }
16905}
16906
16907impl wkt::message::Message for ListWorkflowTemplatesRequest {
16908 fn typename() -> &'static str {
16909 "type.googleapis.com/google.cloud.dataproc.v1.ListWorkflowTemplatesRequest"
16910 }
16911}
16912
16913#[serde_with::serde_as]
16915#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16916#[serde(default, rename_all = "camelCase")]
16917#[non_exhaustive]
16918pub struct ListWorkflowTemplatesResponse {
16919 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
16921 pub templates: std::vec::Vec<crate::model::WorkflowTemplate>,
16922
16923 #[serde(skip_serializing_if = "std::string::String::is_empty")]
16927 pub next_page_token: std::string::String,
16928
16929 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
16933 pub unreachable: std::vec::Vec<std::string::String>,
16934
16935 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
16936 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16937}
16938
16939impl ListWorkflowTemplatesResponse {
16940 pub fn new() -> Self {
16941 std::default::Default::default()
16942 }
16943
16944 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16946 self.next_page_token = v.into();
16947 self
16948 }
16949
16950 pub fn set_templates<T, V>(mut self, v: T) -> Self
16952 where
16953 T: std::iter::IntoIterator<Item = V>,
16954 V: std::convert::Into<crate::model::WorkflowTemplate>,
16955 {
16956 use std::iter::Iterator;
16957 self.templates = v.into_iter().map(|i| i.into()).collect();
16958 self
16959 }
16960
16961 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
16963 where
16964 T: std::iter::IntoIterator<Item = V>,
16965 V: std::convert::Into<std::string::String>,
16966 {
16967 use std::iter::Iterator;
16968 self.unreachable = v.into_iter().map(|i| i.into()).collect();
16969 self
16970 }
16971}
16972
16973impl wkt::message::Message for ListWorkflowTemplatesResponse {
16974 fn typename() -> &'static str {
16975 "type.googleapis.com/google.cloud.dataproc.v1.ListWorkflowTemplatesResponse"
16976 }
16977}
16978
16979#[doc(hidden)]
16980impl gax::paginator::internal::PageableResponse for ListWorkflowTemplatesResponse {
16981 type PageItem = crate::model::WorkflowTemplate;
16982
16983 fn items(self) -> std::vec::Vec<Self::PageItem> {
16984 self.templates
16985 }
16986
16987 fn next_page_token(&self) -> std::string::String {
16988 use std::clone::Clone;
16989 self.next_page_token.clone()
16990 }
16991}
16992
16993#[serde_with::serde_as]
16997#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
16998#[serde(default, rename_all = "camelCase")]
16999#[non_exhaustive]
17000pub struct DeleteWorkflowTemplateRequest {
17001 #[serde(skip_serializing_if = "std::string::String::is_empty")]
17013 pub name: std::string::String,
17014
17015 pub version: i32,
17019
17020 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
17021 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17022}
17023
17024impl DeleteWorkflowTemplateRequest {
17025 pub fn new() -> Self {
17026 std::default::Default::default()
17027 }
17028
17029 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17031 self.name = v.into();
17032 self
17033 }
17034
17035 pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17037 self.version = v.into();
17038 self
17039 }
17040}
17041
17042impl wkt::message::Message for DeleteWorkflowTemplateRequest {
17043 fn typename() -> &'static str {
17044 "type.googleapis.com/google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest"
17045 }
17046}
17047
17048#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
17050pub struct Component(i32);
17051
17052impl Component {
17053 pub const COMPONENT_UNSPECIFIED: Component = Component::new(0);
17055
17056 pub const ANACONDA: Component = Component::new(5);
17062
17063 pub const DOCKER: Component = Component::new(13);
17065
17066 pub const DRUID: Component = Component::new(9);
17068
17069 pub const FLINK: Component = Component::new(14);
17071
17072 pub const HBASE: Component = Component::new(11);
17074
17075 pub const HIVE_WEBHCAT: Component = Component::new(3);
17077
17078 pub const HUDI: Component = Component::new(18);
17080
17081 pub const JUPYTER: Component = Component::new(1);
17083
17084 pub const PRESTO: Component = Component::new(6);
17086
17087 pub const TRINO: Component = Component::new(17);
17089
17090 pub const RANGER: Component = Component::new(12);
17092
17093 pub const SOLR: Component = Component::new(10);
17095
17096 pub const ZEPPELIN: Component = Component::new(4);
17098
17099 pub const ZOOKEEPER: Component = Component::new(8);
17101
17102 pub(crate) const fn new(value: i32) -> Self {
17104 Self(value)
17105 }
17106
17107 pub fn value(&self) -> i32 {
17109 self.0
17110 }
17111
17112 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
17114 match self.0 {
17115 0 => std::borrow::Cow::Borrowed("COMPONENT_UNSPECIFIED"),
17116 1 => std::borrow::Cow::Borrowed("JUPYTER"),
17117 3 => std::borrow::Cow::Borrowed("HIVE_WEBHCAT"),
17118 4 => std::borrow::Cow::Borrowed("ZEPPELIN"),
17119 5 => std::borrow::Cow::Borrowed("ANACONDA"),
17120 6 => std::borrow::Cow::Borrowed("PRESTO"),
17121 8 => std::borrow::Cow::Borrowed("ZOOKEEPER"),
17122 9 => std::borrow::Cow::Borrowed("DRUID"),
17123 10 => std::borrow::Cow::Borrowed("SOLR"),
17124 11 => std::borrow::Cow::Borrowed("HBASE"),
17125 12 => std::borrow::Cow::Borrowed("RANGER"),
17126 13 => std::borrow::Cow::Borrowed("DOCKER"),
17127 14 => std::borrow::Cow::Borrowed("FLINK"),
17128 17 => std::borrow::Cow::Borrowed("TRINO"),
17129 18 => std::borrow::Cow::Borrowed("HUDI"),
17130 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
17131 }
17132 }
17133
17134 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
17136 match name {
17137 "COMPONENT_UNSPECIFIED" => std::option::Option::Some(Self::COMPONENT_UNSPECIFIED),
17138 "ANACONDA" => std::option::Option::Some(Self::ANACONDA),
17139 "DOCKER" => std::option::Option::Some(Self::DOCKER),
17140 "DRUID" => std::option::Option::Some(Self::DRUID),
17141 "FLINK" => std::option::Option::Some(Self::FLINK),
17142 "HBASE" => std::option::Option::Some(Self::HBASE),
17143 "HIVE_WEBHCAT" => std::option::Option::Some(Self::HIVE_WEBHCAT),
17144 "HUDI" => std::option::Option::Some(Self::HUDI),
17145 "JUPYTER" => std::option::Option::Some(Self::JUPYTER),
17146 "PRESTO" => std::option::Option::Some(Self::PRESTO),
17147 "TRINO" => std::option::Option::Some(Self::TRINO),
17148 "RANGER" => std::option::Option::Some(Self::RANGER),
17149 "SOLR" => std::option::Option::Some(Self::SOLR),
17150 "ZEPPELIN" => std::option::Option::Some(Self::ZEPPELIN),
17151 "ZOOKEEPER" => std::option::Option::Some(Self::ZOOKEEPER),
17152 _ => std::option::Option::None,
17153 }
17154 }
17155}
17156
17157impl std::convert::From<i32> for Component {
17158 fn from(value: i32) -> Self {
17159 Self::new(value)
17160 }
17161}
17162
17163impl std::default::Default for Component {
17164 fn default() -> Self {
17165 Self::new(0)
17166 }
17167}
17168
17169#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
17171pub struct FailureAction(i32);
17172
17173impl FailureAction {
17174 pub const FAILURE_ACTION_UNSPECIFIED: FailureAction = FailureAction::new(0);
17176
17177 pub const NO_ACTION: FailureAction = FailureAction::new(1);
17180
17181 pub const DELETE: FailureAction = FailureAction::new(2);
17183
17184 pub(crate) const fn new(value: i32) -> Self {
17186 Self(value)
17187 }
17188
17189 pub fn value(&self) -> i32 {
17191 self.0
17192 }
17193
17194 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
17196 match self.0 {
17197 0 => std::borrow::Cow::Borrowed("FAILURE_ACTION_UNSPECIFIED"),
17198 1 => std::borrow::Cow::Borrowed("NO_ACTION"),
17199 2 => std::borrow::Cow::Borrowed("DELETE"),
17200 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
17201 }
17202 }
17203
17204 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
17206 match name {
17207 "FAILURE_ACTION_UNSPECIFIED" => {
17208 std::option::Option::Some(Self::FAILURE_ACTION_UNSPECIFIED)
17209 }
17210 "NO_ACTION" => std::option::Option::Some(Self::NO_ACTION),
17211 "DELETE" => std::option::Option::Some(Self::DELETE),
17212 _ => std::option::Option::None,
17213 }
17214 }
17215}
17216
17217impl std::convert::From<i32> for FailureAction {
17218 fn from(value: i32) -> Self {
17219 Self::new(value)
17220 }
17221}
17222
17223impl std::default::Default for FailureAction {
17224 fn default() -> Self {
17225 Self::new(0)
17226 }
17227}