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
37mod debug;
38mod deserialize;
39mod serialize;
40
41#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct AutoscalingPolicy {
45 pub id: std::string::String,
51
52 pub name: std::string::String,
64
65 pub worker_config: std::option::Option<crate::model::InstanceGroupAutoscalingPolicyConfig>,
67
68 pub secondary_worker_config:
70 std::option::Option<crate::model::InstanceGroupAutoscalingPolicyConfig>,
71
72 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
80
81 pub algorithm: std::option::Option<crate::model::autoscaling_policy::Algorithm>,
83
84 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
85}
86
87impl AutoscalingPolicy {
88 pub fn new() -> Self {
89 std::default::Default::default()
90 }
91
92 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
94 self.id = v.into();
95 self
96 }
97
98 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
100 self.name = v.into();
101 self
102 }
103
104 pub fn set_worker_config<T>(mut self, v: T) -> Self
106 where
107 T: std::convert::Into<crate::model::InstanceGroupAutoscalingPolicyConfig>,
108 {
109 self.worker_config = std::option::Option::Some(v.into());
110 self
111 }
112
113 pub fn set_or_clear_worker_config<T>(mut self, v: std::option::Option<T>) -> Self
115 where
116 T: std::convert::Into<crate::model::InstanceGroupAutoscalingPolicyConfig>,
117 {
118 self.worker_config = v.map(|x| x.into());
119 self
120 }
121
122 pub fn set_secondary_worker_config<T>(mut self, v: T) -> Self
124 where
125 T: std::convert::Into<crate::model::InstanceGroupAutoscalingPolicyConfig>,
126 {
127 self.secondary_worker_config = std::option::Option::Some(v.into());
128 self
129 }
130
131 pub fn set_or_clear_secondary_worker_config<T>(mut self, v: std::option::Option<T>) -> Self
133 where
134 T: std::convert::Into<crate::model::InstanceGroupAutoscalingPolicyConfig>,
135 {
136 self.secondary_worker_config = v.map(|x| x.into());
137 self
138 }
139
140 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
142 where
143 T: std::iter::IntoIterator<Item = (K, V)>,
144 K: std::convert::Into<std::string::String>,
145 V: std::convert::Into<std::string::String>,
146 {
147 use std::iter::Iterator;
148 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
149 self
150 }
151
152 pub fn set_algorithm<
157 T: std::convert::Into<std::option::Option<crate::model::autoscaling_policy::Algorithm>>,
158 >(
159 mut self,
160 v: T,
161 ) -> Self {
162 self.algorithm = v.into();
163 self
164 }
165
166 pub fn basic_algorithm(
170 &self,
171 ) -> std::option::Option<&std::boxed::Box<crate::model::BasicAutoscalingAlgorithm>> {
172 #[allow(unreachable_patterns)]
173 self.algorithm.as_ref().and_then(|v| match v {
174 crate::model::autoscaling_policy::Algorithm::BasicAlgorithm(v) => {
175 std::option::Option::Some(v)
176 }
177 _ => std::option::Option::None,
178 })
179 }
180
181 pub fn set_basic_algorithm<
187 T: std::convert::Into<std::boxed::Box<crate::model::BasicAutoscalingAlgorithm>>,
188 >(
189 mut self,
190 v: T,
191 ) -> Self {
192 self.algorithm = std::option::Option::Some(
193 crate::model::autoscaling_policy::Algorithm::BasicAlgorithm(v.into()),
194 );
195 self
196 }
197}
198
199impl wkt::message::Message for AutoscalingPolicy {
200 fn typename() -> &'static str {
201 "type.googleapis.com/google.cloud.dataproc.v1.AutoscalingPolicy"
202 }
203}
204
205pub mod autoscaling_policy {
207 #[allow(unused_imports)]
208 use super::*;
209
210 #[derive(Clone, Debug, PartialEq)]
212 #[non_exhaustive]
213 pub enum Algorithm {
214 BasicAlgorithm(std::boxed::Box<crate::model::BasicAutoscalingAlgorithm>),
215 }
216}
217
218#[derive(Clone, Default, PartialEq)]
220#[non_exhaustive]
221pub struct BasicAutoscalingAlgorithm {
222 pub cooldown_period: std::option::Option<wkt::Duration>,
227
228 pub config: std::option::Option<crate::model::basic_autoscaling_algorithm::Config>,
229
230 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
231}
232
233impl BasicAutoscalingAlgorithm {
234 pub fn new() -> Self {
235 std::default::Default::default()
236 }
237
238 pub fn set_cooldown_period<T>(mut self, v: T) -> Self
240 where
241 T: std::convert::Into<wkt::Duration>,
242 {
243 self.cooldown_period = std::option::Option::Some(v.into());
244 self
245 }
246
247 pub fn set_or_clear_cooldown_period<T>(mut self, v: std::option::Option<T>) -> Self
249 where
250 T: std::convert::Into<wkt::Duration>,
251 {
252 self.cooldown_period = v.map(|x| x.into());
253 self
254 }
255
256 pub fn set_config<
261 T: std::convert::Into<std::option::Option<crate::model::basic_autoscaling_algorithm::Config>>,
262 >(
263 mut self,
264 v: T,
265 ) -> Self {
266 self.config = v.into();
267 self
268 }
269
270 pub fn yarn_config(
274 &self,
275 ) -> std::option::Option<&std::boxed::Box<crate::model::BasicYarnAutoscalingConfig>> {
276 #[allow(unreachable_patterns)]
277 self.config.as_ref().and_then(|v| match v {
278 crate::model::basic_autoscaling_algorithm::Config::YarnConfig(v) => {
279 std::option::Option::Some(v)
280 }
281 _ => std::option::Option::None,
282 })
283 }
284
285 pub fn set_yarn_config<
291 T: std::convert::Into<std::boxed::Box<crate::model::BasicYarnAutoscalingConfig>>,
292 >(
293 mut self,
294 v: T,
295 ) -> Self {
296 self.config = std::option::Option::Some(
297 crate::model::basic_autoscaling_algorithm::Config::YarnConfig(v.into()),
298 );
299 self
300 }
301}
302
303impl wkt::message::Message for BasicAutoscalingAlgorithm {
304 fn typename() -> &'static str {
305 "type.googleapis.com/google.cloud.dataproc.v1.BasicAutoscalingAlgorithm"
306 }
307}
308
309pub mod basic_autoscaling_algorithm {
311 #[allow(unused_imports)]
312 use super::*;
313
314 #[derive(Clone, Debug, PartialEq)]
315 #[non_exhaustive]
316 pub enum Config {
317 YarnConfig(std::boxed::Box<crate::model::BasicYarnAutoscalingConfig>),
319 }
320}
321
322#[derive(Clone, Default, PartialEq)]
324#[non_exhaustive]
325pub struct BasicYarnAutoscalingConfig {
326 pub graceful_decommission_timeout: std::option::Option<wkt::Duration>,
333
334 pub scale_up_factor: f64,
345
346 pub scale_down_factor: f64,
357
358 pub scale_up_min_worker_fraction: f64,
366
367 pub scale_down_min_worker_fraction: f64,
375
376 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
377}
378
379impl BasicYarnAutoscalingConfig {
380 pub fn new() -> Self {
381 std::default::Default::default()
382 }
383
384 pub fn set_graceful_decommission_timeout<T>(mut self, v: T) -> Self
386 where
387 T: std::convert::Into<wkt::Duration>,
388 {
389 self.graceful_decommission_timeout = std::option::Option::Some(v.into());
390 self
391 }
392
393 pub fn set_or_clear_graceful_decommission_timeout<T>(
395 mut self,
396 v: std::option::Option<T>,
397 ) -> Self
398 where
399 T: std::convert::Into<wkt::Duration>,
400 {
401 self.graceful_decommission_timeout = v.map(|x| x.into());
402 self
403 }
404
405 pub fn set_scale_up_factor<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
407 self.scale_up_factor = v.into();
408 self
409 }
410
411 pub fn set_scale_down_factor<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
413 self.scale_down_factor = v.into();
414 self
415 }
416
417 pub fn set_scale_up_min_worker_fraction<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
419 self.scale_up_min_worker_fraction = v.into();
420 self
421 }
422
423 pub fn set_scale_down_min_worker_fraction<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
425 self.scale_down_min_worker_fraction = v.into();
426 self
427 }
428}
429
430impl wkt::message::Message for BasicYarnAutoscalingConfig {
431 fn typename() -> &'static str {
432 "type.googleapis.com/google.cloud.dataproc.v1.BasicYarnAutoscalingConfig"
433 }
434}
435
436#[derive(Clone, Default, PartialEq)]
439#[non_exhaustive]
440pub struct InstanceGroupAutoscalingPolicyConfig {
441 pub min_instances: i32,
446
447 pub max_instances: i32,
454
455 pub weight: i32,
474
475 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
476}
477
478impl InstanceGroupAutoscalingPolicyConfig {
479 pub fn new() -> Self {
480 std::default::Default::default()
481 }
482
483 pub fn set_min_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
485 self.min_instances = v.into();
486 self
487 }
488
489 pub fn set_max_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
491 self.max_instances = v.into();
492 self
493 }
494
495 pub fn set_weight<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
497 self.weight = v.into();
498 self
499 }
500}
501
502impl wkt::message::Message for InstanceGroupAutoscalingPolicyConfig {
503 fn typename() -> &'static str {
504 "type.googleapis.com/google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig"
505 }
506}
507
508#[derive(Clone, Default, PartialEq)]
510#[non_exhaustive]
511pub struct CreateAutoscalingPolicyRequest {
512 pub parent: std::string::String,
524
525 pub policy: std::option::Option<crate::model::AutoscalingPolicy>,
527
528 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
529}
530
531impl CreateAutoscalingPolicyRequest {
532 pub fn new() -> Self {
533 std::default::Default::default()
534 }
535
536 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
538 self.parent = v.into();
539 self
540 }
541
542 pub fn set_policy<T>(mut self, v: T) -> Self
544 where
545 T: std::convert::Into<crate::model::AutoscalingPolicy>,
546 {
547 self.policy = std::option::Option::Some(v.into());
548 self
549 }
550
551 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
553 where
554 T: std::convert::Into<crate::model::AutoscalingPolicy>,
555 {
556 self.policy = v.map(|x| x.into());
557 self
558 }
559}
560
561impl wkt::message::Message for CreateAutoscalingPolicyRequest {
562 fn typename() -> &'static str {
563 "type.googleapis.com/google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest"
564 }
565}
566
567#[derive(Clone, Default, PartialEq)]
569#[non_exhaustive]
570pub struct GetAutoscalingPolicyRequest {
571 pub name: std::string::String,
583
584 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
585}
586
587impl GetAutoscalingPolicyRequest {
588 pub fn new() -> Self {
589 std::default::Default::default()
590 }
591
592 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
594 self.name = v.into();
595 self
596 }
597}
598
599impl wkt::message::Message for GetAutoscalingPolicyRequest {
600 fn typename() -> &'static str {
601 "type.googleapis.com/google.cloud.dataproc.v1.GetAutoscalingPolicyRequest"
602 }
603}
604
605#[derive(Clone, Default, PartialEq)]
607#[non_exhaustive]
608pub struct UpdateAutoscalingPolicyRequest {
609 pub policy: std::option::Option<crate::model::AutoscalingPolicy>,
611
612 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
613}
614
615impl UpdateAutoscalingPolicyRequest {
616 pub fn new() -> Self {
617 std::default::Default::default()
618 }
619
620 pub fn set_policy<T>(mut self, v: T) -> Self
622 where
623 T: std::convert::Into<crate::model::AutoscalingPolicy>,
624 {
625 self.policy = std::option::Option::Some(v.into());
626 self
627 }
628
629 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
631 where
632 T: std::convert::Into<crate::model::AutoscalingPolicy>,
633 {
634 self.policy = v.map(|x| x.into());
635 self
636 }
637}
638
639impl wkt::message::Message for UpdateAutoscalingPolicyRequest {
640 fn typename() -> &'static str {
641 "type.googleapis.com/google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest"
642 }
643}
644
645#[derive(Clone, Default, PartialEq)]
649#[non_exhaustive]
650pub struct DeleteAutoscalingPolicyRequest {
651 pub name: std::string::String,
663
664 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
665}
666
667impl DeleteAutoscalingPolicyRequest {
668 pub fn new() -> Self {
669 std::default::Default::default()
670 }
671
672 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
674 self.name = v.into();
675 self
676 }
677}
678
679impl wkt::message::Message for DeleteAutoscalingPolicyRequest {
680 fn typename() -> &'static str {
681 "type.googleapis.com/google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest"
682 }
683}
684
685#[derive(Clone, Default, PartialEq)]
687#[non_exhaustive]
688pub struct ListAutoscalingPoliciesRequest {
689 pub parent: std::string::String,
701
702 pub page_size: i32,
705
706 pub page_token: std::string::String,
709
710 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
711}
712
713impl ListAutoscalingPoliciesRequest {
714 pub fn new() -> Self {
715 std::default::Default::default()
716 }
717
718 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
720 self.parent = v.into();
721 self
722 }
723
724 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
726 self.page_size = v.into();
727 self
728 }
729
730 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
732 self.page_token = v.into();
733 self
734 }
735}
736
737impl wkt::message::Message for ListAutoscalingPoliciesRequest {
738 fn typename() -> &'static str {
739 "type.googleapis.com/google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest"
740 }
741}
742
743#[derive(Clone, Default, PartialEq)]
745#[non_exhaustive]
746pub struct ListAutoscalingPoliciesResponse {
747 pub policies: std::vec::Vec<crate::model::AutoscalingPolicy>,
749
750 pub next_page_token: std::string::String,
753
754 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
755}
756
757impl ListAutoscalingPoliciesResponse {
758 pub fn new() -> Self {
759 std::default::Default::default()
760 }
761
762 pub fn set_policies<T, V>(mut self, v: T) -> Self
764 where
765 T: std::iter::IntoIterator<Item = V>,
766 V: std::convert::Into<crate::model::AutoscalingPolicy>,
767 {
768 use std::iter::Iterator;
769 self.policies = v.into_iter().map(|i| i.into()).collect();
770 self
771 }
772
773 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
775 self.next_page_token = v.into();
776 self
777 }
778}
779
780impl wkt::message::Message for ListAutoscalingPoliciesResponse {
781 fn typename() -> &'static str {
782 "type.googleapis.com/google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse"
783 }
784}
785
786#[doc(hidden)]
787impl gax::paginator::internal::PageableResponse for ListAutoscalingPoliciesResponse {
788 type PageItem = crate::model::AutoscalingPolicy;
789
790 fn items(self) -> std::vec::Vec<Self::PageItem> {
791 self.policies
792 }
793
794 fn next_page_token(&self) -> std::string::String {
795 use std::clone::Clone;
796 self.next_page_token.clone()
797 }
798}
799
800#[derive(Clone, Default, PartialEq)]
802#[non_exhaustive]
803pub struct CreateBatchRequest {
804 pub parent: std::string::String,
806
807 pub batch: std::option::Option<crate::model::Batch>,
809
810 pub batch_id: std::string::String,
815
816 pub request_id: std::string::String,
829
830 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
831}
832
833impl CreateBatchRequest {
834 pub fn new() -> Self {
835 std::default::Default::default()
836 }
837
838 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
840 self.parent = v.into();
841 self
842 }
843
844 pub fn set_batch<T>(mut self, v: T) -> Self
846 where
847 T: std::convert::Into<crate::model::Batch>,
848 {
849 self.batch = std::option::Option::Some(v.into());
850 self
851 }
852
853 pub fn set_or_clear_batch<T>(mut self, v: std::option::Option<T>) -> Self
855 where
856 T: std::convert::Into<crate::model::Batch>,
857 {
858 self.batch = v.map(|x| x.into());
859 self
860 }
861
862 pub fn set_batch_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
864 self.batch_id = v.into();
865 self
866 }
867
868 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
870 self.request_id = v.into();
871 self
872 }
873}
874
875impl wkt::message::Message for CreateBatchRequest {
876 fn typename() -> &'static str {
877 "type.googleapis.com/google.cloud.dataproc.v1.CreateBatchRequest"
878 }
879}
880
881#[derive(Clone, Default, PartialEq)]
883#[non_exhaustive]
884pub struct GetBatchRequest {
885 pub name: std::string::String,
889
890 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
891}
892
893impl GetBatchRequest {
894 pub fn new() -> Self {
895 std::default::Default::default()
896 }
897
898 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
900 self.name = v.into();
901 self
902 }
903}
904
905impl wkt::message::Message for GetBatchRequest {
906 fn typename() -> &'static str {
907 "type.googleapis.com/google.cloud.dataproc.v1.GetBatchRequest"
908 }
909}
910
911#[derive(Clone, Default, PartialEq)]
913#[non_exhaustive]
914pub struct ListBatchesRequest {
915 pub parent: std::string::String,
917
918 pub page_size: i32,
922
923 pub page_token: std::string::String,
926
927 pub filter: std::string::String,
940
941 pub order_by: std::string::String,
948
949 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
950}
951
952impl ListBatchesRequest {
953 pub fn new() -> Self {
954 std::default::Default::default()
955 }
956
957 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
959 self.parent = v.into();
960 self
961 }
962
963 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
965 self.page_size = v.into();
966 self
967 }
968
969 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
971 self.page_token = v.into();
972 self
973 }
974
975 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
977 self.filter = v.into();
978 self
979 }
980
981 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
983 self.order_by = v.into();
984 self
985 }
986}
987
988impl wkt::message::Message for ListBatchesRequest {
989 fn typename() -> &'static str {
990 "type.googleapis.com/google.cloud.dataproc.v1.ListBatchesRequest"
991 }
992}
993
994#[derive(Clone, Default, PartialEq)]
996#[non_exhaustive]
997pub struct ListBatchesResponse {
998 pub batches: std::vec::Vec<crate::model::Batch>,
1000
1001 pub next_page_token: std::string::String,
1004
1005 pub unreachable: std::vec::Vec<std::string::String>,
1009
1010 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1011}
1012
1013impl ListBatchesResponse {
1014 pub fn new() -> Self {
1015 std::default::Default::default()
1016 }
1017
1018 pub fn set_batches<T, V>(mut self, v: T) -> Self
1020 where
1021 T: std::iter::IntoIterator<Item = V>,
1022 V: std::convert::Into<crate::model::Batch>,
1023 {
1024 use std::iter::Iterator;
1025 self.batches = v.into_iter().map(|i| i.into()).collect();
1026 self
1027 }
1028
1029 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1031 self.next_page_token = v.into();
1032 self
1033 }
1034
1035 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1037 where
1038 T: std::iter::IntoIterator<Item = V>,
1039 V: std::convert::Into<std::string::String>,
1040 {
1041 use std::iter::Iterator;
1042 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1043 self
1044 }
1045}
1046
1047impl wkt::message::Message for ListBatchesResponse {
1048 fn typename() -> &'static str {
1049 "type.googleapis.com/google.cloud.dataproc.v1.ListBatchesResponse"
1050 }
1051}
1052
1053#[doc(hidden)]
1054impl gax::paginator::internal::PageableResponse for ListBatchesResponse {
1055 type PageItem = crate::model::Batch;
1056
1057 fn items(self) -> std::vec::Vec<Self::PageItem> {
1058 self.batches
1059 }
1060
1061 fn next_page_token(&self) -> std::string::String {
1062 use std::clone::Clone;
1063 self.next_page_token.clone()
1064 }
1065}
1066
1067#[derive(Clone, Default, PartialEq)]
1069#[non_exhaustive]
1070pub struct DeleteBatchRequest {
1071 pub name: std::string::String,
1075
1076 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1077}
1078
1079impl DeleteBatchRequest {
1080 pub fn new() -> Self {
1081 std::default::Default::default()
1082 }
1083
1084 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1086 self.name = v.into();
1087 self
1088 }
1089}
1090
1091impl wkt::message::Message for DeleteBatchRequest {
1092 fn typename() -> &'static str {
1093 "type.googleapis.com/google.cloud.dataproc.v1.DeleteBatchRequest"
1094 }
1095}
1096
1097#[derive(Clone, Default, PartialEq)]
1099#[non_exhaustive]
1100pub struct Batch {
1101 pub name: std::string::String,
1103
1104 pub uuid: std::string::String,
1107
1108 pub create_time: std::option::Option<wkt::Timestamp>,
1110
1111 pub runtime_info: std::option::Option<crate::model::RuntimeInfo>,
1113
1114 pub state: crate::model::batch::State,
1116
1117 pub state_message: std::string::String,
1120
1121 pub state_time: std::option::Option<wkt::Timestamp>,
1123
1124 pub creator: std::string::String,
1126
1127 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1135
1136 pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
1138
1139 pub environment_config: std::option::Option<crate::model::EnvironmentConfig>,
1141
1142 pub operation: std::string::String,
1144
1145 pub state_history: std::vec::Vec<crate::model::batch::StateHistory>,
1147
1148 pub batch_config: std::option::Option<crate::model::batch::BatchConfig>,
1150
1151 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1152}
1153
1154impl Batch {
1155 pub fn new() -> Self {
1156 std::default::Default::default()
1157 }
1158
1159 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1161 self.name = v.into();
1162 self
1163 }
1164
1165 pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1167 self.uuid = v.into();
1168 self
1169 }
1170
1171 pub fn set_create_time<T>(mut self, v: T) -> Self
1173 where
1174 T: std::convert::Into<wkt::Timestamp>,
1175 {
1176 self.create_time = std::option::Option::Some(v.into());
1177 self
1178 }
1179
1180 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1182 where
1183 T: std::convert::Into<wkt::Timestamp>,
1184 {
1185 self.create_time = v.map(|x| x.into());
1186 self
1187 }
1188
1189 pub fn set_runtime_info<T>(mut self, v: T) -> Self
1191 where
1192 T: std::convert::Into<crate::model::RuntimeInfo>,
1193 {
1194 self.runtime_info = std::option::Option::Some(v.into());
1195 self
1196 }
1197
1198 pub fn set_or_clear_runtime_info<T>(mut self, v: std::option::Option<T>) -> Self
1200 where
1201 T: std::convert::Into<crate::model::RuntimeInfo>,
1202 {
1203 self.runtime_info = v.map(|x| x.into());
1204 self
1205 }
1206
1207 pub fn set_state<T: std::convert::Into<crate::model::batch::State>>(mut self, v: T) -> Self {
1209 self.state = v.into();
1210 self
1211 }
1212
1213 pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1215 self.state_message = v.into();
1216 self
1217 }
1218
1219 pub fn set_state_time<T>(mut self, v: T) -> Self
1221 where
1222 T: std::convert::Into<wkt::Timestamp>,
1223 {
1224 self.state_time = std::option::Option::Some(v.into());
1225 self
1226 }
1227
1228 pub fn set_or_clear_state_time<T>(mut self, v: std::option::Option<T>) -> Self
1230 where
1231 T: std::convert::Into<wkt::Timestamp>,
1232 {
1233 self.state_time = v.map(|x| x.into());
1234 self
1235 }
1236
1237 pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1239 self.creator = v.into();
1240 self
1241 }
1242
1243 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1245 where
1246 T: std::iter::IntoIterator<Item = (K, V)>,
1247 K: std::convert::Into<std::string::String>,
1248 V: std::convert::Into<std::string::String>,
1249 {
1250 use std::iter::Iterator;
1251 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1252 self
1253 }
1254
1255 pub fn set_runtime_config<T>(mut self, v: T) -> Self
1257 where
1258 T: std::convert::Into<crate::model::RuntimeConfig>,
1259 {
1260 self.runtime_config = std::option::Option::Some(v.into());
1261 self
1262 }
1263
1264 pub fn set_or_clear_runtime_config<T>(mut self, v: std::option::Option<T>) -> Self
1266 where
1267 T: std::convert::Into<crate::model::RuntimeConfig>,
1268 {
1269 self.runtime_config = v.map(|x| x.into());
1270 self
1271 }
1272
1273 pub fn set_environment_config<T>(mut self, v: T) -> Self
1275 where
1276 T: std::convert::Into<crate::model::EnvironmentConfig>,
1277 {
1278 self.environment_config = std::option::Option::Some(v.into());
1279 self
1280 }
1281
1282 pub fn set_or_clear_environment_config<T>(mut self, v: std::option::Option<T>) -> Self
1284 where
1285 T: std::convert::Into<crate::model::EnvironmentConfig>,
1286 {
1287 self.environment_config = v.map(|x| x.into());
1288 self
1289 }
1290
1291 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1293 self.operation = v.into();
1294 self
1295 }
1296
1297 pub fn set_state_history<T, V>(mut self, v: T) -> Self
1299 where
1300 T: std::iter::IntoIterator<Item = V>,
1301 V: std::convert::Into<crate::model::batch::StateHistory>,
1302 {
1303 use std::iter::Iterator;
1304 self.state_history = v.into_iter().map(|i| i.into()).collect();
1305 self
1306 }
1307
1308 pub fn set_batch_config<
1313 T: std::convert::Into<std::option::Option<crate::model::batch::BatchConfig>>,
1314 >(
1315 mut self,
1316 v: T,
1317 ) -> Self {
1318 self.batch_config = v.into();
1319 self
1320 }
1321
1322 pub fn pyspark_batch(
1326 &self,
1327 ) -> std::option::Option<&std::boxed::Box<crate::model::PySparkBatch>> {
1328 #[allow(unreachable_patterns)]
1329 self.batch_config.as_ref().and_then(|v| match v {
1330 crate::model::batch::BatchConfig::PysparkBatch(v) => std::option::Option::Some(v),
1331 _ => std::option::Option::None,
1332 })
1333 }
1334
1335 pub fn set_pyspark_batch<T: std::convert::Into<std::boxed::Box<crate::model::PySparkBatch>>>(
1341 mut self,
1342 v: T,
1343 ) -> Self {
1344 self.batch_config =
1345 std::option::Option::Some(crate::model::batch::BatchConfig::PysparkBatch(v.into()));
1346 self
1347 }
1348
1349 pub fn spark_batch(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkBatch>> {
1353 #[allow(unreachable_patterns)]
1354 self.batch_config.as_ref().and_then(|v| match v {
1355 crate::model::batch::BatchConfig::SparkBatch(v) => std::option::Option::Some(v),
1356 _ => std::option::Option::None,
1357 })
1358 }
1359
1360 pub fn set_spark_batch<T: std::convert::Into<std::boxed::Box<crate::model::SparkBatch>>>(
1366 mut self,
1367 v: T,
1368 ) -> Self {
1369 self.batch_config =
1370 std::option::Option::Some(crate::model::batch::BatchConfig::SparkBatch(v.into()));
1371 self
1372 }
1373
1374 pub fn spark_r_batch(
1378 &self,
1379 ) -> std::option::Option<&std::boxed::Box<crate::model::SparkRBatch>> {
1380 #[allow(unreachable_patterns)]
1381 self.batch_config.as_ref().and_then(|v| match v {
1382 crate::model::batch::BatchConfig::SparkRBatch(v) => std::option::Option::Some(v),
1383 _ => std::option::Option::None,
1384 })
1385 }
1386
1387 pub fn set_spark_r_batch<T: std::convert::Into<std::boxed::Box<crate::model::SparkRBatch>>>(
1393 mut self,
1394 v: T,
1395 ) -> Self {
1396 self.batch_config =
1397 std::option::Option::Some(crate::model::batch::BatchConfig::SparkRBatch(v.into()));
1398 self
1399 }
1400
1401 pub fn spark_sql_batch(
1405 &self,
1406 ) -> std::option::Option<&std::boxed::Box<crate::model::SparkSqlBatch>> {
1407 #[allow(unreachable_patterns)]
1408 self.batch_config.as_ref().and_then(|v| match v {
1409 crate::model::batch::BatchConfig::SparkSqlBatch(v) => std::option::Option::Some(v),
1410 _ => std::option::Option::None,
1411 })
1412 }
1413
1414 pub fn set_spark_sql_batch<
1420 T: std::convert::Into<std::boxed::Box<crate::model::SparkSqlBatch>>,
1421 >(
1422 mut self,
1423 v: T,
1424 ) -> Self {
1425 self.batch_config =
1426 std::option::Option::Some(crate::model::batch::BatchConfig::SparkSqlBatch(v.into()));
1427 self
1428 }
1429}
1430
1431impl wkt::message::Message for Batch {
1432 fn typename() -> &'static str {
1433 "type.googleapis.com/google.cloud.dataproc.v1.Batch"
1434 }
1435}
1436
1437pub mod batch {
1439 #[allow(unused_imports)]
1440 use super::*;
1441
1442 #[derive(Clone, Default, PartialEq)]
1444 #[non_exhaustive]
1445 pub struct StateHistory {
1446 pub state: crate::model::batch::State,
1448
1449 pub state_message: std::string::String,
1451
1452 pub state_start_time: std::option::Option<wkt::Timestamp>,
1454
1455 pub(crate) _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>(mut self, v: T) -> Self
1483 where
1484 T: std::convert::Into<wkt::Timestamp>,
1485 {
1486 self.state_start_time = std::option::Option::Some(v.into());
1487 self
1488 }
1489
1490 pub fn set_or_clear_state_start_time<T>(mut self, v: std::option::Option<T>) -> Self
1492 where
1493 T: std::convert::Into<wkt::Timestamp>,
1494 {
1495 self.state_start_time = v.map(|x| x.into());
1496 self
1497 }
1498 }
1499
1500 impl wkt::message::Message for StateHistory {
1501 fn typename() -> &'static str {
1502 "type.googleapis.com/google.cloud.dataproc.v1.Batch.StateHistory"
1503 }
1504 }
1505
1506 #[derive(Clone, Debug, PartialEq)]
1522 #[non_exhaustive]
1523 pub enum State {
1524 Unspecified,
1526 Pending,
1528 Running,
1530 Cancelling,
1532 Cancelled,
1534 Succeeded,
1536 Failed,
1538 UnknownValue(state::UnknownValue),
1543 }
1544
1545 #[doc(hidden)]
1546 pub mod state {
1547 #[allow(unused_imports)]
1548 use super::*;
1549 #[derive(Clone, Debug, PartialEq)]
1550 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1551 }
1552
1553 impl State {
1554 pub fn value(&self) -> std::option::Option<i32> {
1559 match self {
1560 Self::Unspecified => std::option::Option::Some(0),
1561 Self::Pending => std::option::Option::Some(1),
1562 Self::Running => std::option::Option::Some(2),
1563 Self::Cancelling => std::option::Option::Some(3),
1564 Self::Cancelled => std::option::Option::Some(4),
1565 Self::Succeeded => std::option::Option::Some(5),
1566 Self::Failed => std::option::Option::Some(6),
1567 Self::UnknownValue(u) => u.0.value(),
1568 }
1569 }
1570
1571 pub fn name(&self) -> std::option::Option<&str> {
1576 match self {
1577 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1578 Self::Pending => std::option::Option::Some("PENDING"),
1579 Self::Running => std::option::Option::Some("RUNNING"),
1580 Self::Cancelling => std::option::Option::Some("CANCELLING"),
1581 Self::Cancelled => std::option::Option::Some("CANCELLED"),
1582 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
1583 Self::Failed => std::option::Option::Some("FAILED"),
1584 Self::UnknownValue(u) => u.0.name(),
1585 }
1586 }
1587 }
1588
1589 impl std::default::Default for State {
1590 fn default() -> Self {
1591 use std::convert::From;
1592 Self::from(0)
1593 }
1594 }
1595
1596 impl std::fmt::Display for State {
1597 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1598 wkt::internal::display_enum(f, self.name(), self.value())
1599 }
1600 }
1601
1602 impl std::convert::From<i32> for State {
1603 fn from(value: i32) -> Self {
1604 match value {
1605 0 => Self::Unspecified,
1606 1 => Self::Pending,
1607 2 => Self::Running,
1608 3 => Self::Cancelling,
1609 4 => Self::Cancelled,
1610 5 => Self::Succeeded,
1611 6 => Self::Failed,
1612 _ => Self::UnknownValue(state::UnknownValue(
1613 wkt::internal::UnknownEnumValue::Integer(value),
1614 )),
1615 }
1616 }
1617 }
1618
1619 impl std::convert::From<&str> for State {
1620 fn from(value: &str) -> Self {
1621 use std::string::ToString;
1622 match value {
1623 "STATE_UNSPECIFIED" => Self::Unspecified,
1624 "PENDING" => Self::Pending,
1625 "RUNNING" => Self::Running,
1626 "CANCELLING" => Self::Cancelling,
1627 "CANCELLED" => Self::Cancelled,
1628 "SUCCEEDED" => Self::Succeeded,
1629 "FAILED" => Self::Failed,
1630 _ => Self::UnknownValue(state::UnknownValue(
1631 wkt::internal::UnknownEnumValue::String(value.to_string()),
1632 )),
1633 }
1634 }
1635 }
1636
1637 impl serde::ser::Serialize for State {
1638 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1639 where
1640 S: serde::Serializer,
1641 {
1642 match self {
1643 Self::Unspecified => serializer.serialize_i32(0),
1644 Self::Pending => serializer.serialize_i32(1),
1645 Self::Running => serializer.serialize_i32(2),
1646 Self::Cancelling => serializer.serialize_i32(3),
1647 Self::Cancelled => serializer.serialize_i32(4),
1648 Self::Succeeded => serializer.serialize_i32(5),
1649 Self::Failed => serializer.serialize_i32(6),
1650 Self::UnknownValue(u) => u.0.serialize(serializer),
1651 }
1652 }
1653 }
1654
1655 impl<'de> serde::de::Deserialize<'de> for State {
1656 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1657 where
1658 D: serde::Deserializer<'de>,
1659 {
1660 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1661 ".google.cloud.dataproc.v1.Batch.State",
1662 ))
1663 }
1664 }
1665
1666 #[derive(Clone, Debug, PartialEq)]
1668 #[non_exhaustive]
1669 pub enum BatchConfig {
1670 PysparkBatch(std::boxed::Box<crate::model::PySparkBatch>),
1672 SparkBatch(std::boxed::Box<crate::model::SparkBatch>),
1674 SparkRBatch(std::boxed::Box<crate::model::SparkRBatch>),
1676 SparkSqlBatch(std::boxed::Box<crate::model::SparkSqlBatch>),
1678 }
1679}
1680
1681#[derive(Clone, Default, PartialEq)]
1686#[non_exhaustive]
1687pub struct PySparkBatch {
1688 pub main_python_file_uri: std::string::String,
1691
1692 pub args: std::vec::Vec<std::string::String>,
1696
1697 pub python_file_uris: std::vec::Vec<std::string::String>,
1700
1701 pub jar_file_uris: std::vec::Vec<std::string::String>,
1704
1705 pub file_uris: std::vec::Vec<std::string::String>,
1708
1709 pub archive_uris: std::vec::Vec<std::string::String>,
1713
1714 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1715}
1716
1717impl PySparkBatch {
1718 pub fn new() -> Self {
1719 std::default::Default::default()
1720 }
1721
1722 pub fn set_main_python_file_uri<T: std::convert::Into<std::string::String>>(
1724 mut self,
1725 v: T,
1726 ) -> Self {
1727 self.main_python_file_uri = v.into();
1728 self
1729 }
1730
1731 pub fn set_args<T, V>(mut self, v: T) -> Self
1733 where
1734 T: std::iter::IntoIterator<Item = V>,
1735 V: std::convert::Into<std::string::String>,
1736 {
1737 use std::iter::Iterator;
1738 self.args = v.into_iter().map(|i| i.into()).collect();
1739 self
1740 }
1741
1742 pub fn set_python_file_uris<T, V>(mut self, v: T) -> Self
1744 where
1745 T: std::iter::IntoIterator<Item = V>,
1746 V: std::convert::Into<std::string::String>,
1747 {
1748 use std::iter::Iterator;
1749 self.python_file_uris = v.into_iter().map(|i| i.into()).collect();
1750 self
1751 }
1752
1753 pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
1755 where
1756 T: std::iter::IntoIterator<Item = V>,
1757 V: std::convert::Into<std::string::String>,
1758 {
1759 use std::iter::Iterator;
1760 self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
1761 self
1762 }
1763
1764 pub fn set_file_uris<T, V>(mut self, v: T) -> Self
1766 where
1767 T: std::iter::IntoIterator<Item = V>,
1768 V: std::convert::Into<std::string::String>,
1769 {
1770 use std::iter::Iterator;
1771 self.file_uris = v.into_iter().map(|i| i.into()).collect();
1772 self
1773 }
1774
1775 pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
1777 where
1778 T: std::iter::IntoIterator<Item = V>,
1779 V: std::convert::Into<std::string::String>,
1780 {
1781 use std::iter::Iterator;
1782 self.archive_uris = v.into_iter().map(|i| i.into()).collect();
1783 self
1784 }
1785}
1786
1787impl wkt::message::Message for PySparkBatch {
1788 fn typename() -> &'static str {
1789 "type.googleapis.com/google.cloud.dataproc.v1.PySparkBatch"
1790 }
1791}
1792
1793#[derive(Clone, Default, PartialEq)]
1796#[non_exhaustive]
1797pub struct SparkBatch {
1798 pub args: std::vec::Vec<std::string::String>,
1802
1803 pub jar_file_uris: std::vec::Vec<std::string::String>,
1806
1807 pub file_uris: std::vec::Vec<std::string::String>,
1810
1811 pub archive_uris: std::vec::Vec<std::string::String>,
1815
1816 pub driver: std::option::Option<crate::model::spark_batch::Driver>,
1822
1823 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1824}
1825
1826impl SparkBatch {
1827 pub fn new() -> Self {
1828 std::default::Default::default()
1829 }
1830
1831 pub fn set_args<T, V>(mut self, v: T) -> Self
1833 where
1834 T: std::iter::IntoIterator<Item = V>,
1835 V: std::convert::Into<std::string::String>,
1836 {
1837 use std::iter::Iterator;
1838 self.args = v.into_iter().map(|i| i.into()).collect();
1839 self
1840 }
1841
1842 pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
1844 where
1845 T: std::iter::IntoIterator<Item = V>,
1846 V: std::convert::Into<std::string::String>,
1847 {
1848 use std::iter::Iterator;
1849 self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
1850 self
1851 }
1852
1853 pub fn set_file_uris<T, V>(mut self, v: T) -> Self
1855 where
1856 T: std::iter::IntoIterator<Item = V>,
1857 V: std::convert::Into<std::string::String>,
1858 {
1859 use std::iter::Iterator;
1860 self.file_uris = v.into_iter().map(|i| i.into()).collect();
1861 self
1862 }
1863
1864 pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
1866 where
1867 T: std::iter::IntoIterator<Item = V>,
1868 V: std::convert::Into<std::string::String>,
1869 {
1870 use std::iter::Iterator;
1871 self.archive_uris = v.into_iter().map(|i| i.into()).collect();
1872 self
1873 }
1874
1875 pub fn set_driver<
1880 T: std::convert::Into<std::option::Option<crate::model::spark_batch::Driver>>,
1881 >(
1882 mut self,
1883 v: T,
1884 ) -> Self {
1885 self.driver = v.into();
1886 self
1887 }
1888
1889 pub fn main_jar_file_uri(&self) -> std::option::Option<&std::string::String> {
1893 #[allow(unreachable_patterns)]
1894 self.driver.as_ref().and_then(|v| match v {
1895 crate::model::spark_batch::Driver::MainJarFileUri(v) => std::option::Option::Some(v),
1896 _ => std::option::Option::None,
1897 })
1898 }
1899
1900 pub fn set_main_jar_file_uri<T: std::convert::Into<std::string::String>>(
1906 mut self,
1907 v: T,
1908 ) -> Self {
1909 self.driver =
1910 std::option::Option::Some(crate::model::spark_batch::Driver::MainJarFileUri(v.into()));
1911 self
1912 }
1913
1914 pub fn main_class(&self) -> std::option::Option<&std::string::String> {
1918 #[allow(unreachable_patterns)]
1919 self.driver.as_ref().and_then(|v| match v {
1920 crate::model::spark_batch::Driver::MainClass(v) => std::option::Option::Some(v),
1921 _ => std::option::Option::None,
1922 })
1923 }
1924
1925 pub fn set_main_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1931 self.driver =
1932 std::option::Option::Some(crate::model::spark_batch::Driver::MainClass(v.into()));
1933 self
1934 }
1935}
1936
1937impl wkt::message::Message for SparkBatch {
1938 fn typename() -> &'static str {
1939 "type.googleapis.com/google.cloud.dataproc.v1.SparkBatch"
1940 }
1941}
1942
1943pub mod spark_batch {
1945 #[allow(unused_imports)]
1946 use super::*;
1947
1948 #[derive(Clone, Debug, PartialEq)]
1954 #[non_exhaustive]
1955 pub enum Driver {
1956 MainJarFileUri(std::string::String),
1958 MainClass(std::string::String),
1961 }
1962}
1963
1964#[derive(Clone, Default, PartialEq)]
1968#[non_exhaustive]
1969pub struct SparkRBatch {
1970 pub main_r_file_uri: std::string::String,
1973
1974 pub args: std::vec::Vec<std::string::String>,
1978
1979 pub file_uris: std::vec::Vec<std::string::String>,
1982
1983 pub archive_uris: std::vec::Vec<std::string::String>,
1987
1988 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1989}
1990
1991impl SparkRBatch {
1992 pub fn new() -> Self {
1993 std::default::Default::default()
1994 }
1995
1996 pub fn set_main_r_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1998 self.main_r_file_uri = v.into();
1999 self
2000 }
2001
2002 pub fn set_args<T, V>(mut self, v: T) -> Self
2004 where
2005 T: std::iter::IntoIterator<Item = V>,
2006 V: std::convert::Into<std::string::String>,
2007 {
2008 use std::iter::Iterator;
2009 self.args = v.into_iter().map(|i| i.into()).collect();
2010 self
2011 }
2012
2013 pub fn set_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.file_uris = v.into_iter().map(|i| i.into()).collect();
2021 self
2022 }
2023
2024 pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
2026 where
2027 T: std::iter::IntoIterator<Item = V>,
2028 V: std::convert::Into<std::string::String>,
2029 {
2030 use std::iter::Iterator;
2031 self.archive_uris = v.into_iter().map(|i| i.into()).collect();
2032 self
2033 }
2034}
2035
2036impl wkt::message::Message for SparkRBatch {
2037 fn typename() -> &'static str {
2038 "type.googleapis.com/google.cloud.dataproc.v1.SparkRBatch"
2039 }
2040}
2041
2042#[derive(Clone, Default, PartialEq)]
2046#[non_exhaustive]
2047pub struct SparkSqlBatch {
2048 pub query_file_uri: std::string::String,
2051
2052 pub query_variables: std::collections::HashMap<std::string::String, std::string::String>,
2055
2056 pub jar_file_uris: std::vec::Vec<std::string::String>,
2058
2059 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2060}
2061
2062impl SparkSqlBatch {
2063 pub fn new() -> Self {
2064 std::default::Default::default()
2065 }
2066
2067 pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2069 self.query_file_uri = v.into();
2070 self
2071 }
2072
2073 pub fn set_query_variables<T, K, V>(mut self, v: T) -> Self
2075 where
2076 T: std::iter::IntoIterator<Item = (K, V)>,
2077 K: std::convert::Into<std::string::String>,
2078 V: std::convert::Into<std::string::String>,
2079 {
2080 use std::iter::Iterator;
2081 self.query_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2082 self
2083 }
2084
2085 pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
2087 where
2088 T: std::iter::IntoIterator<Item = V>,
2089 V: std::convert::Into<std::string::String>,
2090 {
2091 use std::iter::Iterator;
2092 self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
2093 self
2094 }
2095}
2096
2097impl wkt::message::Message for SparkSqlBatch {
2098 fn typename() -> &'static str {
2099 "type.googleapis.com/google.cloud.dataproc.v1.SparkSqlBatch"
2100 }
2101}
2102
2103#[derive(Clone, Default, PartialEq)]
2106#[non_exhaustive]
2107pub struct Cluster {
2108 pub project_id: std::string::String,
2110
2111 pub cluster_name: std::string::String,
2116
2117 pub config: std::option::Option<crate::model::ClusterConfig>,
2123
2124 pub virtual_cluster_config: std::option::Option<crate::model::VirtualClusterConfig>,
2137
2138 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2146
2147 pub status: std::option::Option<crate::model::ClusterStatus>,
2149
2150 pub status_history: std::vec::Vec<crate::model::ClusterStatus>,
2152
2153 pub cluster_uuid: std::string::String,
2156
2157 pub metrics: std::option::Option<crate::model::ClusterMetrics>,
2162
2163 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2164}
2165
2166impl Cluster {
2167 pub fn new() -> Self {
2168 std::default::Default::default()
2169 }
2170
2171 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2173 self.project_id = v.into();
2174 self
2175 }
2176
2177 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2179 self.cluster_name = v.into();
2180 self
2181 }
2182
2183 pub fn set_config<T>(mut self, v: T) -> Self
2185 where
2186 T: std::convert::Into<crate::model::ClusterConfig>,
2187 {
2188 self.config = std::option::Option::Some(v.into());
2189 self
2190 }
2191
2192 pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
2194 where
2195 T: std::convert::Into<crate::model::ClusterConfig>,
2196 {
2197 self.config = v.map(|x| x.into());
2198 self
2199 }
2200
2201 pub fn set_virtual_cluster_config<T>(mut self, v: T) -> Self
2203 where
2204 T: std::convert::Into<crate::model::VirtualClusterConfig>,
2205 {
2206 self.virtual_cluster_config = std::option::Option::Some(v.into());
2207 self
2208 }
2209
2210 pub fn set_or_clear_virtual_cluster_config<T>(mut self, v: std::option::Option<T>) -> Self
2212 where
2213 T: std::convert::Into<crate::model::VirtualClusterConfig>,
2214 {
2215 self.virtual_cluster_config = v.map(|x| x.into());
2216 self
2217 }
2218
2219 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2221 where
2222 T: std::iter::IntoIterator<Item = (K, V)>,
2223 K: std::convert::Into<std::string::String>,
2224 V: std::convert::Into<std::string::String>,
2225 {
2226 use std::iter::Iterator;
2227 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2228 self
2229 }
2230
2231 pub fn set_status<T>(mut self, v: T) -> Self
2233 where
2234 T: std::convert::Into<crate::model::ClusterStatus>,
2235 {
2236 self.status = std::option::Option::Some(v.into());
2237 self
2238 }
2239
2240 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
2242 where
2243 T: std::convert::Into<crate::model::ClusterStatus>,
2244 {
2245 self.status = v.map(|x| x.into());
2246 self
2247 }
2248
2249 pub fn set_status_history<T, V>(mut self, v: T) -> Self
2251 where
2252 T: std::iter::IntoIterator<Item = V>,
2253 V: std::convert::Into<crate::model::ClusterStatus>,
2254 {
2255 use std::iter::Iterator;
2256 self.status_history = v.into_iter().map(|i| i.into()).collect();
2257 self
2258 }
2259
2260 pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2262 self.cluster_uuid = v.into();
2263 self
2264 }
2265
2266 pub fn set_metrics<T>(mut self, v: T) -> Self
2268 where
2269 T: std::convert::Into<crate::model::ClusterMetrics>,
2270 {
2271 self.metrics = std::option::Option::Some(v.into());
2272 self
2273 }
2274
2275 pub fn set_or_clear_metrics<T>(mut self, v: std::option::Option<T>) -> Self
2277 where
2278 T: std::convert::Into<crate::model::ClusterMetrics>,
2279 {
2280 self.metrics = v.map(|x| x.into());
2281 self
2282 }
2283}
2284
2285impl wkt::message::Message for Cluster {
2286 fn typename() -> &'static str {
2287 "type.googleapis.com/google.cloud.dataproc.v1.Cluster"
2288 }
2289}
2290
2291#[derive(Clone, Default, PartialEq)]
2293#[non_exhaustive]
2294pub struct ClusterConfig {
2295 pub cluster_tier: crate::model::cluster_config::ClusterTier,
2297
2298 pub config_bucket: std::string::String,
2310
2311 pub temp_bucket: std::string::String,
2323
2324 pub gce_cluster_config: std::option::Option<crate::model::GceClusterConfig>,
2327
2328 pub master_config: std::option::Option<crate::model::InstanceGroupConfig>,
2331
2332 pub worker_config: std::option::Option<crate::model::InstanceGroupConfig>,
2335
2336 pub secondary_worker_config: std::option::Option<crate::model::InstanceGroupConfig>,
2339
2340 pub software_config: std::option::Option<crate::model::SoftwareConfig>,
2342
2343 pub initialization_actions: std::vec::Vec<crate::model::NodeInitializationAction>,
2359
2360 pub encryption_config: std::option::Option<crate::model::EncryptionConfig>,
2362
2363 pub autoscaling_config: std::option::Option<crate::model::AutoscalingConfig>,
2366
2367 pub security_config: std::option::Option<crate::model::SecurityConfig>,
2369
2370 pub lifecycle_config: std::option::Option<crate::model::LifecycleConfig>,
2372
2373 pub endpoint_config: std::option::Option<crate::model::EndpointConfig>,
2375
2376 pub metastore_config: std::option::Option<crate::model::MetastoreConfig>,
2378
2379 pub dataproc_metric_config: std::option::Option<crate::model::DataprocMetricConfig>,
2381
2382 pub auxiliary_node_groups: std::vec::Vec<crate::model::AuxiliaryNodeGroup>,
2384
2385 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2386}
2387
2388impl ClusterConfig {
2389 pub fn new() -> Self {
2390 std::default::Default::default()
2391 }
2392
2393 pub fn set_cluster_tier<T: std::convert::Into<crate::model::cluster_config::ClusterTier>>(
2395 mut self,
2396 v: T,
2397 ) -> Self {
2398 self.cluster_tier = v.into();
2399 self
2400 }
2401
2402 pub fn set_config_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2404 self.config_bucket = v.into();
2405 self
2406 }
2407
2408 pub fn set_temp_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2410 self.temp_bucket = v.into();
2411 self
2412 }
2413
2414 pub fn set_gce_cluster_config<T>(mut self, v: T) -> Self
2416 where
2417 T: std::convert::Into<crate::model::GceClusterConfig>,
2418 {
2419 self.gce_cluster_config = std::option::Option::Some(v.into());
2420 self
2421 }
2422
2423 pub fn set_or_clear_gce_cluster_config<T>(mut self, v: std::option::Option<T>) -> Self
2425 where
2426 T: std::convert::Into<crate::model::GceClusterConfig>,
2427 {
2428 self.gce_cluster_config = v.map(|x| x.into());
2429 self
2430 }
2431
2432 pub fn set_master_config<T>(mut self, v: T) -> Self
2434 where
2435 T: std::convert::Into<crate::model::InstanceGroupConfig>,
2436 {
2437 self.master_config = std::option::Option::Some(v.into());
2438 self
2439 }
2440
2441 pub fn set_or_clear_master_config<T>(mut self, v: std::option::Option<T>) -> Self
2443 where
2444 T: std::convert::Into<crate::model::InstanceGroupConfig>,
2445 {
2446 self.master_config = v.map(|x| x.into());
2447 self
2448 }
2449
2450 pub fn set_worker_config<T>(mut self, v: T) -> Self
2452 where
2453 T: std::convert::Into<crate::model::InstanceGroupConfig>,
2454 {
2455 self.worker_config = std::option::Option::Some(v.into());
2456 self
2457 }
2458
2459 pub fn set_or_clear_worker_config<T>(mut self, v: std::option::Option<T>) -> Self
2461 where
2462 T: std::convert::Into<crate::model::InstanceGroupConfig>,
2463 {
2464 self.worker_config = v.map(|x| x.into());
2465 self
2466 }
2467
2468 pub fn set_secondary_worker_config<T>(mut self, v: T) -> Self
2470 where
2471 T: std::convert::Into<crate::model::InstanceGroupConfig>,
2472 {
2473 self.secondary_worker_config = std::option::Option::Some(v.into());
2474 self
2475 }
2476
2477 pub fn set_or_clear_secondary_worker_config<T>(mut self, v: std::option::Option<T>) -> Self
2479 where
2480 T: std::convert::Into<crate::model::InstanceGroupConfig>,
2481 {
2482 self.secondary_worker_config = v.map(|x| x.into());
2483 self
2484 }
2485
2486 pub fn set_software_config<T>(mut self, v: T) -> Self
2488 where
2489 T: std::convert::Into<crate::model::SoftwareConfig>,
2490 {
2491 self.software_config = std::option::Option::Some(v.into());
2492 self
2493 }
2494
2495 pub fn set_or_clear_software_config<T>(mut self, v: std::option::Option<T>) -> Self
2497 where
2498 T: std::convert::Into<crate::model::SoftwareConfig>,
2499 {
2500 self.software_config = v.map(|x| x.into());
2501 self
2502 }
2503
2504 pub fn set_initialization_actions<T, V>(mut self, v: T) -> Self
2506 where
2507 T: std::iter::IntoIterator<Item = V>,
2508 V: std::convert::Into<crate::model::NodeInitializationAction>,
2509 {
2510 use std::iter::Iterator;
2511 self.initialization_actions = v.into_iter().map(|i| i.into()).collect();
2512 self
2513 }
2514
2515 pub fn set_encryption_config<T>(mut self, v: T) -> Self
2517 where
2518 T: std::convert::Into<crate::model::EncryptionConfig>,
2519 {
2520 self.encryption_config = std::option::Option::Some(v.into());
2521 self
2522 }
2523
2524 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
2526 where
2527 T: std::convert::Into<crate::model::EncryptionConfig>,
2528 {
2529 self.encryption_config = v.map(|x| x.into());
2530 self
2531 }
2532
2533 pub fn set_autoscaling_config<T>(mut self, v: T) -> Self
2535 where
2536 T: std::convert::Into<crate::model::AutoscalingConfig>,
2537 {
2538 self.autoscaling_config = std::option::Option::Some(v.into());
2539 self
2540 }
2541
2542 pub fn set_or_clear_autoscaling_config<T>(mut self, v: std::option::Option<T>) -> Self
2544 where
2545 T: std::convert::Into<crate::model::AutoscalingConfig>,
2546 {
2547 self.autoscaling_config = v.map(|x| x.into());
2548 self
2549 }
2550
2551 pub fn set_security_config<T>(mut self, v: T) -> Self
2553 where
2554 T: std::convert::Into<crate::model::SecurityConfig>,
2555 {
2556 self.security_config = std::option::Option::Some(v.into());
2557 self
2558 }
2559
2560 pub fn set_or_clear_security_config<T>(mut self, v: std::option::Option<T>) -> Self
2562 where
2563 T: std::convert::Into<crate::model::SecurityConfig>,
2564 {
2565 self.security_config = v.map(|x| x.into());
2566 self
2567 }
2568
2569 pub fn set_lifecycle_config<T>(mut self, v: T) -> Self
2571 where
2572 T: std::convert::Into<crate::model::LifecycleConfig>,
2573 {
2574 self.lifecycle_config = std::option::Option::Some(v.into());
2575 self
2576 }
2577
2578 pub fn set_or_clear_lifecycle_config<T>(mut self, v: std::option::Option<T>) -> Self
2580 where
2581 T: std::convert::Into<crate::model::LifecycleConfig>,
2582 {
2583 self.lifecycle_config = v.map(|x| x.into());
2584 self
2585 }
2586
2587 pub fn set_endpoint_config<T>(mut self, v: T) -> Self
2589 where
2590 T: std::convert::Into<crate::model::EndpointConfig>,
2591 {
2592 self.endpoint_config = std::option::Option::Some(v.into());
2593 self
2594 }
2595
2596 pub fn set_or_clear_endpoint_config<T>(mut self, v: std::option::Option<T>) -> Self
2598 where
2599 T: std::convert::Into<crate::model::EndpointConfig>,
2600 {
2601 self.endpoint_config = v.map(|x| x.into());
2602 self
2603 }
2604
2605 pub fn set_metastore_config<T>(mut self, v: T) -> Self
2607 where
2608 T: std::convert::Into<crate::model::MetastoreConfig>,
2609 {
2610 self.metastore_config = std::option::Option::Some(v.into());
2611 self
2612 }
2613
2614 pub fn set_or_clear_metastore_config<T>(mut self, v: std::option::Option<T>) -> Self
2616 where
2617 T: std::convert::Into<crate::model::MetastoreConfig>,
2618 {
2619 self.metastore_config = v.map(|x| x.into());
2620 self
2621 }
2622
2623 pub fn set_dataproc_metric_config<T>(mut self, v: T) -> Self
2625 where
2626 T: std::convert::Into<crate::model::DataprocMetricConfig>,
2627 {
2628 self.dataproc_metric_config = std::option::Option::Some(v.into());
2629 self
2630 }
2631
2632 pub fn set_or_clear_dataproc_metric_config<T>(mut self, v: std::option::Option<T>) -> Self
2634 where
2635 T: std::convert::Into<crate::model::DataprocMetricConfig>,
2636 {
2637 self.dataproc_metric_config = v.map(|x| x.into());
2638 self
2639 }
2640
2641 pub fn set_auxiliary_node_groups<T, V>(mut self, v: T) -> Self
2643 where
2644 T: std::iter::IntoIterator<Item = V>,
2645 V: std::convert::Into<crate::model::AuxiliaryNodeGroup>,
2646 {
2647 use std::iter::Iterator;
2648 self.auxiliary_node_groups = v.into_iter().map(|i| i.into()).collect();
2649 self
2650 }
2651}
2652
2653impl wkt::message::Message for ClusterConfig {
2654 fn typename() -> &'static str {
2655 "type.googleapis.com/google.cloud.dataproc.v1.ClusterConfig"
2656 }
2657}
2658
2659pub mod cluster_config {
2661 #[allow(unused_imports)]
2662 use super::*;
2663
2664 #[derive(Clone, Debug, PartialEq)]
2680 #[non_exhaustive]
2681 pub enum ClusterTier {
2682 Unspecified,
2684 Standard,
2686 Premium,
2688 UnknownValue(cluster_tier::UnknownValue),
2693 }
2694
2695 #[doc(hidden)]
2696 pub mod cluster_tier {
2697 #[allow(unused_imports)]
2698 use super::*;
2699 #[derive(Clone, Debug, PartialEq)]
2700 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2701 }
2702
2703 impl ClusterTier {
2704 pub fn value(&self) -> std::option::Option<i32> {
2709 match self {
2710 Self::Unspecified => std::option::Option::Some(0),
2711 Self::Standard => std::option::Option::Some(1),
2712 Self::Premium => std::option::Option::Some(2),
2713 Self::UnknownValue(u) => u.0.value(),
2714 }
2715 }
2716
2717 pub fn name(&self) -> std::option::Option<&str> {
2722 match self {
2723 Self::Unspecified => std::option::Option::Some("CLUSTER_TIER_UNSPECIFIED"),
2724 Self::Standard => std::option::Option::Some("CLUSTER_TIER_STANDARD"),
2725 Self::Premium => std::option::Option::Some("CLUSTER_TIER_PREMIUM"),
2726 Self::UnknownValue(u) => u.0.name(),
2727 }
2728 }
2729 }
2730
2731 impl std::default::Default for ClusterTier {
2732 fn default() -> Self {
2733 use std::convert::From;
2734 Self::from(0)
2735 }
2736 }
2737
2738 impl std::fmt::Display for ClusterTier {
2739 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2740 wkt::internal::display_enum(f, self.name(), self.value())
2741 }
2742 }
2743
2744 impl std::convert::From<i32> for ClusterTier {
2745 fn from(value: i32) -> Self {
2746 match value {
2747 0 => Self::Unspecified,
2748 1 => Self::Standard,
2749 2 => Self::Premium,
2750 _ => Self::UnknownValue(cluster_tier::UnknownValue(
2751 wkt::internal::UnknownEnumValue::Integer(value),
2752 )),
2753 }
2754 }
2755 }
2756
2757 impl std::convert::From<&str> for ClusterTier {
2758 fn from(value: &str) -> Self {
2759 use std::string::ToString;
2760 match value {
2761 "CLUSTER_TIER_UNSPECIFIED" => Self::Unspecified,
2762 "CLUSTER_TIER_STANDARD" => Self::Standard,
2763 "CLUSTER_TIER_PREMIUM" => Self::Premium,
2764 _ => Self::UnknownValue(cluster_tier::UnknownValue(
2765 wkt::internal::UnknownEnumValue::String(value.to_string()),
2766 )),
2767 }
2768 }
2769 }
2770
2771 impl serde::ser::Serialize for ClusterTier {
2772 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2773 where
2774 S: serde::Serializer,
2775 {
2776 match self {
2777 Self::Unspecified => serializer.serialize_i32(0),
2778 Self::Standard => serializer.serialize_i32(1),
2779 Self::Premium => serializer.serialize_i32(2),
2780 Self::UnknownValue(u) => u.0.serialize(serializer),
2781 }
2782 }
2783 }
2784
2785 impl<'de> serde::de::Deserialize<'de> for ClusterTier {
2786 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2787 where
2788 D: serde::Deserializer<'de>,
2789 {
2790 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ClusterTier>::new(
2791 ".google.cloud.dataproc.v1.ClusterConfig.ClusterTier",
2792 ))
2793 }
2794 }
2795}
2796
2797#[derive(Clone, Default, PartialEq)]
2801#[non_exhaustive]
2802pub struct VirtualClusterConfig {
2803 pub staging_bucket: std::string::String,
2815
2816 pub auxiliary_services_config: std::option::Option<crate::model::AuxiliaryServicesConfig>,
2818
2819 pub infrastructure_config:
2820 std::option::Option<crate::model::virtual_cluster_config::InfrastructureConfig>,
2821
2822 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2823}
2824
2825impl VirtualClusterConfig {
2826 pub fn new() -> Self {
2827 std::default::Default::default()
2828 }
2829
2830 pub fn set_staging_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2832 self.staging_bucket = v.into();
2833 self
2834 }
2835
2836 pub fn set_auxiliary_services_config<T>(mut self, v: T) -> Self
2838 where
2839 T: std::convert::Into<crate::model::AuxiliaryServicesConfig>,
2840 {
2841 self.auxiliary_services_config = std::option::Option::Some(v.into());
2842 self
2843 }
2844
2845 pub fn set_or_clear_auxiliary_services_config<T>(mut self, v: std::option::Option<T>) -> Self
2847 where
2848 T: std::convert::Into<crate::model::AuxiliaryServicesConfig>,
2849 {
2850 self.auxiliary_services_config = v.map(|x| x.into());
2851 self
2852 }
2853
2854 pub fn set_infrastructure_config<
2859 T: std::convert::Into<
2860 std::option::Option<crate::model::virtual_cluster_config::InfrastructureConfig>,
2861 >,
2862 >(
2863 mut self,
2864 v: T,
2865 ) -> Self {
2866 self.infrastructure_config = v.into();
2867 self
2868 }
2869
2870 pub fn kubernetes_cluster_config(
2874 &self,
2875 ) -> std::option::Option<&std::boxed::Box<crate::model::KubernetesClusterConfig>> {
2876 #[allow(unreachable_patterns)]
2877 self.infrastructure_config.as_ref().and_then(|v| match v {
2878 crate::model::virtual_cluster_config::InfrastructureConfig::KubernetesClusterConfig(
2879 v,
2880 ) => std::option::Option::Some(v),
2881 _ => std::option::Option::None,
2882 })
2883 }
2884
2885 pub fn set_kubernetes_cluster_config<
2891 T: std::convert::Into<std::boxed::Box<crate::model::KubernetesClusterConfig>>,
2892 >(
2893 mut self,
2894 v: T,
2895 ) -> Self {
2896 self.infrastructure_config = std::option::Option::Some(
2897 crate::model::virtual_cluster_config::InfrastructureConfig::KubernetesClusterConfig(
2898 v.into(),
2899 ),
2900 );
2901 self
2902 }
2903}
2904
2905impl wkt::message::Message for VirtualClusterConfig {
2906 fn typename() -> &'static str {
2907 "type.googleapis.com/google.cloud.dataproc.v1.VirtualClusterConfig"
2908 }
2909}
2910
2911pub mod virtual_cluster_config {
2913 #[allow(unused_imports)]
2914 use super::*;
2915
2916 #[derive(Clone, Debug, PartialEq)]
2917 #[non_exhaustive]
2918 pub enum InfrastructureConfig {
2919 KubernetesClusterConfig(std::boxed::Box<crate::model::KubernetesClusterConfig>),
2922 }
2923}
2924
2925#[derive(Clone, Default, PartialEq)]
2927#[non_exhaustive]
2928pub struct AuxiliaryServicesConfig {
2929 pub metastore_config: std::option::Option<crate::model::MetastoreConfig>,
2931
2932 pub spark_history_server_config: std::option::Option<crate::model::SparkHistoryServerConfig>,
2934
2935 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2936}
2937
2938impl AuxiliaryServicesConfig {
2939 pub fn new() -> Self {
2940 std::default::Default::default()
2941 }
2942
2943 pub fn set_metastore_config<T>(mut self, v: T) -> Self
2945 where
2946 T: std::convert::Into<crate::model::MetastoreConfig>,
2947 {
2948 self.metastore_config = std::option::Option::Some(v.into());
2949 self
2950 }
2951
2952 pub fn set_or_clear_metastore_config<T>(mut self, v: std::option::Option<T>) -> Self
2954 where
2955 T: std::convert::Into<crate::model::MetastoreConfig>,
2956 {
2957 self.metastore_config = v.map(|x| x.into());
2958 self
2959 }
2960
2961 pub fn set_spark_history_server_config<T>(mut self, v: T) -> Self
2963 where
2964 T: std::convert::Into<crate::model::SparkHistoryServerConfig>,
2965 {
2966 self.spark_history_server_config = std::option::Option::Some(v.into());
2967 self
2968 }
2969
2970 pub fn set_or_clear_spark_history_server_config<T>(mut self, v: std::option::Option<T>) -> Self
2972 where
2973 T: std::convert::Into<crate::model::SparkHistoryServerConfig>,
2974 {
2975 self.spark_history_server_config = v.map(|x| x.into());
2976 self
2977 }
2978}
2979
2980impl wkt::message::Message for AuxiliaryServicesConfig {
2981 fn typename() -> &'static str {
2982 "type.googleapis.com/google.cloud.dataproc.v1.AuxiliaryServicesConfig"
2983 }
2984}
2985
2986#[derive(Clone, Default, PartialEq)]
2988#[non_exhaustive]
2989pub struct EndpointConfig {
2990 pub http_ports: std::collections::HashMap<std::string::String, std::string::String>,
2993
2994 pub enable_http_port_access: bool,
2997
2998 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2999}
3000
3001impl EndpointConfig {
3002 pub fn new() -> Self {
3003 std::default::Default::default()
3004 }
3005
3006 pub fn set_http_ports<T, K, V>(mut self, v: T) -> Self
3008 where
3009 T: std::iter::IntoIterator<Item = (K, V)>,
3010 K: std::convert::Into<std::string::String>,
3011 V: std::convert::Into<std::string::String>,
3012 {
3013 use std::iter::Iterator;
3014 self.http_ports = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3015 self
3016 }
3017
3018 pub fn set_enable_http_port_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3020 self.enable_http_port_access = v.into();
3021 self
3022 }
3023}
3024
3025impl wkt::message::Message for EndpointConfig {
3026 fn typename() -> &'static str {
3027 "type.googleapis.com/google.cloud.dataproc.v1.EndpointConfig"
3028 }
3029}
3030
3031#[derive(Clone, Default, PartialEq)]
3033#[non_exhaustive]
3034pub struct AutoscalingConfig {
3035 pub policy_uri: std::string::String,
3045
3046 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3047}
3048
3049impl AutoscalingConfig {
3050 pub fn new() -> Self {
3051 std::default::Default::default()
3052 }
3053
3054 pub fn set_policy_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3056 self.policy_uri = v.into();
3057 self
3058 }
3059}
3060
3061impl wkt::message::Message for AutoscalingConfig {
3062 fn typename() -> &'static str {
3063 "type.googleapis.com/google.cloud.dataproc.v1.AutoscalingConfig"
3064 }
3065}
3066
3067#[derive(Clone, Default, PartialEq)]
3069#[non_exhaustive]
3070pub struct EncryptionConfig {
3071 pub gce_pd_kms_key_name: std::string::String,
3077
3078 pub kms_key: std::string::String,
3105
3106 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3107}
3108
3109impl EncryptionConfig {
3110 pub fn new() -> Self {
3111 std::default::Default::default()
3112 }
3113
3114 pub fn set_gce_pd_kms_key_name<T: std::convert::Into<std::string::String>>(
3116 mut self,
3117 v: T,
3118 ) -> Self {
3119 self.gce_pd_kms_key_name = v.into();
3120 self
3121 }
3122
3123 pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3125 self.kms_key = v.into();
3126 self
3127 }
3128}
3129
3130impl wkt::message::Message for EncryptionConfig {
3131 fn typename() -> &'static str {
3132 "type.googleapis.com/google.cloud.dataproc.v1.EncryptionConfig"
3133 }
3134}
3135
3136#[derive(Clone, Default, PartialEq)]
3139#[non_exhaustive]
3140pub struct GceClusterConfig {
3141 pub zone_uri: std::string::String,
3151
3152 pub network_uri: std::string::String,
3165
3166 pub subnetwork_uri: std::string::String,
3175
3176 pub internal_ip_only: std::option::Option<bool>,
3193
3194 pub private_ipv6_google_access: crate::model::gce_cluster_config::PrivateIpv6GoogleAccess,
3196
3197 pub service_account: std::string::String,
3209
3210 pub service_account_scopes: std::vec::Vec<std::string::String>,
3225
3226 pub tags: std::vec::Vec<std::string::String>,
3229
3230 pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
3234
3235 pub reservation_affinity: std::option::Option<crate::model::ReservationAffinity>,
3237
3238 pub node_group_affinity: std::option::Option<crate::model::NodeGroupAffinity>,
3240
3241 pub shielded_instance_config: std::option::Option<crate::model::ShieldedInstanceConfig>,
3245
3246 pub confidential_instance_config: std::option::Option<crate::model::ConfidentialInstanceConfig>,
3249
3250 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3251}
3252
3253impl GceClusterConfig {
3254 pub fn new() -> Self {
3255 std::default::Default::default()
3256 }
3257
3258 pub fn set_zone_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3260 self.zone_uri = v.into();
3261 self
3262 }
3263
3264 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3266 self.network_uri = v.into();
3267 self
3268 }
3269
3270 pub fn set_subnetwork_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3272 self.subnetwork_uri = v.into();
3273 self
3274 }
3275
3276 pub fn set_internal_ip_only<T>(mut self, v: T) -> Self
3278 where
3279 T: std::convert::Into<bool>,
3280 {
3281 self.internal_ip_only = std::option::Option::Some(v.into());
3282 self
3283 }
3284
3285 pub fn set_or_clear_internal_ip_only<T>(mut self, v: std::option::Option<T>) -> Self
3287 where
3288 T: std::convert::Into<bool>,
3289 {
3290 self.internal_ip_only = v.map(|x| x.into());
3291 self
3292 }
3293
3294 pub fn set_private_ipv6_google_access<
3296 T: std::convert::Into<crate::model::gce_cluster_config::PrivateIpv6GoogleAccess>,
3297 >(
3298 mut self,
3299 v: T,
3300 ) -> Self {
3301 self.private_ipv6_google_access = v.into();
3302 self
3303 }
3304
3305 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3307 self.service_account = v.into();
3308 self
3309 }
3310
3311 pub fn set_service_account_scopes<T, V>(mut self, v: T) -> Self
3313 where
3314 T: std::iter::IntoIterator<Item = V>,
3315 V: std::convert::Into<std::string::String>,
3316 {
3317 use std::iter::Iterator;
3318 self.service_account_scopes = v.into_iter().map(|i| i.into()).collect();
3319 self
3320 }
3321
3322 pub fn set_tags<T, V>(mut self, v: T) -> Self
3324 where
3325 T: std::iter::IntoIterator<Item = V>,
3326 V: std::convert::Into<std::string::String>,
3327 {
3328 use std::iter::Iterator;
3329 self.tags = v.into_iter().map(|i| i.into()).collect();
3330 self
3331 }
3332
3333 pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
3335 where
3336 T: std::iter::IntoIterator<Item = (K, V)>,
3337 K: std::convert::Into<std::string::String>,
3338 V: std::convert::Into<std::string::String>,
3339 {
3340 use std::iter::Iterator;
3341 self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3342 self
3343 }
3344
3345 pub fn set_reservation_affinity<T>(mut self, v: T) -> Self
3347 where
3348 T: std::convert::Into<crate::model::ReservationAffinity>,
3349 {
3350 self.reservation_affinity = std::option::Option::Some(v.into());
3351 self
3352 }
3353
3354 pub fn set_or_clear_reservation_affinity<T>(mut self, v: std::option::Option<T>) -> Self
3356 where
3357 T: std::convert::Into<crate::model::ReservationAffinity>,
3358 {
3359 self.reservation_affinity = v.map(|x| x.into());
3360 self
3361 }
3362
3363 pub fn set_node_group_affinity<T>(mut self, v: T) -> Self
3365 where
3366 T: std::convert::Into<crate::model::NodeGroupAffinity>,
3367 {
3368 self.node_group_affinity = std::option::Option::Some(v.into());
3369 self
3370 }
3371
3372 pub fn set_or_clear_node_group_affinity<T>(mut self, v: std::option::Option<T>) -> Self
3374 where
3375 T: std::convert::Into<crate::model::NodeGroupAffinity>,
3376 {
3377 self.node_group_affinity = v.map(|x| x.into());
3378 self
3379 }
3380
3381 pub fn set_shielded_instance_config<T>(mut self, v: T) -> Self
3383 where
3384 T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
3385 {
3386 self.shielded_instance_config = std::option::Option::Some(v.into());
3387 self
3388 }
3389
3390 pub fn set_or_clear_shielded_instance_config<T>(mut self, v: std::option::Option<T>) -> Self
3392 where
3393 T: std::convert::Into<crate::model::ShieldedInstanceConfig>,
3394 {
3395 self.shielded_instance_config = v.map(|x| x.into());
3396 self
3397 }
3398
3399 pub fn set_confidential_instance_config<T>(mut self, v: T) -> Self
3401 where
3402 T: std::convert::Into<crate::model::ConfidentialInstanceConfig>,
3403 {
3404 self.confidential_instance_config = std::option::Option::Some(v.into());
3405 self
3406 }
3407
3408 pub fn set_or_clear_confidential_instance_config<T>(mut self, v: std::option::Option<T>) -> Self
3410 where
3411 T: std::convert::Into<crate::model::ConfidentialInstanceConfig>,
3412 {
3413 self.confidential_instance_config = v.map(|x| x.into());
3414 self
3415 }
3416}
3417
3418impl wkt::message::Message for GceClusterConfig {
3419 fn typename() -> &'static str {
3420 "type.googleapis.com/google.cloud.dataproc.v1.GceClusterConfig"
3421 }
3422}
3423
3424pub mod gce_cluster_config {
3426 #[allow(unused_imports)]
3427 use super::*;
3428
3429 #[derive(Clone, Debug, PartialEq)]
3449 #[non_exhaustive]
3450 pub enum PrivateIpv6GoogleAccess {
3451 Unspecified,
3457 InheritFromSubnetwork,
3461 Outbound,
3464 Bidirectional,
3467 UnknownValue(private_ipv_6_google_access::UnknownValue),
3472 }
3473
3474 #[doc(hidden)]
3475 pub mod private_ipv_6_google_access {
3476 #[allow(unused_imports)]
3477 use super::*;
3478 #[derive(Clone, Debug, PartialEq)]
3479 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3480 }
3481
3482 impl PrivateIpv6GoogleAccess {
3483 pub fn value(&self) -> std::option::Option<i32> {
3488 match self {
3489 Self::Unspecified => std::option::Option::Some(0),
3490 Self::InheritFromSubnetwork => std::option::Option::Some(1),
3491 Self::Outbound => std::option::Option::Some(2),
3492 Self::Bidirectional => std::option::Option::Some(3),
3493 Self::UnknownValue(u) => u.0.value(),
3494 }
3495 }
3496
3497 pub fn name(&self) -> std::option::Option<&str> {
3502 match self {
3503 Self::Unspecified => {
3504 std::option::Option::Some("PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED")
3505 }
3506 Self::InheritFromSubnetwork => std::option::Option::Some("INHERIT_FROM_SUBNETWORK"),
3507 Self::Outbound => std::option::Option::Some("OUTBOUND"),
3508 Self::Bidirectional => std::option::Option::Some("BIDIRECTIONAL"),
3509 Self::UnknownValue(u) => u.0.name(),
3510 }
3511 }
3512 }
3513
3514 impl std::default::Default for PrivateIpv6GoogleAccess {
3515 fn default() -> Self {
3516 use std::convert::From;
3517 Self::from(0)
3518 }
3519 }
3520
3521 impl std::fmt::Display for PrivateIpv6GoogleAccess {
3522 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3523 wkt::internal::display_enum(f, self.name(), self.value())
3524 }
3525 }
3526
3527 impl std::convert::From<i32> for PrivateIpv6GoogleAccess {
3528 fn from(value: i32) -> Self {
3529 match value {
3530 0 => Self::Unspecified,
3531 1 => Self::InheritFromSubnetwork,
3532 2 => Self::Outbound,
3533 3 => Self::Bidirectional,
3534 _ => Self::UnknownValue(private_ipv_6_google_access::UnknownValue(
3535 wkt::internal::UnknownEnumValue::Integer(value),
3536 )),
3537 }
3538 }
3539 }
3540
3541 impl std::convert::From<&str> for PrivateIpv6GoogleAccess {
3542 fn from(value: &str) -> Self {
3543 use std::string::ToString;
3544 match value {
3545 "PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED" => Self::Unspecified,
3546 "INHERIT_FROM_SUBNETWORK" => Self::InheritFromSubnetwork,
3547 "OUTBOUND" => Self::Outbound,
3548 "BIDIRECTIONAL" => Self::Bidirectional,
3549 _ => Self::UnknownValue(private_ipv_6_google_access::UnknownValue(
3550 wkt::internal::UnknownEnumValue::String(value.to_string()),
3551 )),
3552 }
3553 }
3554 }
3555
3556 impl serde::ser::Serialize for PrivateIpv6GoogleAccess {
3557 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3558 where
3559 S: serde::Serializer,
3560 {
3561 match self {
3562 Self::Unspecified => serializer.serialize_i32(0),
3563 Self::InheritFromSubnetwork => serializer.serialize_i32(1),
3564 Self::Outbound => serializer.serialize_i32(2),
3565 Self::Bidirectional => serializer.serialize_i32(3),
3566 Self::UnknownValue(u) => u.0.serialize(serializer),
3567 }
3568 }
3569 }
3570
3571 impl<'de> serde::de::Deserialize<'de> for PrivateIpv6GoogleAccess {
3572 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3573 where
3574 D: serde::Deserializer<'de>,
3575 {
3576 deserializer.deserialize_any(
3577 wkt::internal::EnumVisitor::<PrivateIpv6GoogleAccess>::new(
3578 ".google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess",
3579 ),
3580 )
3581 }
3582 }
3583}
3584
3585#[derive(Clone, Default, PartialEq)]
3591#[non_exhaustive]
3592pub struct NodeGroupAffinity {
3593 pub node_group_uri: std::string::String,
3604
3605 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3606}
3607
3608impl NodeGroupAffinity {
3609 pub fn new() -> Self {
3610 std::default::Default::default()
3611 }
3612
3613 pub fn set_node_group_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3615 self.node_group_uri = v.into();
3616 self
3617 }
3618}
3619
3620impl wkt::message::Message for NodeGroupAffinity {
3621 fn typename() -> &'static str {
3622 "type.googleapis.com/google.cloud.dataproc.v1.NodeGroupAffinity"
3623 }
3624}
3625
3626#[derive(Clone, Default, PartialEq)]
3629#[non_exhaustive]
3630pub struct ShieldedInstanceConfig {
3631 pub enable_secure_boot: std::option::Option<bool>,
3633
3634 pub enable_vtpm: std::option::Option<bool>,
3636
3637 pub enable_integrity_monitoring: std::option::Option<bool>,
3639
3640 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3641}
3642
3643impl ShieldedInstanceConfig {
3644 pub fn new() -> Self {
3645 std::default::Default::default()
3646 }
3647
3648 pub fn set_enable_secure_boot<T>(mut self, v: T) -> Self
3650 where
3651 T: std::convert::Into<bool>,
3652 {
3653 self.enable_secure_boot = std::option::Option::Some(v.into());
3654 self
3655 }
3656
3657 pub fn set_or_clear_enable_secure_boot<T>(mut self, v: std::option::Option<T>) -> Self
3659 where
3660 T: std::convert::Into<bool>,
3661 {
3662 self.enable_secure_boot = v.map(|x| x.into());
3663 self
3664 }
3665
3666 pub fn set_enable_vtpm<T>(mut self, v: T) -> Self
3668 where
3669 T: std::convert::Into<bool>,
3670 {
3671 self.enable_vtpm = std::option::Option::Some(v.into());
3672 self
3673 }
3674
3675 pub fn set_or_clear_enable_vtpm<T>(mut self, v: std::option::Option<T>) -> Self
3677 where
3678 T: std::convert::Into<bool>,
3679 {
3680 self.enable_vtpm = v.map(|x| x.into());
3681 self
3682 }
3683
3684 pub fn set_enable_integrity_monitoring<T>(mut self, v: T) -> Self
3686 where
3687 T: std::convert::Into<bool>,
3688 {
3689 self.enable_integrity_monitoring = std::option::Option::Some(v.into());
3690 self
3691 }
3692
3693 pub fn set_or_clear_enable_integrity_monitoring<T>(mut self, v: std::option::Option<T>) -> Self
3695 where
3696 T: std::convert::Into<bool>,
3697 {
3698 self.enable_integrity_monitoring = v.map(|x| x.into());
3699 self
3700 }
3701}
3702
3703impl wkt::message::Message for ShieldedInstanceConfig {
3704 fn typename() -> &'static str {
3705 "type.googleapis.com/google.cloud.dataproc.v1.ShieldedInstanceConfig"
3706 }
3707}
3708
3709#[derive(Clone, Default, PartialEq)]
3712#[non_exhaustive]
3713pub struct ConfidentialInstanceConfig {
3714 pub enable_confidential_compute: bool,
3717
3718 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3719}
3720
3721impl ConfidentialInstanceConfig {
3722 pub fn new() -> Self {
3723 std::default::Default::default()
3724 }
3725
3726 pub fn set_enable_confidential_compute<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3728 self.enable_confidential_compute = v.into();
3729 self
3730 }
3731}
3732
3733impl wkt::message::Message for ConfidentialInstanceConfig {
3734 fn typename() -> &'static str {
3735 "type.googleapis.com/google.cloud.dataproc.v1.ConfidentialInstanceConfig"
3736 }
3737}
3738
3739#[derive(Clone, Default, PartialEq)]
3742#[non_exhaustive]
3743pub struct InstanceGroupConfig {
3744 pub num_instances: i32,
3751
3752 pub instance_names: std::vec::Vec<std::string::String>,
3755
3756 pub instance_references: std::vec::Vec<crate::model::InstanceReference>,
3758
3759 pub image_uri: std::string::String,
3778
3779 pub machine_type_uri: std::string::String,
3793
3794 pub disk_config: std::option::Option<crate::model::DiskConfig>,
3796
3797 pub is_preemptible: bool,
3800
3801 pub preemptibility: crate::model::instance_group_config::Preemptibility,
3809
3810 pub managed_group_config: std::option::Option<crate::model::ManagedGroupConfig>,
3814
3815 pub accelerators: std::vec::Vec<crate::model::AcceleratorConfig>,
3818
3819 pub min_cpu_platform: std::string::String,
3823
3824 pub min_num_instances: i32,
3839
3840 pub instance_flexibility_policy: std::option::Option<crate::model::InstanceFlexibilityPolicy>,
3843
3844 pub startup_config: std::option::Option<crate::model::StartupConfig>,
3847
3848 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3849}
3850
3851impl InstanceGroupConfig {
3852 pub fn new() -> Self {
3853 std::default::Default::default()
3854 }
3855
3856 pub fn set_num_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3858 self.num_instances = v.into();
3859 self
3860 }
3861
3862 pub fn set_instance_names<T, V>(mut self, v: T) -> Self
3864 where
3865 T: std::iter::IntoIterator<Item = V>,
3866 V: std::convert::Into<std::string::String>,
3867 {
3868 use std::iter::Iterator;
3869 self.instance_names = v.into_iter().map(|i| i.into()).collect();
3870 self
3871 }
3872
3873 pub fn set_instance_references<T, V>(mut self, v: T) -> Self
3875 where
3876 T: std::iter::IntoIterator<Item = V>,
3877 V: std::convert::Into<crate::model::InstanceReference>,
3878 {
3879 use std::iter::Iterator;
3880 self.instance_references = v.into_iter().map(|i| i.into()).collect();
3881 self
3882 }
3883
3884 pub fn set_image_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3886 self.image_uri = v.into();
3887 self
3888 }
3889
3890 pub fn set_machine_type_uri<T: std::convert::Into<std::string::String>>(
3892 mut self,
3893 v: T,
3894 ) -> Self {
3895 self.machine_type_uri = v.into();
3896 self
3897 }
3898
3899 pub fn set_disk_config<T>(mut self, v: T) -> Self
3901 where
3902 T: std::convert::Into<crate::model::DiskConfig>,
3903 {
3904 self.disk_config = std::option::Option::Some(v.into());
3905 self
3906 }
3907
3908 pub fn set_or_clear_disk_config<T>(mut self, v: std::option::Option<T>) -> Self
3910 where
3911 T: std::convert::Into<crate::model::DiskConfig>,
3912 {
3913 self.disk_config = v.map(|x| x.into());
3914 self
3915 }
3916
3917 pub fn set_is_preemptible<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3919 self.is_preemptible = v.into();
3920 self
3921 }
3922
3923 pub fn set_preemptibility<
3925 T: std::convert::Into<crate::model::instance_group_config::Preemptibility>,
3926 >(
3927 mut self,
3928 v: T,
3929 ) -> Self {
3930 self.preemptibility = v.into();
3931 self
3932 }
3933
3934 pub fn set_managed_group_config<T>(mut self, v: T) -> Self
3936 where
3937 T: std::convert::Into<crate::model::ManagedGroupConfig>,
3938 {
3939 self.managed_group_config = std::option::Option::Some(v.into());
3940 self
3941 }
3942
3943 pub fn set_or_clear_managed_group_config<T>(mut self, v: std::option::Option<T>) -> Self
3945 where
3946 T: std::convert::Into<crate::model::ManagedGroupConfig>,
3947 {
3948 self.managed_group_config = v.map(|x| x.into());
3949 self
3950 }
3951
3952 pub fn set_accelerators<T, V>(mut self, v: T) -> Self
3954 where
3955 T: std::iter::IntoIterator<Item = V>,
3956 V: std::convert::Into<crate::model::AcceleratorConfig>,
3957 {
3958 use std::iter::Iterator;
3959 self.accelerators = v.into_iter().map(|i| i.into()).collect();
3960 self
3961 }
3962
3963 pub fn set_min_cpu_platform<T: std::convert::Into<std::string::String>>(
3965 mut self,
3966 v: T,
3967 ) -> Self {
3968 self.min_cpu_platform = v.into();
3969 self
3970 }
3971
3972 pub fn set_min_num_instances<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3974 self.min_num_instances = v.into();
3975 self
3976 }
3977
3978 pub fn set_instance_flexibility_policy<T>(mut self, v: T) -> Self
3980 where
3981 T: std::convert::Into<crate::model::InstanceFlexibilityPolicy>,
3982 {
3983 self.instance_flexibility_policy = std::option::Option::Some(v.into());
3984 self
3985 }
3986
3987 pub fn set_or_clear_instance_flexibility_policy<T>(mut self, v: std::option::Option<T>) -> Self
3989 where
3990 T: std::convert::Into<crate::model::InstanceFlexibilityPolicy>,
3991 {
3992 self.instance_flexibility_policy = v.map(|x| x.into());
3993 self
3994 }
3995
3996 pub fn set_startup_config<T>(mut self, v: T) -> Self
3998 where
3999 T: std::convert::Into<crate::model::StartupConfig>,
4000 {
4001 self.startup_config = std::option::Option::Some(v.into());
4002 self
4003 }
4004
4005 pub fn set_or_clear_startup_config<T>(mut self, v: std::option::Option<T>) -> Self
4007 where
4008 T: std::convert::Into<crate::model::StartupConfig>,
4009 {
4010 self.startup_config = v.map(|x| x.into());
4011 self
4012 }
4013}
4014
4015impl wkt::message::Message for InstanceGroupConfig {
4016 fn typename() -> &'static str {
4017 "type.googleapis.com/google.cloud.dataproc.v1.InstanceGroupConfig"
4018 }
4019}
4020
4021pub mod instance_group_config {
4023 #[allow(unused_imports)]
4024 use super::*;
4025
4026 #[derive(Clone, Debug, PartialEq)]
4042 #[non_exhaustive]
4043 pub enum Preemptibility {
4044 Unspecified,
4047 NonPreemptible,
4052 Preemptible,
4059 Spot,
4068 UnknownValue(preemptibility::UnknownValue),
4073 }
4074
4075 #[doc(hidden)]
4076 pub mod preemptibility {
4077 #[allow(unused_imports)]
4078 use super::*;
4079 #[derive(Clone, Debug, PartialEq)]
4080 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4081 }
4082
4083 impl Preemptibility {
4084 pub fn value(&self) -> std::option::Option<i32> {
4089 match self {
4090 Self::Unspecified => std::option::Option::Some(0),
4091 Self::NonPreemptible => std::option::Option::Some(1),
4092 Self::Preemptible => std::option::Option::Some(2),
4093 Self::Spot => std::option::Option::Some(3),
4094 Self::UnknownValue(u) => u.0.value(),
4095 }
4096 }
4097
4098 pub fn name(&self) -> std::option::Option<&str> {
4103 match self {
4104 Self::Unspecified => std::option::Option::Some("PREEMPTIBILITY_UNSPECIFIED"),
4105 Self::NonPreemptible => std::option::Option::Some("NON_PREEMPTIBLE"),
4106 Self::Preemptible => std::option::Option::Some("PREEMPTIBLE"),
4107 Self::Spot => std::option::Option::Some("SPOT"),
4108 Self::UnknownValue(u) => u.0.name(),
4109 }
4110 }
4111 }
4112
4113 impl std::default::Default for Preemptibility {
4114 fn default() -> Self {
4115 use std::convert::From;
4116 Self::from(0)
4117 }
4118 }
4119
4120 impl std::fmt::Display for Preemptibility {
4121 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4122 wkt::internal::display_enum(f, self.name(), self.value())
4123 }
4124 }
4125
4126 impl std::convert::From<i32> for Preemptibility {
4127 fn from(value: i32) -> Self {
4128 match value {
4129 0 => Self::Unspecified,
4130 1 => Self::NonPreemptible,
4131 2 => Self::Preemptible,
4132 3 => Self::Spot,
4133 _ => Self::UnknownValue(preemptibility::UnknownValue(
4134 wkt::internal::UnknownEnumValue::Integer(value),
4135 )),
4136 }
4137 }
4138 }
4139
4140 impl std::convert::From<&str> for Preemptibility {
4141 fn from(value: &str) -> Self {
4142 use std::string::ToString;
4143 match value {
4144 "PREEMPTIBILITY_UNSPECIFIED" => Self::Unspecified,
4145 "NON_PREEMPTIBLE" => Self::NonPreemptible,
4146 "PREEMPTIBLE" => Self::Preemptible,
4147 "SPOT" => Self::Spot,
4148 _ => Self::UnknownValue(preemptibility::UnknownValue(
4149 wkt::internal::UnknownEnumValue::String(value.to_string()),
4150 )),
4151 }
4152 }
4153 }
4154
4155 impl serde::ser::Serialize for Preemptibility {
4156 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4157 where
4158 S: serde::Serializer,
4159 {
4160 match self {
4161 Self::Unspecified => serializer.serialize_i32(0),
4162 Self::NonPreemptible => serializer.serialize_i32(1),
4163 Self::Preemptible => serializer.serialize_i32(2),
4164 Self::Spot => serializer.serialize_i32(3),
4165 Self::UnknownValue(u) => u.0.serialize(serializer),
4166 }
4167 }
4168 }
4169
4170 impl<'de> serde::de::Deserialize<'de> for Preemptibility {
4171 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4172 where
4173 D: serde::Deserializer<'de>,
4174 {
4175 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Preemptibility>::new(
4176 ".google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility",
4177 ))
4178 }
4179 }
4180}
4181
4182#[derive(Clone, Default, PartialEq)]
4185#[non_exhaustive]
4186pub struct StartupConfig {
4187 pub required_registration_fraction: std::option::Option<f64>,
4194
4195 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4196}
4197
4198impl StartupConfig {
4199 pub fn new() -> Self {
4200 std::default::Default::default()
4201 }
4202
4203 pub fn set_required_registration_fraction<T>(mut self, v: T) -> Self
4205 where
4206 T: std::convert::Into<f64>,
4207 {
4208 self.required_registration_fraction = std::option::Option::Some(v.into());
4209 self
4210 }
4211
4212 pub fn set_or_clear_required_registration_fraction<T>(
4214 mut self,
4215 v: std::option::Option<T>,
4216 ) -> Self
4217 where
4218 T: std::convert::Into<f64>,
4219 {
4220 self.required_registration_fraction = v.map(|x| x.into());
4221 self
4222 }
4223}
4224
4225impl wkt::message::Message for StartupConfig {
4226 fn typename() -> &'static str {
4227 "type.googleapis.com/google.cloud.dataproc.v1.StartupConfig"
4228 }
4229}
4230
4231#[derive(Clone, Default, PartialEq)]
4233#[non_exhaustive]
4234pub struct InstanceReference {
4235 pub instance_name: std::string::String,
4237
4238 pub instance_id: std::string::String,
4240
4241 pub public_key: std::string::String,
4243
4244 pub public_ecies_key: std::string::String,
4246
4247 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4248}
4249
4250impl InstanceReference {
4251 pub fn new() -> Self {
4252 std::default::Default::default()
4253 }
4254
4255 pub fn set_instance_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4257 self.instance_name = v.into();
4258 self
4259 }
4260
4261 pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4263 self.instance_id = v.into();
4264 self
4265 }
4266
4267 pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4269 self.public_key = v.into();
4270 self
4271 }
4272
4273 pub fn set_public_ecies_key<T: std::convert::Into<std::string::String>>(
4275 mut self,
4276 v: T,
4277 ) -> Self {
4278 self.public_ecies_key = v.into();
4279 self
4280 }
4281}
4282
4283impl wkt::message::Message for InstanceReference {
4284 fn typename() -> &'static str {
4285 "type.googleapis.com/google.cloud.dataproc.v1.InstanceReference"
4286 }
4287}
4288
4289#[derive(Clone, Default, PartialEq)]
4291#[non_exhaustive]
4292pub struct ManagedGroupConfig {
4293 pub instance_template_name: std::string::String,
4296
4297 pub instance_group_manager_name: std::string::String,
4299
4300 pub instance_group_manager_uri: std::string::String,
4303
4304 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4305}
4306
4307impl ManagedGroupConfig {
4308 pub fn new() -> Self {
4309 std::default::Default::default()
4310 }
4311
4312 pub fn set_instance_template_name<T: std::convert::Into<std::string::String>>(
4314 mut self,
4315 v: T,
4316 ) -> Self {
4317 self.instance_template_name = v.into();
4318 self
4319 }
4320
4321 pub fn set_instance_group_manager_name<T: std::convert::Into<std::string::String>>(
4323 mut self,
4324 v: T,
4325 ) -> Self {
4326 self.instance_group_manager_name = v.into();
4327 self
4328 }
4329
4330 pub fn set_instance_group_manager_uri<T: std::convert::Into<std::string::String>>(
4332 mut self,
4333 v: T,
4334 ) -> Self {
4335 self.instance_group_manager_uri = v.into();
4336 self
4337 }
4338}
4339
4340impl wkt::message::Message for ManagedGroupConfig {
4341 fn typename() -> &'static str {
4342 "type.googleapis.com/google.cloud.dataproc.v1.ManagedGroupConfig"
4343 }
4344}
4345
4346#[derive(Clone, Default, PartialEq)]
4349#[non_exhaustive]
4350pub struct InstanceFlexibilityPolicy {
4351 pub provisioning_model_mix:
4354 std::option::Option<crate::model::instance_flexibility_policy::ProvisioningModelMix>,
4355
4356 pub instance_selection_list:
4359 std::vec::Vec<crate::model::instance_flexibility_policy::InstanceSelection>,
4360
4361 pub instance_selection_results:
4363 std::vec::Vec<crate::model::instance_flexibility_policy::InstanceSelectionResult>,
4364
4365 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4366}
4367
4368impl InstanceFlexibilityPolicy {
4369 pub fn new() -> Self {
4370 std::default::Default::default()
4371 }
4372
4373 pub fn set_provisioning_model_mix<T>(mut self, v: T) -> Self
4375 where
4376 T: std::convert::Into<crate::model::instance_flexibility_policy::ProvisioningModelMix>,
4377 {
4378 self.provisioning_model_mix = std::option::Option::Some(v.into());
4379 self
4380 }
4381
4382 pub fn set_or_clear_provisioning_model_mix<T>(mut self, v: std::option::Option<T>) -> Self
4384 where
4385 T: std::convert::Into<crate::model::instance_flexibility_policy::ProvisioningModelMix>,
4386 {
4387 self.provisioning_model_mix = v.map(|x| x.into());
4388 self
4389 }
4390
4391 pub fn set_instance_selection_list<T, V>(mut self, v: T) -> Self
4393 where
4394 T: std::iter::IntoIterator<Item = V>,
4395 V: std::convert::Into<crate::model::instance_flexibility_policy::InstanceSelection>,
4396 {
4397 use std::iter::Iterator;
4398 self.instance_selection_list = v.into_iter().map(|i| i.into()).collect();
4399 self
4400 }
4401
4402 pub fn set_instance_selection_results<T, V>(mut self, v: T) -> Self
4404 where
4405 T: std::iter::IntoIterator<Item = V>,
4406 V: std::convert::Into<crate::model::instance_flexibility_policy::InstanceSelectionResult>,
4407 {
4408 use std::iter::Iterator;
4409 self.instance_selection_results = v.into_iter().map(|i| i.into()).collect();
4410 self
4411 }
4412}
4413
4414impl wkt::message::Message for InstanceFlexibilityPolicy {
4415 fn typename() -> &'static str {
4416 "type.googleapis.com/google.cloud.dataproc.v1.InstanceFlexibilityPolicy"
4417 }
4418}
4419
4420pub mod instance_flexibility_policy {
4422 #[allow(unused_imports)]
4423 use super::*;
4424
4425 #[derive(Clone, Default, PartialEq)]
4428 #[non_exhaustive]
4429 pub struct ProvisioningModelMix {
4430 pub standard_capacity_base: std::option::Option<i32>,
4438
4439 pub standard_capacity_percent_above_base: std::option::Option<i32>,
4447
4448 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4449 }
4450
4451 impl ProvisioningModelMix {
4452 pub fn new() -> Self {
4453 std::default::Default::default()
4454 }
4455
4456 pub fn set_standard_capacity_base<T>(mut self, v: T) -> Self
4458 where
4459 T: std::convert::Into<i32>,
4460 {
4461 self.standard_capacity_base = std::option::Option::Some(v.into());
4462 self
4463 }
4464
4465 pub fn set_or_clear_standard_capacity_base<T>(mut self, v: std::option::Option<T>) -> Self
4467 where
4468 T: std::convert::Into<i32>,
4469 {
4470 self.standard_capacity_base = v.map(|x| x.into());
4471 self
4472 }
4473
4474 pub fn set_standard_capacity_percent_above_base<T>(mut self, v: T) -> Self
4476 where
4477 T: std::convert::Into<i32>,
4478 {
4479 self.standard_capacity_percent_above_base = std::option::Option::Some(v.into());
4480 self
4481 }
4482
4483 pub fn set_or_clear_standard_capacity_percent_above_base<T>(
4485 mut self,
4486 v: std::option::Option<T>,
4487 ) -> Self
4488 where
4489 T: std::convert::Into<i32>,
4490 {
4491 self.standard_capacity_percent_above_base = v.map(|x| x.into());
4492 self
4493 }
4494 }
4495
4496 impl wkt::message::Message for ProvisioningModelMix {
4497 fn typename() -> &'static str {
4498 "type.googleapis.com/google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix"
4499 }
4500 }
4501
4502 #[derive(Clone, Default, PartialEq)]
4504 #[non_exhaustive]
4505 pub struct InstanceSelection {
4506 pub machine_types: std::vec::Vec<std::string::String>,
4508
4509 pub rank: i32,
4515
4516 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4517 }
4518
4519 impl InstanceSelection {
4520 pub fn new() -> Self {
4521 std::default::Default::default()
4522 }
4523
4524 pub fn set_machine_types<T, V>(mut self, v: T) -> Self
4526 where
4527 T: std::iter::IntoIterator<Item = V>,
4528 V: std::convert::Into<std::string::String>,
4529 {
4530 use std::iter::Iterator;
4531 self.machine_types = v.into_iter().map(|i| i.into()).collect();
4532 self
4533 }
4534
4535 pub fn set_rank<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4537 self.rank = v.into();
4538 self
4539 }
4540 }
4541
4542 impl wkt::message::Message for InstanceSelection {
4543 fn typename() -> &'static str {
4544 "type.googleapis.com/google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection"
4545 }
4546 }
4547
4548 #[derive(Clone, Default, PartialEq)]
4551 #[non_exhaustive]
4552 pub struct InstanceSelectionResult {
4553 pub machine_type: std::option::Option<std::string::String>,
4555
4556 pub vm_count: std::option::Option<i32>,
4558
4559 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4560 }
4561
4562 impl InstanceSelectionResult {
4563 pub fn new() -> Self {
4564 std::default::Default::default()
4565 }
4566
4567 pub fn set_machine_type<T>(mut self, v: T) -> Self
4569 where
4570 T: std::convert::Into<std::string::String>,
4571 {
4572 self.machine_type = std::option::Option::Some(v.into());
4573 self
4574 }
4575
4576 pub fn set_or_clear_machine_type<T>(mut self, v: std::option::Option<T>) -> Self
4578 where
4579 T: std::convert::Into<std::string::String>,
4580 {
4581 self.machine_type = v.map(|x| x.into());
4582 self
4583 }
4584
4585 pub fn set_vm_count<T>(mut self, v: T) -> Self
4587 where
4588 T: std::convert::Into<i32>,
4589 {
4590 self.vm_count = std::option::Option::Some(v.into());
4591 self
4592 }
4593
4594 pub fn set_or_clear_vm_count<T>(mut self, v: std::option::Option<T>) -> Self
4596 where
4597 T: std::convert::Into<i32>,
4598 {
4599 self.vm_count = v.map(|x| x.into());
4600 self
4601 }
4602 }
4603
4604 impl wkt::message::Message for InstanceSelectionResult {
4605 fn typename() -> &'static str {
4606 "type.googleapis.com/google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult"
4607 }
4608 }
4609}
4610
4611#[derive(Clone, Default, PartialEq)]
4615#[non_exhaustive]
4616pub struct AcceleratorConfig {
4617 pub accelerator_type_uri: std::string::String,
4634
4635 pub accelerator_count: i32,
4637
4638 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4639}
4640
4641impl AcceleratorConfig {
4642 pub fn new() -> Self {
4643 std::default::Default::default()
4644 }
4645
4646 pub fn set_accelerator_type_uri<T: std::convert::Into<std::string::String>>(
4648 mut self,
4649 v: T,
4650 ) -> Self {
4651 self.accelerator_type_uri = v.into();
4652 self
4653 }
4654
4655 pub fn set_accelerator_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4657 self.accelerator_count = v.into();
4658 self
4659 }
4660}
4661
4662impl wkt::message::Message for AcceleratorConfig {
4663 fn typename() -> &'static str {
4664 "type.googleapis.com/google.cloud.dataproc.v1.AcceleratorConfig"
4665 }
4666}
4667
4668#[derive(Clone, Default, PartialEq)]
4670#[non_exhaustive]
4671pub struct DiskConfig {
4672 pub boot_disk_type: std::string::String,
4678
4679 pub boot_disk_size_gb: i32,
4681
4682 pub num_local_ssds: i32,
4692
4693 pub local_ssd_interface: std::string::String,
4699
4700 pub boot_disk_provisioned_iops: std::option::Option<i64>,
4704
4705 pub boot_disk_provisioned_throughput: std::option::Option<i64>,
4710
4711 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4712}
4713
4714impl DiskConfig {
4715 pub fn new() -> Self {
4716 std::default::Default::default()
4717 }
4718
4719 pub fn set_boot_disk_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4721 self.boot_disk_type = v.into();
4722 self
4723 }
4724
4725 pub fn set_boot_disk_size_gb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4727 self.boot_disk_size_gb = v.into();
4728 self
4729 }
4730
4731 pub fn set_num_local_ssds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4733 self.num_local_ssds = v.into();
4734 self
4735 }
4736
4737 pub fn set_local_ssd_interface<T: std::convert::Into<std::string::String>>(
4739 mut self,
4740 v: T,
4741 ) -> Self {
4742 self.local_ssd_interface = v.into();
4743 self
4744 }
4745
4746 pub fn set_boot_disk_provisioned_iops<T>(mut self, v: T) -> Self
4748 where
4749 T: std::convert::Into<i64>,
4750 {
4751 self.boot_disk_provisioned_iops = std::option::Option::Some(v.into());
4752 self
4753 }
4754
4755 pub fn set_or_clear_boot_disk_provisioned_iops<T>(mut self, v: std::option::Option<T>) -> Self
4757 where
4758 T: std::convert::Into<i64>,
4759 {
4760 self.boot_disk_provisioned_iops = v.map(|x| x.into());
4761 self
4762 }
4763
4764 pub fn set_boot_disk_provisioned_throughput<T>(mut self, v: T) -> Self
4766 where
4767 T: std::convert::Into<i64>,
4768 {
4769 self.boot_disk_provisioned_throughput = std::option::Option::Some(v.into());
4770 self
4771 }
4772
4773 pub fn set_or_clear_boot_disk_provisioned_throughput<T>(
4775 mut self,
4776 v: std::option::Option<T>,
4777 ) -> Self
4778 where
4779 T: std::convert::Into<i64>,
4780 {
4781 self.boot_disk_provisioned_throughput = v.map(|x| x.into());
4782 self
4783 }
4784}
4785
4786impl wkt::message::Message for DiskConfig {
4787 fn typename() -> &'static str {
4788 "type.googleapis.com/google.cloud.dataproc.v1.DiskConfig"
4789 }
4790}
4791
4792#[derive(Clone, Default, PartialEq)]
4794#[non_exhaustive]
4795pub struct AuxiliaryNodeGroup {
4796 pub node_group: std::option::Option<crate::model::NodeGroup>,
4798
4799 pub node_group_id: std::string::String,
4805
4806 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4807}
4808
4809impl AuxiliaryNodeGroup {
4810 pub fn new() -> Self {
4811 std::default::Default::default()
4812 }
4813
4814 pub fn set_node_group<T>(mut self, v: T) -> Self
4816 where
4817 T: std::convert::Into<crate::model::NodeGroup>,
4818 {
4819 self.node_group = std::option::Option::Some(v.into());
4820 self
4821 }
4822
4823 pub fn set_or_clear_node_group<T>(mut self, v: std::option::Option<T>) -> Self
4825 where
4826 T: std::convert::Into<crate::model::NodeGroup>,
4827 {
4828 self.node_group = v.map(|x| x.into());
4829 self
4830 }
4831
4832 pub fn set_node_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4834 self.node_group_id = v.into();
4835 self
4836 }
4837}
4838
4839impl wkt::message::Message for AuxiliaryNodeGroup {
4840 fn typename() -> &'static str {
4841 "type.googleapis.com/google.cloud.dataproc.v1.AuxiliaryNodeGroup"
4842 }
4843}
4844
4845#[derive(Clone, Default, PartialEq)]
4852#[non_exhaustive]
4853pub struct NodeGroup {
4854 pub name: std::string::String,
4856
4857 pub roles: std::vec::Vec<crate::model::node_group::Role>,
4859
4860 pub node_group_config: std::option::Option<crate::model::InstanceGroupConfig>,
4862
4863 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4872
4873 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4874}
4875
4876impl NodeGroup {
4877 pub fn new() -> Self {
4878 std::default::Default::default()
4879 }
4880
4881 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4883 self.name = v.into();
4884 self
4885 }
4886
4887 pub fn set_roles<T, V>(mut self, v: T) -> Self
4889 where
4890 T: std::iter::IntoIterator<Item = V>,
4891 V: std::convert::Into<crate::model::node_group::Role>,
4892 {
4893 use std::iter::Iterator;
4894 self.roles = v.into_iter().map(|i| i.into()).collect();
4895 self
4896 }
4897
4898 pub fn set_node_group_config<T>(mut self, v: T) -> Self
4900 where
4901 T: std::convert::Into<crate::model::InstanceGroupConfig>,
4902 {
4903 self.node_group_config = std::option::Option::Some(v.into());
4904 self
4905 }
4906
4907 pub fn set_or_clear_node_group_config<T>(mut self, v: std::option::Option<T>) -> Self
4909 where
4910 T: std::convert::Into<crate::model::InstanceGroupConfig>,
4911 {
4912 self.node_group_config = v.map(|x| x.into());
4913 self
4914 }
4915
4916 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4918 where
4919 T: std::iter::IntoIterator<Item = (K, V)>,
4920 K: std::convert::Into<std::string::String>,
4921 V: std::convert::Into<std::string::String>,
4922 {
4923 use std::iter::Iterator;
4924 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4925 self
4926 }
4927}
4928
4929impl wkt::message::Message for NodeGroup {
4930 fn typename() -> &'static str {
4931 "type.googleapis.com/google.cloud.dataproc.v1.NodeGroup"
4932 }
4933}
4934
4935pub mod node_group {
4937 #[allow(unused_imports)]
4938 use super::*;
4939
4940 #[derive(Clone, Debug, PartialEq)]
4956 #[non_exhaustive]
4957 pub enum Role {
4958 Unspecified,
4960 Driver,
4962 UnknownValue(role::UnknownValue),
4967 }
4968
4969 #[doc(hidden)]
4970 pub mod role {
4971 #[allow(unused_imports)]
4972 use super::*;
4973 #[derive(Clone, Debug, PartialEq)]
4974 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4975 }
4976
4977 impl Role {
4978 pub fn value(&self) -> std::option::Option<i32> {
4983 match self {
4984 Self::Unspecified => std::option::Option::Some(0),
4985 Self::Driver => std::option::Option::Some(1),
4986 Self::UnknownValue(u) => u.0.value(),
4987 }
4988 }
4989
4990 pub fn name(&self) -> std::option::Option<&str> {
4995 match self {
4996 Self::Unspecified => std::option::Option::Some("ROLE_UNSPECIFIED"),
4997 Self::Driver => std::option::Option::Some("DRIVER"),
4998 Self::UnknownValue(u) => u.0.name(),
4999 }
5000 }
5001 }
5002
5003 impl std::default::Default for Role {
5004 fn default() -> Self {
5005 use std::convert::From;
5006 Self::from(0)
5007 }
5008 }
5009
5010 impl std::fmt::Display for Role {
5011 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5012 wkt::internal::display_enum(f, self.name(), self.value())
5013 }
5014 }
5015
5016 impl std::convert::From<i32> for Role {
5017 fn from(value: i32) -> Self {
5018 match value {
5019 0 => Self::Unspecified,
5020 1 => Self::Driver,
5021 _ => Self::UnknownValue(role::UnknownValue(
5022 wkt::internal::UnknownEnumValue::Integer(value),
5023 )),
5024 }
5025 }
5026 }
5027
5028 impl std::convert::From<&str> for Role {
5029 fn from(value: &str) -> Self {
5030 use std::string::ToString;
5031 match value {
5032 "ROLE_UNSPECIFIED" => Self::Unspecified,
5033 "DRIVER" => Self::Driver,
5034 _ => Self::UnknownValue(role::UnknownValue(
5035 wkt::internal::UnknownEnumValue::String(value.to_string()),
5036 )),
5037 }
5038 }
5039 }
5040
5041 impl serde::ser::Serialize for Role {
5042 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5043 where
5044 S: serde::Serializer,
5045 {
5046 match self {
5047 Self::Unspecified => serializer.serialize_i32(0),
5048 Self::Driver => serializer.serialize_i32(1),
5049 Self::UnknownValue(u) => u.0.serialize(serializer),
5050 }
5051 }
5052 }
5053
5054 impl<'de> serde::de::Deserialize<'de> for Role {
5055 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5056 where
5057 D: serde::Deserializer<'de>,
5058 {
5059 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Role>::new(
5060 ".google.cloud.dataproc.v1.NodeGroup.Role",
5061 ))
5062 }
5063 }
5064}
5065
5066#[derive(Clone, Default, PartialEq)]
5069#[non_exhaustive]
5070pub struct NodeInitializationAction {
5071 pub executable_file: std::string::String,
5073
5074 pub execution_timeout: std::option::Option<wkt::Duration>,
5082
5083 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5084}
5085
5086impl NodeInitializationAction {
5087 pub fn new() -> Self {
5088 std::default::Default::default()
5089 }
5090
5091 pub fn set_executable_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5093 self.executable_file = v.into();
5094 self
5095 }
5096
5097 pub fn set_execution_timeout<T>(mut self, v: T) -> Self
5099 where
5100 T: std::convert::Into<wkt::Duration>,
5101 {
5102 self.execution_timeout = std::option::Option::Some(v.into());
5103 self
5104 }
5105
5106 pub fn set_or_clear_execution_timeout<T>(mut self, v: std::option::Option<T>) -> Self
5108 where
5109 T: std::convert::Into<wkt::Duration>,
5110 {
5111 self.execution_timeout = v.map(|x| x.into());
5112 self
5113 }
5114}
5115
5116impl wkt::message::Message for NodeInitializationAction {
5117 fn typename() -> &'static str {
5118 "type.googleapis.com/google.cloud.dataproc.v1.NodeInitializationAction"
5119 }
5120}
5121
5122#[derive(Clone, Default, PartialEq)]
5124#[non_exhaustive]
5125pub struct ClusterStatus {
5126 pub state: crate::model::cluster_status::State,
5128
5129 pub detail: std::string::String,
5131
5132 pub state_start_time: std::option::Option<wkt::Timestamp>,
5135
5136 pub substate: crate::model::cluster_status::Substate,
5139
5140 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5141}
5142
5143impl ClusterStatus {
5144 pub fn new() -> Self {
5145 std::default::Default::default()
5146 }
5147
5148 pub fn set_state<T: std::convert::Into<crate::model::cluster_status::State>>(
5150 mut self,
5151 v: T,
5152 ) -> Self {
5153 self.state = v.into();
5154 self
5155 }
5156
5157 pub fn set_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5159 self.detail = v.into();
5160 self
5161 }
5162
5163 pub fn set_state_start_time<T>(mut self, v: T) -> Self
5165 where
5166 T: std::convert::Into<wkt::Timestamp>,
5167 {
5168 self.state_start_time = std::option::Option::Some(v.into());
5169 self
5170 }
5171
5172 pub fn set_or_clear_state_start_time<T>(mut self, v: std::option::Option<T>) -> Self
5174 where
5175 T: std::convert::Into<wkt::Timestamp>,
5176 {
5177 self.state_start_time = v.map(|x| x.into());
5178 self
5179 }
5180
5181 pub fn set_substate<T: std::convert::Into<crate::model::cluster_status::Substate>>(
5183 mut self,
5184 v: T,
5185 ) -> Self {
5186 self.substate = v.into();
5187 self
5188 }
5189}
5190
5191impl wkt::message::Message for ClusterStatus {
5192 fn typename() -> &'static str {
5193 "type.googleapis.com/google.cloud.dataproc.v1.ClusterStatus"
5194 }
5195}
5196
5197pub mod cluster_status {
5199 #[allow(unused_imports)]
5200 use super::*;
5201
5202 #[derive(Clone, Debug, PartialEq)]
5218 #[non_exhaustive]
5219 pub enum State {
5220 Unknown,
5222 Creating,
5224 Running,
5230 Error,
5232 ErrorDueToUpdate,
5235 Deleting,
5237 Updating,
5239 Stopping,
5241 Stopped,
5243 Starting,
5245 Repairing,
5247 UnknownValue(state::UnknownValue),
5252 }
5253
5254 #[doc(hidden)]
5255 pub mod state {
5256 #[allow(unused_imports)]
5257 use super::*;
5258 #[derive(Clone, Debug, PartialEq)]
5259 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5260 }
5261
5262 impl State {
5263 pub fn value(&self) -> std::option::Option<i32> {
5268 match self {
5269 Self::Unknown => std::option::Option::Some(0),
5270 Self::Creating => std::option::Option::Some(1),
5271 Self::Running => std::option::Option::Some(2),
5272 Self::Error => std::option::Option::Some(3),
5273 Self::ErrorDueToUpdate => std::option::Option::Some(9),
5274 Self::Deleting => std::option::Option::Some(4),
5275 Self::Updating => std::option::Option::Some(5),
5276 Self::Stopping => std::option::Option::Some(6),
5277 Self::Stopped => std::option::Option::Some(7),
5278 Self::Starting => std::option::Option::Some(8),
5279 Self::Repairing => std::option::Option::Some(10),
5280 Self::UnknownValue(u) => u.0.value(),
5281 }
5282 }
5283
5284 pub fn name(&self) -> std::option::Option<&str> {
5289 match self {
5290 Self::Unknown => std::option::Option::Some("UNKNOWN"),
5291 Self::Creating => std::option::Option::Some("CREATING"),
5292 Self::Running => std::option::Option::Some("RUNNING"),
5293 Self::Error => std::option::Option::Some("ERROR"),
5294 Self::ErrorDueToUpdate => std::option::Option::Some("ERROR_DUE_TO_UPDATE"),
5295 Self::Deleting => std::option::Option::Some("DELETING"),
5296 Self::Updating => std::option::Option::Some("UPDATING"),
5297 Self::Stopping => std::option::Option::Some("STOPPING"),
5298 Self::Stopped => std::option::Option::Some("STOPPED"),
5299 Self::Starting => std::option::Option::Some("STARTING"),
5300 Self::Repairing => std::option::Option::Some("REPAIRING"),
5301 Self::UnknownValue(u) => u.0.name(),
5302 }
5303 }
5304 }
5305
5306 impl std::default::Default for State {
5307 fn default() -> Self {
5308 use std::convert::From;
5309 Self::from(0)
5310 }
5311 }
5312
5313 impl std::fmt::Display for State {
5314 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5315 wkt::internal::display_enum(f, self.name(), self.value())
5316 }
5317 }
5318
5319 impl std::convert::From<i32> for State {
5320 fn from(value: i32) -> Self {
5321 match value {
5322 0 => Self::Unknown,
5323 1 => Self::Creating,
5324 2 => Self::Running,
5325 3 => Self::Error,
5326 4 => Self::Deleting,
5327 5 => Self::Updating,
5328 6 => Self::Stopping,
5329 7 => Self::Stopped,
5330 8 => Self::Starting,
5331 9 => Self::ErrorDueToUpdate,
5332 10 => Self::Repairing,
5333 _ => Self::UnknownValue(state::UnknownValue(
5334 wkt::internal::UnknownEnumValue::Integer(value),
5335 )),
5336 }
5337 }
5338 }
5339
5340 impl std::convert::From<&str> for State {
5341 fn from(value: &str) -> Self {
5342 use std::string::ToString;
5343 match value {
5344 "UNKNOWN" => Self::Unknown,
5345 "CREATING" => Self::Creating,
5346 "RUNNING" => Self::Running,
5347 "ERROR" => Self::Error,
5348 "ERROR_DUE_TO_UPDATE" => Self::ErrorDueToUpdate,
5349 "DELETING" => Self::Deleting,
5350 "UPDATING" => Self::Updating,
5351 "STOPPING" => Self::Stopping,
5352 "STOPPED" => Self::Stopped,
5353 "STARTING" => Self::Starting,
5354 "REPAIRING" => Self::Repairing,
5355 _ => Self::UnknownValue(state::UnknownValue(
5356 wkt::internal::UnknownEnumValue::String(value.to_string()),
5357 )),
5358 }
5359 }
5360 }
5361
5362 impl serde::ser::Serialize for State {
5363 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5364 where
5365 S: serde::Serializer,
5366 {
5367 match self {
5368 Self::Unknown => serializer.serialize_i32(0),
5369 Self::Creating => serializer.serialize_i32(1),
5370 Self::Running => serializer.serialize_i32(2),
5371 Self::Error => serializer.serialize_i32(3),
5372 Self::ErrorDueToUpdate => serializer.serialize_i32(9),
5373 Self::Deleting => serializer.serialize_i32(4),
5374 Self::Updating => serializer.serialize_i32(5),
5375 Self::Stopping => serializer.serialize_i32(6),
5376 Self::Stopped => serializer.serialize_i32(7),
5377 Self::Starting => serializer.serialize_i32(8),
5378 Self::Repairing => serializer.serialize_i32(10),
5379 Self::UnknownValue(u) => u.0.serialize(serializer),
5380 }
5381 }
5382 }
5383
5384 impl<'de> serde::de::Deserialize<'de> for State {
5385 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5386 where
5387 D: serde::Deserializer<'de>,
5388 {
5389 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5390 ".google.cloud.dataproc.v1.ClusterStatus.State",
5391 ))
5392 }
5393 }
5394
5395 #[derive(Clone, Debug, PartialEq)]
5411 #[non_exhaustive]
5412 pub enum Substate {
5413 Unspecified,
5415 Unhealthy,
5421 StaleStatus,
5426 UnknownValue(substate::UnknownValue),
5431 }
5432
5433 #[doc(hidden)]
5434 pub mod substate {
5435 #[allow(unused_imports)]
5436 use super::*;
5437 #[derive(Clone, Debug, PartialEq)]
5438 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5439 }
5440
5441 impl Substate {
5442 pub fn value(&self) -> std::option::Option<i32> {
5447 match self {
5448 Self::Unspecified => std::option::Option::Some(0),
5449 Self::Unhealthy => std::option::Option::Some(1),
5450 Self::StaleStatus => std::option::Option::Some(2),
5451 Self::UnknownValue(u) => u.0.value(),
5452 }
5453 }
5454
5455 pub fn name(&self) -> std::option::Option<&str> {
5460 match self {
5461 Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
5462 Self::Unhealthy => std::option::Option::Some("UNHEALTHY"),
5463 Self::StaleStatus => std::option::Option::Some("STALE_STATUS"),
5464 Self::UnknownValue(u) => u.0.name(),
5465 }
5466 }
5467 }
5468
5469 impl std::default::Default for Substate {
5470 fn default() -> Self {
5471 use std::convert::From;
5472 Self::from(0)
5473 }
5474 }
5475
5476 impl std::fmt::Display for Substate {
5477 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5478 wkt::internal::display_enum(f, self.name(), self.value())
5479 }
5480 }
5481
5482 impl std::convert::From<i32> for Substate {
5483 fn from(value: i32) -> Self {
5484 match value {
5485 0 => Self::Unspecified,
5486 1 => Self::Unhealthy,
5487 2 => Self::StaleStatus,
5488 _ => Self::UnknownValue(substate::UnknownValue(
5489 wkt::internal::UnknownEnumValue::Integer(value),
5490 )),
5491 }
5492 }
5493 }
5494
5495 impl std::convert::From<&str> for Substate {
5496 fn from(value: &str) -> Self {
5497 use std::string::ToString;
5498 match value {
5499 "UNSPECIFIED" => Self::Unspecified,
5500 "UNHEALTHY" => Self::Unhealthy,
5501 "STALE_STATUS" => Self::StaleStatus,
5502 _ => Self::UnknownValue(substate::UnknownValue(
5503 wkt::internal::UnknownEnumValue::String(value.to_string()),
5504 )),
5505 }
5506 }
5507 }
5508
5509 impl serde::ser::Serialize for Substate {
5510 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5511 where
5512 S: serde::Serializer,
5513 {
5514 match self {
5515 Self::Unspecified => serializer.serialize_i32(0),
5516 Self::Unhealthy => serializer.serialize_i32(1),
5517 Self::StaleStatus => serializer.serialize_i32(2),
5518 Self::UnknownValue(u) => u.0.serialize(serializer),
5519 }
5520 }
5521 }
5522
5523 impl<'de> serde::de::Deserialize<'de> for Substate {
5524 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5525 where
5526 D: serde::Deserializer<'de>,
5527 {
5528 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Substate>::new(
5529 ".google.cloud.dataproc.v1.ClusterStatus.Substate",
5530 ))
5531 }
5532 }
5533}
5534
5535#[derive(Clone, Default, PartialEq)]
5537#[non_exhaustive]
5538pub struct SecurityConfig {
5539 pub kerberos_config: std::option::Option<crate::model::KerberosConfig>,
5541
5542 pub identity_config: std::option::Option<crate::model::IdentityConfig>,
5545
5546 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5547}
5548
5549impl SecurityConfig {
5550 pub fn new() -> Self {
5551 std::default::Default::default()
5552 }
5553
5554 pub fn set_kerberos_config<T>(mut self, v: T) -> Self
5556 where
5557 T: std::convert::Into<crate::model::KerberosConfig>,
5558 {
5559 self.kerberos_config = std::option::Option::Some(v.into());
5560 self
5561 }
5562
5563 pub fn set_or_clear_kerberos_config<T>(mut self, v: std::option::Option<T>) -> Self
5565 where
5566 T: std::convert::Into<crate::model::KerberosConfig>,
5567 {
5568 self.kerberos_config = v.map(|x| x.into());
5569 self
5570 }
5571
5572 pub fn set_identity_config<T>(mut self, v: T) -> Self
5574 where
5575 T: std::convert::Into<crate::model::IdentityConfig>,
5576 {
5577 self.identity_config = std::option::Option::Some(v.into());
5578 self
5579 }
5580
5581 pub fn set_or_clear_identity_config<T>(mut self, v: std::option::Option<T>) -> Self
5583 where
5584 T: std::convert::Into<crate::model::IdentityConfig>,
5585 {
5586 self.identity_config = v.map(|x| x.into());
5587 self
5588 }
5589}
5590
5591impl wkt::message::Message for SecurityConfig {
5592 fn typename() -> &'static str {
5593 "type.googleapis.com/google.cloud.dataproc.v1.SecurityConfig"
5594 }
5595}
5596
5597#[derive(Clone, Default, PartialEq)]
5599#[non_exhaustive]
5600pub struct KerberosConfig {
5601 pub enable_kerberos: bool,
5604
5605 pub root_principal_password_uri: std::string::String,
5608
5609 pub kms_key_uri: std::string::String,
5612
5613 pub keystore_uri: std::string::String,
5617
5618 pub truststore_uri: std::string::String,
5622
5623 pub keystore_password_uri: std::string::String,
5627
5628 pub key_password_uri: std::string::String,
5632
5633 pub truststore_password_uri: std::string::String,
5637
5638 pub cross_realm_trust_realm: std::string::String,
5641
5642 pub cross_realm_trust_kdc: std::string::String,
5645
5646 pub cross_realm_trust_admin_server: std::string::String,
5649
5650 pub cross_realm_trust_shared_password_uri: std::string::String,
5654
5655 pub kdc_db_key_uri: std::string::String,
5658
5659 pub tgt_lifetime_hours: i32,
5663
5664 pub realm: std::string::String,
5667
5668 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5669}
5670
5671impl KerberosConfig {
5672 pub fn new() -> Self {
5673 std::default::Default::default()
5674 }
5675
5676 pub fn set_enable_kerberos<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5678 self.enable_kerberos = v.into();
5679 self
5680 }
5681
5682 pub fn set_root_principal_password_uri<T: std::convert::Into<std::string::String>>(
5684 mut self,
5685 v: T,
5686 ) -> Self {
5687 self.root_principal_password_uri = v.into();
5688 self
5689 }
5690
5691 pub fn set_kms_key_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5693 self.kms_key_uri = v.into();
5694 self
5695 }
5696
5697 pub fn set_keystore_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5699 self.keystore_uri = v.into();
5700 self
5701 }
5702
5703 pub fn set_truststore_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5705 self.truststore_uri = v.into();
5706 self
5707 }
5708
5709 pub fn set_keystore_password_uri<T: std::convert::Into<std::string::String>>(
5711 mut self,
5712 v: T,
5713 ) -> Self {
5714 self.keystore_password_uri = v.into();
5715 self
5716 }
5717
5718 pub fn set_key_password_uri<T: std::convert::Into<std::string::String>>(
5720 mut self,
5721 v: T,
5722 ) -> Self {
5723 self.key_password_uri = v.into();
5724 self
5725 }
5726
5727 pub fn set_truststore_password_uri<T: std::convert::Into<std::string::String>>(
5729 mut self,
5730 v: T,
5731 ) -> Self {
5732 self.truststore_password_uri = v.into();
5733 self
5734 }
5735
5736 pub fn set_cross_realm_trust_realm<T: std::convert::Into<std::string::String>>(
5738 mut self,
5739 v: T,
5740 ) -> Self {
5741 self.cross_realm_trust_realm = v.into();
5742 self
5743 }
5744
5745 pub fn set_cross_realm_trust_kdc<T: std::convert::Into<std::string::String>>(
5747 mut self,
5748 v: T,
5749 ) -> Self {
5750 self.cross_realm_trust_kdc = v.into();
5751 self
5752 }
5753
5754 pub fn set_cross_realm_trust_admin_server<T: std::convert::Into<std::string::String>>(
5756 mut self,
5757 v: T,
5758 ) -> Self {
5759 self.cross_realm_trust_admin_server = v.into();
5760 self
5761 }
5762
5763 pub fn set_cross_realm_trust_shared_password_uri<T: std::convert::Into<std::string::String>>(
5765 mut self,
5766 v: T,
5767 ) -> Self {
5768 self.cross_realm_trust_shared_password_uri = v.into();
5769 self
5770 }
5771
5772 pub fn set_kdc_db_key_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5774 self.kdc_db_key_uri = v.into();
5775 self
5776 }
5777
5778 pub fn set_tgt_lifetime_hours<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5780 self.tgt_lifetime_hours = v.into();
5781 self
5782 }
5783
5784 pub fn set_realm<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5786 self.realm = v.into();
5787 self
5788 }
5789}
5790
5791impl wkt::message::Message for KerberosConfig {
5792 fn typename() -> &'static str {
5793 "type.googleapis.com/google.cloud.dataproc.v1.KerberosConfig"
5794 }
5795}
5796
5797#[derive(Clone, Default, PartialEq)]
5800#[non_exhaustive]
5801pub struct IdentityConfig {
5802 pub user_service_account_mapping:
5804 std::collections::HashMap<std::string::String, std::string::String>,
5805
5806 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5807}
5808
5809impl IdentityConfig {
5810 pub fn new() -> Self {
5811 std::default::Default::default()
5812 }
5813
5814 pub fn set_user_service_account_mapping<T, K, V>(mut self, v: T) -> Self
5816 where
5817 T: std::iter::IntoIterator<Item = (K, V)>,
5818 K: std::convert::Into<std::string::String>,
5819 V: std::convert::Into<std::string::String>,
5820 {
5821 use std::iter::Iterator;
5822 self.user_service_account_mapping =
5823 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5824 self
5825 }
5826}
5827
5828impl wkt::message::Message for IdentityConfig {
5829 fn typename() -> &'static str {
5830 "type.googleapis.com/google.cloud.dataproc.v1.IdentityConfig"
5831 }
5832}
5833
5834#[derive(Clone, Default, PartialEq)]
5836#[non_exhaustive]
5837pub struct SoftwareConfig {
5838 pub image_version: std::string::String,
5846
5847 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
5866
5867 pub optional_components: std::vec::Vec<crate::model::Component>,
5869
5870 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5871}
5872
5873impl SoftwareConfig {
5874 pub fn new() -> Self {
5875 std::default::Default::default()
5876 }
5877
5878 pub fn set_image_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5880 self.image_version = v.into();
5881 self
5882 }
5883
5884 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
5886 where
5887 T: std::iter::IntoIterator<Item = (K, V)>,
5888 K: std::convert::Into<std::string::String>,
5889 V: std::convert::Into<std::string::String>,
5890 {
5891 use std::iter::Iterator;
5892 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5893 self
5894 }
5895
5896 pub fn set_optional_components<T, V>(mut self, v: T) -> Self
5898 where
5899 T: std::iter::IntoIterator<Item = V>,
5900 V: std::convert::Into<crate::model::Component>,
5901 {
5902 use std::iter::Iterator;
5903 self.optional_components = v.into_iter().map(|i| i.into()).collect();
5904 self
5905 }
5906}
5907
5908impl wkt::message::Message for SoftwareConfig {
5909 fn typename() -> &'static str {
5910 "type.googleapis.com/google.cloud.dataproc.v1.SoftwareConfig"
5911 }
5912}
5913
5914#[derive(Clone, Default, PartialEq)]
5916#[non_exhaustive]
5917pub struct LifecycleConfig {
5918 pub idle_delete_ttl: std::option::Option<wkt::Duration>,
5924
5925 pub idle_start_time: std::option::Option<wkt::Timestamp>,
5930
5931 pub ttl: std::option::Option<crate::model::lifecycle_config::Ttl>,
5934
5935 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5936}
5937
5938impl LifecycleConfig {
5939 pub fn new() -> Self {
5940 std::default::Default::default()
5941 }
5942
5943 pub fn set_idle_delete_ttl<T>(mut self, v: T) -> Self
5945 where
5946 T: std::convert::Into<wkt::Duration>,
5947 {
5948 self.idle_delete_ttl = std::option::Option::Some(v.into());
5949 self
5950 }
5951
5952 pub fn set_or_clear_idle_delete_ttl<T>(mut self, v: std::option::Option<T>) -> Self
5954 where
5955 T: std::convert::Into<wkt::Duration>,
5956 {
5957 self.idle_delete_ttl = v.map(|x| x.into());
5958 self
5959 }
5960
5961 pub fn set_idle_start_time<T>(mut self, v: T) -> Self
5963 where
5964 T: std::convert::Into<wkt::Timestamp>,
5965 {
5966 self.idle_start_time = std::option::Option::Some(v.into());
5967 self
5968 }
5969
5970 pub fn set_or_clear_idle_start_time<T>(mut self, v: std::option::Option<T>) -> Self
5972 where
5973 T: std::convert::Into<wkt::Timestamp>,
5974 {
5975 self.idle_start_time = v.map(|x| x.into());
5976 self
5977 }
5978
5979 pub fn set_ttl<
5984 T: std::convert::Into<std::option::Option<crate::model::lifecycle_config::Ttl>>,
5985 >(
5986 mut self,
5987 v: T,
5988 ) -> Self {
5989 self.ttl = v.into();
5990 self
5991 }
5992
5993 pub fn auto_delete_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
5997 #[allow(unreachable_patterns)]
5998 self.ttl.as_ref().and_then(|v| match v {
5999 crate::model::lifecycle_config::Ttl::AutoDeleteTime(v) => std::option::Option::Some(v),
6000 _ => std::option::Option::None,
6001 })
6002 }
6003
6004 pub fn set_auto_delete_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
6010 mut self,
6011 v: T,
6012 ) -> Self {
6013 self.ttl = std::option::Option::Some(crate::model::lifecycle_config::Ttl::AutoDeleteTime(
6014 v.into(),
6015 ));
6016 self
6017 }
6018
6019 pub fn auto_delete_ttl(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
6023 #[allow(unreachable_patterns)]
6024 self.ttl.as_ref().and_then(|v| match v {
6025 crate::model::lifecycle_config::Ttl::AutoDeleteTtl(v) => std::option::Option::Some(v),
6026 _ => std::option::Option::None,
6027 })
6028 }
6029
6030 pub fn set_auto_delete_ttl<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
6036 mut self,
6037 v: T,
6038 ) -> Self {
6039 self.ttl =
6040 std::option::Option::Some(crate::model::lifecycle_config::Ttl::AutoDeleteTtl(v.into()));
6041 self
6042 }
6043}
6044
6045impl wkt::message::Message for LifecycleConfig {
6046 fn typename() -> &'static str {
6047 "type.googleapis.com/google.cloud.dataproc.v1.LifecycleConfig"
6048 }
6049}
6050
6051pub mod lifecycle_config {
6053 #[allow(unused_imports)]
6054 use super::*;
6055
6056 #[derive(Clone, Debug, PartialEq)]
6059 #[non_exhaustive]
6060 pub enum Ttl {
6061 AutoDeleteTime(std::boxed::Box<wkt::Timestamp>),
6065 AutoDeleteTtl(std::boxed::Box<wkt::Duration>),
6070 }
6071}
6072
6073#[derive(Clone, Default, PartialEq)]
6075#[non_exhaustive]
6076pub struct MetastoreConfig {
6077 pub dataproc_metastore_service: std::string::String,
6083
6084 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6085}
6086
6087impl MetastoreConfig {
6088 pub fn new() -> Self {
6089 std::default::Default::default()
6090 }
6091
6092 pub fn set_dataproc_metastore_service<T: std::convert::Into<std::string::String>>(
6094 mut self,
6095 v: T,
6096 ) -> Self {
6097 self.dataproc_metastore_service = v.into();
6098 self
6099 }
6100}
6101
6102impl wkt::message::Message for MetastoreConfig {
6103 fn typename() -> &'static str {
6104 "type.googleapis.com/google.cloud.dataproc.v1.MetastoreConfig"
6105 }
6106}
6107
6108#[derive(Clone, Default, PartialEq)]
6113#[non_exhaustive]
6114pub struct ClusterMetrics {
6115 pub hdfs_metrics: std::collections::HashMap<std::string::String, i64>,
6117
6118 pub yarn_metrics: std::collections::HashMap<std::string::String, i64>,
6120
6121 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6122}
6123
6124impl ClusterMetrics {
6125 pub fn new() -> Self {
6126 std::default::Default::default()
6127 }
6128
6129 pub fn set_hdfs_metrics<T, K, V>(mut self, v: T) -> Self
6131 where
6132 T: std::iter::IntoIterator<Item = (K, V)>,
6133 K: std::convert::Into<std::string::String>,
6134 V: std::convert::Into<i64>,
6135 {
6136 use std::iter::Iterator;
6137 self.hdfs_metrics = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6138 self
6139 }
6140
6141 pub fn set_yarn_metrics<T, K, V>(mut self, v: T) -> Self
6143 where
6144 T: std::iter::IntoIterator<Item = (K, V)>,
6145 K: std::convert::Into<std::string::String>,
6146 V: std::convert::Into<i64>,
6147 {
6148 use std::iter::Iterator;
6149 self.yarn_metrics = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6150 self
6151 }
6152}
6153
6154impl wkt::message::Message for ClusterMetrics {
6155 fn typename() -> &'static str {
6156 "type.googleapis.com/google.cloud.dataproc.v1.ClusterMetrics"
6157 }
6158}
6159
6160#[derive(Clone, Default, PartialEq)]
6162#[non_exhaustive]
6163pub struct DataprocMetricConfig {
6164 pub metrics: std::vec::Vec<crate::model::dataproc_metric_config::Metric>,
6166
6167 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6168}
6169
6170impl DataprocMetricConfig {
6171 pub fn new() -> Self {
6172 std::default::Default::default()
6173 }
6174
6175 pub fn set_metrics<T, V>(mut self, v: T) -> Self
6177 where
6178 T: std::iter::IntoIterator<Item = V>,
6179 V: std::convert::Into<crate::model::dataproc_metric_config::Metric>,
6180 {
6181 use std::iter::Iterator;
6182 self.metrics = v.into_iter().map(|i| i.into()).collect();
6183 self
6184 }
6185}
6186
6187impl wkt::message::Message for DataprocMetricConfig {
6188 fn typename() -> &'static str {
6189 "type.googleapis.com/google.cloud.dataproc.v1.DataprocMetricConfig"
6190 }
6191}
6192
6193pub mod dataproc_metric_config {
6195 #[allow(unused_imports)]
6196 use super::*;
6197
6198 #[derive(Clone, Default, PartialEq)]
6200 #[non_exhaustive]
6201 pub struct Metric {
6202 pub metric_source: crate::model::dataproc_metric_config::MetricSource,
6207
6208 pub metric_overrides: std::vec::Vec<std::string::String>,
6238
6239 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6240 }
6241
6242 impl Metric {
6243 pub fn new() -> Self {
6244 std::default::Default::default()
6245 }
6246
6247 pub fn set_metric_source<
6249 T: std::convert::Into<crate::model::dataproc_metric_config::MetricSource>,
6250 >(
6251 mut self,
6252 v: T,
6253 ) -> Self {
6254 self.metric_source = v.into();
6255 self
6256 }
6257
6258 pub fn set_metric_overrides<T, V>(mut self, v: T) -> Self
6260 where
6261 T: std::iter::IntoIterator<Item = V>,
6262 V: std::convert::Into<std::string::String>,
6263 {
6264 use std::iter::Iterator;
6265 self.metric_overrides = v.into_iter().map(|i| i.into()).collect();
6266 self
6267 }
6268 }
6269
6270 impl wkt::message::Message for Metric {
6271 fn typename() -> &'static str {
6272 "type.googleapis.com/google.cloud.dataproc.v1.DataprocMetricConfig.Metric"
6273 }
6274 }
6275
6276 #[derive(Clone, Debug, PartialEq)]
6294 #[non_exhaustive]
6295 pub enum MetricSource {
6296 Unspecified,
6298 MonitoringAgentDefaults,
6303 Hdfs,
6305 Spark,
6307 Yarn,
6309 SparkHistoryServer,
6311 Hiveserver2,
6313 Hivemetastore,
6315 Flink,
6317 UnknownValue(metric_source::UnknownValue),
6322 }
6323
6324 #[doc(hidden)]
6325 pub mod metric_source {
6326 #[allow(unused_imports)]
6327 use super::*;
6328 #[derive(Clone, Debug, PartialEq)]
6329 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6330 }
6331
6332 impl MetricSource {
6333 pub fn value(&self) -> std::option::Option<i32> {
6338 match self {
6339 Self::Unspecified => std::option::Option::Some(0),
6340 Self::MonitoringAgentDefaults => std::option::Option::Some(1),
6341 Self::Hdfs => std::option::Option::Some(2),
6342 Self::Spark => std::option::Option::Some(3),
6343 Self::Yarn => std::option::Option::Some(4),
6344 Self::SparkHistoryServer => std::option::Option::Some(5),
6345 Self::Hiveserver2 => std::option::Option::Some(6),
6346 Self::Hivemetastore => std::option::Option::Some(7),
6347 Self::Flink => std::option::Option::Some(8),
6348 Self::UnknownValue(u) => u.0.value(),
6349 }
6350 }
6351
6352 pub fn name(&self) -> std::option::Option<&str> {
6357 match self {
6358 Self::Unspecified => std::option::Option::Some("METRIC_SOURCE_UNSPECIFIED"),
6359 Self::MonitoringAgentDefaults => {
6360 std::option::Option::Some("MONITORING_AGENT_DEFAULTS")
6361 }
6362 Self::Hdfs => std::option::Option::Some("HDFS"),
6363 Self::Spark => std::option::Option::Some("SPARK"),
6364 Self::Yarn => std::option::Option::Some("YARN"),
6365 Self::SparkHistoryServer => std::option::Option::Some("SPARK_HISTORY_SERVER"),
6366 Self::Hiveserver2 => std::option::Option::Some("HIVESERVER2"),
6367 Self::Hivemetastore => std::option::Option::Some("HIVEMETASTORE"),
6368 Self::Flink => std::option::Option::Some("FLINK"),
6369 Self::UnknownValue(u) => u.0.name(),
6370 }
6371 }
6372 }
6373
6374 impl std::default::Default for MetricSource {
6375 fn default() -> Self {
6376 use std::convert::From;
6377 Self::from(0)
6378 }
6379 }
6380
6381 impl std::fmt::Display for MetricSource {
6382 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6383 wkt::internal::display_enum(f, self.name(), self.value())
6384 }
6385 }
6386
6387 impl std::convert::From<i32> for MetricSource {
6388 fn from(value: i32) -> Self {
6389 match value {
6390 0 => Self::Unspecified,
6391 1 => Self::MonitoringAgentDefaults,
6392 2 => Self::Hdfs,
6393 3 => Self::Spark,
6394 4 => Self::Yarn,
6395 5 => Self::SparkHistoryServer,
6396 6 => Self::Hiveserver2,
6397 7 => Self::Hivemetastore,
6398 8 => Self::Flink,
6399 _ => Self::UnknownValue(metric_source::UnknownValue(
6400 wkt::internal::UnknownEnumValue::Integer(value),
6401 )),
6402 }
6403 }
6404 }
6405
6406 impl std::convert::From<&str> for MetricSource {
6407 fn from(value: &str) -> Self {
6408 use std::string::ToString;
6409 match value {
6410 "METRIC_SOURCE_UNSPECIFIED" => Self::Unspecified,
6411 "MONITORING_AGENT_DEFAULTS" => Self::MonitoringAgentDefaults,
6412 "HDFS" => Self::Hdfs,
6413 "SPARK" => Self::Spark,
6414 "YARN" => Self::Yarn,
6415 "SPARK_HISTORY_SERVER" => Self::SparkHistoryServer,
6416 "HIVESERVER2" => Self::Hiveserver2,
6417 "HIVEMETASTORE" => Self::Hivemetastore,
6418 "FLINK" => Self::Flink,
6419 _ => Self::UnknownValue(metric_source::UnknownValue(
6420 wkt::internal::UnknownEnumValue::String(value.to_string()),
6421 )),
6422 }
6423 }
6424 }
6425
6426 impl serde::ser::Serialize for MetricSource {
6427 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6428 where
6429 S: serde::Serializer,
6430 {
6431 match self {
6432 Self::Unspecified => serializer.serialize_i32(0),
6433 Self::MonitoringAgentDefaults => serializer.serialize_i32(1),
6434 Self::Hdfs => serializer.serialize_i32(2),
6435 Self::Spark => serializer.serialize_i32(3),
6436 Self::Yarn => serializer.serialize_i32(4),
6437 Self::SparkHistoryServer => serializer.serialize_i32(5),
6438 Self::Hiveserver2 => serializer.serialize_i32(6),
6439 Self::Hivemetastore => serializer.serialize_i32(7),
6440 Self::Flink => serializer.serialize_i32(8),
6441 Self::UnknownValue(u) => u.0.serialize(serializer),
6442 }
6443 }
6444 }
6445
6446 impl<'de> serde::de::Deserialize<'de> for MetricSource {
6447 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6448 where
6449 D: serde::Deserializer<'de>,
6450 {
6451 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MetricSource>::new(
6452 ".google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource",
6453 ))
6454 }
6455 }
6456}
6457
6458#[derive(Clone, Default, PartialEq)]
6460#[non_exhaustive]
6461pub struct CreateClusterRequest {
6462 pub project_id: std::string::String,
6465
6466 pub region: std::string::String,
6468
6469 pub cluster: std::option::Option<crate::model::Cluster>,
6471
6472 pub request_id: std::string::String,
6487
6488 pub action_on_failed_primary_workers: crate::model::FailureAction,
6490
6491 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6492}
6493
6494impl CreateClusterRequest {
6495 pub fn new() -> Self {
6496 std::default::Default::default()
6497 }
6498
6499 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6501 self.project_id = v.into();
6502 self
6503 }
6504
6505 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6507 self.region = v.into();
6508 self
6509 }
6510
6511 pub fn set_cluster<T>(mut self, v: T) -> Self
6513 where
6514 T: std::convert::Into<crate::model::Cluster>,
6515 {
6516 self.cluster = std::option::Option::Some(v.into());
6517 self
6518 }
6519
6520 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
6522 where
6523 T: std::convert::Into<crate::model::Cluster>,
6524 {
6525 self.cluster = v.map(|x| x.into());
6526 self
6527 }
6528
6529 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6531 self.request_id = v.into();
6532 self
6533 }
6534
6535 pub fn set_action_on_failed_primary_workers<
6537 T: std::convert::Into<crate::model::FailureAction>,
6538 >(
6539 mut self,
6540 v: T,
6541 ) -> Self {
6542 self.action_on_failed_primary_workers = v.into();
6543 self
6544 }
6545}
6546
6547impl wkt::message::Message for CreateClusterRequest {
6548 fn typename() -> &'static str {
6549 "type.googleapis.com/google.cloud.dataproc.v1.CreateClusterRequest"
6550 }
6551}
6552
6553#[derive(Clone, Default, PartialEq)]
6555#[non_exhaustive]
6556pub struct UpdateClusterRequest {
6557 pub project_id: std::string::String,
6560
6561 pub region: std::string::String,
6563
6564 pub cluster_name: std::string::String,
6566
6567 pub cluster: std::option::Option<crate::model::Cluster>,
6569
6570 pub graceful_decommission_timeout: std::option::Option<wkt::Duration>,
6580
6581 pub update_mask: std::option::Option<wkt::FieldMask>,
6614
6615 pub request_id: std::string::String,
6630
6631 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6632}
6633
6634impl UpdateClusterRequest {
6635 pub fn new() -> Self {
6636 std::default::Default::default()
6637 }
6638
6639 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6641 self.project_id = v.into();
6642 self
6643 }
6644
6645 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6647 self.region = v.into();
6648 self
6649 }
6650
6651 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6653 self.cluster_name = v.into();
6654 self
6655 }
6656
6657 pub fn set_cluster<T>(mut self, v: T) -> Self
6659 where
6660 T: std::convert::Into<crate::model::Cluster>,
6661 {
6662 self.cluster = std::option::Option::Some(v.into());
6663 self
6664 }
6665
6666 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
6668 where
6669 T: std::convert::Into<crate::model::Cluster>,
6670 {
6671 self.cluster = v.map(|x| x.into());
6672 self
6673 }
6674
6675 pub fn set_graceful_decommission_timeout<T>(mut self, v: T) -> Self
6677 where
6678 T: std::convert::Into<wkt::Duration>,
6679 {
6680 self.graceful_decommission_timeout = std::option::Option::Some(v.into());
6681 self
6682 }
6683
6684 pub fn set_or_clear_graceful_decommission_timeout<T>(
6686 mut self,
6687 v: std::option::Option<T>,
6688 ) -> Self
6689 where
6690 T: std::convert::Into<wkt::Duration>,
6691 {
6692 self.graceful_decommission_timeout = v.map(|x| x.into());
6693 self
6694 }
6695
6696 pub fn set_update_mask<T>(mut self, v: T) -> Self
6698 where
6699 T: std::convert::Into<wkt::FieldMask>,
6700 {
6701 self.update_mask = std::option::Option::Some(v.into());
6702 self
6703 }
6704
6705 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6707 where
6708 T: std::convert::Into<wkt::FieldMask>,
6709 {
6710 self.update_mask = v.map(|x| x.into());
6711 self
6712 }
6713
6714 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6716 self.request_id = v.into();
6717 self
6718 }
6719}
6720
6721impl wkt::message::Message for UpdateClusterRequest {
6722 fn typename() -> &'static str {
6723 "type.googleapis.com/google.cloud.dataproc.v1.UpdateClusterRequest"
6724 }
6725}
6726
6727#[derive(Clone, Default, PartialEq)]
6729#[non_exhaustive]
6730pub struct StopClusterRequest {
6731 pub project_id: std::string::String,
6734
6735 pub region: std::string::String,
6737
6738 pub cluster_name: std::string::String,
6740
6741 pub cluster_uuid: std::string::String,
6744
6745 pub request_id: std::string::String,
6760
6761 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6762}
6763
6764impl StopClusterRequest {
6765 pub fn new() -> Self {
6766 std::default::Default::default()
6767 }
6768
6769 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6771 self.project_id = v.into();
6772 self
6773 }
6774
6775 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6777 self.region = v.into();
6778 self
6779 }
6780
6781 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6783 self.cluster_name = v.into();
6784 self
6785 }
6786
6787 pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6789 self.cluster_uuid = v.into();
6790 self
6791 }
6792
6793 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6795 self.request_id = v.into();
6796 self
6797 }
6798}
6799
6800impl wkt::message::Message for StopClusterRequest {
6801 fn typename() -> &'static str {
6802 "type.googleapis.com/google.cloud.dataproc.v1.StopClusterRequest"
6803 }
6804}
6805
6806#[derive(Clone, Default, PartialEq)]
6808#[non_exhaustive]
6809pub struct StartClusterRequest {
6810 pub project_id: std::string::String,
6813
6814 pub region: std::string::String,
6816
6817 pub cluster_name: std::string::String,
6819
6820 pub cluster_uuid: std::string::String,
6823
6824 pub request_id: std::string::String,
6839
6840 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6841}
6842
6843impl StartClusterRequest {
6844 pub fn new() -> Self {
6845 std::default::Default::default()
6846 }
6847
6848 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6850 self.project_id = v.into();
6851 self
6852 }
6853
6854 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6856 self.region = v.into();
6857 self
6858 }
6859
6860 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6862 self.cluster_name = v.into();
6863 self
6864 }
6865
6866 pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6868 self.cluster_uuid = v.into();
6869 self
6870 }
6871
6872 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6874 self.request_id = v.into();
6875 self
6876 }
6877}
6878
6879impl wkt::message::Message for StartClusterRequest {
6880 fn typename() -> &'static str {
6881 "type.googleapis.com/google.cloud.dataproc.v1.StartClusterRequest"
6882 }
6883}
6884
6885#[derive(Clone, Default, PartialEq)]
6887#[non_exhaustive]
6888pub struct DeleteClusterRequest {
6889 pub project_id: std::string::String,
6892
6893 pub region: std::string::String,
6895
6896 pub cluster_name: std::string::String,
6898
6899 pub cluster_uuid: std::string::String,
6902
6903 pub request_id: std::string::String,
6918
6919 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6920}
6921
6922impl DeleteClusterRequest {
6923 pub fn new() -> Self {
6924 std::default::Default::default()
6925 }
6926
6927 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6929 self.project_id = v.into();
6930 self
6931 }
6932
6933 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6935 self.region = v.into();
6936 self
6937 }
6938
6939 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6941 self.cluster_name = v.into();
6942 self
6943 }
6944
6945 pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6947 self.cluster_uuid = v.into();
6948 self
6949 }
6950
6951 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6953 self.request_id = v.into();
6954 self
6955 }
6956}
6957
6958impl wkt::message::Message for DeleteClusterRequest {
6959 fn typename() -> &'static str {
6960 "type.googleapis.com/google.cloud.dataproc.v1.DeleteClusterRequest"
6961 }
6962}
6963
6964#[derive(Clone, Default, PartialEq)]
6966#[non_exhaustive]
6967pub struct GetClusterRequest {
6968 pub project_id: std::string::String,
6971
6972 pub region: std::string::String,
6974
6975 pub cluster_name: std::string::String,
6977
6978 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6979}
6980
6981impl GetClusterRequest {
6982 pub fn new() -> Self {
6983 std::default::Default::default()
6984 }
6985
6986 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6988 self.project_id = v.into();
6989 self
6990 }
6991
6992 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6994 self.region = v.into();
6995 self
6996 }
6997
6998 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7000 self.cluster_name = v.into();
7001 self
7002 }
7003}
7004
7005impl wkt::message::Message for GetClusterRequest {
7006 fn typename() -> &'static str {
7007 "type.googleapis.com/google.cloud.dataproc.v1.GetClusterRequest"
7008 }
7009}
7010
7011#[derive(Clone, Default, PartialEq)]
7013#[non_exhaustive]
7014pub struct ListClustersRequest {
7015 pub project_id: std::string::String,
7018
7019 pub region: std::string::String,
7021
7022 pub filter: std::string::String,
7042
7043 pub page_size: i32,
7045
7046 pub page_token: std::string::String,
7048
7049 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7050}
7051
7052impl ListClustersRequest {
7053 pub fn new() -> Self {
7054 std::default::Default::default()
7055 }
7056
7057 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7059 self.project_id = v.into();
7060 self
7061 }
7062
7063 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7065 self.region = v.into();
7066 self
7067 }
7068
7069 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7071 self.filter = v.into();
7072 self
7073 }
7074
7075 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7077 self.page_size = v.into();
7078 self
7079 }
7080
7081 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7083 self.page_token = v.into();
7084 self
7085 }
7086}
7087
7088impl wkt::message::Message for ListClustersRequest {
7089 fn typename() -> &'static str {
7090 "type.googleapis.com/google.cloud.dataproc.v1.ListClustersRequest"
7091 }
7092}
7093
7094#[derive(Clone, Default, PartialEq)]
7096#[non_exhaustive]
7097pub struct ListClustersResponse {
7098 pub clusters: std::vec::Vec<crate::model::Cluster>,
7100
7101 pub next_page_token: std::string::String,
7105
7106 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7107}
7108
7109impl ListClustersResponse {
7110 pub fn new() -> Self {
7111 std::default::Default::default()
7112 }
7113
7114 pub fn set_clusters<T, V>(mut self, v: T) -> Self
7116 where
7117 T: std::iter::IntoIterator<Item = V>,
7118 V: std::convert::Into<crate::model::Cluster>,
7119 {
7120 use std::iter::Iterator;
7121 self.clusters = v.into_iter().map(|i| i.into()).collect();
7122 self
7123 }
7124
7125 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7127 self.next_page_token = v.into();
7128 self
7129 }
7130}
7131
7132impl wkt::message::Message for ListClustersResponse {
7133 fn typename() -> &'static str {
7134 "type.googleapis.com/google.cloud.dataproc.v1.ListClustersResponse"
7135 }
7136}
7137
7138#[doc(hidden)]
7139impl gax::paginator::internal::PageableResponse for ListClustersResponse {
7140 type PageItem = crate::model::Cluster;
7141
7142 fn items(self) -> std::vec::Vec<Self::PageItem> {
7143 self.clusters
7144 }
7145
7146 fn next_page_token(&self) -> std::string::String {
7147 use std::clone::Clone;
7148 self.next_page_token.clone()
7149 }
7150}
7151
7152#[derive(Clone, Default, PartialEq)]
7154#[non_exhaustive]
7155pub struct DiagnoseClusterRequest {
7156 pub project_id: std::string::String,
7159
7160 pub region: std::string::String,
7162
7163 pub cluster_name: std::string::String,
7165
7166 pub tarball_gcs_dir: std::string::String,
7170
7171 pub tarball_access: crate::model::diagnose_cluster_request::TarballAccess,
7174
7175 pub diagnosis_interval: std::option::Option<gtype::model::Interval>,
7178
7179 pub jobs: std::vec::Vec<std::string::String>,
7182
7183 pub yarn_application_ids: std::vec::Vec<std::string::String>,
7186
7187 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7188}
7189
7190impl DiagnoseClusterRequest {
7191 pub fn new() -> Self {
7192 std::default::Default::default()
7193 }
7194
7195 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7197 self.project_id = v.into();
7198 self
7199 }
7200
7201 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7203 self.region = v.into();
7204 self
7205 }
7206
7207 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7209 self.cluster_name = v.into();
7210 self
7211 }
7212
7213 pub fn set_tarball_gcs_dir<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7215 self.tarball_gcs_dir = v.into();
7216 self
7217 }
7218
7219 pub fn set_tarball_access<
7221 T: std::convert::Into<crate::model::diagnose_cluster_request::TarballAccess>,
7222 >(
7223 mut self,
7224 v: T,
7225 ) -> Self {
7226 self.tarball_access = v.into();
7227 self
7228 }
7229
7230 pub fn set_diagnosis_interval<T>(mut self, v: T) -> Self
7232 where
7233 T: std::convert::Into<gtype::model::Interval>,
7234 {
7235 self.diagnosis_interval = std::option::Option::Some(v.into());
7236 self
7237 }
7238
7239 pub fn set_or_clear_diagnosis_interval<T>(mut self, v: std::option::Option<T>) -> Self
7241 where
7242 T: std::convert::Into<gtype::model::Interval>,
7243 {
7244 self.diagnosis_interval = v.map(|x| x.into());
7245 self
7246 }
7247
7248 pub fn set_jobs<T, V>(mut self, v: T) -> Self
7250 where
7251 T: std::iter::IntoIterator<Item = V>,
7252 V: std::convert::Into<std::string::String>,
7253 {
7254 use std::iter::Iterator;
7255 self.jobs = v.into_iter().map(|i| i.into()).collect();
7256 self
7257 }
7258
7259 pub fn set_yarn_application_ids<T, V>(mut self, v: T) -> Self
7261 where
7262 T: std::iter::IntoIterator<Item = V>,
7263 V: std::convert::Into<std::string::String>,
7264 {
7265 use std::iter::Iterator;
7266 self.yarn_application_ids = v.into_iter().map(|i| i.into()).collect();
7267 self
7268 }
7269}
7270
7271impl wkt::message::Message for DiagnoseClusterRequest {
7272 fn typename() -> &'static str {
7273 "type.googleapis.com/google.cloud.dataproc.v1.DiagnoseClusterRequest"
7274 }
7275}
7276
7277pub mod diagnose_cluster_request {
7279 #[allow(unused_imports)]
7280 use super::*;
7281
7282 #[derive(Clone, Debug, PartialEq)]
7298 #[non_exhaustive]
7299 pub enum TarballAccess {
7300 Unspecified,
7302 GoogleCloudSupport,
7305 GoogleDataprocDiagnose,
7308 UnknownValue(tarball_access::UnknownValue),
7313 }
7314
7315 #[doc(hidden)]
7316 pub mod tarball_access {
7317 #[allow(unused_imports)]
7318 use super::*;
7319 #[derive(Clone, Debug, PartialEq)]
7320 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7321 }
7322
7323 impl TarballAccess {
7324 pub fn value(&self) -> std::option::Option<i32> {
7329 match self {
7330 Self::Unspecified => std::option::Option::Some(0),
7331 Self::GoogleCloudSupport => std::option::Option::Some(1),
7332 Self::GoogleDataprocDiagnose => std::option::Option::Some(2),
7333 Self::UnknownValue(u) => u.0.value(),
7334 }
7335 }
7336
7337 pub fn name(&self) -> std::option::Option<&str> {
7342 match self {
7343 Self::Unspecified => std::option::Option::Some("TARBALL_ACCESS_UNSPECIFIED"),
7344 Self::GoogleCloudSupport => std::option::Option::Some("GOOGLE_CLOUD_SUPPORT"),
7345 Self::GoogleDataprocDiagnose => {
7346 std::option::Option::Some("GOOGLE_DATAPROC_DIAGNOSE")
7347 }
7348 Self::UnknownValue(u) => u.0.name(),
7349 }
7350 }
7351 }
7352
7353 impl std::default::Default for TarballAccess {
7354 fn default() -> Self {
7355 use std::convert::From;
7356 Self::from(0)
7357 }
7358 }
7359
7360 impl std::fmt::Display for TarballAccess {
7361 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7362 wkt::internal::display_enum(f, self.name(), self.value())
7363 }
7364 }
7365
7366 impl std::convert::From<i32> for TarballAccess {
7367 fn from(value: i32) -> Self {
7368 match value {
7369 0 => Self::Unspecified,
7370 1 => Self::GoogleCloudSupport,
7371 2 => Self::GoogleDataprocDiagnose,
7372 _ => Self::UnknownValue(tarball_access::UnknownValue(
7373 wkt::internal::UnknownEnumValue::Integer(value),
7374 )),
7375 }
7376 }
7377 }
7378
7379 impl std::convert::From<&str> for TarballAccess {
7380 fn from(value: &str) -> Self {
7381 use std::string::ToString;
7382 match value {
7383 "TARBALL_ACCESS_UNSPECIFIED" => Self::Unspecified,
7384 "GOOGLE_CLOUD_SUPPORT" => Self::GoogleCloudSupport,
7385 "GOOGLE_DATAPROC_DIAGNOSE" => Self::GoogleDataprocDiagnose,
7386 _ => Self::UnknownValue(tarball_access::UnknownValue(
7387 wkt::internal::UnknownEnumValue::String(value.to_string()),
7388 )),
7389 }
7390 }
7391 }
7392
7393 impl serde::ser::Serialize for TarballAccess {
7394 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7395 where
7396 S: serde::Serializer,
7397 {
7398 match self {
7399 Self::Unspecified => serializer.serialize_i32(0),
7400 Self::GoogleCloudSupport => serializer.serialize_i32(1),
7401 Self::GoogleDataprocDiagnose => serializer.serialize_i32(2),
7402 Self::UnknownValue(u) => u.0.serialize(serializer),
7403 }
7404 }
7405 }
7406
7407 impl<'de> serde::de::Deserialize<'de> for TarballAccess {
7408 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7409 where
7410 D: serde::Deserializer<'de>,
7411 {
7412 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TarballAccess>::new(
7413 ".google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess",
7414 ))
7415 }
7416 }
7417}
7418
7419#[derive(Clone, Default, PartialEq)]
7421#[non_exhaustive]
7422pub struct DiagnoseClusterResults {
7423 pub output_uri: std::string::String,
7427
7428 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7429}
7430
7431impl DiagnoseClusterResults {
7432 pub fn new() -> Self {
7433 std::default::Default::default()
7434 }
7435
7436 pub fn set_output_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7438 self.output_uri = v.into();
7439 self
7440 }
7441}
7442
7443impl wkt::message::Message for DiagnoseClusterResults {
7444 fn typename() -> &'static str {
7445 "type.googleapis.com/google.cloud.dataproc.v1.DiagnoseClusterResults"
7446 }
7447}
7448
7449#[derive(Clone, Default, PartialEq)]
7451#[non_exhaustive]
7452pub struct ReservationAffinity {
7453 pub consume_reservation_type: crate::model::reservation_affinity::Type,
7455
7456 pub key: std::string::String,
7458
7459 pub values: std::vec::Vec<std::string::String>,
7461
7462 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7463}
7464
7465impl ReservationAffinity {
7466 pub fn new() -> Self {
7467 std::default::Default::default()
7468 }
7469
7470 pub fn set_consume_reservation_type<
7472 T: std::convert::Into<crate::model::reservation_affinity::Type>,
7473 >(
7474 mut self,
7475 v: T,
7476 ) -> Self {
7477 self.consume_reservation_type = v.into();
7478 self
7479 }
7480
7481 pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7483 self.key = v.into();
7484 self
7485 }
7486
7487 pub fn set_values<T, V>(mut self, v: T) -> Self
7489 where
7490 T: std::iter::IntoIterator<Item = V>,
7491 V: std::convert::Into<std::string::String>,
7492 {
7493 use std::iter::Iterator;
7494 self.values = v.into_iter().map(|i| i.into()).collect();
7495 self
7496 }
7497}
7498
7499impl wkt::message::Message for ReservationAffinity {
7500 fn typename() -> &'static str {
7501 "type.googleapis.com/google.cloud.dataproc.v1.ReservationAffinity"
7502 }
7503}
7504
7505pub mod reservation_affinity {
7507 #[allow(unused_imports)]
7508 use super::*;
7509
7510 #[derive(Clone, Debug, PartialEq)]
7526 #[non_exhaustive]
7527 pub enum Type {
7528 Unspecified,
7529 NoReservation,
7531 AnyReservation,
7533 SpecificReservation,
7536 UnknownValue(r#type::UnknownValue),
7541 }
7542
7543 #[doc(hidden)]
7544 pub mod r#type {
7545 #[allow(unused_imports)]
7546 use super::*;
7547 #[derive(Clone, Debug, PartialEq)]
7548 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7549 }
7550
7551 impl Type {
7552 pub fn value(&self) -> std::option::Option<i32> {
7557 match self {
7558 Self::Unspecified => std::option::Option::Some(0),
7559 Self::NoReservation => std::option::Option::Some(1),
7560 Self::AnyReservation => std::option::Option::Some(2),
7561 Self::SpecificReservation => std::option::Option::Some(3),
7562 Self::UnknownValue(u) => u.0.value(),
7563 }
7564 }
7565
7566 pub fn name(&self) -> std::option::Option<&str> {
7571 match self {
7572 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
7573 Self::NoReservation => std::option::Option::Some("NO_RESERVATION"),
7574 Self::AnyReservation => std::option::Option::Some("ANY_RESERVATION"),
7575 Self::SpecificReservation => std::option::Option::Some("SPECIFIC_RESERVATION"),
7576 Self::UnknownValue(u) => u.0.name(),
7577 }
7578 }
7579 }
7580
7581 impl std::default::Default for Type {
7582 fn default() -> Self {
7583 use std::convert::From;
7584 Self::from(0)
7585 }
7586 }
7587
7588 impl std::fmt::Display for Type {
7589 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7590 wkt::internal::display_enum(f, self.name(), self.value())
7591 }
7592 }
7593
7594 impl std::convert::From<i32> for Type {
7595 fn from(value: i32) -> Self {
7596 match value {
7597 0 => Self::Unspecified,
7598 1 => Self::NoReservation,
7599 2 => Self::AnyReservation,
7600 3 => Self::SpecificReservation,
7601 _ => Self::UnknownValue(r#type::UnknownValue(
7602 wkt::internal::UnknownEnumValue::Integer(value),
7603 )),
7604 }
7605 }
7606 }
7607
7608 impl std::convert::From<&str> for Type {
7609 fn from(value: &str) -> Self {
7610 use std::string::ToString;
7611 match value {
7612 "TYPE_UNSPECIFIED" => Self::Unspecified,
7613 "NO_RESERVATION" => Self::NoReservation,
7614 "ANY_RESERVATION" => Self::AnyReservation,
7615 "SPECIFIC_RESERVATION" => Self::SpecificReservation,
7616 _ => Self::UnknownValue(r#type::UnknownValue(
7617 wkt::internal::UnknownEnumValue::String(value.to_string()),
7618 )),
7619 }
7620 }
7621 }
7622
7623 impl serde::ser::Serialize for Type {
7624 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7625 where
7626 S: serde::Serializer,
7627 {
7628 match self {
7629 Self::Unspecified => serializer.serialize_i32(0),
7630 Self::NoReservation => serializer.serialize_i32(1),
7631 Self::AnyReservation => serializer.serialize_i32(2),
7632 Self::SpecificReservation => serializer.serialize_i32(3),
7633 Self::UnknownValue(u) => u.0.serialize(serializer),
7634 }
7635 }
7636 }
7637
7638 impl<'de> serde::de::Deserialize<'de> for Type {
7639 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7640 where
7641 D: serde::Deserializer<'de>,
7642 {
7643 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
7644 ".google.cloud.dataproc.v1.ReservationAffinity.Type",
7645 ))
7646 }
7647 }
7648}
7649
7650#[derive(Clone, Default, PartialEq)]
7652#[non_exhaustive]
7653pub struct LoggingConfig {
7654 pub driver_log_levels:
7662 std::collections::HashMap<std::string::String, crate::model::logging_config::Level>,
7663
7664 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7665}
7666
7667impl LoggingConfig {
7668 pub fn new() -> Self {
7669 std::default::Default::default()
7670 }
7671
7672 pub fn set_driver_log_levels<T, K, V>(mut self, v: T) -> Self
7674 where
7675 T: std::iter::IntoIterator<Item = (K, V)>,
7676 K: std::convert::Into<std::string::String>,
7677 V: std::convert::Into<crate::model::logging_config::Level>,
7678 {
7679 use std::iter::Iterator;
7680 self.driver_log_levels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7681 self
7682 }
7683}
7684
7685impl wkt::message::Message for LoggingConfig {
7686 fn typename() -> &'static str {
7687 "type.googleapis.com/google.cloud.dataproc.v1.LoggingConfig"
7688 }
7689}
7690
7691pub mod logging_config {
7693 #[allow(unused_imports)]
7694 use super::*;
7695
7696 #[derive(Clone, Debug, PartialEq)]
7714 #[non_exhaustive]
7715 pub enum Level {
7716 Unspecified,
7718 All,
7720 Trace,
7722 Debug,
7724 Info,
7726 Warn,
7728 Error,
7730 Fatal,
7732 Off,
7734 UnknownValue(level::UnknownValue),
7739 }
7740
7741 #[doc(hidden)]
7742 pub mod level {
7743 #[allow(unused_imports)]
7744 use super::*;
7745 #[derive(Clone, Debug, PartialEq)]
7746 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7747 }
7748
7749 impl Level {
7750 pub fn value(&self) -> std::option::Option<i32> {
7755 match self {
7756 Self::Unspecified => std::option::Option::Some(0),
7757 Self::All => std::option::Option::Some(1),
7758 Self::Trace => std::option::Option::Some(2),
7759 Self::Debug => std::option::Option::Some(3),
7760 Self::Info => std::option::Option::Some(4),
7761 Self::Warn => std::option::Option::Some(5),
7762 Self::Error => std::option::Option::Some(6),
7763 Self::Fatal => std::option::Option::Some(7),
7764 Self::Off => std::option::Option::Some(8),
7765 Self::UnknownValue(u) => u.0.value(),
7766 }
7767 }
7768
7769 pub fn name(&self) -> std::option::Option<&str> {
7774 match self {
7775 Self::Unspecified => std::option::Option::Some("LEVEL_UNSPECIFIED"),
7776 Self::All => std::option::Option::Some("ALL"),
7777 Self::Trace => std::option::Option::Some("TRACE"),
7778 Self::Debug => std::option::Option::Some("DEBUG"),
7779 Self::Info => std::option::Option::Some("INFO"),
7780 Self::Warn => std::option::Option::Some("WARN"),
7781 Self::Error => std::option::Option::Some("ERROR"),
7782 Self::Fatal => std::option::Option::Some("FATAL"),
7783 Self::Off => std::option::Option::Some("OFF"),
7784 Self::UnknownValue(u) => u.0.name(),
7785 }
7786 }
7787 }
7788
7789 impl std::default::Default for Level {
7790 fn default() -> Self {
7791 use std::convert::From;
7792 Self::from(0)
7793 }
7794 }
7795
7796 impl std::fmt::Display for Level {
7797 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7798 wkt::internal::display_enum(f, self.name(), self.value())
7799 }
7800 }
7801
7802 impl std::convert::From<i32> for Level {
7803 fn from(value: i32) -> Self {
7804 match value {
7805 0 => Self::Unspecified,
7806 1 => Self::All,
7807 2 => Self::Trace,
7808 3 => Self::Debug,
7809 4 => Self::Info,
7810 5 => Self::Warn,
7811 6 => Self::Error,
7812 7 => Self::Fatal,
7813 8 => Self::Off,
7814 _ => Self::UnknownValue(level::UnknownValue(
7815 wkt::internal::UnknownEnumValue::Integer(value),
7816 )),
7817 }
7818 }
7819 }
7820
7821 impl std::convert::From<&str> for Level {
7822 fn from(value: &str) -> Self {
7823 use std::string::ToString;
7824 match value {
7825 "LEVEL_UNSPECIFIED" => Self::Unspecified,
7826 "ALL" => Self::All,
7827 "TRACE" => Self::Trace,
7828 "DEBUG" => Self::Debug,
7829 "INFO" => Self::Info,
7830 "WARN" => Self::Warn,
7831 "ERROR" => Self::Error,
7832 "FATAL" => Self::Fatal,
7833 "OFF" => Self::Off,
7834 _ => Self::UnknownValue(level::UnknownValue(
7835 wkt::internal::UnknownEnumValue::String(value.to_string()),
7836 )),
7837 }
7838 }
7839 }
7840
7841 impl serde::ser::Serialize for Level {
7842 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7843 where
7844 S: serde::Serializer,
7845 {
7846 match self {
7847 Self::Unspecified => serializer.serialize_i32(0),
7848 Self::All => serializer.serialize_i32(1),
7849 Self::Trace => serializer.serialize_i32(2),
7850 Self::Debug => serializer.serialize_i32(3),
7851 Self::Info => serializer.serialize_i32(4),
7852 Self::Warn => serializer.serialize_i32(5),
7853 Self::Error => serializer.serialize_i32(6),
7854 Self::Fatal => serializer.serialize_i32(7),
7855 Self::Off => serializer.serialize_i32(8),
7856 Self::UnknownValue(u) => u.0.serialize(serializer),
7857 }
7858 }
7859 }
7860
7861 impl<'de> serde::de::Deserialize<'de> for Level {
7862 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7863 where
7864 D: serde::Deserializer<'de>,
7865 {
7866 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Level>::new(
7867 ".google.cloud.dataproc.v1.LoggingConfig.Level",
7868 ))
7869 }
7870 }
7871}
7872
7873#[derive(Clone, Default, PartialEq)]
7879#[non_exhaustive]
7880pub struct HadoopJob {
7881 pub args: std::vec::Vec<std::string::String>,
7886
7887 pub jar_file_uris: std::vec::Vec<std::string::String>,
7890
7891 pub file_uris: std::vec::Vec<std::string::String>,
7895
7896 pub archive_uris: std::vec::Vec<std::string::String>,
7900
7901 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
7906
7907 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
7909
7910 pub driver: std::option::Option<crate::model::hadoop_job::Driver>,
7915
7916 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7917}
7918
7919impl HadoopJob {
7920 pub fn new() -> Self {
7921 std::default::Default::default()
7922 }
7923
7924 pub fn set_args<T, V>(mut self, v: T) -> Self
7926 where
7927 T: std::iter::IntoIterator<Item = V>,
7928 V: std::convert::Into<std::string::String>,
7929 {
7930 use std::iter::Iterator;
7931 self.args = v.into_iter().map(|i| i.into()).collect();
7932 self
7933 }
7934
7935 pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
7937 where
7938 T: std::iter::IntoIterator<Item = V>,
7939 V: std::convert::Into<std::string::String>,
7940 {
7941 use std::iter::Iterator;
7942 self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
7943 self
7944 }
7945
7946 pub fn set_file_uris<T, V>(mut self, v: T) -> Self
7948 where
7949 T: std::iter::IntoIterator<Item = V>,
7950 V: std::convert::Into<std::string::String>,
7951 {
7952 use std::iter::Iterator;
7953 self.file_uris = v.into_iter().map(|i| i.into()).collect();
7954 self
7955 }
7956
7957 pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
7959 where
7960 T: std::iter::IntoIterator<Item = V>,
7961 V: std::convert::Into<std::string::String>,
7962 {
7963 use std::iter::Iterator;
7964 self.archive_uris = v.into_iter().map(|i| i.into()).collect();
7965 self
7966 }
7967
7968 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
7970 where
7971 T: std::iter::IntoIterator<Item = (K, V)>,
7972 K: std::convert::Into<std::string::String>,
7973 V: std::convert::Into<std::string::String>,
7974 {
7975 use std::iter::Iterator;
7976 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7977 self
7978 }
7979
7980 pub fn set_logging_config<T>(mut self, v: T) -> Self
7982 where
7983 T: std::convert::Into<crate::model::LoggingConfig>,
7984 {
7985 self.logging_config = std::option::Option::Some(v.into());
7986 self
7987 }
7988
7989 pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
7991 where
7992 T: std::convert::Into<crate::model::LoggingConfig>,
7993 {
7994 self.logging_config = v.map(|x| x.into());
7995 self
7996 }
7997
7998 pub fn set_driver<
8003 T: std::convert::Into<std::option::Option<crate::model::hadoop_job::Driver>>,
8004 >(
8005 mut self,
8006 v: T,
8007 ) -> Self {
8008 self.driver = v.into();
8009 self
8010 }
8011
8012 pub fn main_jar_file_uri(&self) -> std::option::Option<&std::string::String> {
8016 #[allow(unreachable_patterns)]
8017 self.driver.as_ref().and_then(|v| match v {
8018 crate::model::hadoop_job::Driver::MainJarFileUri(v) => std::option::Option::Some(v),
8019 _ => std::option::Option::None,
8020 })
8021 }
8022
8023 pub fn set_main_jar_file_uri<T: std::convert::Into<std::string::String>>(
8029 mut self,
8030 v: T,
8031 ) -> Self {
8032 self.driver =
8033 std::option::Option::Some(crate::model::hadoop_job::Driver::MainJarFileUri(v.into()));
8034 self
8035 }
8036
8037 pub fn main_class(&self) -> std::option::Option<&std::string::String> {
8041 #[allow(unreachable_patterns)]
8042 self.driver.as_ref().and_then(|v| match v {
8043 crate::model::hadoop_job::Driver::MainClass(v) => std::option::Option::Some(v),
8044 _ => std::option::Option::None,
8045 })
8046 }
8047
8048 pub fn set_main_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8054 self.driver =
8055 std::option::Option::Some(crate::model::hadoop_job::Driver::MainClass(v.into()));
8056 self
8057 }
8058}
8059
8060impl wkt::message::Message for HadoopJob {
8061 fn typename() -> &'static str {
8062 "type.googleapis.com/google.cloud.dataproc.v1.HadoopJob"
8063 }
8064}
8065
8066pub mod hadoop_job {
8068 #[allow(unused_imports)]
8069 use super::*;
8070
8071 #[derive(Clone, Debug, PartialEq)]
8076 #[non_exhaustive]
8077 pub enum Driver {
8078 MainJarFileUri(std::string::String),
8084 MainClass(std::string::String),
8087 }
8088}
8089
8090#[derive(Clone, Default, PartialEq)]
8093#[non_exhaustive]
8094pub struct SparkJob {
8095 pub args: std::vec::Vec<std::string::String>,
8099
8100 pub jar_file_uris: std::vec::Vec<std::string::String>,
8103
8104 pub file_uris: std::vec::Vec<std::string::String>,
8107
8108 pub archive_uris: std::vec::Vec<std::string::String>,
8112
8113 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
8118
8119 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
8121
8122 pub driver: std::option::Option<crate::model::spark_job::Driver>,
8132
8133 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8134}
8135
8136impl SparkJob {
8137 pub fn new() -> Self {
8138 std::default::Default::default()
8139 }
8140
8141 pub fn set_args<T, V>(mut self, v: T) -> Self
8143 where
8144 T: std::iter::IntoIterator<Item = V>,
8145 V: std::convert::Into<std::string::String>,
8146 {
8147 use std::iter::Iterator;
8148 self.args = v.into_iter().map(|i| i.into()).collect();
8149 self
8150 }
8151
8152 pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
8154 where
8155 T: std::iter::IntoIterator<Item = V>,
8156 V: std::convert::Into<std::string::String>,
8157 {
8158 use std::iter::Iterator;
8159 self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
8160 self
8161 }
8162
8163 pub fn set_file_uris<T, V>(mut self, v: T) -> Self
8165 where
8166 T: std::iter::IntoIterator<Item = V>,
8167 V: std::convert::Into<std::string::String>,
8168 {
8169 use std::iter::Iterator;
8170 self.file_uris = v.into_iter().map(|i| i.into()).collect();
8171 self
8172 }
8173
8174 pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
8176 where
8177 T: std::iter::IntoIterator<Item = V>,
8178 V: std::convert::Into<std::string::String>,
8179 {
8180 use std::iter::Iterator;
8181 self.archive_uris = v.into_iter().map(|i| i.into()).collect();
8182 self
8183 }
8184
8185 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
8187 where
8188 T: std::iter::IntoIterator<Item = (K, V)>,
8189 K: std::convert::Into<std::string::String>,
8190 V: std::convert::Into<std::string::String>,
8191 {
8192 use std::iter::Iterator;
8193 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8194 self
8195 }
8196
8197 pub fn set_logging_config<T>(mut self, v: T) -> Self
8199 where
8200 T: std::convert::Into<crate::model::LoggingConfig>,
8201 {
8202 self.logging_config = std::option::Option::Some(v.into());
8203 self
8204 }
8205
8206 pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
8208 where
8209 T: std::convert::Into<crate::model::LoggingConfig>,
8210 {
8211 self.logging_config = v.map(|x| x.into());
8212 self
8213 }
8214
8215 pub fn set_driver<
8220 T: std::convert::Into<std::option::Option<crate::model::spark_job::Driver>>,
8221 >(
8222 mut self,
8223 v: T,
8224 ) -> Self {
8225 self.driver = v.into();
8226 self
8227 }
8228
8229 pub fn main_jar_file_uri(&self) -> std::option::Option<&std::string::String> {
8233 #[allow(unreachable_patterns)]
8234 self.driver.as_ref().and_then(|v| match v {
8235 crate::model::spark_job::Driver::MainJarFileUri(v) => std::option::Option::Some(v),
8236 _ => std::option::Option::None,
8237 })
8238 }
8239
8240 pub fn set_main_jar_file_uri<T: std::convert::Into<std::string::String>>(
8246 mut self,
8247 v: T,
8248 ) -> Self {
8249 self.driver =
8250 std::option::Option::Some(crate::model::spark_job::Driver::MainJarFileUri(v.into()));
8251 self
8252 }
8253
8254 pub fn main_class(&self) -> std::option::Option<&std::string::String> {
8258 #[allow(unreachable_patterns)]
8259 self.driver.as_ref().and_then(|v| match v {
8260 crate::model::spark_job::Driver::MainClass(v) => std::option::Option::Some(v),
8261 _ => std::option::Option::None,
8262 })
8263 }
8264
8265 pub fn set_main_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8271 self.driver =
8272 std::option::Option::Some(crate::model::spark_job::Driver::MainClass(v.into()));
8273 self
8274 }
8275}
8276
8277impl wkt::message::Message for SparkJob {
8278 fn typename() -> &'static str {
8279 "type.googleapis.com/google.cloud.dataproc.v1.SparkJob"
8280 }
8281}
8282
8283pub mod spark_job {
8285 #[allow(unused_imports)]
8286 use super::*;
8287
8288 #[derive(Clone, Debug, PartialEq)]
8298 #[non_exhaustive]
8299 pub enum Driver {
8300 MainJarFileUri(std::string::String),
8302 MainClass(std::string::String),
8306 }
8307}
8308
8309#[derive(Clone, Default, PartialEq)]
8314#[non_exhaustive]
8315pub struct PySparkJob {
8316 pub main_python_file_uri: std::string::String,
8319
8320 pub args: std::vec::Vec<std::string::String>,
8324
8325 pub python_file_uris: std::vec::Vec<std::string::String>,
8328
8329 pub jar_file_uris: std::vec::Vec<std::string::String>,
8332
8333 pub file_uris: std::vec::Vec<std::string::String>,
8336
8337 pub archive_uris: std::vec::Vec<std::string::String>,
8341
8342 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
8347
8348 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
8350
8351 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8352}
8353
8354impl PySparkJob {
8355 pub fn new() -> Self {
8356 std::default::Default::default()
8357 }
8358
8359 pub fn set_main_python_file_uri<T: std::convert::Into<std::string::String>>(
8361 mut self,
8362 v: T,
8363 ) -> Self {
8364 self.main_python_file_uri = v.into();
8365 self
8366 }
8367
8368 pub fn set_args<T, V>(mut self, v: T) -> Self
8370 where
8371 T: std::iter::IntoIterator<Item = V>,
8372 V: std::convert::Into<std::string::String>,
8373 {
8374 use std::iter::Iterator;
8375 self.args = v.into_iter().map(|i| i.into()).collect();
8376 self
8377 }
8378
8379 pub fn set_python_file_uris<T, V>(mut self, v: T) -> Self
8381 where
8382 T: std::iter::IntoIterator<Item = V>,
8383 V: std::convert::Into<std::string::String>,
8384 {
8385 use std::iter::Iterator;
8386 self.python_file_uris = v.into_iter().map(|i| i.into()).collect();
8387 self
8388 }
8389
8390 pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
8392 where
8393 T: std::iter::IntoIterator<Item = V>,
8394 V: std::convert::Into<std::string::String>,
8395 {
8396 use std::iter::Iterator;
8397 self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
8398 self
8399 }
8400
8401 pub fn set_file_uris<T, V>(mut self, v: T) -> Self
8403 where
8404 T: std::iter::IntoIterator<Item = V>,
8405 V: std::convert::Into<std::string::String>,
8406 {
8407 use std::iter::Iterator;
8408 self.file_uris = v.into_iter().map(|i| i.into()).collect();
8409 self
8410 }
8411
8412 pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
8414 where
8415 T: std::iter::IntoIterator<Item = V>,
8416 V: std::convert::Into<std::string::String>,
8417 {
8418 use std::iter::Iterator;
8419 self.archive_uris = v.into_iter().map(|i| i.into()).collect();
8420 self
8421 }
8422
8423 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
8425 where
8426 T: std::iter::IntoIterator<Item = (K, V)>,
8427 K: std::convert::Into<std::string::String>,
8428 V: std::convert::Into<std::string::String>,
8429 {
8430 use std::iter::Iterator;
8431 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8432 self
8433 }
8434
8435 pub fn set_logging_config<T>(mut self, v: T) -> Self
8437 where
8438 T: std::convert::Into<crate::model::LoggingConfig>,
8439 {
8440 self.logging_config = std::option::Option::Some(v.into());
8441 self
8442 }
8443
8444 pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
8446 where
8447 T: std::convert::Into<crate::model::LoggingConfig>,
8448 {
8449 self.logging_config = v.map(|x| x.into());
8450 self
8451 }
8452}
8453
8454impl wkt::message::Message for PySparkJob {
8455 fn typename() -> &'static str {
8456 "type.googleapis.com/google.cloud.dataproc.v1.PySparkJob"
8457 }
8458}
8459
8460#[derive(Clone, Default, PartialEq)]
8462#[non_exhaustive]
8463pub struct QueryList {
8464 pub queries: std::vec::Vec<std::string::String>,
8481
8482 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8483}
8484
8485impl QueryList {
8486 pub fn new() -> Self {
8487 std::default::Default::default()
8488 }
8489
8490 pub fn set_queries<T, V>(mut self, v: T) -> Self
8492 where
8493 T: std::iter::IntoIterator<Item = V>,
8494 V: std::convert::Into<std::string::String>,
8495 {
8496 use std::iter::Iterator;
8497 self.queries = v.into_iter().map(|i| i.into()).collect();
8498 self
8499 }
8500}
8501
8502impl wkt::message::Message for QueryList {
8503 fn typename() -> &'static str {
8504 "type.googleapis.com/google.cloud.dataproc.v1.QueryList"
8505 }
8506}
8507
8508#[derive(Clone, Default, PartialEq)]
8511#[non_exhaustive]
8512pub struct HiveJob {
8513 pub continue_on_failure: bool,
8517
8518 pub script_variables: std::collections::HashMap<std::string::String, std::string::String>,
8521
8522 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
8527
8528 pub jar_file_uris: std::vec::Vec<std::string::String>,
8532
8533 pub queries: std::option::Option<crate::model::hive_job::Queries>,
8536
8537 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8538}
8539
8540impl HiveJob {
8541 pub fn new() -> Self {
8542 std::default::Default::default()
8543 }
8544
8545 pub fn set_continue_on_failure<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8547 self.continue_on_failure = v.into();
8548 self
8549 }
8550
8551 pub fn set_script_variables<T, K, V>(mut self, v: T) -> Self
8553 where
8554 T: std::iter::IntoIterator<Item = (K, V)>,
8555 K: std::convert::Into<std::string::String>,
8556 V: std::convert::Into<std::string::String>,
8557 {
8558 use std::iter::Iterator;
8559 self.script_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8560 self
8561 }
8562
8563 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
8565 where
8566 T: std::iter::IntoIterator<Item = (K, V)>,
8567 K: std::convert::Into<std::string::String>,
8568 V: std::convert::Into<std::string::String>,
8569 {
8570 use std::iter::Iterator;
8571 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8572 self
8573 }
8574
8575 pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
8577 where
8578 T: std::iter::IntoIterator<Item = V>,
8579 V: std::convert::Into<std::string::String>,
8580 {
8581 use std::iter::Iterator;
8582 self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
8583 self
8584 }
8585
8586 pub fn set_queries<
8591 T: std::convert::Into<std::option::Option<crate::model::hive_job::Queries>>,
8592 >(
8593 mut self,
8594 v: T,
8595 ) -> Self {
8596 self.queries = v.into();
8597 self
8598 }
8599
8600 pub fn query_file_uri(&self) -> std::option::Option<&std::string::String> {
8604 #[allow(unreachable_patterns)]
8605 self.queries.as_ref().and_then(|v| match v {
8606 crate::model::hive_job::Queries::QueryFileUri(v) => std::option::Option::Some(v),
8607 _ => std::option::Option::None,
8608 })
8609 }
8610
8611 pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8617 self.queries =
8618 std::option::Option::Some(crate::model::hive_job::Queries::QueryFileUri(v.into()));
8619 self
8620 }
8621
8622 pub fn query_list(&self) -> std::option::Option<&std::boxed::Box<crate::model::QueryList>> {
8626 #[allow(unreachable_patterns)]
8627 self.queries.as_ref().and_then(|v| match v {
8628 crate::model::hive_job::Queries::QueryList(v) => std::option::Option::Some(v),
8629 _ => std::option::Option::None,
8630 })
8631 }
8632
8633 pub fn set_query_list<T: std::convert::Into<std::boxed::Box<crate::model::QueryList>>>(
8639 mut self,
8640 v: T,
8641 ) -> Self {
8642 self.queries =
8643 std::option::Option::Some(crate::model::hive_job::Queries::QueryList(v.into()));
8644 self
8645 }
8646}
8647
8648impl wkt::message::Message for HiveJob {
8649 fn typename() -> &'static str {
8650 "type.googleapis.com/google.cloud.dataproc.v1.HiveJob"
8651 }
8652}
8653
8654pub mod hive_job {
8656 #[allow(unused_imports)]
8657 use super::*;
8658
8659 #[derive(Clone, Debug, PartialEq)]
8662 #[non_exhaustive]
8663 pub enum Queries {
8664 QueryFileUri(std::string::String),
8666 QueryList(std::boxed::Box<crate::model::QueryList>),
8668 }
8669}
8670
8671#[derive(Clone, Default, PartialEq)]
8674#[non_exhaustive]
8675pub struct SparkSqlJob {
8676 pub script_variables: std::collections::HashMap<std::string::String, std::string::String>,
8679
8680 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
8684
8685 pub jar_file_uris: std::vec::Vec<std::string::String>,
8687
8688 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
8690
8691 pub queries: std::option::Option<crate::model::spark_sql_job::Queries>,
8694
8695 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8696}
8697
8698impl SparkSqlJob {
8699 pub fn new() -> Self {
8700 std::default::Default::default()
8701 }
8702
8703 pub fn set_script_variables<T, K, V>(mut self, v: T) -> Self
8705 where
8706 T: std::iter::IntoIterator<Item = (K, V)>,
8707 K: std::convert::Into<std::string::String>,
8708 V: std::convert::Into<std::string::String>,
8709 {
8710 use std::iter::Iterator;
8711 self.script_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8712 self
8713 }
8714
8715 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
8717 where
8718 T: std::iter::IntoIterator<Item = (K, V)>,
8719 K: std::convert::Into<std::string::String>,
8720 V: std::convert::Into<std::string::String>,
8721 {
8722 use std::iter::Iterator;
8723 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8724 self
8725 }
8726
8727 pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
8729 where
8730 T: std::iter::IntoIterator<Item = V>,
8731 V: std::convert::Into<std::string::String>,
8732 {
8733 use std::iter::Iterator;
8734 self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
8735 self
8736 }
8737
8738 pub fn set_logging_config<T>(mut self, v: T) -> Self
8740 where
8741 T: std::convert::Into<crate::model::LoggingConfig>,
8742 {
8743 self.logging_config = std::option::Option::Some(v.into());
8744 self
8745 }
8746
8747 pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
8749 where
8750 T: std::convert::Into<crate::model::LoggingConfig>,
8751 {
8752 self.logging_config = v.map(|x| x.into());
8753 self
8754 }
8755
8756 pub fn set_queries<
8761 T: std::convert::Into<std::option::Option<crate::model::spark_sql_job::Queries>>,
8762 >(
8763 mut self,
8764 v: T,
8765 ) -> Self {
8766 self.queries = v.into();
8767 self
8768 }
8769
8770 pub fn query_file_uri(&self) -> std::option::Option<&std::string::String> {
8774 #[allow(unreachable_patterns)]
8775 self.queries.as_ref().and_then(|v| match v {
8776 crate::model::spark_sql_job::Queries::QueryFileUri(v) => std::option::Option::Some(v),
8777 _ => std::option::Option::None,
8778 })
8779 }
8780
8781 pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8787 self.queries =
8788 std::option::Option::Some(crate::model::spark_sql_job::Queries::QueryFileUri(v.into()));
8789 self
8790 }
8791
8792 pub fn query_list(&self) -> std::option::Option<&std::boxed::Box<crate::model::QueryList>> {
8796 #[allow(unreachable_patterns)]
8797 self.queries.as_ref().and_then(|v| match v {
8798 crate::model::spark_sql_job::Queries::QueryList(v) => std::option::Option::Some(v),
8799 _ => std::option::Option::None,
8800 })
8801 }
8802
8803 pub fn set_query_list<T: std::convert::Into<std::boxed::Box<crate::model::QueryList>>>(
8809 mut self,
8810 v: T,
8811 ) -> Self {
8812 self.queries =
8813 std::option::Option::Some(crate::model::spark_sql_job::Queries::QueryList(v.into()));
8814 self
8815 }
8816}
8817
8818impl wkt::message::Message for SparkSqlJob {
8819 fn typename() -> &'static str {
8820 "type.googleapis.com/google.cloud.dataproc.v1.SparkSqlJob"
8821 }
8822}
8823
8824pub mod spark_sql_job {
8826 #[allow(unused_imports)]
8827 use super::*;
8828
8829 #[derive(Clone, Debug, PartialEq)]
8832 #[non_exhaustive]
8833 pub enum Queries {
8834 QueryFileUri(std::string::String),
8836 QueryList(std::boxed::Box<crate::model::QueryList>),
8838 }
8839}
8840
8841#[derive(Clone, Default, PartialEq)]
8844#[non_exhaustive]
8845pub struct PigJob {
8846 pub continue_on_failure: bool,
8850
8851 pub script_variables: std::collections::HashMap<std::string::String, std::string::String>,
8854
8855 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
8860
8861 pub jar_file_uris: std::vec::Vec<std::string::String>,
8864
8865 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
8867
8868 pub queries: std::option::Option<crate::model::pig_job::Queries>,
8871
8872 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8873}
8874
8875impl PigJob {
8876 pub fn new() -> Self {
8877 std::default::Default::default()
8878 }
8879
8880 pub fn set_continue_on_failure<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8882 self.continue_on_failure = v.into();
8883 self
8884 }
8885
8886 pub fn set_script_variables<T, K, V>(mut self, v: T) -> Self
8888 where
8889 T: std::iter::IntoIterator<Item = (K, V)>,
8890 K: std::convert::Into<std::string::String>,
8891 V: std::convert::Into<std::string::String>,
8892 {
8893 use std::iter::Iterator;
8894 self.script_variables = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8895 self
8896 }
8897
8898 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
8900 where
8901 T: std::iter::IntoIterator<Item = (K, V)>,
8902 K: std::convert::Into<std::string::String>,
8903 V: std::convert::Into<std::string::String>,
8904 {
8905 use std::iter::Iterator;
8906 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8907 self
8908 }
8909
8910 pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
8912 where
8913 T: std::iter::IntoIterator<Item = V>,
8914 V: std::convert::Into<std::string::String>,
8915 {
8916 use std::iter::Iterator;
8917 self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
8918 self
8919 }
8920
8921 pub fn set_logging_config<T>(mut self, v: T) -> Self
8923 where
8924 T: std::convert::Into<crate::model::LoggingConfig>,
8925 {
8926 self.logging_config = std::option::Option::Some(v.into());
8927 self
8928 }
8929
8930 pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
8932 where
8933 T: std::convert::Into<crate::model::LoggingConfig>,
8934 {
8935 self.logging_config = v.map(|x| x.into());
8936 self
8937 }
8938
8939 pub fn set_queries<
8944 T: std::convert::Into<std::option::Option<crate::model::pig_job::Queries>>,
8945 >(
8946 mut self,
8947 v: T,
8948 ) -> Self {
8949 self.queries = v.into();
8950 self
8951 }
8952
8953 pub fn query_file_uri(&self) -> std::option::Option<&std::string::String> {
8957 #[allow(unreachable_patterns)]
8958 self.queries.as_ref().and_then(|v| match v {
8959 crate::model::pig_job::Queries::QueryFileUri(v) => std::option::Option::Some(v),
8960 _ => std::option::Option::None,
8961 })
8962 }
8963
8964 pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8970 self.queries =
8971 std::option::Option::Some(crate::model::pig_job::Queries::QueryFileUri(v.into()));
8972 self
8973 }
8974
8975 pub fn query_list(&self) -> std::option::Option<&std::boxed::Box<crate::model::QueryList>> {
8979 #[allow(unreachable_patterns)]
8980 self.queries.as_ref().and_then(|v| match v {
8981 crate::model::pig_job::Queries::QueryList(v) => std::option::Option::Some(v),
8982 _ => std::option::Option::None,
8983 })
8984 }
8985
8986 pub fn set_query_list<T: std::convert::Into<std::boxed::Box<crate::model::QueryList>>>(
8992 mut self,
8993 v: T,
8994 ) -> Self {
8995 self.queries =
8996 std::option::Option::Some(crate::model::pig_job::Queries::QueryList(v.into()));
8997 self
8998 }
8999}
9000
9001impl wkt::message::Message for PigJob {
9002 fn typename() -> &'static str {
9003 "type.googleapis.com/google.cloud.dataproc.v1.PigJob"
9004 }
9005}
9006
9007pub mod pig_job {
9009 #[allow(unused_imports)]
9010 use super::*;
9011
9012 #[derive(Clone, Debug, PartialEq)]
9015 #[non_exhaustive]
9016 pub enum Queries {
9017 QueryFileUri(std::string::String),
9019 QueryList(std::boxed::Box<crate::model::QueryList>),
9021 }
9022}
9023
9024#[derive(Clone, Default, PartialEq)]
9028#[non_exhaustive]
9029pub struct SparkRJob {
9030 pub main_r_file_uri: std::string::String,
9033
9034 pub args: std::vec::Vec<std::string::String>,
9038
9039 pub file_uris: std::vec::Vec<std::string::String>,
9042
9043 pub archive_uris: std::vec::Vec<std::string::String>,
9047
9048 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
9053
9054 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
9056
9057 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9058}
9059
9060impl SparkRJob {
9061 pub fn new() -> Self {
9062 std::default::Default::default()
9063 }
9064
9065 pub fn set_main_r_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9067 self.main_r_file_uri = v.into();
9068 self
9069 }
9070
9071 pub fn set_args<T, V>(mut self, v: T) -> Self
9073 where
9074 T: std::iter::IntoIterator<Item = V>,
9075 V: std::convert::Into<std::string::String>,
9076 {
9077 use std::iter::Iterator;
9078 self.args = v.into_iter().map(|i| i.into()).collect();
9079 self
9080 }
9081
9082 pub fn set_file_uris<T, V>(mut self, v: T) -> Self
9084 where
9085 T: std::iter::IntoIterator<Item = V>,
9086 V: std::convert::Into<std::string::String>,
9087 {
9088 use std::iter::Iterator;
9089 self.file_uris = v.into_iter().map(|i| i.into()).collect();
9090 self
9091 }
9092
9093 pub fn set_archive_uris<T, V>(mut self, v: T) -> Self
9095 where
9096 T: std::iter::IntoIterator<Item = V>,
9097 V: std::convert::Into<std::string::String>,
9098 {
9099 use std::iter::Iterator;
9100 self.archive_uris = v.into_iter().map(|i| i.into()).collect();
9101 self
9102 }
9103
9104 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
9106 where
9107 T: std::iter::IntoIterator<Item = (K, V)>,
9108 K: std::convert::Into<std::string::String>,
9109 V: std::convert::Into<std::string::String>,
9110 {
9111 use std::iter::Iterator;
9112 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9113 self
9114 }
9115
9116 pub fn set_logging_config<T>(mut self, v: T) -> Self
9118 where
9119 T: std::convert::Into<crate::model::LoggingConfig>,
9120 {
9121 self.logging_config = std::option::Option::Some(v.into());
9122 self
9123 }
9124
9125 pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
9127 where
9128 T: std::convert::Into<crate::model::LoggingConfig>,
9129 {
9130 self.logging_config = v.map(|x| x.into());
9131 self
9132 }
9133}
9134
9135impl wkt::message::Message for SparkRJob {
9136 fn typename() -> &'static str {
9137 "type.googleapis.com/google.cloud.dataproc.v1.SparkRJob"
9138 }
9139}
9140
9141#[derive(Clone, Default, PartialEq)]
9147#[non_exhaustive]
9148pub struct PrestoJob {
9149 pub continue_on_failure: bool,
9153
9154 pub output_format: std::string::String,
9157
9158 pub client_tags: std::vec::Vec<std::string::String>,
9160
9161 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
9165
9166 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
9168
9169 pub queries: std::option::Option<crate::model::presto_job::Queries>,
9172
9173 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9174}
9175
9176impl PrestoJob {
9177 pub fn new() -> Self {
9178 std::default::Default::default()
9179 }
9180
9181 pub fn set_continue_on_failure<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9183 self.continue_on_failure = v.into();
9184 self
9185 }
9186
9187 pub fn set_output_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9189 self.output_format = v.into();
9190 self
9191 }
9192
9193 pub fn set_client_tags<T, V>(mut self, v: T) -> Self
9195 where
9196 T: std::iter::IntoIterator<Item = V>,
9197 V: std::convert::Into<std::string::String>,
9198 {
9199 use std::iter::Iterator;
9200 self.client_tags = v.into_iter().map(|i| i.into()).collect();
9201 self
9202 }
9203
9204 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
9206 where
9207 T: std::iter::IntoIterator<Item = (K, V)>,
9208 K: std::convert::Into<std::string::String>,
9209 V: std::convert::Into<std::string::String>,
9210 {
9211 use std::iter::Iterator;
9212 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9213 self
9214 }
9215
9216 pub fn set_logging_config<T>(mut self, v: T) -> Self
9218 where
9219 T: std::convert::Into<crate::model::LoggingConfig>,
9220 {
9221 self.logging_config = std::option::Option::Some(v.into());
9222 self
9223 }
9224
9225 pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
9227 where
9228 T: std::convert::Into<crate::model::LoggingConfig>,
9229 {
9230 self.logging_config = v.map(|x| x.into());
9231 self
9232 }
9233
9234 pub fn set_queries<
9239 T: std::convert::Into<std::option::Option<crate::model::presto_job::Queries>>,
9240 >(
9241 mut self,
9242 v: T,
9243 ) -> Self {
9244 self.queries = v.into();
9245 self
9246 }
9247
9248 pub fn query_file_uri(&self) -> std::option::Option<&std::string::String> {
9252 #[allow(unreachable_patterns)]
9253 self.queries.as_ref().and_then(|v| match v {
9254 crate::model::presto_job::Queries::QueryFileUri(v) => std::option::Option::Some(v),
9255 _ => std::option::Option::None,
9256 })
9257 }
9258
9259 pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9265 self.queries =
9266 std::option::Option::Some(crate::model::presto_job::Queries::QueryFileUri(v.into()));
9267 self
9268 }
9269
9270 pub fn query_list(&self) -> std::option::Option<&std::boxed::Box<crate::model::QueryList>> {
9274 #[allow(unreachable_patterns)]
9275 self.queries.as_ref().and_then(|v| match v {
9276 crate::model::presto_job::Queries::QueryList(v) => std::option::Option::Some(v),
9277 _ => std::option::Option::None,
9278 })
9279 }
9280
9281 pub fn set_query_list<T: std::convert::Into<std::boxed::Box<crate::model::QueryList>>>(
9287 mut self,
9288 v: T,
9289 ) -> Self {
9290 self.queries =
9291 std::option::Option::Some(crate::model::presto_job::Queries::QueryList(v.into()));
9292 self
9293 }
9294}
9295
9296impl wkt::message::Message for PrestoJob {
9297 fn typename() -> &'static str {
9298 "type.googleapis.com/google.cloud.dataproc.v1.PrestoJob"
9299 }
9300}
9301
9302pub mod presto_job {
9304 #[allow(unused_imports)]
9305 use super::*;
9306
9307 #[derive(Clone, Debug, PartialEq)]
9310 #[non_exhaustive]
9311 pub enum Queries {
9312 QueryFileUri(std::string::String),
9314 QueryList(std::boxed::Box<crate::model::QueryList>),
9316 }
9317}
9318
9319#[derive(Clone, Default, PartialEq)]
9325#[non_exhaustive]
9326pub struct TrinoJob {
9327 pub continue_on_failure: bool,
9331
9332 pub output_format: std::string::String,
9335
9336 pub client_tags: std::vec::Vec<std::string::String>,
9338
9339 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
9343
9344 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
9346
9347 pub queries: std::option::Option<crate::model::trino_job::Queries>,
9350
9351 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9352}
9353
9354impl TrinoJob {
9355 pub fn new() -> Self {
9356 std::default::Default::default()
9357 }
9358
9359 pub fn set_continue_on_failure<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9361 self.continue_on_failure = v.into();
9362 self
9363 }
9364
9365 pub fn set_output_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9367 self.output_format = v.into();
9368 self
9369 }
9370
9371 pub fn set_client_tags<T, V>(mut self, v: T) -> Self
9373 where
9374 T: std::iter::IntoIterator<Item = V>,
9375 V: std::convert::Into<std::string::String>,
9376 {
9377 use std::iter::Iterator;
9378 self.client_tags = v.into_iter().map(|i| i.into()).collect();
9379 self
9380 }
9381
9382 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
9384 where
9385 T: std::iter::IntoIterator<Item = (K, V)>,
9386 K: std::convert::Into<std::string::String>,
9387 V: std::convert::Into<std::string::String>,
9388 {
9389 use std::iter::Iterator;
9390 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9391 self
9392 }
9393
9394 pub fn set_logging_config<T>(mut self, v: T) -> Self
9396 where
9397 T: std::convert::Into<crate::model::LoggingConfig>,
9398 {
9399 self.logging_config = std::option::Option::Some(v.into());
9400 self
9401 }
9402
9403 pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
9405 where
9406 T: std::convert::Into<crate::model::LoggingConfig>,
9407 {
9408 self.logging_config = v.map(|x| x.into());
9409 self
9410 }
9411
9412 pub fn set_queries<
9417 T: std::convert::Into<std::option::Option<crate::model::trino_job::Queries>>,
9418 >(
9419 mut self,
9420 v: T,
9421 ) -> Self {
9422 self.queries = v.into();
9423 self
9424 }
9425
9426 pub fn query_file_uri(&self) -> std::option::Option<&std::string::String> {
9430 #[allow(unreachable_patterns)]
9431 self.queries.as_ref().and_then(|v| match v {
9432 crate::model::trino_job::Queries::QueryFileUri(v) => std::option::Option::Some(v),
9433 _ => std::option::Option::None,
9434 })
9435 }
9436
9437 pub fn set_query_file_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9443 self.queries =
9444 std::option::Option::Some(crate::model::trino_job::Queries::QueryFileUri(v.into()));
9445 self
9446 }
9447
9448 pub fn query_list(&self) -> std::option::Option<&std::boxed::Box<crate::model::QueryList>> {
9452 #[allow(unreachable_patterns)]
9453 self.queries.as_ref().and_then(|v| match v {
9454 crate::model::trino_job::Queries::QueryList(v) => std::option::Option::Some(v),
9455 _ => std::option::Option::None,
9456 })
9457 }
9458
9459 pub fn set_query_list<T: std::convert::Into<std::boxed::Box<crate::model::QueryList>>>(
9465 mut self,
9466 v: T,
9467 ) -> Self {
9468 self.queries =
9469 std::option::Option::Some(crate::model::trino_job::Queries::QueryList(v.into()));
9470 self
9471 }
9472}
9473
9474impl wkt::message::Message for TrinoJob {
9475 fn typename() -> &'static str {
9476 "type.googleapis.com/google.cloud.dataproc.v1.TrinoJob"
9477 }
9478}
9479
9480pub mod trino_job {
9482 #[allow(unused_imports)]
9483 use super::*;
9484
9485 #[derive(Clone, Debug, PartialEq)]
9488 #[non_exhaustive]
9489 pub enum Queries {
9490 QueryFileUri(std::string::String),
9492 QueryList(std::boxed::Box<crate::model::QueryList>),
9494 }
9495}
9496
9497#[derive(Clone, Default, PartialEq)]
9499#[non_exhaustive]
9500pub struct FlinkJob {
9501 pub args: std::vec::Vec<std::string::String>,
9505
9506 pub jar_file_uris: std::vec::Vec<std::string::String>,
9509
9510 pub savepoint_uri: std::string::String,
9513
9514 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
9519
9520 pub logging_config: std::option::Option<crate::model::LoggingConfig>,
9522
9523 pub driver: std::option::Option<crate::model::flink_job::Driver>,
9533
9534 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9535}
9536
9537impl FlinkJob {
9538 pub fn new() -> Self {
9539 std::default::Default::default()
9540 }
9541
9542 pub fn set_args<T, V>(mut self, v: T) -> Self
9544 where
9545 T: std::iter::IntoIterator<Item = V>,
9546 V: std::convert::Into<std::string::String>,
9547 {
9548 use std::iter::Iterator;
9549 self.args = v.into_iter().map(|i| i.into()).collect();
9550 self
9551 }
9552
9553 pub fn set_jar_file_uris<T, V>(mut self, v: T) -> Self
9555 where
9556 T: std::iter::IntoIterator<Item = V>,
9557 V: std::convert::Into<std::string::String>,
9558 {
9559 use std::iter::Iterator;
9560 self.jar_file_uris = v.into_iter().map(|i| i.into()).collect();
9561 self
9562 }
9563
9564 pub fn set_savepoint_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9566 self.savepoint_uri = v.into();
9567 self
9568 }
9569
9570 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
9572 where
9573 T: std::iter::IntoIterator<Item = (K, V)>,
9574 K: std::convert::Into<std::string::String>,
9575 V: std::convert::Into<std::string::String>,
9576 {
9577 use std::iter::Iterator;
9578 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9579 self
9580 }
9581
9582 pub fn set_logging_config<T>(mut self, v: T) -> Self
9584 where
9585 T: std::convert::Into<crate::model::LoggingConfig>,
9586 {
9587 self.logging_config = std::option::Option::Some(v.into());
9588 self
9589 }
9590
9591 pub fn set_or_clear_logging_config<T>(mut self, v: std::option::Option<T>) -> Self
9593 where
9594 T: std::convert::Into<crate::model::LoggingConfig>,
9595 {
9596 self.logging_config = v.map(|x| x.into());
9597 self
9598 }
9599
9600 pub fn set_driver<
9605 T: std::convert::Into<std::option::Option<crate::model::flink_job::Driver>>,
9606 >(
9607 mut self,
9608 v: T,
9609 ) -> Self {
9610 self.driver = v.into();
9611 self
9612 }
9613
9614 pub fn main_jar_file_uri(&self) -> std::option::Option<&std::string::String> {
9618 #[allow(unreachable_patterns)]
9619 self.driver.as_ref().and_then(|v| match v {
9620 crate::model::flink_job::Driver::MainJarFileUri(v) => std::option::Option::Some(v),
9621 _ => std::option::Option::None,
9622 })
9623 }
9624
9625 pub fn set_main_jar_file_uri<T: std::convert::Into<std::string::String>>(
9631 mut self,
9632 v: T,
9633 ) -> Self {
9634 self.driver =
9635 std::option::Option::Some(crate::model::flink_job::Driver::MainJarFileUri(v.into()));
9636 self
9637 }
9638
9639 pub fn main_class(&self) -> std::option::Option<&std::string::String> {
9643 #[allow(unreachable_patterns)]
9644 self.driver.as_ref().and_then(|v| match v {
9645 crate::model::flink_job::Driver::MainClass(v) => std::option::Option::Some(v),
9646 _ => std::option::Option::None,
9647 })
9648 }
9649
9650 pub fn set_main_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9656 self.driver =
9657 std::option::Option::Some(crate::model::flink_job::Driver::MainClass(v.into()));
9658 self
9659 }
9660}
9661
9662impl wkt::message::Message for FlinkJob {
9663 fn typename() -> &'static str {
9664 "type.googleapis.com/google.cloud.dataproc.v1.FlinkJob"
9665 }
9666}
9667
9668pub mod flink_job {
9670 #[allow(unused_imports)]
9671 use super::*;
9672
9673 #[derive(Clone, Debug, PartialEq)]
9683 #[non_exhaustive]
9684 pub enum Driver {
9685 MainJarFileUri(std::string::String),
9687 MainClass(std::string::String),
9693 }
9694}
9695
9696#[derive(Clone, Default, PartialEq)]
9698#[non_exhaustive]
9699pub struct JobPlacement {
9700 pub cluster_name: std::string::String,
9702
9703 pub cluster_uuid: std::string::String,
9706
9707 pub cluster_labels: std::collections::HashMap<std::string::String, std::string::String>,
9710
9711 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9712}
9713
9714impl JobPlacement {
9715 pub fn new() -> Self {
9716 std::default::Default::default()
9717 }
9718
9719 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9721 self.cluster_name = v.into();
9722 self
9723 }
9724
9725 pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9727 self.cluster_uuid = v.into();
9728 self
9729 }
9730
9731 pub fn set_cluster_labels<T, K, V>(mut self, v: T) -> Self
9733 where
9734 T: std::iter::IntoIterator<Item = (K, V)>,
9735 K: std::convert::Into<std::string::String>,
9736 V: std::convert::Into<std::string::String>,
9737 {
9738 use std::iter::Iterator;
9739 self.cluster_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9740 self
9741 }
9742}
9743
9744impl wkt::message::Message for JobPlacement {
9745 fn typename() -> &'static str {
9746 "type.googleapis.com/google.cloud.dataproc.v1.JobPlacement"
9747 }
9748}
9749
9750#[derive(Clone, Default, PartialEq)]
9752#[non_exhaustive]
9753pub struct JobStatus {
9754 pub state: crate::model::job_status::State,
9756
9757 pub details: std::string::String,
9760
9761 pub state_start_time: std::option::Option<wkt::Timestamp>,
9763
9764 pub substate: crate::model::job_status::Substate,
9767
9768 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9769}
9770
9771impl JobStatus {
9772 pub fn new() -> Self {
9773 std::default::Default::default()
9774 }
9775
9776 pub fn set_state<T: std::convert::Into<crate::model::job_status::State>>(
9778 mut self,
9779 v: T,
9780 ) -> Self {
9781 self.state = v.into();
9782 self
9783 }
9784
9785 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9787 self.details = v.into();
9788 self
9789 }
9790
9791 pub fn set_state_start_time<T>(mut self, v: T) -> Self
9793 where
9794 T: std::convert::Into<wkt::Timestamp>,
9795 {
9796 self.state_start_time = std::option::Option::Some(v.into());
9797 self
9798 }
9799
9800 pub fn set_or_clear_state_start_time<T>(mut self, v: std::option::Option<T>) -> Self
9802 where
9803 T: std::convert::Into<wkt::Timestamp>,
9804 {
9805 self.state_start_time = v.map(|x| x.into());
9806 self
9807 }
9808
9809 pub fn set_substate<T: std::convert::Into<crate::model::job_status::Substate>>(
9811 mut self,
9812 v: T,
9813 ) -> Self {
9814 self.substate = v.into();
9815 self
9816 }
9817}
9818
9819impl wkt::message::Message for JobStatus {
9820 fn typename() -> &'static str {
9821 "type.googleapis.com/google.cloud.dataproc.v1.JobStatus"
9822 }
9823}
9824
9825pub mod job_status {
9827 #[allow(unused_imports)]
9828 use super::*;
9829
9830 #[derive(Clone, Debug, PartialEq)]
9846 #[non_exhaustive]
9847 pub enum State {
9848 Unspecified,
9850 Pending,
9852 SetupDone,
9855 Running,
9857 CancelPending,
9859 CancelStarted,
9862 Cancelled,
9864 Done,
9866 Error,
9868 AttemptFailure,
9873 UnknownValue(state::UnknownValue),
9878 }
9879
9880 #[doc(hidden)]
9881 pub mod state {
9882 #[allow(unused_imports)]
9883 use super::*;
9884 #[derive(Clone, Debug, PartialEq)]
9885 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9886 }
9887
9888 impl State {
9889 pub fn value(&self) -> std::option::Option<i32> {
9894 match self {
9895 Self::Unspecified => std::option::Option::Some(0),
9896 Self::Pending => std::option::Option::Some(1),
9897 Self::SetupDone => std::option::Option::Some(8),
9898 Self::Running => std::option::Option::Some(2),
9899 Self::CancelPending => std::option::Option::Some(3),
9900 Self::CancelStarted => std::option::Option::Some(7),
9901 Self::Cancelled => std::option::Option::Some(4),
9902 Self::Done => std::option::Option::Some(5),
9903 Self::Error => std::option::Option::Some(6),
9904 Self::AttemptFailure => std::option::Option::Some(9),
9905 Self::UnknownValue(u) => u.0.value(),
9906 }
9907 }
9908
9909 pub fn name(&self) -> std::option::Option<&str> {
9914 match self {
9915 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9916 Self::Pending => std::option::Option::Some("PENDING"),
9917 Self::SetupDone => std::option::Option::Some("SETUP_DONE"),
9918 Self::Running => std::option::Option::Some("RUNNING"),
9919 Self::CancelPending => std::option::Option::Some("CANCEL_PENDING"),
9920 Self::CancelStarted => std::option::Option::Some("CANCEL_STARTED"),
9921 Self::Cancelled => std::option::Option::Some("CANCELLED"),
9922 Self::Done => std::option::Option::Some("DONE"),
9923 Self::Error => std::option::Option::Some("ERROR"),
9924 Self::AttemptFailure => std::option::Option::Some("ATTEMPT_FAILURE"),
9925 Self::UnknownValue(u) => u.0.name(),
9926 }
9927 }
9928 }
9929
9930 impl std::default::Default for State {
9931 fn default() -> Self {
9932 use std::convert::From;
9933 Self::from(0)
9934 }
9935 }
9936
9937 impl std::fmt::Display for State {
9938 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9939 wkt::internal::display_enum(f, self.name(), self.value())
9940 }
9941 }
9942
9943 impl std::convert::From<i32> for State {
9944 fn from(value: i32) -> Self {
9945 match value {
9946 0 => Self::Unspecified,
9947 1 => Self::Pending,
9948 2 => Self::Running,
9949 3 => Self::CancelPending,
9950 4 => Self::Cancelled,
9951 5 => Self::Done,
9952 6 => Self::Error,
9953 7 => Self::CancelStarted,
9954 8 => Self::SetupDone,
9955 9 => Self::AttemptFailure,
9956 _ => Self::UnknownValue(state::UnknownValue(
9957 wkt::internal::UnknownEnumValue::Integer(value),
9958 )),
9959 }
9960 }
9961 }
9962
9963 impl std::convert::From<&str> for State {
9964 fn from(value: &str) -> Self {
9965 use std::string::ToString;
9966 match value {
9967 "STATE_UNSPECIFIED" => Self::Unspecified,
9968 "PENDING" => Self::Pending,
9969 "SETUP_DONE" => Self::SetupDone,
9970 "RUNNING" => Self::Running,
9971 "CANCEL_PENDING" => Self::CancelPending,
9972 "CANCEL_STARTED" => Self::CancelStarted,
9973 "CANCELLED" => Self::Cancelled,
9974 "DONE" => Self::Done,
9975 "ERROR" => Self::Error,
9976 "ATTEMPT_FAILURE" => Self::AttemptFailure,
9977 _ => Self::UnknownValue(state::UnknownValue(
9978 wkt::internal::UnknownEnumValue::String(value.to_string()),
9979 )),
9980 }
9981 }
9982 }
9983
9984 impl serde::ser::Serialize for State {
9985 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9986 where
9987 S: serde::Serializer,
9988 {
9989 match self {
9990 Self::Unspecified => serializer.serialize_i32(0),
9991 Self::Pending => serializer.serialize_i32(1),
9992 Self::SetupDone => serializer.serialize_i32(8),
9993 Self::Running => serializer.serialize_i32(2),
9994 Self::CancelPending => serializer.serialize_i32(3),
9995 Self::CancelStarted => serializer.serialize_i32(7),
9996 Self::Cancelled => serializer.serialize_i32(4),
9997 Self::Done => serializer.serialize_i32(5),
9998 Self::Error => serializer.serialize_i32(6),
9999 Self::AttemptFailure => serializer.serialize_i32(9),
10000 Self::UnknownValue(u) => u.0.serialize(serializer),
10001 }
10002 }
10003 }
10004
10005 impl<'de> serde::de::Deserialize<'de> for State {
10006 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10007 where
10008 D: serde::Deserializer<'de>,
10009 {
10010 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10011 ".google.cloud.dataproc.v1.JobStatus.State",
10012 ))
10013 }
10014 }
10015
10016 #[derive(Clone, Debug, PartialEq)]
10032 #[non_exhaustive]
10033 pub enum Substate {
10034 Unspecified,
10036 Submitted,
10040 Queued,
10046 StaleStatus,
10052 UnknownValue(substate::UnknownValue),
10057 }
10058
10059 #[doc(hidden)]
10060 pub mod substate {
10061 #[allow(unused_imports)]
10062 use super::*;
10063 #[derive(Clone, Debug, PartialEq)]
10064 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10065 }
10066
10067 impl Substate {
10068 pub fn value(&self) -> std::option::Option<i32> {
10073 match self {
10074 Self::Unspecified => std::option::Option::Some(0),
10075 Self::Submitted => std::option::Option::Some(1),
10076 Self::Queued => std::option::Option::Some(2),
10077 Self::StaleStatus => std::option::Option::Some(3),
10078 Self::UnknownValue(u) => u.0.value(),
10079 }
10080 }
10081
10082 pub fn name(&self) -> std::option::Option<&str> {
10087 match self {
10088 Self::Unspecified => std::option::Option::Some("UNSPECIFIED"),
10089 Self::Submitted => std::option::Option::Some("SUBMITTED"),
10090 Self::Queued => std::option::Option::Some("QUEUED"),
10091 Self::StaleStatus => std::option::Option::Some("STALE_STATUS"),
10092 Self::UnknownValue(u) => u.0.name(),
10093 }
10094 }
10095 }
10096
10097 impl std::default::Default for Substate {
10098 fn default() -> Self {
10099 use std::convert::From;
10100 Self::from(0)
10101 }
10102 }
10103
10104 impl std::fmt::Display for Substate {
10105 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10106 wkt::internal::display_enum(f, self.name(), self.value())
10107 }
10108 }
10109
10110 impl std::convert::From<i32> for Substate {
10111 fn from(value: i32) -> Self {
10112 match value {
10113 0 => Self::Unspecified,
10114 1 => Self::Submitted,
10115 2 => Self::Queued,
10116 3 => Self::StaleStatus,
10117 _ => Self::UnknownValue(substate::UnknownValue(
10118 wkt::internal::UnknownEnumValue::Integer(value),
10119 )),
10120 }
10121 }
10122 }
10123
10124 impl std::convert::From<&str> for Substate {
10125 fn from(value: &str) -> Self {
10126 use std::string::ToString;
10127 match value {
10128 "UNSPECIFIED" => Self::Unspecified,
10129 "SUBMITTED" => Self::Submitted,
10130 "QUEUED" => Self::Queued,
10131 "STALE_STATUS" => Self::StaleStatus,
10132 _ => Self::UnknownValue(substate::UnknownValue(
10133 wkt::internal::UnknownEnumValue::String(value.to_string()),
10134 )),
10135 }
10136 }
10137 }
10138
10139 impl serde::ser::Serialize for Substate {
10140 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10141 where
10142 S: serde::Serializer,
10143 {
10144 match self {
10145 Self::Unspecified => serializer.serialize_i32(0),
10146 Self::Submitted => serializer.serialize_i32(1),
10147 Self::Queued => serializer.serialize_i32(2),
10148 Self::StaleStatus => serializer.serialize_i32(3),
10149 Self::UnknownValue(u) => u.0.serialize(serializer),
10150 }
10151 }
10152 }
10153
10154 impl<'de> serde::de::Deserialize<'de> for Substate {
10155 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10156 where
10157 D: serde::Deserializer<'de>,
10158 {
10159 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Substate>::new(
10160 ".google.cloud.dataproc.v1.JobStatus.Substate",
10161 ))
10162 }
10163 }
10164}
10165
10166#[derive(Clone, Default, PartialEq)]
10168#[non_exhaustive]
10169pub struct JobReference {
10170 pub project_id: std::string::String,
10173
10174 pub job_id: std::string::String,
10181
10182 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10183}
10184
10185impl JobReference {
10186 pub fn new() -> Self {
10187 std::default::Default::default()
10188 }
10189
10190 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10192 self.project_id = v.into();
10193 self
10194 }
10195
10196 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10198 self.job_id = v.into();
10199 self
10200 }
10201}
10202
10203impl wkt::message::Message for JobReference {
10204 fn typename() -> &'static str {
10205 "type.googleapis.com/google.cloud.dataproc.v1.JobReference"
10206 }
10207}
10208
10209#[derive(Clone, Default, PartialEq)]
10215#[non_exhaustive]
10216pub struct YarnApplication {
10217 pub name: std::string::String,
10219
10220 pub state: crate::model::yarn_application::State,
10222
10223 pub progress: f32,
10225
10226 pub tracking_url: std::string::String,
10231
10232 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10233}
10234
10235impl YarnApplication {
10236 pub fn new() -> Self {
10237 std::default::Default::default()
10238 }
10239
10240 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10242 self.name = v.into();
10243 self
10244 }
10245
10246 pub fn set_state<T: std::convert::Into<crate::model::yarn_application::State>>(
10248 mut self,
10249 v: T,
10250 ) -> Self {
10251 self.state = v.into();
10252 self
10253 }
10254
10255 pub fn set_progress<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
10257 self.progress = v.into();
10258 self
10259 }
10260
10261 pub fn set_tracking_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10263 self.tracking_url = v.into();
10264 self
10265 }
10266}
10267
10268impl wkt::message::Message for YarnApplication {
10269 fn typename() -> &'static str {
10270 "type.googleapis.com/google.cloud.dataproc.v1.YarnApplication"
10271 }
10272}
10273
10274pub mod yarn_application {
10276 #[allow(unused_imports)]
10277 use super::*;
10278
10279 #[derive(Clone, Debug, PartialEq)]
10296 #[non_exhaustive]
10297 pub enum State {
10298 Unspecified,
10300 New,
10302 NewSaving,
10304 Submitted,
10306 Accepted,
10308 Running,
10310 Finished,
10312 Failed,
10314 Killed,
10316 UnknownValue(state::UnknownValue),
10321 }
10322
10323 #[doc(hidden)]
10324 pub mod state {
10325 #[allow(unused_imports)]
10326 use super::*;
10327 #[derive(Clone, Debug, PartialEq)]
10328 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10329 }
10330
10331 impl State {
10332 pub fn value(&self) -> std::option::Option<i32> {
10337 match self {
10338 Self::Unspecified => std::option::Option::Some(0),
10339 Self::New => std::option::Option::Some(1),
10340 Self::NewSaving => std::option::Option::Some(2),
10341 Self::Submitted => std::option::Option::Some(3),
10342 Self::Accepted => std::option::Option::Some(4),
10343 Self::Running => std::option::Option::Some(5),
10344 Self::Finished => std::option::Option::Some(6),
10345 Self::Failed => std::option::Option::Some(7),
10346 Self::Killed => std::option::Option::Some(8),
10347 Self::UnknownValue(u) => u.0.value(),
10348 }
10349 }
10350
10351 pub fn name(&self) -> std::option::Option<&str> {
10356 match self {
10357 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10358 Self::New => std::option::Option::Some("NEW"),
10359 Self::NewSaving => std::option::Option::Some("NEW_SAVING"),
10360 Self::Submitted => std::option::Option::Some("SUBMITTED"),
10361 Self::Accepted => std::option::Option::Some("ACCEPTED"),
10362 Self::Running => std::option::Option::Some("RUNNING"),
10363 Self::Finished => std::option::Option::Some("FINISHED"),
10364 Self::Failed => std::option::Option::Some("FAILED"),
10365 Self::Killed => std::option::Option::Some("KILLED"),
10366 Self::UnknownValue(u) => u.0.name(),
10367 }
10368 }
10369 }
10370
10371 impl std::default::Default for State {
10372 fn default() -> Self {
10373 use std::convert::From;
10374 Self::from(0)
10375 }
10376 }
10377
10378 impl std::fmt::Display for State {
10379 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10380 wkt::internal::display_enum(f, self.name(), self.value())
10381 }
10382 }
10383
10384 impl std::convert::From<i32> for State {
10385 fn from(value: i32) -> Self {
10386 match value {
10387 0 => Self::Unspecified,
10388 1 => Self::New,
10389 2 => Self::NewSaving,
10390 3 => Self::Submitted,
10391 4 => Self::Accepted,
10392 5 => Self::Running,
10393 6 => Self::Finished,
10394 7 => Self::Failed,
10395 8 => Self::Killed,
10396 _ => Self::UnknownValue(state::UnknownValue(
10397 wkt::internal::UnknownEnumValue::Integer(value),
10398 )),
10399 }
10400 }
10401 }
10402
10403 impl std::convert::From<&str> for State {
10404 fn from(value: &str) -> Self {
10405 use std::string::ToString;
10406 match value {
10407 "STATE_UNSPECIFIED" => Self::Unspecified,
10408 "NEW" => Self::New,
10409 "NEW_SAVING" => Self::NewSaving,
10410 "SUBMITTED" => Self::Submitted,
10411 "ACCEPTED" => Self::Accepted,
10412 "RUNNING" => Self::Running,
10413 "FINISHED" => Self::Finished,
10414 "FAILED" => Self::Failed,
10415 "KILLED" => Self::Killed,
10416 _ => Self::UnknownValue(state::UnknownValue(
10417 wkt::internal::UnknownEnumValue::String(value.to_string()),
10418 )),
10419 }
10420 }
10421 }
10422
10423 impl serde::ser::Serialize for State {
10424 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10425 where
10426 S: serde::Serializer,
10427 {
10428 match self {
10429 Self::Unspecified => serializer.serialize_i32(0),
10430 Self::New => serializer.serialize_i32(1),
10431 Self::NewSaving => serializer.serialize_i32(2),
10432 Self::Submitted => serializer.serialize_i32(3),
10433 Self::Accepted => serializer.serialize_i32(4),
10434 Self::Running => serializer.serialize_i32(5),
10435 Self::Finished => serializer.serialize_i32(6),
10436 Self::Failed => serializer.serialize_i32(7),
10437 Self::Killed => serializer.serialize_i32(8),
10438 Self::UnknownValue(u) => u.0.serialize(serializer),
10439 }
10440 }
10441 }
10442
10443 impl<'de> serde::de::Deserialize<'de> for State {
10444 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10445 where
10446 D: serde::Deserializer<'de>,
10447 {
10448 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10449 ".google.cloud.dataproc.v1.YarnApplication.State",
10450 ))
10451 }
10452 }
10453}
10454
10455#[derive(Clone, Default, PartialEq)]
10457#[non_exhaustive]
10458pub struct Job {
10459 pub reference: std::option::Option<crate::model::JobReference>,
10464
10465 pub placement: std::option::Option<crate::model::JobPlacement>,
10468
10469 pub status: std::option::Option<crate::model::JobStatus>,
10473
10474 pub status_history: std::vec::Vec<crate::model::JobStatus>,
10476
10477 pub yarn_applications: std::vec::Vec<crate::model::YarnApplication>,
10482
10483 pub driver_output_resource_uri: std::string::String,
10486
10487 pub driver_control_files_uri: std::string::String,
10491
10492 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10500
10501 pub scheduling: std::option::Option<crate::model::JobScheduling>,
10503
10504 pub job_uuid: std::string::String,
10508
10509 pub done: bool,
10514
10515 pub driver_scheduling_config: std::option::Option<crate::model::DriverSchedulingConfig>,
10517
10518 pub type_job: std::option::Option<crate::model::job::TypeJob>,
10520
10521 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10522}
10523
10524impl Job {
10525 pub fn new() -> Self {
10526 std::default::Default::default()
10527 }
10528
10529 pub fn set_reference<T>(mut self, v: T) -> Self
10531 where
10532 T: std::convert::Into<crate::model::JobReference>,
10533 {
10534 self.reference = std::option::Option::Some(v.into());
10535 self
10536 }
10537
10538 pub fn set_or_clear_reference<T>(mut self, v: std::option::Option<T>) -> Self
10540 where
10541 T: std::convert::Into<crate::model::JobReference>,
10542 {
10543 self.reference = v.map(|x| x.into());
10544 self
10545 }
10546
10547 pub fn set_placement<T>(mut self, v: T) -> Self
10549 where
10550 T: std::convert::Into<crate::model::JobPlacement>,
10551 {
10552 self.placement = std::option::Option::Some(v.into());
10553 self
10554 }
10555
10556 pub fn set_or_clear_placement<T>(mut self, v: std::option::Option<T>) -> Self
10558 where
10559 T: std::convert::Into<crate::model::JobPlacement>,
10560 {
10561 self.placement = v.map(|x| x.into());
10562 self
10563 }
10564
10565 pub fn set_status<T>(mut self, v: T) -> Self
10567 where
10568 T: std::convert::Into<crate::model::JobStatus>,
10569 {
10570 self.status = std::option::Option::Some(v.into());
10571 self
10572 }
10573
10574 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
10576 where
10577 T: std::convert::Into<crate::model::JobStatus>,
10578 {
10579 self.status = v.map(|x| x.into());
10580 self
10581 }
10582
10583 pub fn set_status_history<T, V>(mut self, v: T) -> Self
10585 where
10586 T: std::iter::IntoIterator<Item = V>,
10587 V: std::convert::Into<crate::model::JobStatus>,
10588 {
10589 use std::iter::Iterator;
10590 self.status_history = v.into_iter().map(|i| i.into()).collect();
10591 self
10592 }
10593
10594 pub fn set_yarn_applications<T, V>(mut self, v: T) -> Self
10596 where
10597 T: std::iter::IntoIterator<Item = V>,
10598 V: std::convert::Into<crate::model::YarnApplication>,
10599 {
10600 use std::iter::Iterator;
10601 self.yarn_applications = v.into_iter().map(|i| i.into()).collect();
10602 self
10603 }
10604
10605 pub fn set_driver_output_resource_uri<T: std::convert::Into<std::string::String>>(
10607 mut self,
10608 v: T,
10609 ) -> Self {
10610 self.driver_output_resource_uri = v.into();
10611 self
10612 }
10613
10614 pub fn set_driver_control_files_uri<T: std::convert::Into<std::string::String>>(
10616 mut self,
10617 v: T,
10618 ) -> Self {
10619 self.driver_control_files_uri = v.into();
10620 self
10621 }
10622
10623 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
10625 where
10626 T: std::iter::IntoIterator<Item = (K, V)>,
10627 K: std::convert::Into<std::string::String>,
10628 V: std::convert::Into<std::string::String>,
10629 {
10630 use std::iter::Iterator;
10631 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10632 self
10633 }
10634
10635 pub fn set_scheduling<T>(mut self, v: T) -> Self
10637 where
10638 T: std::convert::Into<crate::model::JobScheduling>,
10639 {
10640 self.scheduling = std::option::Option::Some(v.into());
10641 self
10642 }
10643
10644 pub fn set_or_clear_scheduling<T>(mut self, v: std::option::Option<T>) -> Self
10646 where
10647 T: std::convert::Into<crate::model::JobScheduling>,
10648 {
10649 self.scheduling = v.map(|x| x.into());
10650 self
10651 }
10652
10653 pub fn set_job_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10655 self.job_uuid = v.into();
10656 self
10657 }
10658
10659 pub fn set_done<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10661 self.done = v.into();
10662 self
10663 }
10664
10665 pub fn set_driver_scheduling_config<T>(mut self, v: T) -> Self
10667 where
10668 T: std::convert::Into<crate::model::DriverSchedulingConfig>,
10669 {
10670 self.driver_scheduling_config = std::option::Option::Some(v.into());
10671 self
10672 }
10673
10674 pub fn set_or_clear_driver_scheduling_config<T>(mut self, v: std::option::Option<T>) -> Self
10676 where
10677 T: std::convert::Into<crate::model::DriverSchedulingConfig>,
10678 {
10679 self.driver_scheduling_config = v.map(|x| x.into());
10680 self
10681 }
10682
10683 pub fn set_type_job<T: std::convert::Into<std::option::Option<crate::model::job::TypeJob>>>(
10688 mut self,
10689 v: T,
10690 ) -> Self {
10691 self.type_job = v.into();
10692 self
10693 }
10694
10695 pub fn hadoop_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::HadoopJob>> {
10699 #[allow(unreachable_patterns)]
10700 self.type_job.as_ref().and_then(|v| match v {
10701 crate::model::job::TypeJob::HadoopJob(v) => std::option::Option::Some(v),
10702 _ => std::option::Option::None,
10703 })
10704 }
10705
10706 pub fn set_hadoop_job<T: std::convert::Into<std::boxed::Box<crate::model::HadoopJob>>>(
10712 mut self,
10713 v: T,
10714 ) -> Self {
10715 self.type_job = std::option::Option::Some(crate::model::job::TypeJob::HadoopJob(v.into()));
10716 self
10717 }
10718
10719 pub fn spark_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkJob>> {
10723 #[allow(unreachable_patterns)]
10724 self.type_job.as_ref().and_then(|v| match v {
10725 crate::model::job::TypeJob::SparkJob(v) => std::option::Option::Some(v),
10726 _ => std::option::Option::None,
10727 })
10728 }
10729
10730 pub fn set_spark_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkJob>>>(
10736 mut self,
10737 v: T,
10738 ) -> Self {
10739 self.type_job = std::option::Option::Some(crate::model::job::TypeJob::SparkJob(v.into()));
10740 self
10741 }
10742
10743 pub fn pyspark_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PySparkJob>> {
10747 #[allow(unreachable_patterns)]
10748 self.type_job.as_ref().and_then(|v| match v {
10749 crate::model::job::TypeJob::PysparkJob(v) => std::option::Option::Some(v),
10750 _ => std::option::Option::None,
10751 })
10752 }
10753
10754 pub fn set_pyspark_job<T: std::convert::Into<std::boxed::Box<crate::model::PySparkJob>>>(
10760 mut self,
10761 v: T,
10762 ) -> Self {
10763 self.type_job = std::option::Option::Some(crate::model::job::TypeJob::PysparkJob(v.into()));
10764 self
10765 }
10766
10767 pub fn hive_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::HiveJob>> {
10771 #[allow(unreachable_patterns)]
10772 self.type_job.as_ref().and_then(|v| match v {
10773 crate::model::job::TypeJob::HiveJob(v) => std::option::Option::Some(v),
10774 _ => std::option::Option::None,
10775 })
10776 }
10777
10778 pub fn set_hive_job<T: std::convert::Into<std::boxed::Box<crate::model::HiveJob>>>(
10784 mut self,
10785 v: T,
10786 ) -> Self {
10787 self.type_job = std::option::Option::Some(crate::model::job::TypeJob::HiveJob(v.into()));
10788 self
10789 }
10790
10791 pub fn pig_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PigJob>> {
10795 #[allow(unreachable_patterns)]
10796 self.type_job.as_ref().and_then(|v| match v {
10797 crate::model::job::TypeJob::PigJob(v) => std::option::Option::Some(v),
10798 _ => std::option::Option::None,
10799 })
10800 }
10801
10802 pub fn set_pig_job<T: std::convert::Into<std::boxed::Box<crate::model::PigJob>>>(
10808 mut self,
10809 v: T,
10810 ) -> Self {
10811 self.type_job = std::option::Option::Some(crate::model::job::TypeJob::PigJob(v.into()));
10812 self
10813 }
10814
10815 pub fn spark_r_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkRJob>> {
10819 #[allow(unreachable_patterns)]
10820 self.type_job.as_ref().and_then(|v| match v {
10821 crate::model::job::TypeJob::SparkRJob(v) => std::option::Option::Some(v),
10822 _ => std::option::Option::None,
10823 })
10824 }
10825
10826 pub fn set_spark_r_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkRJob>>>(
10832 mut self,
10833 v: T,
10834 ) -> Self {
10835 self.type_job = std::option::Option::Some(crate::model::job::TypeJob::SparkRJob(v.into()));
10836 self
10837 }
10838
10839 pub fn spark_sql_job(
10843 &self,
10844 ) -> std::option::Option<&std::boxed::Box<crate::model::SparkSqlJob>> {
10845 #[allow(unreachable_patterns)]
10846 self.type_job.as_ref().and_then(|v| match v {
10847 crate::model::job::TypeJob::SparkSqlJob(v) => std::option::Option::Some(v),
10848 _ => std::option::Option::None,
10849 })
10850 }
10851
10852 pub fn set_spark_sql_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkSqlJob>>>(
10858 mut self,
10859 v: T,
10860 ) -> Self {
10861 self.type_job =
10862 std::option::Option::Some(crate::model::job::TypeJob::SparkSqlJob(v.into()));
10863 self
10864 }
10865
10866 pub fn presto_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PrestoJob>> {
10870 #[allow(unreachable_patterns)]
10871 self.type_job.as_ref().and_then(|v| match v {
10872 crate::model::job::TypeJob::PrestoJob(v) => std::option::Option::Some(v),
10873 _ => std::option::Option::None,
10874 })
10875 }
10876
10877 pub fn set_presto_job<T: std::convert::Into<std::boxed::Box<crate::model::PrestoJob>>>(
10883 mut self,
10884 v: T,
10885 ) -> Self {
10886 self.type_job = std::option::Option::Some(crate::model::job::TypeJob::PrestoJob(v.into()));
10887 self
10888 }
10889
10890 pub fn trino_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::TrinoJob>> {
10894 #[allow(unreachable_patterns)]
10895 self.type_job.as_ref().and_then(|v| match v {
10896 crate::model::job::TypeJob::TrinoJob(v) => std::option::Option::Some(v),
10897 _ => std::option::Option::None,
10898 })
10899 }
10900
10901 pub fn set_trino_job<T: std::convert::Into<std::boxed::Box<crate::model::TrinoJob>>>(
10907 mut self,
10908 v: T,
10909 ) -> Self {
10910 self.type_job = std::option::Option::Some(crate::model::job::TypeJob::TrinoJob(v.into()));
10911 self
10912 }
10913
10914 pub fn flink_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::FlinkJob>> {
10918 #[allow(unreachable_patterns)]
10919 self.type_job.as_ref().and_then(|v| match v {
10920 crate::model::job::TypeJob::FlinkJob(v) => std::option::Option::Some(v),
10921 _ => std::option::Option::None,
10922 })
10923 }
10924
10925 pub fn set_flink_job<T: std::convert::Into<std::boxed::Box<crate::model::FlinkJob>>>(
10931 mut self,
10932 v: T,
10933 ) -> Self {
10934 self.type_job = std::option::Option::Some(crate::model::job::TypeJob::FlinkJob(v.into()));
10935 self
10936 }
10937}
10938
10939impl wkt::message::Message for Job {
10940 fn typename() -> &'static str {
10941 "type.googleapis.com/google.cloud.dataproc.v1.Job"
10942 }
10943}
10944
10945pub mod job {
10947 #[allow(unused_imports)]
10948 use super::*;
10949
10950 #[derive(Clone, Debug, PartialEq)]
10952 #[non_exhaustive]
10953 pub enum TypeJob {
10954 HadoopJob(std::boxed::Box<crate::model::HadoopJob>),
10956 SparkJob(std::boxed::Box<crate::model::SparkJob>),
10958 PysparkJob(std::boxed::Box<crate::model::PySparkJob>),
10960 HiveJob(std::boxed::Box<crate::model::HiveJob>),
10962 PigJob(std::boxed::Box<crate::model::PigJob>),
10964 SparkRJob(std::boxed::Box<crate::model::SparkRJob>),
10966 SparkSqlJob(std::boxed::Box<crate::model::SparkSqlJob>),
10968 PrestoJob(std::boxed::Box<crate::model::PrestoJob>),
10970 TrinoJob(std::boxed::Box<crate::model::TrinoJob>),
10972 FlinkJob(std::boxed::Box<crate::model::FlinkJob>),
10974 }
10975}
10976
10977#[derive(Clone, Default, PartialEq)]
10979#[non_exhaustive]
10980pub struct DriverSchedulingConfig {
10981 pub memory_mb: i32,
10983
10984 pub vcores: i32,
10986
10987 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10988}
10989
10990impl DriverSchedulingConfig {
10991 pub fn new() -> Self {
10992 std::default::Default::default()
10993 }
10994
10995 pub fn set_memory_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10997 self.memory_mb = v.into();
10998 self
10999 }
11000
11001 pub fn set_vcores<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11003 self.vcores = v.into();
11004 self
11005 }
11006}
11007
11008impl wkt::message::Message for DriverSchedulingConfig {
11009 fn typename() -> &'static str {
11010 "type.googleapis.com/google.cloud.dataproc.v1.DriverSchedulingConfig"
11011 }
11012}
11013
11014#[derive(Clone, Default, PartialEq)]
11016#[non_exhaustive]
11017pub struct JobScheduling {
11018 pub max_failures_per_hour: i32,
11031
11032 pub max_failures_total: i32,
11043
11044 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11045}
11046
11047impl JobScheduling {
11048 pub fn new() -> Self {
11049 std::default::Default::default()
11050 }
11051
11052 pub fn set_max_failures_per_hour<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11054 self.max_failures_per_hour = v.into();
11055 self
11056 }
11057
11058 pub fn set_max_failures_total<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11060 self.max_failures_total = v.into();
11061 self
11062 }
11063}
11064
11065impl wkt::message::Message for JobScheduling {
11066 fn typename() -> &'static str {
11067 "type.googleapis.com/google.cloud.dataproc.v1.JobScheduling"
11068 }
11069}
11070
11071#[derive(Clone, Default, PartialEq)]
11073#[non_exhaustive]
11074pub struct SubmitJobRequest {
11075 pub project_id: std::string::String,
11078
11079 pub region: std::string::String,
11081
11082 pub job: std::option::Option<crate::model::Job>,
11084
11085 pub request_id: std::string::String,
11100
11101 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11102}
11103
11104impl SubmitJobRequest {
11105 pub fn new() -> Self {
11106 std::default::Default::default()
11107 }
11108
11109 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11111 self.project_id = v.into();
11112 self
11113 }
11114
11115 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11117 self.region = v.into();
11118 self
11119 }
11120
11121 pub fn set_job<T>(mut self, v: T) -> Self
11123 where
11124 T: std::convert::Into<crate::model::Job>,
11125 {
11126 self.job = std::option::Option::Some(v.into());
11127 self
11128 }
11129
11130 pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
11132 where
11133 T: std::convert::Into<crate::model::Job>,
11134 {
11135 self.job = v.map(|x| x.into());
11136 self
11137 }
11138
11139 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11141 self.request_id = v.into();
11142 self
11143 }
11144}
11145
11146impl wkt::message::Message for SubmitJobRequest {
11147 fn typename() -> &'static str {
11148 "type.googleapis.com/google.cloud.dataproc.v1.SubmitJobRequest"
11149 }
11150}
11151
11152#[derive(Clone, Default, PartialEq)]
11154#[non_exhaustive]
11155pub struct JobMetadata {
11156 pub job_id: std::string::String,
11158
11159 pub status: std::option::Option<crate::model::JobStatus>,
11161
11162 pub operation_type: std::string::String,
11164
11165 pub start_time: std::option::Option<wkt::Timestamp>,
11167
11168 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11169}
11170
11171impl JobMetadata {
11172 pub fn new() -> Self {
11173 std::default::Default::default()
11174 }
11175
11176 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11178 self.job_id = v.into();
11179 self
11180 }
11181
11182 pub fn set_status<T>(mut self, v: T) -> Self
11184 where
11185 T: std::convert::Into<crate::model::JobStatus>,
11186 {
11187 self.status = std::option::Option::Some(v.into());
11188 self
11189 }
11190
11191 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
11193 where
11194 T: std::convert::Into<crate::model::JobStatus>,
11195 {
11196 self.status = v.map(|x| x.into());
11197 self
11198 }
11199
11200 pub fn set_operation_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11202 self.operation_type = v.into();
11203 self
11204 }
11205
11206 pub fn set_start_time<T>(mut self, v: T) -> Self
11208 where
11209 T: std::convert::Into<wkt::Timestamp>,
11210 {
11211 self.start_time = std::option::Option::Some(v.into());
11212 self
11213 }
11214
11215 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
11217 where
11218 T: std::convert::Into<wkt::Timestamp>,
11219 {
11220 self.start_time = v.map(|x| x.into());
11221 self
11222 }
11223}
11224
11225impl wkt::message::Message for JobMetadata {
11226 fn typename() -> &'static str {
11227 "type.googleapis.com/google.cloud.dataproc.v1.JobMetadata"
11228 }
11229}
11230
11231#[derive(Clone, Default, PartialEq)]
11233#[non_exhaustive]
11234pub struct GetJobRequest {
11235 pub project_id: std::string::String,
11238
11239 pub region: std::string::String,
11241
11242 pub job_id: std::string::String,
11244
11245 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11246}
11247
11248impl GetJobRequest {
11249 pub fn new() -> Self {
11250 std::default::Default::default()
11251 }
11252
11253 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11255 self.project_id = v.into();
11256 self
11257 }
11258
11259 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11261 self.region = v.into();
11262 self
11263 }
11264
11265 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11267 self.job_id = v.into();
11268 self
11269 }
11270}
11271
11272impl wkt::message::Message for GetJobRequest {
11273 fn typename() -> &'static str {
11274 "type.googleapis.com/google.cloud.dataproc.v1.GetJobRequest"
11275 }
11276}
11277
11278#[derive(Clone, Default, PartialEq)]
11280#[non_exhaustive]
11281pub struct ListJobsRequest {
11282 pub project_id: std::string::String,
11285
11286 pub region: std::string::String,
11288
11289 pub page_size: i32,
11291
11292 pub page_token: std::string::String,
11295
11296 pub cluster_name: std::string::String,
11299
11300 pub job_state_matcher: crate::model::list_jobs_request::JobStateMatcher,
11305
11306 pub filter: std::string::String,
11321
11322 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11323}
11324
11325impl ListJobsRequest {
11326 pub fn new() -> Self {
11327 std::default::Default::default()
11328 }
11329
11330 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11332 self.project_id = v.into();
11333 self
11334 }
11335
11336 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11338 self.region = v.into();
11339 self
11340 }
11341
11342 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11344 self.page_size = v.into();
11345 self
11346 }
11347
11348 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11350 self.page_token = v.into();
11351 self
11352 }
11353
11354 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11356 self.cluster_name = v.into();
11357 self
11358 }
11359
11360 pub fn set_job_state_matcher<
11362 T: std::convert::Into<crate::model::list_jobs_request::JobStateMatcher>,
11363 >(
11364 mut self,
11365 v: T,
11366 ) -> Self {
11367 self.job_state_matcher = v.into();
11368 self
11369 }
11370
11371 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11373 self.filter = v.into();
11374 self
11375 }
11376}
11377
11378impl wkt::message::Message for ListJobsRequest {
11379 fn typename() -> &'static str {
11380 "type.googleapis.com/google.cloud.dataproc.v1.ListJobsRequest"
11381 }
11382}
11383
11384pub mod list_jobs_request {
11386 #[allow(unused_imports)]
11387 use super::*;
11388
11389 #[derive(Clone, Debug, PartialEq)]
11405 #[non_exhaustive]
11406 pub enum JobStateMatcher {
11407 All,
11409 Active,
11412 NonActive,
11414 UnknownValue(job_state_matcher::UnknownValue),
11419 }
11420
11421 #[doc(hidden)]
11422 pub mod job_state_matcher {
11423 #[allow(unused_imports)]
11424 use super::*;
11425 #[derive(Clone, Debug, PartialEq)]
11426 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11427 }
11428
11429 impl JobStateMatcher {
11430 pub fn value(&self) -> std::option::Option<i32> {
11435 match self {
11436 Self::All => std::option::Option::Some(0),
11437 Self::Active => std::option::Option::Some(1),
11438 Self::NonActive => std::option::Option::Some(2),
11439 Self::UnknownValue(u) => u.0.value(),
11440 }
11441 }
11442
11443 pub fn name(&self) -> std::option::Option<&str> {
11448 match self {
11449 Self::All => std::option::Option::Some("ALL"),
11450 Self::Active => std::option::Option::Some("ACTIVE"),
11451 Self::NonActive => std::option::Option::Some("NON_ACTIVE"),
11452 Self::UnknownValue(u) => u.0.name(),
11453 }
11454 }
11455 }
11456
11457 impl std::default::Default for JobStateMatcher {
11458 fn default() -> Self {
11459 use std::convert::From;
11460 Self::from(0)
11461 }
11462 }
11463
11464 impl std::fmt::Display for JobStateMatcher {
11465 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11466 wkt::internal::display_enum(f, self.name(), self.value())
11467 }
11468 }
11469
11470 impl std::convert::From<i32> for JobStateMatcher {
11471 fn from(value: i32) -> Self {
11472 match value {
11473 0 => Self::All,
11474 1 => Self::Active,
11475 2 => Self::NonActive,
11476 _ => Self::UnknownValue(job_state_matcher::UnknownValue(
11477 wkt::internal::UnknownEnumValue::Integer(value),
11478 )),
11479 }
11480 }
11481 }
11482
11483 impl std::convert::From<&str> for JobStateMatcher {
11484 fn from(value: &str) -> Self {
11485 use std::string::ToString;
11486 match value {
11487 "ALL" => Self::All,
11488 "ACTIVE" => Self::Active,
11489 "NON_ACTIVE" => Self::NonActive,
11490 _ => Self::UnknownValue(job_state_matcher::UnknownValue(
11491 wkt::internal::UnknownEnumValue::String(value.to_string()),
11492 )),
11493 }
11494 }
11495 }
11496
11497 impl serde::ser::Serialize for JobStateMatcher {
11498 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11499 where
11500 S: serde::Serializer,
11501 {
11502 match self {
11503 Self::All => serializer.serialize_i32(0),
11504 Self::Active => serializer.serialize_i32(1),
11505 Self::NonActive => serializer.serialize_i32(2),
11506 Self::UnknownValue(u) => u.0.serialize(serializer),
11507 }
11508 }
11509 }
11510
11511 impl<'de> serde::de::Deserialize<'de> for JobStateMatcher {
11512 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11513 where
11514 D: serde::Deserializer<'de>,
11515 {
11516 deserializer.deserialize_any(wkt::internal::EnumVisitor::<JobStateMatcher>::new(
11517 ".google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher",
11518 ))
11519 }
11520 }
11521}
11522
11523#[derive(Clone, Default, PartialEq)]
11525#[non_exhaustive]
11526pub struct UpdateJobRequest {
11527 pub project_id: std::string::String,
11530
11531 pub region: std::string::String,
11533
11534 pub job_id: std::string::String,
11536
11537 pub job: std::option::Option<crate::model::Job>,
11539
11540 pub update_mask: std::option::Option<wkt::FieldMask>,
11547
11548 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11549}
11550
11551impl UpdateJobRequest {
11552 pub fn new() -> Self {
11553 std::default::Default::default()
11554 }
11555
11556 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11558 self.project_id = v.into();
11559 self
11560 }
11561
11562 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11564 self.region = v.into();
11565 self
11566 }
11567
11568 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11570 self.job_id = v.into();
11571 self
11572 }
11573
11574 pub fn set_job<T>(mut self, v: T) -> Self
11576 where
11577 T: std::convert::Into<crate::model::Job>,
11578 {
11579 self.job = std::option::Option::Some(v.into());
11580 self
11581 }
11582
11583 pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
11585 where
11586 T: std::convert::Into<crate::model::Job>,
11587 {
11588 self.job = v.map(|x| x.into());
11589 self
11590 }
11591
11592 pub fn set_update_mask<T>(mut self, v: T) -> Self
11594 where
11595 T: std::convert::Into<wkt::FieldMask>,
11596 {
11597 self.update_mask = std::option::Option::Some(v.into());
11598 self
11599 }
11600
11601 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11603 where
11604 T: std::convert::Into<wkt::FieldMask>,
11605 {
11606 self.update_mask = v.map(|x| x.into());
11607 self
11608 }
11609}
11610
11611impl wkt::message::Message for UpdateJobRequest {
11612 fn typename() -> &'static str {
11613 "type.googleapis.com/google.cloud.dataproc.v1.UpdateJobRequest"
11614 }
11615}
11616
11617#[derive(Clone, Default, PartialEq)]
11619#[non_exhaustive]
11620pub struct ListJobsResponse {
11621 pub jobs: std::vec::Vec<crate::model::Job>,
11623
11624 pub next_page_token: std::string::String,
11628
11629 pub unreachable: std::vec::Vec<std::string::String>,
11636
11637 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11638}
11639
11640impl ListJobsResponse {
11641 pub fn new() -> Self {
11642 std::default::Default::default()
11643 }
11644
11645 pub fn set_jobs<T, V>(mut self, v: T) -> Self
11647 where
11648 T: std::iter::IntoIterator<Item = V>,
11649 V: std::convert::Into<crate::model::Job>,
11650 {
11651 use std::iter::Iterator;
11652 self.jobs = v.into_iter().map(|i| i.into()).collect();
11653 self
11654 }
11655
11656 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11658 self.next_page_token = v.into();
11659 self
11660 }
11661
11662 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11664 where
11665 T: std::iter::IntoIterator<Item = V>,
11666 V: std::convert::Into<std::string::String>,
11667 {
11668 use std::iter::Iterator;
11669 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11670 self
11671 }
11672}
11673
11674impl wkt::message::Message for ListJobsResponse {
11675 fn typename() -> &'static str {
11676 "type.googleapis.com/google.cloud.dataproc.v1.ListJobsResponse"
11677 }
11678}
11679
11680#[doc(hidden)]
11681impl gax::paginator::internal::PageableResponse for ListJobsResponse {
11682 type PageItem = crate::model::Job;
11683
11684 fn items(self) -> std::vec::Vec<Self::PageItem> {
11685 self.jobs
11686 }
11687
11688 fn next_page_token(&self) -> std::string::String {
11689 use std::clone::Clone;
11690 self.next_page_token.clone()
11691 }
11692}
11693
11694#[derive(Clone, Default, PartialEq)]
11696#[non_exhaustive]
11697pub struct CancelJobRequest {
11698 pub project_id: std::string::String,
11701
11702 pub region: std::string::String,
11704
11705 pub job_id: std::string::String,
11707
11708 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11709}
11710
11711impl CancelJobRequest {
11712 pub fn new() -> Self {
11713 std::default::Default::default()
11714 }
11715
11716 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11718 self.project_id = v.into();
11719 self
11720 }
11721
11722 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11724 self.region = v.into();
11725 self
11726 }
11727
11728 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11730 self.job_id = v.into();
11731 self
11732 }
11733}
11734
11735impl wkt::message::Message for CancelJobRequest {
11736 fn typename() -> &'static str {
11737 "type.googleapis.com/google.cloud.dataproc.v1.CancelJobRequest"
11738 }
11739}
11740
11741#[derive(Clone, Default, PartialEq)]
11743#[non_exhaustive]
11744pub struct DeleteJobRequest {
11745 pub project_id: std::string::String,
11748
11749 pub region: std::string::String,
11751
11752 pub job_id: std::string::String,
11754
11755 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11756}
11757
11758impl DeleteJobRequest {
11759 pub fn new() -> Self {
11760 std::default::Default::default()
11761 }
11762
11763 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11765 self.project_id = v.into();
11766 self
11767 }
11768
11769 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11771 self.region = v.into();
11772 self
11773 }
11774
11775 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11777 self.job_id = v.into();
11778 self
11779 }
11780}
11781
11782impl wkt::message::Message for DeleteJobRequest {
11783 fn typename() -> &'static str {
11784 "type.googleapis.com/google.cloud.dataproc.v1.DeleteJobRequest"
11785 }
11786}
11787
11788#[derive(Clone, Default, PartialEq)]
11790#[non_exhaustive]
11791pub struct CreateNodeGroupRequest {
11792 pub parent: std::string::String,
11795
11796 pub node_group: std::option::Option<crate::model::NodeGroup>,
11798
11799 pub node_group_id: std::string::String,
11805
11806 pub request_id: std::string::String,
11821
11822 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11823}
11824
11825impl CreateNodeGroupRequest {
11826 pub fn new() -> Self {
11827 std::default::Default::default()
11828 }
11829
11830 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11832 self.parent = v.into();
11833 self
11834 }
11835
11836 pub fn set_node_group<T>(mut self, v: T) -> Self
11838 where
11839 T: std::convert::Into<crate::model::NodeGroup>,
11840 {
11841 self.node_group = std::option::Option::Some(v.into());
11842 self
11843 }
11844
11845 pub fn set_or_clear_node_group<T>(mut self, v: std::option::Option<T>) -> Self
11847 where
11848 T: std::convert::Into<crate::model::NodeGroup>,
11849 {
11850 self.node_group = v.map(|x| x.into());
11851 self
11852 }
11853
11854 pub fn set_node_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11856 self.node_group_id = v.into();
11857 self
11858 }
11859
11860 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11862 self.request_id = v.into();
11863 self
11864 }
11865}
11866
11867impl wkt::message::Message for CreateNodeGroupRequest {
11868 fn typename() -> &'static str {
11869 "type.googleapis.com/google.cloud.dataproc.v1.CreateNodeGroupRequest"
11870 }
11871}
11872
11873#[derive(Clone, Default, PartialEq)]
11875#[non_exhaustive]
11876pub struct ResizeNodeGroupRequest {
11877 pub name: std::string::String,
11881
11882 pub size: i32,
11886
11887 pub request_id: std::string::String,
11902
11903 pub graceful_decommission_timeout: std::option::Option<wkt::Duration>,
11916
11917 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11918}
11919
11920impl ResizeNodeGroupRequest {
11921 pub fn new() -> Self {
11922 std::default::Default::default()
11923 }
11924
11925 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11927 self.name = v.into();
11928 self
11929 }
11930
11931 pub fn set_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11933 self.size = v.into();
11934 self
11935 }
11936
11937 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11939 self.request_id = v.into();
11940 self
11941 }
11942
11943 pub fn set_graceful_decommission_timeout<T>(mut self, v: T) -> Self
11945 where
11946 T: std::convert::Into<wkt::Duration>,
11947 {
11948 self.graceful_decommission_timeout = std::option::Option::Some(v.into());
11949 self
11950 }
11951
11952 pub fn set_or_clear_graceful_decommission_timeout<T>(
11954 mut self,
11955 v: std::option::Option<T>,
11956 ) -> Self
11957 where
11958 T: std::convert::Into<wkt::Duration>,
11959 {
11960 self.graceful_decommission_timeout = v.map(|x| x.into());
11961 self
11962 }
11963}
11964
11965impl wkt::message::Message for ResizeNodeGroupRequest {
11966 fn typename() -> &'static str {
11967 "type.googleapis.com/google.cloud.dataproc.v1.ResizeNodeGroupRequest"
11968 }
11969}
11970
11971#[derive(Clone, Default, PartialEq)]
11973#[non_exhaustive]
11974pub struct GetNodeGroupRequest {
11975 pub name: std::string::String,
11979
11980 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11981}
11982
11983impl GetNodeGroupRequest {
11984 pub fn new() -> Self {
11985 std::default::Default::default()
11986 }
11987
11988 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11990 self.name = v.into();
11991 self
11992 }
11993}
11994
11995impl wkt::message::Message for GetNodeGroupRequest {
11996 fn typename() -> &'static str {
11997 "type.googleapis.com/google.cloud.dataproc.v1.GetNodeGroupRequest"
11998 }
11999}
12000
12001#[derive(Clone, Default, PartialEq)]
12003#[non_exhaustive]
12004pub struct BatchOperationMetadata {
12005 pub batch: std::string::String,
12007
12008 pub batch_uuid: std::string::String,
12010
12011 pub create_time: std::option::Option<wkt::Timestamp>,
12013
12014 pub done_time: std::option::Option<wkt::Timestamp>,
12016
12017 pub operation_type: crate::model::batch_operation_metadata::BatchOperationType,
12019
12020 pub description: std::string::String,
12022
12023 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12025
12026 pub warnings: std::vec::Vec<std::string::String>,
12028
12029 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12030}
12031
12032impl BatchOperationMetadata {
12033 pub fn new() -> Self {
12034 std::default::Default::default()
12035 }
12036
12037 pub fn set_batch<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12039 self.batch = v.into();
12040 self
12041 }
12042
12043 pub fn set_batch_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12045 self.batch_uuid = v.into();
12046 self
12047 }
12048
12049 pub fn set_create_time<T>(mut self, v: T) -> Self
12051 where
12052 T: std::convert::Into<wkt::Timestamp>,
12053 {
12054 self.create_time = std::option::Option::Some(v.into());
12055 self
12056 }
12057
12058 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12060 where
12061 T: std::convert::Into<wkt::Timestamp>,
12062 {
12063 self.create_time = v.map(|x| x.into());
12064 self
12065 }
12066
12067 pub fn set_done_time<T>(mut self, v: T) -> Self
12069 where
12070 T: std::convert::Into<wkt::Timestamp>,
12071 {
12072 self.done_time = std::option::Option::Some(v.into());
12073 self
12074 }
12075
12076 pub fn set_or_clear_done_time<T>(mut self, v: std::option::Option<T>) -> Self
12078 where
12079 T: std::convert::Into<wkt::Timestamp>,
12080 {
12081 self.done_time = v.map(|x| x.into());
12082 self
12083 }
12084
12085 pub fn set_operation_type<
12087 T: std::convert::Into<crate::model::batch_operation_metadata::BatchOperationType>,
12088 >(
12089 mut self,
12090 v: T,
12091 ) -> Self {
12092 self.operation_type = v.into();
12093 self
12094 }
12095
12096 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12098 self.description = v.into();
12099 self
12100 }
12101
12102 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12104 where
12105 T: std::iter::IntoIterator<Item = (K, V)>,
12106 K: std::convert::Into<std::string::String>,
12107 V: std::convert::Into<std::string::String>,
12108 {
12109 use std::iter::Iterator;
12110 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12111 self
12112 }
12113
12114 pub fn set_warnings<T, V>(mut self, v: T) -> Self
12116 where
12117 T: std::iter::IntoIterator<Item = V>,
12118 V: std::convert::Into<std::string::String>,
12119 {
12120 use std::iter::Iterator;
12121 self.warnings = v.into_iter().map(|i| i.into()).collect();
12122 self
12123 }
12124}
12125
12126impl wkt::message::Message for BatchOperationMetadata {
12127 fn typename() -> &'static str {
12128 "type.googleapis.com/google.cloud.dataproc.v1.BatchOperationMetadata"
12129 }
12130}
12131
12132pub mod batch_operation_metadata {
12134 #[allow(unused_imports)]
12135 use super::*;
12136
12137 #[derive(Clone, Debug, PartialEq)]
12153 #[non_exhaustive]
12154 pub enum BatchOperationType {
12155 Unspecified,
12157 Batch,
12159 UnknownValue(batch_operation_type::UnknownValue),
12164 }
12165
12166 #[doc(hidden)]
12167 pub mod batch_operation_type {
12168 #[allow(unused_imports)]
12169 use super::*;
12170 #[derive(Clone, Debug, PartialEq)]
12171 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12172 }
12173
12174 impl BatchOperationType {
12175 pub fn value(&self) -> std::option::Option<i32> {
12180 match self {
12181 Self::Unspecified => std::option::Option::Some(0),
12182 Self::Batch => std::option::Option::Some(1),
12183 Self::UnknownValue(u) => u.0.value(),
12184 }
12185 }
12186
12187 pub fn name(&self) -> std::option::Option<&str> {
12192 match self {
12193 Self::Unspecified => std::option::Option::Some("BATCH_OPERATION_TYPE_UNSPECIFIED"),
12194 Self::Batch => std::option::Option::Some("BATCH"),
12195 Self::UnknownValue(u) => u.0.name(),
12196 }
12197 }
12198 }
12199
12200 impl std::default::Default for BatchOperationType {
12201 fn default() -> Self {
12202 use std::convert::From;
12203 Self::from(0)
12204 }
12205 }
12206
12207 impl std::fmt::Display for BatchOperationType {
12208 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12209 wkt::internal::display_enum(f, self.name(), self.value())
12210 }
12211 }
12212
12213 impl std::convert::From<i32> for BatchOperationType {
12214 fn from(value: i32) -> Self {
12215 match value {
12216 0 => Self::Unspecified,
12217 1 => Self::Batch,
12218 _ => Self::UnknownValue(batch_operation_type::UnknownValue(
12219 wkt::internal::UnknownEnumValue::Integer(value),
12220 )),
12221 }
12222 }
12223 }
12224
12225 impl std::convert::From<&str> for BatchOperationType {
12226 fn from(value: &str) -> Self {
12227 use std::string::ToString;
12228 match value {
12229 "BATCH_OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
12230 "BATCH" => Self::Batch,
12231 _ => Self::UnknownValue(batch_operation_type::UnknownValue(
12232 wkt::internal::UnknownEnumValue::String(value.to_string()),
12233 )),
12234 }
12235 }
12236 }
12237
12238 impl serde::ser::Serialize for BatchOperationType {
12239 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12240 where
12241 S: serde::Serializer,
12242 {
12243 match self {
12244 Self::Unspecified => serializer.serialize_i32(0),
12245 Self::Batch => serializer.serialize_i32(1),
12246 Self::UnknownValue(u) => u.0.serialize(serializer),
12247 }
12248 }
12249 }
12250
12251 impl<'de> serde::de::Deserialize<'de> for BatchOperationType {
12252 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12253 where
12254 D: serde::Deserializer<'de>,
12255 {
12256 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BatchOperationType>::new(
12257 ".google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType",
12258 ))
12259 }
12260 }
12261}
12262
12263#[derive(Clone, Default, PartialEq)]
12265#[non_exhaustive]
12266pub struct SessionOperationMetadata {
12267 pub session: std::string::String,
12269
12270 pub session_uuid: std::string::String,
12272
12273 pub create_time: std::option::Option<wkt::Timestamp>,
12275
12276 pub done_time: std::option::Option<wkt::Timestamp>,
12278
12279 pub operation_type: crate::model::session_operation_metadata::SessionOperationType,
12281
12282 pub description: std::string::String,
12284
12285 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12287
12288 pub warnings: std::vec::Vec<std::string::String>,
12290
12291 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12292}
12293
12294impl SessionOperationMetadata {
12295 pub fn new() -> Self {
12296 std::default::Default::default()
12297 }
12298
12299 pub fn set_session<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12301 self.session = v.into();
12302 self
12303 }
12304
12305 pub fn set_session_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12307 self.session_uuid = v.into();
12308 self
12309 }
12310
12311 pub fn set_create_time<T>(mut self, v: T) -> Self
12313 where
12314 T: std::convert::Into<wkt::Timestamp>,
12315 {
12316 self.create_time = std::option::Option::Some(v.into());
12317 self
12318 }
12319
12320 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12322 where
12323 T: std::convert::Into<wkt::Timestamp>,
12324 {
12325 self.create_time = v.map(|x| x.into());
12326 self
12327 }
12328
12329 pub fn set_done_time<T>(mut self, v: T) -> Self
12331 where
12332 T: std::convert::Into<wkt::Timestamp>,
12333 {
12334 self.done_time = std::option::Option::Some(v.into());
12335 self
12336 }
12337
12338 pub fn set_or_clear_done_time<T>(mut self, v: std::option::Option<T>) -> Self
12340 where
12341 T: std::convert::Into<wkt::Timestamp>,
12342 {
12343 self.done_time = v.map(|x| x.into());
12344 self
12345 }
12346
12347 pub fn set_operation_type<
12349 T: std::convert::Into<crate::model::session_operation_metadata::SessionOperationType>,
12350 >(
12351 mut self,
12352 v: T,
12353 ) -> Self {
12354 self.operation_type = v.into();
12355 self
12356 }
12357
12358 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12360 self.description = v.into();
12361 self
12362 }
12363
12364 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12366 where
12367 T: std::iter::IntoIterator<Item = (K, V)>,
12368 K: std::convert::Into<std::string::String>,
12369 V: std::convert::Into<std::string::String>,
12370 {
12371 use std::iter::Iterator;
12372 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12373 self
12374 }
12375
12376 pub fn set_warnings<T, V>(mut self, v: T) -> Self
12378 where
12379 T: std::iter::IntoIterator<Item = V>,
12380 V: std::convert::Into<std::string::String>,
12381 {
12382 use std::iter::Iterator;
12383 self.warnings = v.into_iter().map(|i| i.into()).collect();
12384 self
12385 }
12386}
12387
12388impl wkt::message::Message for SessionOperationMetadata {
12389 fn typename() -> &'static str {
12390 "type.googleapis.com/google.cloud.dataproc.v1.SessionOperationMetadata"
12391 }
12392}
12393
12394pub mod session_operation_metadata {
12396 #[allow(unused_imports)]
12397 use super::*;
12398
12399 #[derive(Clone, Debug, PartialEq)]
12415 #[non_exhaustive]
12416 pub enum SessionOperationType {
12417 Unspecified,
12419 Create,
12421 Terminate,
12423 Delete,
12425 UnknownValue(session_operation_type::UnknownValue),
12430 }
12431
12432 #[doc(hidden)]
12433 pub mod session_operation_type {
12434 #[allow(unused_imports)]
12435 use super::*;
12436 #[derive(Clone, Debug, PartialEq)]
12437 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12438 }
12439
12440 impl SessionOperationType {
12441 pub fn value(&self) -> std::option::Option<i32> {
12446 match self {
12447 Self::Unspecified => std::option::Option::Some(0),
12448 Self::Create => std::option::Option::Some(1),
12449 Self::Terminate => std::option::Option::Some(2),
12450 Self::Delete => std::option::Option::Some(3),
12451 Self::UnknownValue(u) => u.0.value(),
12452 }
12453 }
12454
12455 pub fn name(&self) -> std::option::Option<&str> {
12460 match self {
12461 Self::Unspecified => {
12462 std::option::Option::Some("SESSION_OPERATION_TYPE_UNSPECIFIED")
12463 }
12464 Self::Create => std::option::Option::Some("CREATE"),
12465 Self::Terminate => std::option::Option::Some("TERMINATE"),
12466 Self::Delete => std::option::Option::Some("DELETE"),
12467 Self::UnknownValue(u) => u.0.name(),
12468 }
12469 }
12470 }
12471
12472 impl std::default::Default for SessionOperationType {
12473 fn default() -> Self {
12474 use std::convert::From;
12475 Self::from(0)
12476 }
12477 }
12478
12479 impl std::fmt::Display for SessionOperationType {
12480 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12481 wkt::internal::display_enum(f, self.name(), self.value())
12482 }
12483 }
12484
12485 impl std::convert::From<i32> for SessionOperationType {
12486 fn from(value: i32) -> Self {
12487 match value {
12488 0 => Self::Unspecified,
12489 1 => Self::Create,
12490 2 => Self::Terminate,
12491 3 => Self::Delete,
12492 _ => Self::UnknownValue(session_operation_type::UnknownValue(
12493 wkt::internal::UnknownEnumValue::Integer(value),
12494 )),
12495 }
12496 }
12497 }
12498
12499 impl std::convert::From<&str> for SessionOperationType {
12500 fn from(value: &str) -> Self {
12501 use std::string::ToString;
12502 match value {
12503 "SESSION_OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
12504 "CREATE" => Self::Create,
12505 "TERMINATE" => Self::Terminate,
12506 "DELETE" => Self::Delete,
12507 _ => Self::UnknownValue(session_operation_type::UnknownValue(
12508 wkt::internal::UnknownEnumValue::String(value.to_string()),
12509 )),
12510 }
12511 }
12512 }
12513
12514 impl serde::ser::Serialize for SessionOperationType {
12515 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12516 where
12517 S: serde::Serializer,
12518 {
12519 match self {
12520 Self::Unspecified => serializer.serialize_i32(0),
12521 Self::Create => serializer.serialize_i32(1),
12522 Self::Terminate => serializer.serialize_i32(2),
12523 Self::Delete => serializer.serialize_i32(3),
12524 Self::UnknownValue(u) => u.0.serialize(serializer),
12525 }
12526 }
12527 }
12528
12529 impl<'de> serde::de::Deserialize<'de> for SessionOperationType {
12530 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12531 where
12532 D: serde::Deserializer<'de>,
12533 {
12534 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SessionOperationType>::new(
12535 ".google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType",
12536 ))
12537 }
12538 }
12539}
12540
12541#[derive(Clone, Default, PartialEq)]
12543#[non_exhaustive]
12544pub struct ClusterOperationStatus {
12545 pub state: crate::model::cluster_operation_status::State,
12547
12548 pub inner_state: std::string::String,
12550
12551 pub details: std::string::String,
12553
12554 pub state_start_time: std::option::Option<wkt::Timestamp>,
12556
12557 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12558}
12559
12560impl ClusterOperationStatus {
12561 pub fn new() -> Self {
12562 std::default::Default::default()
12563 }
12564
12565 pub fn set_state<T: std::convert::Into<crate::model::cluster_operation_status::State>>(
12567 mut self,
12568 v: T,
12569 ) -> Self {
12570 self.state = v.into();
12571 self
12572 }
12573
12574 pub fn set_inner_state<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12576 self.inner_state = v.into();
12577 self
12578 }
12579
12580 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12582 self.details = v.into();
12583 self
12584 }
12585
12586 pub fn set_state_start_time<T>(mut self, v: T) -> Self
12588 where
12589 T: std::convert::Into<wkt::Timestamp>,
12590 {
12591 self.state_start_time = std::option::Option::Some(v.into());
12592 self
12593 }
12594
12595 pub fn set_or_clear_state_start_time<T>(mut self, v: std::option::Option<T>) -> Self
12597 where
12598 T: std::convert::Into<wkt::Timestamp>,
12599 {
12600 self.state_start_time = v.map(|x| x.into());
12601 self
12602 }
12603}
12604
12605impl wkt::message::Message for ClusterOperationStatus {
12606 fn typename() -> &'static str {
12607 "type.googleapis.com/google.cloud.dataproc.v1.ClusterOperationStatus"
12608 }
12609}
12610
12611pub mod cluster_operation_status {
12613 #[allow(unused_imports)]
12614 use super::*;
12615
12616 #[derive(Clone, Debug, PartialEq)]
12632 #[non_exhaustive]
12633 pub enum State {
12634 Unknown,
12636 Pending,
12638 Running,
12640 Done,
12642 UnknownValue(state::UnknownValue),
12647 }
12648
12649 #[doc(hidden)]
12650 pub mod state {
12651 #[allow(unused_imports)]
12652 use super::*;
12653 #[derive(Clone, Debug, PartialEq)]
12654 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12655 }
12656
12657 impl State {
12658 pub fn value(&self) -> std::option::Option<i32> {
12663 match self {
12664 Self::Unknown => std::option::Option::Some(0),
12665 Self::Pending => std::option::Option::Some(1),
12666 Self::Running => std::option::Option::Some(2),
12667 Self::Done => std::option::Option::Some(3),
12668 Self::UnknownValue(u) => u.0.value(),
12669 }
12670 }
12671
12672 pub fn name(&self) -> std::option::Option<&str> {
12677 match self {
12678 Self::Unknown => std::option::Option::Some("UNKNOWN"),
12679 Self::Pending => std::option::Option::Some("PENDING"),
12680 Self::Running => std::option::Option::Some("RUNNING"),
12681 Self::Done => std::option::Option::Some("DONE"),
12682 Self::UnknownValue(u) => u.0.name(),
12683 }
12684 }
12685 }
12686
12687 impl std::default::Default for State {
12688 fn default() -> Self {
12689 use std::convert::From;
12690 Self::from(0)
12691 }
12692 }
12693
12694 impl std::fmt::Display for State {
12695 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12696 wkt::internal::display_enum(f, self.name(), self.value())
12697 }
12698 }
12699
12700 impl std::convert::From<i32> for State {
12701 fn from(value: i32) -> Self {
12702 match value {
12703 0 => Self::Unknown,
12704 1 => Self::Pending,
12705 2 => Self::Running,
12706 3 => Self::Done,
12707 _ => Self::UnknownValue(state::UnknownValue(
12708 wkt::internal::UnknownEnumValue::Integer(value),
12709 )),
12710 }
12711 }
12712 }
12713
12714 impl std::convert::From<&str> for State {
12715 fn from(value: &str) -> Self {
12716 use std::string::ToString;
12717 match value {
12718 "UNKNOWN" => Self::Unknown,
12719 "PENDING" => Self::Pending,
12720 "RUNNING" => Self::Running,
12721 "DONE" => Self::Done,
12722 _ => Self::UnknownValue(state::UnknownValue(
12723 wkt::internal::UnknownEnumValue::String(value.to_string()),
12724 )),
12725 }
12726 }
12727 }
12728
12729 impl serde::ser::Serialize for State {
12730 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12731 where
12732 S: serde::Serializer,
12733 {
12734 match self {
12735 Self::Unknown => serializer.serialize_i32(0),
12736 Self::Pending => serializer.serialize_i32(1),
12737 Self::Running => serializer.serialize_i32(2),
12738 Self::Done => serializer.serialize_i32(3),
12739 Self::UnknownValue(u) => u.0.serialize(serializer),
12740 }
12741 }
12742 }
12743
12744 impl<'de> serde::de::Deserialize<'de> for State {
12745 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12746 where
12747 D: serde::Deserializer<'de>,
12748 {
12749 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12750 ".google.cloud.dataproc.v1.ClusterOperationStatus.State",
12751 ))
12752 }
12753 }
12754}
12755
12756#[derive(Clone, Default, PartialEq)]
12758#[non_exhaustive]
12759pub struct ClusterOperationMetadata {
12760 pub cluster_name: std::string::String,
12762
12763 pub cluster_uuid: std::string::String,
12765
12766 pub status: std::option::Option<crate::model::ClusterOperationStatus>,
12768
12769 pub status_history: std::vec::Vec<crate::model::ClusterOperationStatus>,
12771
12772 pub operation_type: std::string::String,
12774
12775 pub description: std::string::String,
12777
12778 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12780
12781 pub warnings: std::vec::Vec<std::string::String>,
12783
12784 pub child_operation_ids: std::vec::Vec<std::string::String>,
12786
12787 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12788}
12789
12790impl ClusterOperationMetadata {
12791 pub fn new() -> Self {
12792 std::default::Default::default()
12793 }
12794
12795 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12797 self.cluster_name = v.into();
12798 self
12799 }
12800
12801 pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12803 self.cluster_uuid = v.into();
12804 self
12805 }
12806
12807 pub fn set_status<T>(mut self, v: T) -> Self
12809 where
12810 T: std::convert::Into<crate::model::ClusterOperationStatus>,
12811 {
12812 self.status = std::option::Option::Some(v.into());
12813 self
12814 }
12815
12816 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
12818 where
12819 T: std::convert::Into<crate::model::ClusterOperationStatus>,
12820 {
12821 self.status = v.map(|x| x.into());
12822 self
12823 }
12824
12825 pub fn set_status_history<T, V>(mut self, v: T) -> Self
12827 where
12828 T: std::iter::IntoIterator<Item = V>,
12829 V: std::convert::Into<crate::model::ClusterOperationStatus>,
12830 {
12831 use std::iter::Iterator;
12832 self.status_history = v.into_iter().map(|i| i.into()).collect();
12833 self
12834 }
12835
12836 pub fn set_operation_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12838 self.operation_type = v.into();
12839 self
12840 }
12841
12842 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12844 self.description = v.into();
12845 self
12846 }
12847
12848 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12850 where
12851 T: std::iter::IntoIterator<Item = (K, V)>,
12852 K: std::convert::Into<std::string::String>,
12853 V: std::convert::Into<std::string::String>,
12854 {
12855 use std::iter::Iterator;
12856 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12857 self
12858 }
12859
12860 pub fn set_warnings<T, V>(mut self, v: T) -> Self
12862 where
12863 T: std::iter::IntoIterator<Item = V>,
12864 V: std::convert::Into<std::string::String>,
12865 {
12866 use std::iter::Iterator;
12867 self.warnings = v.into_iter().map(|i| i.into()).collect();
12868 self
12869 }
12870
12871 pub fn set_child_operation_ids<T, V>(mut self, v: T) -> Self
12873 where
12874 T: std::iter::IntoIterator<Item = V>,
12875 V: std::convert::Into<std::string::String>,
12876 {
12877 use std::iter::Iterator;
12878 self.child_operation_ids = v.into_iter().map(|i| i.into()).collect();
12879 self
12880 }
12881}
12882
12883impl wkt::message::Message for ClusterOperationMetadata {
12884 fn typename() -> &'static str {
12885 "type.googleapis.com/google.cloud.dataproc.v1.ClusterOperationMetadata"
12886 }
12887}
12888
12889#[derive(Clone, Default, PartialEq)]
12891#[non_exhaustive]
12892pub struct NodeGroupOperationMetadata {
12893 pub node_group_id: std::string::String,
12895
12896 pub cluster_uuid: std::string::String,
12898
12899 pub status: std::option::Option<crate::model::ClusterOperationStatus>,
12901
12902 pub status_history: std::vec::Vec<crate::model::ClusterOperationStatus>,
12904
12905 pub operation_type: crate::model::node_group_operation_metadata::NodeGroupOperationType,
12907
12908 pub description: std::string::String,
12910
12911 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12913
12914 pub warnings: std::vec::Vec<std::string::String>,
12916
12917 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12918}
12919
12920impl NodeGroupOperationMetadata {
12921 pub fn new() -> Self {
12922 std::default::Default::default()
12923 }
12924
12925 pub fn set_node_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12927 self.node_group_id = v.into();
12928 self
12929 }
12930
12931 pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12933 self.cluster_uuid = v.into();
12934 self
12935 }
12936
12937 pub fn set_status<T>(mut self, v: T) -> Self
12939 where
12940 T: std::convert::Into<crate::model::ClusterOperationStatus>,
12941 {
12942 self.status = std::option::Option::Some(v.into());
12943 self
12944 }
12945
12946 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
12948 where
12949 T: std::convert::Into<crate::model::ClusterOperationStatus>,
12950 {
12951 self.status = v.map(|x| x.into());
12952 self
12953 }
12954
12955 pub fn set_status_history<T, V>(mut self, v: T) -> Self
12957 where
12958 T: std::iter::IntoIterator<Item = V>,
12959 V: std::convert::Into<crate::model::ClusterOperationStatus>,
12960 {
12961 use std::iter::Iterator;
12962 self.status_history = v.into_iter().map(|i| i.into()).collect();
12963 self
12964 }
12965
12966 pub fn set_operation_type<
12968 T: std::convert::Into<crate::model::node_group_operation_metadata::NodeGroupOperationType>,
12969 >(
12970 mut self,
12971 v: T,
12972 ) -> Self {
12973 self.operation_type = v.into();
12974 self
12975 }
12976
12977 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12979 self.description = v.into();
12980 self
12981 }
12982
12983 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12985 where
12986 T: std::iter::IntoIterator<Item = (K, V)>,
12987 K: std::convert::Into<std::string::String>,
12988 V: std::convert::Into<std::string::String>,
12989 {
12990 use std::iter::Iterator;
12991 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12992 self
12993 }
12994
12995 pub fn set_warnings<T, V>(mut self, v: T) -> Self
12997 where
12998 T: std::iter::IntoIterator<Item = V>,
12999 V: std::convert::Into<std::string::String>,
13000 {
13001 use std::iter::Iterator;
13002 self.warnings = v.into_iter().map(|i| i.into()).collect();
13003 self
13004 }
13005}
13006
13007impl wkt::message::Message for NodeGroupOperationMetadata {
13008 fn typename() -> &'static str {
13009 "type.googleapis.com/google.cloud.dataproc.v1.NodeGroupOperationMetadata"
13010 }
13011}
13012
13013pub mod node_group_operation_metadata {
13015 #[allow(unused_imports)]
13016 use super::*;
13017
13018 #[derive(Clone, Debug, PartialEq)]
13034 #[non_exhaustive]
13035 pub enum NodeGroupOperationType {
13036 Unspecified,
13038 Create,
13040 Update,
13042 Delete,
13044 Resize,
13046 UnknownValue(node_group_operation_type::UnknownValue),
13051 }
13052
13053 #[doc(hidden)]
13054 pub mod node_group_operation_type {
13055 #[allow(unused_imports)]
13056 use super::*;
13057 #[derive(Clone, Debug, PartialEq)]
13058 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13059 }
13060
13061 impl NodeGroupOperationType {
13062 pub fn value(&self) -> std::option::Option<i32> {
13067 match self {
13068 Self::Unspecified => std::option::Option::Some(0),
13069 Self::Create => std::option::Option::Some(1),
13070 Self::Update => std::option::Option::Some(2),
13071 Self::Delete => std::option::Option::Some(3),
13072 Self::Resize => std::option::Option::Some(4),
13073 Self::UnknownValue(u) => u.0.value(),
13074 }
13075 }
13076
13077 pub fn name(&self) -> std::option::Option<&str> {
13082 match self {
13083 Self::Unspecified => {
13084 std::option::Option::Some("NODE_GROUP_OPERATION_TYPE_UNSPECIFIED")
13085 }
13086 Self::Create => std::option::Option::Some("CREATE"),
13087 Self::Update => std::option::Option::Some("UPDATE"),
13088 Self::Delete => std::option::Option::Some("DELETE"),
13089 Self::Resize => std::option::Option::Some("RESIZE"),
13090 Self::UnknownValue(u) => u.0.name(),
13091 }
13092 }
13093 }
13094
13095 impl std::default::Default for NodeGroupOperationType {
13096 fn default() -> Self {
13097 use std::convert::From;
13098 Self::from(0)
13099 }
13100 }
13101
13102 impl std::fmt::Display for NodeGroupOperationType {
13103 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13104 wkt::internal::display_enum(f, self.name(), self.value())
13105 }
13106 }
13107
13108 impl std::convert::From<i32> for NodeGroupOperationType {
13109 fn from(value: i32) -> Self {
13110 match value {
13111 0 => Self::Unspecified,
13112 1 => Self::Create,
13113 2 => Self::Update,
13114 3 => Self::Delete,
13115 4 => Self::Resize,
13116 _ => Self::UnknownValue(node_group_operation_type::UnknownValue(
13117 wkt::internal::UnknownEnumValue::Integer(value),
13118 )),
13119 }
13120 }
13121 }
13122
13123 impl std::convert::From<&str> for NodeGroupOperationType {
13124 fn from(value: &str) -> Self {
13125 use std::string::ToString;
13126 match value {
13127 "NODE_GROUP_OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
13128 "CREATE" => Self::Create,
13129 "UPDATE" => Self::Update,
13130 "DELETE" => Self::Delete,
13131 "RESIZE" => Self::Resize,
13132 _ => Self::UnknownValue(node_group_operation_type::UnknownValue(
13133 wkt::internal::UnknownEnumValue::String(value.to_string()),
13134 )),
13135 }
13136 }
13137 }
13138
13139 impl serde::ser::Serialize for NodeGroupOperationType {
13140 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13141 where
13142 S: serde::Serializer,
13143 {
13144 match self {
13145 Self::Unspecified => serializer.serialize_i32(0),
13146 Self::Create => serializer.serialize_i32(1),
13147 Self::Update => serializer.serialize_i32(2),
13148 Self::Delete => serializer.serialize_i32(3),
13149 Self::Resize => serializer.serialize_i32(4),
13150 Self::UnknownValue(u) => u.0.serialize(serializer),
13151 }
13152 }
13153 }
13154
13155 impl<'de> serde::de::Deserialize<'de> for NodeGroupOperationType {
13156 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13157 where
13158 D: serde::Deserializer<'de>,
13159 {
13160 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NodeGroupOperationType>::new(
13161 ".google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType",
13162 ))
13163 }
13164 }
13165}
13166
13167#[derive(Clone, Default, PartialEq)]
13169#[non_exhaustive]
13170pub struct CreateSessionTemplateRequest {
13171 pub parent: std::string::String,
13173
13174 pub session_template: std::option::Option<crate::model::SessionTemplate>,
13176
13177 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13178}
13179
13180impl CreateSessionTemplateRequest {
13181 pub fn new() -> Self {
13182 std::default::Default::default()
13183 }
13184
13185 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13187 self.parent = v.into();
13188 self
13189 }
13190
13191 pub fn set_session_template<T>(mut self, v: T) -> Self
13193 where
13194 T: std::convert::Into<crate::model::SessionTemplate>,
13195 {
13196 self.session_template = std::option::Option::Some(v.into());
13197 self
13198 }
13199
13200 pub fn set_or_clear_session_template<T>(mut self, v: std::option::Option<T>) -> Self
13202 where
13203 T: std::convert::Into<crate::model::SessionTemplate>,
13204 {
13205 self.session_template = v.map(|x| x.into());
13206 self
13207 }
13208}
13209
13210impl wkt::message::Message for CreateSessionTemplateRequest {
13211 fn typename() -> &'static str {
13212 "type.googleapis.com/google.cloud.dataproc.v1.CreateSessionTemplateRequest"
13213 }
13214}
13215
13216#[derive(Clone, Default, PartialEq)]
13218#[non_exhaustive]
13219pub struct UpdateSessionTemplateRequest {
13220 pub session_template: std::option::Option<crate::model::SessionTemplate>,
13222
13223 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13224}
13225
13226impl UpdateSessionTemplateRequest {
13227 pub fn new() -> Self {
13228 std::default::Default::default()
13229 }
13230
13231 pub fn set_session_template<T>(mut self, v: T) -> Self
13233 where
13234 T: std::convert::Into<crate::model::SessionTemplate>,
13235 {
13236 self.session_template = std::option::Option::Some(v.into());
13237 self
13238 }
13239
13240 pub fn set_or_clear_session_template<T>(mut self, v: std::option::Option<T>) -> Self
13242 where
13243 T: std::convert::Into<crate::model::SessionTemplate>,
13244 {
13245 self.session_template = v.map(|x| x.into());
13246 self
13247 }
13248}
13249
13250impl wkt::message::Message for UpdateSessionTemplateRequest {
13251 fn typename() -> &'static str {
13252 "type.googleapis.com/google.cloud.dataproc.v1.UpdateSessionTemplateRequest"
13253 }
13254}
13255
13256#[derive(Clone, Default, PartialEq)]
13258#[non_exhaustive]
13259pub struct GetSessionTemplateRequest {
13260 pub name: std::string::String,
13262
13263 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13264}
13265
13266impl GetSessionTemplateRequest {
13267 pub fn new() -> Self {
13268 std::default::Default::default()
13269 }
13270
13271 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13273 self.name = v.into();
13274 self
13275 }
13276}
13277
13278impl wkt::message::Message for GetSessionTemplateRequest {
13279 fn typename() -> &'static str {
13280 "type.googleapis.com/google.cloud.dataproc.v1.GetSessionTemplateRequest"
13281 }
13282}
13283
13284#[derive(Clone, Default, PartialEq)]
13286#[non_exhaustive]
13287pub struct ListSessionTemplatesRequest {
13288 pub parent: std::string::String,
13290
13291 pub page_size: i32,
13294
13295 pub page_token: std::string::String,
13298
13299 pub filter: std::string::String,
13304
13305 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13306}
13307
13308impl ListSessionTemplatesRequest {
13309 pub fn new() -> Self {
13310 std::default::Default::default()
13311 }
13312
13313 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13315 self.parent = v.into();
13316 self
13317 }
13318
13319 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13321 self.page_size = v.into();
13322 self
13323 }
13324
13325 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13327 self.page_token = v.into();
13328 self
13329 }
13330
13331 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13333 self.filter = v.into();
13334 self
13335 }
13336}
13337
13338impl wkt::message::Message for ListSessionTemplatesRequest {
13339 fn typename() -> &'static str {
13340 "type.googleapis.com/google.cloud.dataproc.v1.ListSessionTemplatesRequest"
13341 }
13342}
13343
13344#[derive(Clone, Default, PartialEq)]
13346#[non_exhaustive]
13347pub struct ListSessionTemplatesResponse {
13348 pub session_templates: std::vec::Vec<crate::model::SessionTemplate>,
13350
13351 pub next_page_token: std::string::String,
13354
13355 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13356}
13357
13358impl ListSessionTemplatesResponse {
13359 pub fn new() -> Self {
13360 std::default::Default::default()
13361 }
13362
13363 pub fn set_session_templates<T, V>(mut self, v: T) -> Self
13365 where
13366 T: std::iter::IntoIterator<Item = V>,
13367 V: std::convert::Into<crate::model::SessionTemplate>,
13368 {
13369 use std::iter::Iterator;
13370 self.session_templates = v.into_iter().map(|i| i.into()).collect();
13371 self
13372 }
13373
13374 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13376 self.next_page_token = v.into();
13377 self
13378 }
13379}
13380
13381impl wkt::message::Message for ListSessionTemplatesResponse {
13382 fn typename() -> &'static str {
13383 "type.googleapis.com/google.cloud.dataproc.v1.ListSessionTemplatesResponse"
13384 }
13385}
13386
13387#[doc(hidden)]
13388impl gax::paginator::internal::PageableResponse for ListSessionTemplatesResponse {
13389 type PageItem = crate::model::SessionTemplate;
13390
13391 fn items(self) -> std::vec::Vec<Self::PageItem> {
13392 self.session_templates
13393 }
13394
13395 fn next_page_token(&self) -> std::string::String {
13396 use std::clone::Clone;
13397 self.next_page_token.clone()
13398 }
13399}
13400
13401#[derive(Clone, Default, PartialEq)]
13403#[non_exhaustive]
13404pub struct DeleteSessionTemplateRequest {
13405 pub name: std::string::String,
13407
13408 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13409}
13410
13411impl DeleteSessionTemplateRequest {
13412 pub fn new() -> Self {
13413 std::default::Default::default()
13414 }
13415
13416 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13418 self.name = v.into();
13419 self
13420 }
13421}
13422
13423impl wkt::message::Message for DeleteSessionTemplateRequest {
13424 fn typename() -> &'static str {
13425 "type.googleapis.com/google.cloud.dataproc.v1.DeleteSessionTemplateRequest"
13426 }
13427}
13428
13429#[derive(Clone, Default, PartialEq)]
13431#[non_exhaustive]
13432pub struct SessionTemplate {
13433 pub name: std::string::String,
13435
13436 pub description: std::string::String,
13438
13439 pub create_time: std::option::Option<wkt::Timestamp>,
13441
13442 pub creator: std::string::String,
13444
13445 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
13453
13454 pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
13456
13457 pub environment_config: std::option::Option<crate::model::EnvironmentConfig>,
13459
13460 pub update_time: std::option::Option<wkt::Timestamp>,
13462
13463 pub uuid: std::string::String,
13466
13467 pub session_config: std::option::Option<crate::model::session_template::SessionConfig>,
13469
13470 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13471}
13472
13473impl SessionTemplate {
13474 pub fn new() -> Self {
13475 std::default::Default::default()
13476 }
13477
13478 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13480 self.name = v.into();
13481 self
13482 }
13483
13484 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13486 self.description = v.into();
13487 self
13488 }
13489
13490 pub fn set_create_time<T>(mut self, v: T) -> Self
13492 where
13493 T: std::convert::Into<wkt::Timestamp>,
13494 {
13495 self.create_time = std::option::Option::Some(v.into());
13496 self
13497 }
13498
13499 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13501 where
13502 T: std::convert::Into<wkt::Timestamp>,
13503 {
13504 self.create_time = v.map(|x| x.into());
13505 self
13506 }
13507
13508 pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13510 self.creator = v.into();
13511 self
13512 }
13513
13514 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13516 where
13517 T: std::iter::IntoIterator<Item = (K, V)>,
13518 K: std::convert::Into<std::string::String>,
13519 V: std::convert::Into<std::string::String>,
13520 {
13521 use std::iter::Iterator;
13522 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13523 self
13524 }
13525
13526 pub fn set_runtime_config<T>(mut self, v: T) -> Self
13528 where
13529 T: std::convert::Into<crate::model::RuntimeConfig>,
13530 {
13531 self.runtime_config = std::option::Option::Some(v.into());
13532 self
13533 }
13534
13535 pub fn set_or_clear_runtime_config<T>(mut self, v: std::option::Option<T>) -> Self
13537 where
13538 T: std::convert::Into<crate::model::RuntimeConfig>,
13539 {
13540 self.runtime_config = v.map(|x| x.into());
13541 self
13542 }
13543
13544 pub fn set_environment_config<T>(mut self, v: T) -> Self
13546 where
13547 T: std::convert::Into<crate::model::EnvironmentConfig>,
13548 {
13549 self.environment_config = std::option::Option::Some(v.into());
13550 self
13551 }
13552
13553 pub fn set_or_clear_environment_config<T>(mut self, v: std::option::Option<T>) -> Self
13555 where
13556 T: std::convert::Into<crate::model::EnvironmentConfig>,
13557 {
13558 self.environment_config = v.map(|x| x.into());
13559 self
13560 }
13561
13562 pub fn set_update_time<T>(mut self, v: T) -> Self
13564 where
13565 T: std::convert::Into<wkt::Timestamp>,
13566 {
13567 self.update_time = std::option::Option::Some(v.into());
13568 self
13569 }
13570
13571 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13573 where
13574 T: std::convert::Into<wkt::Timestamp>,
13575 {
13576 self.update_time = v.map(|x| x.into());
13577 self
13578 }
13579
13580 pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13582 self.uuid = v.into();
13583 self
13584 }
13585
13586 pub fn set_session_config<
13591 T: std::convert::Into<std::option::Option<crate::model::session_template::SessionConfig>>,
13592 >(
13593 mut self,
13594 v: T,
13595 ) -> Self {
13596 self.session_config = v.into();
13597 self
13598 }
13599
13600 pub fn jupyter_session(
13604 &self,
13605 ) -> std::option::Option<&std::boxed::Box<crate::model::JupyterConfig>> {
13606 #[allow(unreachable_patterns)]
13607 self.session_config.as_ref().and_then(|v| match v {
13608 crate::model::session_template::SessionConfig::JupyterSession(v) => {
13609 std::option::Option::Some(v)
13610 }
13611 _ => std::option::Option::None,
13612 })
13613 }
13614
13615 pub fn set_jupyter_session<
13621 T: std::convert::Into<std::boxed::Box<crate::model::JupyterConfig>>,
13622 >(
13623 mut self,
13624 v: T,
13625 ) -> Self {
13626 self.session_config = std::option::Option::Some(
13627 crate::model::session_template::SessionConfig::JupyterSession(v.into()),
13628 );
13629 self
13630 }
13631
13632 pub fn spark_connect_session(
13636 &self,
13637 ) -> std::option::Option<&std::boxed::Box<crate::model::SparkConnectConfig>> {
13638 #[allow(unreachable_patterns)]
13639 self.session_config.as_ref().and_then(|v| match v {
13640 crate::model::session_template::SessionConfig::SparkConnectSession(v) => {
13641 std::option::Option::Some(v)
13642 }
13643 _ => std::option::Option::None,
13644 })
13645 }
13646
13647 pub fn set_spark_connect_session<
13653 T: std::convert::Into<std::boxed::Box<crate::model::SparkConnectConfig>>,
13654 >(
13655 mut self,
13656 v: T,
13657 ) -> Self {
13658 self.session_config = std::option::Option::Some(
13659 crate::model::session_template::SessionConfig::SparkConnectSession(v.into()),
13660 );
13661 self
13662 }
13663}
13664
13665impl wkt::message::Message for SessionTemplate {
13666 fn typename() -> &'static str {
13667 "type.googleapis.com/google.cloud.dataproc.v1.SessionTemplate"
13668 }
13669}
13670
13671pub mod session_template {
13673 #[allow(unused_imports)]
13674 use super::*;
13675
13676 #[derive(Clone, Debug, PartialEq)]
13678 #[non_exhaustive]
13679 pub enum SessionConfig {
13680 JupyterSession(std::boxed::Box<crate::model::JupyterConfig>),
13682 SparkConnectSession(std::boxed::Box<crate::model::SparkConnectConfig>),
13684 }
13685}
13686
13687#[derive(Clone, Default, PartialEq)]
13689#[non_exhaustive]
13690pub struct CreateSessionRequest {
13691 pub parent: std::string::String,
13693
13694 pub session: std::option::Option<crate::model::Session>,
13696
13697 pub session_id: std::string::String,
13703
13704 pub request_id: std::string::String,
13719
13720 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13721}
13722
13723impl CreateSessionRequest {
13724 pub fn new() -> Self {
13725 std::default::Default::default()
13726 }
13727
13728 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13730 self.parent = v.into();
13731 self
13732 }
13733
13734 pub fn set_session<T>(mut self, v: T) -> Self
13736 where
13737 T: std::convert::Into<crate::model::Session>,
13738 {
13739 self.session = std::option::Option::Some(v.into());
13740 self
13741 }
13742
13743 pub fn set_or_clear_session<T>(mut self, v: std::option::Option<T>) -> Self
13745 where
13746 T: std::convert::Into<crate::model::Session>,
13747 {
13748 self.session = v.map(|x| x.into());
13749 self
13750 }
13751
13752 pub fn set_session_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13754 self.session_id = v.into();
13755 self
13756 }
13757
13758 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13760 self.request_id = v.into();
13761 self
13762 }
13763}
13764
13765impl wkt::message::Message for CreateSessionRequest {
13766 fn typename() -> &'static str {
13767 "type.googleapis.com/google.cloud.dataproc.v1.CreateSessionRequest"
13768 }
13769}
13770
13771#[derive(Clone, Default, PartialEq)]
13773#[non_exhaustive]
13774pub struct GetSessionRequest {
13775 pub name: std::string::String,
13777
13778 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13779}
13780
13781impl GetSessionRequest {
13782 pub fn new() -> Self {
13783 std::default::Default::default()
13784 }
13785
13786 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13788 self.name = v.into();
13789 self
13790 }
13791}
13792
13793impl wkt::message::Message for GetSessionRequest {
13794 fn typename() -> &'static str {
13795 "type.googleapis.com/google.cloud.dataproc.v1.GetSessionRequest"
13796 }
13797}
13798
13799#[derive(Clone, Default, PartialEq)]
13801#[non_exhaustive]
13802pub struct ListSessionsRequest {
13803 pub parent: std::string::String,
13805
13806 pub page_size: i32,
13809
13810 pub page_token: std::string::String,
13813
13814 pub filter: std::string::String,
13830
13831 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13832}
13833
13834impl ListSessionsRequest {
13835 pub fn new() -> Self {
13836 std::default::Default::default()
13837 }
13838
13839 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13841 self.parent = v.into();
13842 self
13843 }
13844
13845 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13847 self.page_size = v.into();
13848 self
13849 }
13850
13851 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13853 self.page_token = v.into();
13854 self
13855 }
13856
13857 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13859 self.filter = v.into();
13860 self
13861 }
13862}
13863
13864impl wkt::message::Message for ListSessionsRequest {
13865 fn typename() -> &'static str {
13866 "type.googleapis.com/google.cloud.dataproc.v1.ListSessionsRequest"
13867 }
13868}
13869
13870#[derive(Clone, Default, PartialEq)]
13872#[non_exhaustive]
13873pub struct ListSessionsResponse {
13874 pub sessions: std::vec::Vec<crate::model::Session>,
13876
13877 pub next_page_token: std::string::String,
13880
13881 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13882}
13883
13884impl ListSessionsResponse {
13885 pub fn new() -> Self {
13886 std::default::Default::default()
13887 }
13888
13889 pub fn set_sessions<T, V>(mut self, v: T) -> Self
13891 where
13892 T: std::iter::IntoIterator<Item = V>,
13893 V: std::convert::Into<crate::model::Session>,
13894 {
13895 use std::iter::Iterator;
13896 self.sessions = v.into_iter().map(|i| i.into()).collect();
13897 self
13898 }
13899
13900 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13902 self.next_page_token = v.into();
13903 self
13904 }
13905}
13906
13907impl wkt::message::Message for ListSessionsResponse {
13908 fn typename() -> &'static str {
13909 "type.googleapis.com/google.cloud.dataproc.v1.ListSessionsResponse"
13910 }
13911}
13912
13913#[doc(hidden)]
13914impl gax::paginator::internal::PageableResponse for ListSessionsResponse {
13915 type PageItem = crate::model::Session;
13916
13917 fn items(self) -> std::vec::Vec<Self::PageItem> {
13918 self.sessions
13919 }
13920
13921 fn next_page_token(&self) -> std::string::String {
13922 use std::clone::Clone;
13923 self.next_page_token.clone()
13924 }
13925}
13926
13927#[derive(Clone, Default, PartialEq)]
13929#[non_exhaustive]
13930pub struct TerminateSessionRequest {
13931 pub name: std::string::String,
13933
13934 pub request_id: std::string::String,
13945
13946 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13947}
13948
13949impl TerminateSessionRequest {
13950 pub fn new() -> Self {
13951 std::default::Default::default()
13952 }
13953
13954 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13956 self.name = v.into();
13957 self
13958 }
13959
13960 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13962 self.request_id = v.into();
13963 self
13964 }
13965}
13966
13967impl wkt::message::Message for TerminateSessionRequest {
13968 fn typename() -> &'static str {
13969 "type.googleapis.com/google.cloud.dataproc.v1.TerminateSessionRequest"
13970 }
13971}
13972
13973#[derive(Clone, Default, PartialEq)]
13975#[non_exhaustive]
13976pub struct DeleteSessionRequest {
13977 pub name: std::string::String,
13979
13980 pub request_id: std::string::String,
13991
13992 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13993}
13994
13995impl DeleteSessionRequest {
13996 pub fn new() -> Self {
13997 std::default::Default::default()
13998 }
13999
14000 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14002 self.name = v.into();
14003 self
14004 }
14005
14006 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14008 self.request_id = v.into();
14009 self
14010 }
14011}
14012
14013impl wkt::message::Message for DeleteSessionRequest {
14014 fn typename() -> &'static str {
14015 "type.googleapis.com/google.cloud.dataproc.v1.DeleteSessionRequest"
14016 }
14017}
14018
14019#[derive(Clone, Default, PartialEq)]
14021#[non_exhaustive]
14022pub struct Session {
14023 pub name: std::string::String,
14025
14026 pub uuid: std::string::String,
14029
14030 pub create_time: std::option::Option<wkt::Timestamp>,
14032
14033 pub runtime_info: std::option::Option<crate::model::RuntimeInfo>,
14035
14036 pub state: crate::model::session::State,
14038
14039 pub state_message: std::string::String,
14042
14043 pub state_time: std::option::Option<wkt::Timestamp>,
14045
14046 pub creator: std::string::String,
14048
14049 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
14057
14058 pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
14060
14061 pub environment_config: std::option::Option<crate::model::EnvironmentConfig>,
14063
14064 pub user: std::string::String,
14066
14067 pub state_history: std::vec::Vec<crate::model::session::SessionStateHistory>,
14069
14070 pub session_template: std::string::String,
14082
14083 pub session_config: std::option::Option<crate::model::session::SessionConfig>,
14085
14086 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14087}
14088
14089impl Session {
14090 pub fn new() -> Self {
14091 std::default::Default::default()
14092 }
14093
14094 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14096 self.name = v.into();
14097 self
14098 }
14099
14100 pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14102 self.uuid = v.into();
14103 self
14104 }
14105
14106 pub fn set_create_time<T>(mut self, v: T) -> Self
14108 where
14109 T: std::convert::Into<wkt::Timestamp>,
14110 {
14111 self.create_time = std::option::Option::Some(v.into());
14112 self
14113 }
14114
14115 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14117 where
14118 T: std::convert::Into<wkt::Timestamp>,
14119 {
14120 self.create_time = v.map(|x| x.into());
14121 self
14122 }
14123
14124 pub fn set_runtime_info<T>(mut self, v: T) -> Self
14126 where
14127 T: std::convert::Into<crate::model::RuntimeInfo>,
14128 {
14129 self.runtime_info = std::option::Option::Some(v.into());
14130 self
14131 }
14132
14133 pub fn set_or_clear_runtime_info<T>(mut self, v: std::option::Option<T>) -> Self
14135 where
14136 T: std::convert::Into<crate::model::RuntimeInfo>,
14137 {
14138 self.runtime_info = v.map(|x| x.into());
14139 self
14140 }
14141
14142 pub fn set_state<T: std::convert::Into<crate::model::session::State>>(mut self, v: T) -> Self {
14144 self.state = v.into();
14145 self
14146 }
14147
14148 pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14150 self.state_message = v.into();
14151 self
14152 }
14153
14154 pub fn set_state_time<T>(mut self, v: T) -> Self
14156 where
14157 T: std::convert::Into<wkt::Timestamp>,
14158 {
14159 self.state_time = std::option::Option::Some(v.into());
14160 self
14161 }
14162
14163 pub fn set_or_clear_state_time<T>(mut self, v: std::option::Option<T>) -> Self
14165 where
14166 T: std::convert::Into<wkt::Timestamp>,
14167 {
14168 self.state_time = v.map(|x| x.into());
14169 self
14170 }
14171
14172 pub fn set_creator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14174 self.creator = v.into();
14175 self
14176 }
14177
14178 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
14180 where
14181 T: std::iter::IntoIterator<Item = (K, V)>,
14182 K: std::convert::Into<std::string::String>,
14183 V: std::convert::Into<std::string::String>,
14184 {
14185 use std::iter::Iterator;
14186 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14187 self
14188 }
14189
14190 pub fn set_runtime_config<T>(mut self, v: T) -> Self
14192 where
14193 T: std::convert::Into<crate::model::RuntimeConfig>,
14194 {
14195 self.runtime_config = std::option::Option::Some(v.into());
14196 self
14197 }
14198
14199 pub fn set_or_clear_runtime_config<T>(mut self, v: std::option::Option<T>) -> Self
14201 where
14202 T: std::convert::Into<crate::model::RuntimeConfig>,
14203 {
14204 self.runtime_config = v.map(|x| x.into());
14205 self
14206 }
14207
14208 pub fn set_environment_config<T>(mut self, v: T) -> Self
14210 where
14211 T: std::convert::Into<crate::model::EnvironmentConfig>,
14212 {
14213 self.environment_config = std::option::Option::Some(v.into());
14214 self
14215 }
14216
14217 pub fn set_or_clear_environment_config<T>(mut self, v: std::option::Option<T>) -> Self
14219 where
14220 T: std::convert::Into<crate::model::EnvironmentConfig>,
14221 {
14222 self.environment_config = v.map(|x| x.into());
14223 self
14224 }
14225
14226 pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14228 self.user = v.into();
14229 self
14230 }
14231
14232 pub fn set_state_history<T, V>(mut self, v: T) -> Self
14234 where
14235 T: std::iter::IntoIterator<Item = V>,
14236 V: std::convert::Into<crate::model::session::SessionStateHistory>,
14237 {
14238 use std::iter::Iterator;
14239 self.state_history = v.into_iter().map(|i| i.into()).collect();
14240 self
14241 }
14242
14243 pub fn set_session_template<T: std::convert::Into<std::string::String>>(
14245 mut self,
14246 v: T,
14247 ) -> Self {
14248 self.session_template = v.into();
14249 self
14250 }
14251
14252 pub fn set_session_config<
14257 T: std::convert::Into<std::option::Option<crate::model::session::SessionConfig>>,
14258 >(
14259 mut self,
14260 v: T,
14261 ) -> Self {
14262 self.session_config = v.into();
14263 self
14264 }
14265
14266 pub fn jupyter_session(
14270 &self,
14271 ) -> std::option::Option<&std::boxed::Box<crate::model::JupyterConfig>> {
14272 #[allow(unreachable_patterns)]
14273 self.session_config.as_ref().and_then(|v| match v {
14274 crate::model::session::SessionConfig::JupyterSession(v) => std::option::Option::Some(v),
14275 _ => std::option::Option::None,
14276 })
14277 }
14278
14279 pub fn set_jupyter_session<
14285 T: std::convert::Into<std::boxed::Box<crate::model::JupyterConfig>>,
14286 >(
14287 mut self,
14288 v: T,
14289 ) -> Self {
14290 self.session_config = std::option::Option::Some(
14291 crate::model::session::SessionConfig::JupyterSession(v.into()),
14292 );
14293 self
14294 }
14295
14296 pub fn spark_connect_session(
14300 &self,
14301 ) -> std::option::Option<&std::boxed::Box<crate::model::SparkConnectConfig>> {
14302 #[allow(unreachable_patterns)]
14303 self.session_config.as_ref().and_then(|v| match v {
14304 crate::model::session::SessionConfig::SparkConnectSession(v) => {
14305 std::option::Option::Some(v)
14306 }
14307 _ => std::option::Option::None,
14308 })
14309 }
14310
14311 pub fn set_spark_connect_session<
14317 T: std::convert::Into<std::boxed::Box<crate::model::SparkConnectConfig>>,
14318 >(
14319 mut self,
14320 v: T,
14321 ) -> Self {
14322 self.session_config = std::option::Option::Some(
14323 crate::model::session::SessionConfig::SparkConnectSession(v.into()),
14324 );
14325 self
14326 }
14327}
14328
14329impl wkt::message::Message for Session {
14330 fn typename() -> &'static str {
14331 "type.googleapis.com/google.cloud.dataproc.v1.Session"
14332 }
14333}
14334
14335pub mod session {
14337 #[allow(unused_imports)]
14338 use super::*;
14339
14340 #[derive(Clone, Default, PartialEq)]
14342 #[non_exhaustive]
14343 pub struct SessionStateHistory {
14344 pub state: crate::model::session::State,
14347
14348 pub state_message: std::string::String,
14351
14352 pub state_start_time: std::option::Option<wkt::Timestamp>,
14354
14355 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14356 }
14357
14358 impl SessionStateHistory {
14359 pub fn new() -> Self {
14360 std::default::Default::default()
14361 }
14362
14363 pub fn set_state<T: std::convert::Into<crate::model::session::State>>(
14365 mut self,
14366 v: T,
14367 ) -> Self {
14368 self.state = v.into();
14369 self
14370 }
14371
14372 pub fn set_state_message<T: std::convert::Into<std::string::String>>(
14374 mut self,
14375 v: T,
14376 ) -> Self {
14377 self.state_message = v.into();
14378 self
14379 }
14380
14381 pub fn set_state_start_time<T>(mut self, v: T) -> Self
14383 where
14384 T: std::convert::Into<wkt::Timestamp>,
14385 {
14386 self.state_start_time = std::option::Option::Some(v.into());
14387 self
14388 }
14389
14390 pub fn set_or_clear_state_start_time<T>(mut self, v: std::option::Option<T>) -> Self
14392 where
14393 T: std::convert::Into<wkt::Timestamp>,
14394 {
14395 self.state_start_time = v.map(|x| x.into());
14396 self
14397 }
14398 }
14399
14400 impl wkt::message::Message for SessionStateHistory {
14401 fn typename() -> &'static str {
14402 "type.googleapis.com/google.cloud.dataproc.v1.Session.SessionStateHistory"
14403 }
14404 }
14405
14406 #[derive(Clone, Debug, PartialEq)]
14422 #[non_exhaustive]
14423 pub enum State {
14424 Unspecified,
14426 Creating,
14428 Active,
14430 Terminating,
14432 Terminated,
14434 Failed,
14436 UnknownValue(state::UnknownValue),
14441 }
14442
14443 #[doc(hidden)]
14444 pub mod state {
14445 #[allow(unused_imports)]
14446 use super::*;
14447 #[derive(Clone, Debug, PartialEq)]
14448 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14449 }
14450
14451 impl State {
14452 pub fn value(&self) -> std::option::Option<i32> {
14457 match self {
14458 Self::Unspecified => std::option::Option::Some(0),
14459 Self::Creating => std::option::Option::Some(1),
14460 Self::Active => std::option::Option::Some(2),
14461 Self::Terminating => std::option::Option::Some(3),
14462 Self::Terminated => std::option::Option::Some(4),
14463 Self::Failed => std::option::Option::Some(5),
14464 Self::UnknownValue(u) => u.0.value(),
14465 }
14466 }
14467
14468 pub fn name(&self) -> std::option::Option<&str> {
14473 match self {
14474 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14475 Self::Creating => std::option::Option::Some("CREATING"),
14476 Self::Active => std::option::Option::Some("ACTIVE"),
14477 Self::Terminating => std::option::Option::Some("TERMINATING"),
14478 Self::Terminated => std::option::Option::Some("TERMINATED"),
14479 Self::Failed => std::option::Option::Some("FAILED"),
14480 Self::UnknownValue(u) => u.0.name(),
14481 }
14482 }
14483 }
14484
14485 impl std::default::Default for State {
14486 fn default() -> Self {
14487 use std::convert::From;
14488 Self::from(0)
14489 }
14490 }
14491
14492 impl std::fmt::Display for State {
14493 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14494 wkt::internal::display_enum(f, self.name(), self.value())
14495 }
14496 }
14497
14498 impl std::convert::From<i32> for State {
14499 fn from(value: i32) -> Self {
14500 match value {
14501 0 => Self::Unspecified,
14502 1 => Self::Creating,
14503 2 => Self::Active,
14504 3 => Self::Terminating,
14505 4 => Self::Terminated,
14506 5 => Self::Failed,
14507 _ => Self::UnknownValue(state::UnknownValue(
14508 wkt::internal::UnknownEnumValue::Integer(value),
14509 )),
14510 }
14511 }
14512 }
14513
14514 impl std::convert::From<&str> for State {
14515 fn from(value: &str) -> Self {
14516 use std::string::ToString;
14517 match value {
14518 "STATE_UNSPECIFIED" => Self::Unspecified,
14519 "CREATING" => Self::Creating,
14520 "ACTIVE" => Self::Active,
14521 "TERMINATING" => Self::Terminating,
14522 "TERMINATED" => Self::Terminated,
14523 "FAILED" => Self::Failed,
14524 _ => Self::UnknownValue(state::UnknownValue(
14525 wkt::internal::UnknownEnumValue::String(value.to_string()),
14526 )),
14527 }
14528 }
14529 }
14530
14531 impl serde::ser::Serialize for State {
14532 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14533 where
14534 S: serde::Serializer,
14535 {
14536 match self {
14537 Self::Unspecified => serializer.serialize_i32(0),
14538 Self::Creating => serializer.serialize_i32(1),
14539 Self::Active => serializer.serialize_i32(2),
14540 Self::Terminating => serializer.serialize_i32(3),
14541 Self::Terminated => serializer.serialize_i32(4),
14542 Self::Failed => serializer.serialize_i32(5),
14543 Self::UnknownValue(u) => u.0.serialize(serializer),
14544 }
14545 }
14546 }
14547
14548 impl<'de> serde::de::Deserialize<'de> for State {
14549 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14550 where
14551 D: serde::Deserializer<'de>,
14552 {
14553 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14554 ".google.cloud.dataproc.v1.Session.State",
14555 ))
14556 }
14557 }
14558
14559 #[derive(Clone, Debug, PartialEq)]
14561 #[non_exhaustive]
14562 pub enum SessionConfig {
14563 JupyterSession(std::boxed::Box<crate::model::JupyterConfig>),
14565 SparkConnectSession(std::boxed::Box<crate::model::SparkConnectConfig>),
14567 }
14568}
14569
14570#[derive(Clone, Default, PartialEq)]
14572#[non_exhaustive]
14573pub struct JupyterConfig {
14574 pub kernel: crate::model::jupyter_config::Kernel,
14576
14577 pub display_name: std::string::String,
14579
14580 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14581}
14582
14583impl JupyterConfig {
14584 pub fn new() -> Self {
14585 std::default::Default::default()
14586 }
14587
14588 pub fn set_kernel<T: std::convert::Into<crate::model::jupyter_config::Kernel>>(
14590 mut self,
14591 v: T,
14592 ) -> Self {
14593 self.kernel = v.into();
14594 self
14595 }
14596
14597 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14599 self.display_name = v.into();
14600 self
14601 }
14602}
14603
14604impl wkt::message::Message for JupyterConfig {
14605 fn typename() -> &'static str {
14606 "type.googleapis.com/google.cloud.dataproc.v1.JupyterConfig"
14607 }
14608}
14609
14610pub mod jupyter_config {
14612 #[allow(unused_imports)]
14613 use super::*;
14614
14615 #[derive(Clone, Debug, PartialEq)]
14631 #[non_exhaustive]
14632 pub enum Kernel {
14633 Unspecified,
14635 Python,
14637 Scala,
14639 UnknownValue(kernel::UnknownValue),
14644 }
14645
14646 #[doc(hidden)]
14647 pub mod kernel {
14648 #[allow(unused_imports)]
14649 use super::*;
14650 #[derive(Clone, Debug, PartialEq)]
14651 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14652 }
14653
14654 impl Kernel {
14655 pub fn value(&self) -> std::option::Option<i32> {
14660 match self {
14661 Self::Unspecified => std::option::Option::Some(0),
14662 Self::Python => std::option::Option::Some(1),
14663 Self::Scala => std::option::Option::Some(2),
14664 Self::UnknownValue(u) => u.0.value(),
14665 }
14666 }
14667
14668 pub fn name(&self) -> std::option::Option<&str> {
14673 match self {
14674 Self::Unspecified => std::option::Option::Some("KERNEL_UNSPECIFIED"),
14675 Self::Python => std::option::Option::Some("PYTHON"),
14676 Self::Scala => std::option::Option::Some("SCALA"),
14677 Self::UnknownValue(u) => u.0.name(),
14678 }
14679 }
14680 }
14681
14682 impl std::default::Default for Kernel {
14683 fn default() -> Self {
14684 use std::convert::From;
14685 Self::from(0)
14686 }
14687 }
14688
14689 impl std::fmt::Display for Kernel {
14690 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14691 wkt::internal::display_enum(f, self.name(), self.value())
14692 }
14693 }
14694
14695 impl std::convert::From<i32> for Kernel {
14696 fn from(value: i32) -> Self {
14697 match value {
14698 0 => Self::Unspecified,
14699 1 => Self::Python,
14700 2 => Self::Scala,
14701 _ => Self::UnknownValue(kernel::UnknownValue(
14702 wkt::internal::UnknownEnumValue::Integer(value),
14703 )),
14704 }
14705 }
14706 }
14707
14708 impl std::convert::From<&str> for Kernel {
14709 fn from(value: &str) -> Self {
14710 use std::string::ToString;
14711 match value {
14712 "KERNEL_UNSPECIFIED" => Self::Unspecified,
14713 "PYTHON" => Self::Python,
14714 "SCALA" => Self::Scala,
14715 _ => Self::UnknownValue(kernel::UnknownValue(
14716 wkt::internal::UnknownEnumValue::String(value.to_string()),
14717 )),
14718 }
14719 }
14720 }
14721
14722 impl serde::ser::Serialize for Kernel {
14723 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14724 where
14725 S: serde::Serializer,
14726 {
14727 match self {
14728 Self::Unspecified => serializer.serialize_i32(0),
14729 Self::Python => serializer.serialize_i32(1),
14730 Self::Scala => serializer.serialize_i32(2),
14731 Self::UnknownValue(u) => u.0.serialize(serializer),
14732 }
14733 }
14734 }
14735
14736 impl<'de> serde::de::Deserialize<'de> for Kernel {
14737 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14738 where
14739 D: serde::Deserializer<'de>,
14740 {
14741 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Kernel>::new(
14742 ".google.cloud.dataproc.v1.JupyterConfig.Kernel",
14743 ))
14744 }
14745 }
14746}
14747
14748#[derive(Clone, Default, PartialEq)]
14750#[non_exhaustive]
14751pub struct SparkConnectConfig {
14752 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14753}
14754
14755impl SparkConnectConfig {
14756 pub fn new() -> Self {
14757 std::default::Default::default()
14758 }
14759}
14760
14761impl wkt::message::Message for SparkConnectConfig {
14762 fn typename() -> &'static str {
14763 "type.googleapis.com/google.cloud.dataproc.v1.SparkConnectConfig"
14764 }
14765}
14766
14767#[derive(Clone, Default, PartialEq)]
14769#[non_exhaustive]
14770pub struct RuntimeConfig {
14771 pub version: std::string::String,
14773
14774 pub container_image: std::string::String,
14777
14778 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
14781
14782 pub repository_config: std::option::Option<crate::model::RepositoryConfig>,
14784
14785 pub autotuning_config: std::option::Option<crate::model::AutotuningConfig>,
14787
14788 pub cohort: std::string::String,
14791
14792 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14793}
14794
14795impl RuntimeConfig {
14796 pub fn new() -> Self {
14797 std::default::Default::default()
14798 }
14799
14800 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14802 self.version = v.into();
14803 self
14804 }
14805
14806 pub fn set_container_image<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14808 self.container_image = v.into();
14809 self
14810 }
14811
14812 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
14814 where
14815 T: std::iter::IntoIterator<Item = (K, V)>,
14816 K: std::convert::Into<std::string::String>,
14817 V: std::convert::Into<std::string::String>,
14818 {
14819 use std::iter::Iterator;
14820 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14821 self
14822 }
14823
14824 pub fn set_repository_config<T>(mut self, v: T) -> Self
14826 where
14827 T: std::convert::Into<crate::model::RepositoryConfig>,
14828 {
14829 self.repository_config = std::option::Option::Some(v.into());
14830 self
14831 }
14832
14833 pub fn set_or_clear_repository_config<T>(mut self, v: std::option::Option<T>) -> Self
14835 where
14836 T: std::convert::Into<crate::model::RepositoryConfig>,
14837 {
14838 self.repository_config = v.map(|x| x.into());
14839 self
14840 }
14841
14842 pub fn set_autotuning_config<T>(mut self, v: T) -> Self
14844 where
14845 T: std::convert::Into<crate::model::AutotuningConfig>,
14846 {
14847 self.autotuning_config = std::option::Option::Some(v.into());
14848 self
14849 }
14850
14851 pub fn set_or_clear_autotuning_config<T>(mut self, v: std::option::Option<T>) -> Self
14853 where
14854 T: std::convert::Into<crate::model::AutotuningConfig>,
14855 {
14856 self.autotuning_config = v.map(|x| x.into());
14857 self
14858 }
14859
14860 pub fn set_cohort<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14862 self.cohort = v.into();
14863 self
14864 }
14865}
14866
14867impl wkt::message::Message for RuntimeConfig {
14868 fn typename() -> &'static str {
14869 "type.googleapis.com/google.cloud.dataproc.v1.RuntimeConfig"
14870 }
14871}
14872
14873#[derive(Clone, Default, PartialEq)]
14875#[non_exhaustive]
14876pub struct EnvironmentConfig {
14877 pub execution_config: std::option::Option<crate::model::ExecutionConfig>,
14879
14880 pub peripherals_config: std::option::Option<crate::model::PeripheralsConfig>,
14882
14883 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14884}
14885
14886impl EnvironmentConfig {
14887 pub fn new() -> Self {
14888 std::default::Default::default()
14889 }
14890
14891 pub fn set_execution_config<T>(mut self, v: T) -> Self
14893 where
14894 T: std::convert::Into<crate::model::ExecutionConfig>,
14895 {
14896 self.execution_config = std::option::Option::Some(v.into());
14897 self
14898 }
14899
14900 pub fn set_or_clear_execution_config<T>(mut self, v: std::option::Option<T>) -> Self
14902 where
14903 T: std::convert::Into<crate::model::ExecutionConfig>,
14904 {
14905 self.execution_config = v.map(|x| x.into());
14906 self
14907 }
14908
14909 pub fn set_peripherals_config<T>(mut self, v: T) -> Self
14911 where
14912 T: std::convert::Into<crate::model::PeripheralsConfig>,
14913 {
14914 self.peripherals_config = std::option::Option::Some(v.into());
14915 self
14916 }
14917
14918 pub fn set_or_clear_peripherals_config<T>(mut self, v: std::option::Option<T>) -> Self
14920 where
14921 T: std::convert::Into<crate::model::PeripheralsConfig>,
14922 {
14923 self.peripherals_config = v.map(|x| x.into());
14924 self
14925 }
14926}
14927
14928impl wkt::message::Message for EnvironmentConfig {
14929 fn typename() -> &'static str {
14930 "type.googleapis.com/google.cloud.dataproc.v1.EnvironmentConfig"
14931 }
14932}
14933
14934#[derive(Clone, Default, PartialEq)]
14936#[non_exhaustive]
14937pub struct ExecutionConfig {
14938 pub service_account: std::string::String,
14940
14941 pub network_tags: std::vec::Vec<std::string::String>,
14943
14944 pub kms_key: std::string::String,
14946
14947 pub idle_ttl: std::option::Option<wkt::Duration>,
14958
14959 pub ttl: std::option::Option<wkt::Duration>,
14974
14975 pub staging_bucket: std::string::String,
14984
14985 pub authentication_config: std::option::Option<crate::model::AuthenticationConfig>,
14990
14991 pub network: std::option::Option<crate::model::execution_config::Network>,
14993
14994 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14995}
14996
14997impl ExecutionConfig {
14998 pub fn new() -> Self {
14999 std::default::Default::default()
15000 }
15001
15002 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15004 self.service_account = v.into();
15005 self
15006 }
15007
15008 pub fn set_network_tags<T, V>(mut self, v: T) -> Self
15010 where
15011 T: std::iter::IntoIterator<Item = V>,
15012 V: std::convert::Into<std::string::String>,
15013 {
15014 use std::iter::Iterator;
15015 self.network_tags = v.into_iter().map(|i| i.into()).collect();
15016 self
15017 }
15018
15019 pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15021 self.kms_key = v.into();
15022 self
15023 }
15024
15025 pub fn set_idle_ttl<T>(mut self, v: T) -> Self
15027 where
15028 T: std::convert::Into<wkt::Duration>,
15029 {
15030 self.idle_ttl = std::option::Option::Some(v.into());
15031 self
15032 }
15033
15034 pub fn set_or_clear_idle_ttl<T>(mut self, v: std::option::Option<T>) -> Self
15036 where
15037 T: std::convert::Into<wkt::Duration>,
15038 {
15039 self.idle_ttl = v.map(|x| x.into());
15040 self
15041 }
15042
15043 pub fn set_ttl<T>(mut self, v: T) -> Self
15045 where
15046 T: std::convert::Into<wkt::Duration>,
15047 {
15048 self.ttl = std::option::Option::Some(v.into());
15049 self
15050 }
15051
15052 pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
15054 where
15055 T: std::convert::Into<wkt::Duration>,
15056 {
15057 self.ttl = v.map(|x| x.into());
15058 self
15059 }
15060
15061 pub fn set_staging_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15063 self.staging_bucket = v.into();
15064 self
15065 }
15066
15067 pub fn set_authentication_config<T>(mut self, v: T) -> Self
15069 where
15070 T: std::convert::Into<crate::model::AuthenticationConfig>,
15071 {
15072 self.authentication_config = std::option::Option::Some(v.into());
15073 self
15074 }
15075
15076 pub fn set_or_clear_authentication_config<T>(mut self, v: std::option::Option<T>) -> Self
15078 where
15079 T: std::convert::Into<crate::model::AuthenticationConfig>,
15080 {
15081 self.authentication_config = v.map(|x| x.into());
15082 self
15083 }
15084
15085 pub fn set_network<
15090 T: std::convert::Into<std::option::Option<crate::model::execution_config::Network>>,
15091 >(
15092 mut self,
15093 v: T,
15094 ) -> Self {
15095 self.network = v.into();
15096 self
15097 }
15098
15099 pub fn network_uri(&self) -> std::option::Option<&std::string::String> {
15103 #[allow(unreachable_patterns)]
15104 self.network.as_ref().and_then(|v| match v {
15105 crate::model::execution_config::Network::NetworkUri(v) => std::option::Option::Some(v),
15106 _ => std::option::Option::None,
15107 })
15108 }
15109
15110 pub fn set_network_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15116 self.network = std::option::Option::Some(
15117 crate::model::execution_config::Network::NetworkUri(v.into()),
15118 );
15119 self
15120 }
15121
15122 pub fn subnetwork_uri(&self) -> std::option::Option<&std::string::String> {
15126 #[allow(unreachable_patterns)]
15127 self.network.as_ref().and_then(|v| match v {
15128 crate::model::execution_config::Network::SubnetworkUri(v) => {
15129 std::option::Option::Some(v)
15130 }
15131 _ => std::option::Option::None,
15132 })
15133 }
15134
15135 pub fn set_subnetwork_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15141 self.network = std::option::Option::Some(
15142 crate::model::execution_config::Network::SubnetworkUri(v.into()),
15143 );
15144 self
15145 }
15146}
15147
15148impl wkt::message::Message for ExecutionConfig {
15149 fn typename() -> &'static str {
15150 "type.googleapis.com/google.cloud.dataproc.v1.ExecutionConfig"
15151 }
15152}
15153
15154pub mod execution_config {
15156 #[allow(unused_imports)]
15157 use super::*;
15158
15159 #[derive(Clone, Debug, PartialEq)]
15161 #[non_exhaustive]
15162 pub enum Network {
15163 NetworkUri(std::string::String),
15165 SubnetworkUri(std::string::String),
15167 }
15168}
15169
15170#[derive(Clone, Default, PartialEq)]
15172#[non_exhaustive]
15173pub struct SparkHistoryServerConfig {
15174 pub dataproc_cluster: std::string::String,
15181
15182 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15183}
15184
15185impl SparkHistoryServerConfig {
15186 pub fn new() -> Self {
15187 std::default::Default::default()
15188 }
15189
15190 pub fn set_dataproc_cluster<T: std::convert::Into<std::string::String>>(
15192 mut self,
15193 v: T,
15194 ) -> Self {
15195 self.dataproc_cluster = v.into();
15196 self
15197 }
15198}
15199
15200impl wkt::message::Message for SparkHistoryServerConfig {
15201 fn typename() -> &'static str {
15202 "type.googleapis.com/google.cloud.dataproc.v1.SparkHistoryServerConfig"
15203 }
15204}
15205
15206#[derive(Clone, Default, PartialEq)]
15208#[non_exhaustive]
15209pub struct PeripheralsConfig {
15210 pub metastore_service: std::string::String,
15216
15217 pub spark_history_server_config: std::option::Option<crate::model::SparkHistoryServerConfig>,
15219
15220 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15221}
15222
15223impl PeripheralsConfig {
15224 pub fn new() -> Self {
15225 std::default::Default::default()
15226 }
15227
15228 pub fn set_metastore_service<T: std::convert::Into<std::string::String>>(
15230 mut self,
15231 v: T,
15232 ) -> Self {
15233 self.metastore_service = v.into();
15234 self
15235 }
15236
15237 pub fn set_spark_history_server_config<T>(mut self, v: T) -> Self
15239 where
15240 T: std::convert::Into<crate::model::SparkHistoryServerConfig>,
15241 {
15242 self.spark_history_server_config = std::option::Option::Some(v.into());
15243 self
15244 }
15245
15246 pub fn set_or_clear_spark_history_server_config<T>(mut self, v: std::option::Option<T>) -> Self
15248 where
15249 T: std::convert::Into<crate::model::SparkHistoryServerConfig>,
15250 {
15251 self.spark_history_server_config = v.map(|x| x.into());
15252 self
15253 }
15254}
15255
15256impl wkt::message::Message for PeripheralsConfig {
15257 fn typename() -> &'static str {
15258 "type.googleapis.com/google.cloud.dataproc.v1.PeripheralsConfig"
15259 }
15260}
15261
15262#[derive(Clone, Default, PartialEq)]
15264#[non_exhaustive]
15265pub struct RuntimeInfo {
15266 pub endpoints: std::collections::HashMap<std::string::String, std::string::String>,
15269
15270 pub output_uri: std::string::String,
15273
15274 pub diagnostic_output_uri: std::string::String,
15276
15277 pub approximate_usage: std::option::Option<crate::model::UsageMetrics>,
15289
15290 pub current_usage: std::option::Option<crate::model::UsageSnapshot>,
15292
15293 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15294}
15295
15296impl RuntimeInfo {
15297 pub fn new() -> Self {
15298 std::default::Default::default()
15299 }
15300
15301 pub fn set_endpoints<T, K, V>(mut self, v: T) -> Self
15303 where
15304 T: std::iter::IntoIterator<Item = (K, V)>,
15305 K: std::convert::Into<std::string::String>,
15306 V: std::convert::Into<std::string::String>,
15307 {
15308 use std::iter::Iterator;
15309 self.endpoints = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15310 self
15311 }
15312
15313 pub fn set_output_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15315 self.output_uri = v.into();
15316 self
15317 }
15318
15319 pub fn set_diagnostic_output_uri<T: std::convert::Into<std::string::String>>(
15321 mut self,
15322 v: T,
15323 ) -> Self {
15324 self.diagnostic_output_uri = v.into();
15325 self
15326 }
15327
15328 pub fn set_approximate_usage<T>(mut self, v: T) -> Self
15330 where
15331 T: std::convert::Into<crate::model::UsageMetrics>,
15332 {
15333 self.approximate_usage = std::option::Option::Some(v.into());
15334 self
15335 }
15336
15337 pub fn set_or_clear_approximate_usage<T>(mut self, v: std::option::Option<T>) -> Self
15339 where
15340 T: std::convert::Into<crate::model::UsageMetrics>,
15341 {
15342 self.approximate_usage = v.map(|x| x.into());
15343 self
15344 }
15345
15346 pub fn set_current_usage<T>(mut self, v: T) -> Self
15348 where
15349 T: std::convert::Into<crate::model::UsageSnapshot>,
15350 {
15351 self.current_usage = std::option::Option::Some(v.into());
15352 self
15353 }
15354
15355 pub fn set_or_clear_current_usage<T>(mut self, v: std::option::Option<T>) -> Self
15357 where
15358 T: std::convert::Into<crate::model::UsageSnapshot>,
15359 {
15360 self.current_usage = v.map(|x| x.into());
15361 self
15362 }
15363}
15364
15365impl wkt::message::Message for RuntimeInfo {
15366 fn typename() -> &'static str {
15367 "type.googleapis.com/google.cloud.dataproc.v1.RuntimeInfo"
15368 }
15369}
15370
15371#[derive(Clone, Default, PartialEq)]
15373#[non_exhaustive]
15374pub struct UsageMetrics {
15375 pub milli_dcu_seconds: i64,
15379
15380 pub shuffle_storage_gb_seconds: i64,
15384
15385 pub milli_accelerator_seconds: i64,
15389
15390 pub accelerator_type: std::string::String,
15392
15393 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15394}
15395
15396impl UsageMetrics {
15397 pub fn new() -> Self {
15398 std::default::Default::default()
15399 }
15400
15401 pub fn set_milli_dcu_seconds<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15403 self.milli_dcu_seconds = v.into();
15404 self
15405 }
15406
15407 pub fn set_shuffle_storage_gb_seconds<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15409 self.shuffle_storage_gb_seconds = v.into();
15410 self
15411 }
15412
15413 pub fn set_milli_accelerator_seconds<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15415 self.milli_accelerator_seconds = v.into();
15416 self
15417 }
15418
15419 pub fn set_accelerator_type<T: std::convert::Into<std::string::String>>(
15421 mut self,
15422 v: T,
15423 ) -> Self {
15424 self.accelerator_type = v.into();
15425 self
15426 }
15427}
15428
15429impl wkt::message::Message for UsageMetrics {
15430 fn typename() -> &'static str {
15431 "type.googleapis.com/google.cloud.dataproc.v1.UsageMetrics"
15432 }
15433}
15434
15435#[derive(Clone, Default, PartialEq)]
15438#[non_exhaustive]
15439pub struct UsageSnapshot {
15440 pub milli_dcu: i64,
15444
15445 pub shuffle_storage_gb: i64,
15448
15449 pub milli_dcu_premium: i64,
15453
15454 pub shuffle_storage_gb_premium: i64,
15458
15459 pub milli_accelerator: i64,
15462
15463 pub accelerator_type: std::string::String,
15465
15466 pub snapshot_time: std::option::Option<wkt::Timestamp>,
15468
15469 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15470}
15471
15472impl UsageSnapshot {
15473 pub fn new() -> Self {
15474 std::default::Default::default()
15475 }
15476
15477 pub fn set_milli_dcu<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15479 self.milli_dcu = v.into();
15480 self
15481 }
15482
15483 pub fn set_shuffle_storage_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15485 self.shuffle_storage_gb = v.into();
15486 self
15487 }
15488
15489 pub fn set_milli_dcu_premium<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15491 self.milli_dcu_premium = v.into();
15492 self
15493 }
15494
15495 pub fn set_shuffle_storage_gb_premium<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15497 self.shuffle_storage_gb_premium = v.into();
15498 self
15499 }
15500
15501 pub fn set_milli_accelerator<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15503 self.milli_accelerator = v.into();
15504 self
15505 }
15506
15507 pub fn set_accelerator_type<T: std::convert::Into<std::string::String>>(
15509 mut self,
15510 v: T,
15511 ) -> Self {
15512 self.accelerator_type = v.into();
15513 self
15514 }
15515
15516 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
15518 where
15519 T: std::convert::Into<wkt::Timestamp>,
15520 {
15521 self.snapshot_time = std::option::Option::Some(v.into());
15522 self
15523 }
15524
15525 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
15527 where
15528 T: std::convert::Into<wkt::Timestamp>,
15529 {
15530 self.snapshot_time = v.map(|x| x.into());
15531 self
15532 }
15533}
15534
15535impl wkt::message::Message for UsageSnapshot {
15536 fn typename() -> &'static str {
15537 "type.googleapis.com/google.cloud.dataproc.v1.UsageSnapshot"
15538 }
15539}
15540
15541#[derive(Clone, Default, PartialEq)]
15543#[non_exhaustive]
15544pub struct GkeClusterConfig {
15545 pub gke_cluster_target: std::string::String,
15550
15551 pub node_pool_target: std::vec::Vec<crate::model::GkeNodePoolTarget>,
15560
15561 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15562}
15563
15564impl GkeClusterConfig {
15565 pub fn new() -> Self {
15566 std::default::Default::default()
15567 }
15568
15569 pub fn set_gke_cluster_target<T: std::convert::Into<std::string::String>>(
15571 mut self,
15572 v: T,
15573 ) -> Self {
15574 self.gke_cluster_target = v.into();
15575 self
15576 }
15577
15578 pub fn set_node_pool_target<T, V>(mut self, v: T) -> Self
15580 where
15581 T: std::iter::IntoIterator<Item = V>,
15582 V: std::convert::Into<crate::model::GkeNodePoolTarget>,
15583 {
15584 use std::iter::Iterator;
15585 self.node_pool_target = v.into_iter().map(|i| i.into()).collect();
15586 self
15587 }
15588}
15589
15590impl wkt::message::Message for GkeClusterConfig {
15591 fn typename() -> &'static str {
15592 "type.googleapis.com/google.cloud.dataproc.v1.GkeClusterConfig"
15593 }
15594}
15595
15596#[derive(Clone, Default, PartialEq)]
15598#[non_exhaustive]
15599pub struct KubernetesClusterConfig {
15600 pub kubernetes_namespace: std::string::String,
15605
15606 pub kubernetes_software_config: std::option::Option<crate::model::KubernetesSoftwareConfig>,
15609
15610 pub config: std::option::Option<crate::model::kubernetes_cluster_config::Config>,
15611
15612 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15613}
15614
15615impl KubernetesClusterConfig {
15616 pub fn new() -> Self {
15617 std::default::Default::default()
15618 }
15619
15620 pub fn set_kubernetes_namespace<T: std::convert::Into<std::string::String>>(
15622 mut self,
15623 v: T,
15624 ) -> Self {
15625 self.kubernetes_namespace = v.into();
15626 self
15627 }
15628
15629 pub fn set_kubernetes_software_config<T>(mut self, v: T) -> Self
15631 where
15632 T: std::convert::Into<crate::model::KubernetesSoftwareConfig>,
15633 {
15634 self.kubernetes_software_config = std::option::Option::Some(v.into());
15635 self
15636 }
15637
15638 pub fn set_or_clear_kubernetes_software_config<T>(mut self, v: std::option::Option<T>) -> Self
15640 where
15641 T: std::convert::Into<crate::model::KubernetesSoftwareConfig>,
15642 {
15643 self.kubernetes_software_config = v.map(|x| x.into());
15644 self
15645 }
15646
15647 pub fn set_config<
15652 T: std::convert::Into<std::option::Option<crate::model::kubernetes_cluster_config::Config>>,
15653 >(
15654 mut self,
15655 v: T,
15656 ) -> Self {
15657 self.config = v.into();
15658 self
15659 }
15660
15661 pub fn gke_cluster_config(
15665 &self,
15666 ) -> std::option::Option<&std::boxed::Box<crate::model::GkeClusterConfig>> {
15667 #[allow(unreachable_patterns)]
15668 self.config.as_ref().and_then(|v| match v {
15669 crate::model::kubernetes_cluster_config::Config::GkeClusterConfig(v) => {
15670 std::option::Option::Some(v)
15671 }
15672 _ => std::option::Option::None,
15673 })
15674 }
15675
15676 pub fn set_gke_cluster_config<
15682 T: std::convert::Into<std::boxed::Box<crate::model::GkeClusterConfig>>,
15683 >(
15684 mut self,
15685 v: T,
15686 ) -> Self {
15687 self.config = std::option::Option::Some(
15688 crate::model::kubernetes_cluster_config::Config::GkeClusterConfig(v.into()),
15689 );
15690 self
15691 }
15692}
15693
15694impl wkt::message::Message for KubernetesClusterConfig {
15695 fn typename() -> &'static str {
15696 "type.googleapis.com/google.cloud.dataproc.v1.KubernetesClusterConfig"
15697 }
15698}
15699
15700pub mod kubernetes_cluster_config {
15702 #[allow(unused_imports)]
15703 use super::*;
15704
15705 #[derive(Clone, Debug, PartialEq)]
15706 #[non_exhaustive]
15707 pub enum Config {
15708 GkeClusterConfig(std::boxed::Box<crate::model::GkeClusterConfig>),
15710 }
15711}
15712
15713#[derive(Clone, Default, PartialEq)]
15715#[non_exhaustive]
15716pub struct KubernetesSoftwareConfig {
15717 pub component_version: std::collections::HashMap<std::string::String, std::string::String>,
15722
15723 pub properties: std::collections::HashMap<std::string::String, std::string::String>,
15734
15735 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15736}
15737
15738impl KubernetesSoftwareConfig {
15739 pub fn new() -> Self {
15740 std::default::Default::default()
15741 }
15742
15743 pub fn set_component_version<T, K, V>(mut self, v: T) -> Self
15745 where
15746 T: std::iter::IntoIterator<Item = (K, V)>,
15747 K: std::convert::Into<std::string::String>,
15748 V: std::convert::Into<std::string::String>,
15749 {
15750 use std::iter::Iterator;
15751 self.component_version = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15752 self
15753 }
15754
15755 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
15757 where
15758 T: std::iter::IntoIterator<Item = (K, V)>,
15759 K: std::convert::Into<std::string::String>,
15760 V: std::convert::Into<std::string::String>,
15761 {
15762 use std::iter::Iterator;
15763 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15764 self
15765 }
15766}
15767
15768impl wkt::message::Message for KubernetesSoftwareConfig {
15769 fn typename() -> &'static str {
15770 "type.googleapis.com/google.cloud.dataproc.v1.KubernetesSoftwareConfig"
15771 }
15772}
15773
15774#[derive(Clone, Default, PartialEq)]
15776#[non_exhaustive]
15777pub struct GkeNodePoolTarget {
15778 pub node_pool: std::string::String,
15782
15783 pub roles: std::vec::Vec<crate::model::gke_node_pool_target::Role>,
15785
15786 pub node_pool_config: std::option::Option<crate::model::GkeNodePoolConfig>,
15799
15800 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15801}
15802
15803impl GkeNodePoolTarget {
15804 pub fn new() -> Self {
15805 std::default::Default::default()
15806 }
15807
15808 pub fn set_node_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15810 self.node_pool = v.into();
15811 self
15812 }
15813
15814 pub fn set_roles<T, V>(mut self, v: T) -> Self
15816 where
15817 T: std::iter::IntoIterator<Item = V>,
15818 V: std::convert::Into<crate::model::gke_node_pool_target::Role>,
15819 {
15820 use std::iter::Iterator;
15821 self.roles = v.into_iter().map(|i| i.into()).collect();
15822 self
15823 }
15824
15825 pub fn set_node_pool_config<T>(mut self, v: T) -> Self
15827 where
15828 T: std::convert::Into<crate::model::GkeNodePoolConfig>,
15829 {
15830 self.node_pool_config = std::option::Option::Some(v.into());
15831 self
15832 }
15833
15834 pub fn set_or_clear_node_pool_config<T>(mut self, v: std::option::Option<T>) -> Self
15836 where
15837 T: std::convert::Into<crate::model::GkeNodePoolConfig>,
15838 {
15839 self.node_pool_config = v.map(|x| x.into());
15840 self
15841 }
15842}
15843
15844impl wkt::message::Message for GkeNodePoolTarget {
15845 fn typename() -> &'static str {
15846 "type.googleapis.com/google.cloud.dataproc.v1.GkeNodePoolTarget"
15847 }
15848}
15849
15850pub mod gke_node_pool_target {
15852 #[allow(unused_imports)]
15853 use super::*;
15854
15855 #[derive(Clone, Debug, PartialEq)]
15877 #[non_exhaustive]
15878 pub enum Role {
15879 Unspecified,
15881 Default,
15887 Controller,
15890 SparkDriver,
15892 SparkExecutor,
15894 UnknownValue(role::UnknownValue),
15899 }
15900
15901 #[doc(hidden)]
15902 pub mod role {
15903 #[allow(unused_imports)]
15904 use super::*;
15905 #[derive(Clone, Debug, PartialEq)]
15906 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15907 }
15908
15909 impl Role {
15910 pub fn value(&self) -> std::option::Option<i32> {
15915 match self {
15916 Self::Unspecified => std::option::Option::Some(0),
15917 Self::Default => std::option::Option::Some(1),
15918 Self::Controller => std::option::Option::Some(2),
15919 Self::SparkDriver => std::option::Option::Some(3),
15920 Self::SparkExecutor => std::option::Option::Some(4),
15921 Self::UnknownValue(u) => u.0.value(),
15922 }
15923 }
15924
15925 pub fn name(&self) -> std::option::Option<&str> {
15930 match self {
15931 Self::Unspecified => std::option::Option::Some("ROLE_UNSPECIFIED"),
15932 Self::Default => std::option::Option::Some("DEFAULT"),
15933 Self::Controller => std::option::Option::Some("CONTROLLER"),
15934 Self::SparkDriver => std::option::Option::Some("SPARK_DRIVER"),
15935 Self::SparkExecutor => std::option::Option::Some("SPARK_EXECUTOR"),
15936 Self::UnknownValue(u) => u.0.name(),
15937 }
15938 }
15939 }
15940
15941 impl std::default::Default for Role {
15942 fn default() -> Self {
15943 use std::convert::From;
15944 Self::from(0)
15945 }
15946 }
15947
15948 impl std::fmt::Display for Role {
15949 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15950 wkt::internal::display_enum(f, self.name(), self.value())
15951 }
15952 }
15953
15954 impl std::convert::From<i32> for Role {
15955 fn from(value: i32) -> Self {
15956 match value {
15957 0 => Self::Unspecified,
15958 1 => Self::Default,
15959 2 => Self::Controller,
15960 3 => Self::SparkDriver,
15961 4 => Self::SparkExecutor,
15962 _ => Self::UnknownValue(role::UnknownValue(
15963 wkt::internal::UnknownEnumValue::Integer(value),
15964 )),
15965 }
15966 }
15967 }
15968
15969 impl std::convert::From<&str> for Role {
15970 fn from(value: &str) -> Self {
15971 use std::string::ToString;
15972 match value {
15973 "ROLE_UNSPECIFIED" => Self::Unspecified,
15974 "DEFAULT" => Self::Default,
15975 "CONTROLLER" => Self::Controller,
15976 "SPARK_DRIVER" => Self::SparkDriver,
15977 "SPARK_EXECUTOR" => Self::SparkExecutor,
15978 _ => Self::UnknownValue(role::UnknownValue(
15979 wkt::internal::UnknownEnumValue::String(value.to_string()),
15980 )),
15981 }
15982 }
15983 }
15984
15985 impl serde::ser::Serialize for Role {
15986 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15987 where
15988 S: serde::Serializer,
15989 {
15990 match self {
15991 Self::Unspecified => serializer.serialize_i32(0),
15992 Self::Default => serializer.serialize_i32(1),
15993 Self::Controller => serializer.serialize_i32(2),
15994 Self::SparkDriver => serializer.serialize_i32(3),
15995 Self::SparkExecutor => serializer.serialize_i32(4),
15996 Self::UnknownValue(u) => u.0.serialize(serializer),
15997 }
15998 }
15999 }
16000
16001 impl<'de> serde::de::Deserialize<'de> for Role {
16002 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16003 where
16004 D: serde::Deserializer<'de>,
16005 {
16006 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Role>::new(
16007 ".google.cloud.dataproc.v1.GkeNodePoolTarget.Role",
16008 ))
16009 }
16010 }
16011}
16012
16013#[derive(Clone, Default, PartialEq)]
16016#[non_exhaustive]
16017pub struct GkeNodePoolConfig {
16018 pub config: std::option::Option<crate::model::gke_node_pool_config::GkeNodeConfig>,
16020
16021 pub locations: std::vec::Vec<std::string::String>,
16033
16034 pub autoscaling:
16037 std::option::Option<crate::model::gke_node_pool_config::GkeNodePoolAutoscalingConfig>,
16038
16039 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16040}
16041
16042impl GkeNodePoolConfig {
16043 pub fn new() -> Self {
16044 std::default::Default::default()
16045 }
16046
16047 pub fn set_config<T>(mut self, v: T) -> Self
16049 where
16050 T: std::convert::Into<crate::model::gke_node_pool_config::GkeNodeConfig>,
16051 {
16052 self.config = std::option::Option::Some(v.into());
16053 self
16054 }
16055
16056 pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
16058 where
16059 T: std::convert::Into<crate::model::gke_node_pool_config::GkeNodeConfig>,
16060 {
16061 self.config = v.map(|x| x.into());
16062 self
16063 }
16064
16065 pub fn set_locations<T, V>(mut self, v: T) -> Self
16067 where
16068 T: std::iter::IntoIterator<Item = V>,
16069 V: std::convert::Into<std::string::String>,
16070 {
16071 use std::iter::Iterator;
16072 self.locations = v.into_iter().map(|i| i.into()).collect();
16073 self
16074 }
16075
16076 pub fn set_autoscaling<T>(mut self, v: T) -> Self
16078 where
16079 T: std::convert::Into<crate::model::gke_node_pool_config::GkeNodePoolAutoscalingConfig>,
16080 {
16081 self.autoscaling = std::option::Option::Some(v.into());
16082 self
16083 }
16084
16085 pub fn set_or_clear_autoscaling<T>(mut self, v: std::option::Option<T>) -> Self
16087 where
16088 T: std::convert::Into<crate::model::gke_node_pool_config::GkeNodePoolAutoscalingConfig>,
16089 {
16090 self.autoscaling = v.map(|x| x.into());
16091 self
16092 }
16093}
16094
16095impl wkt::message::Message for GkeNodePoolConfig {
16096 fn typename() -> &'static str {
16097 "type.googleapis.com/google.cloud.dataproc.v1.GkeNodePoolConfig"
16098 }
16099}
16100
16101pub mod gke_node_pool_config {
16103 #[allow(unused_imports)]
16104 use super::*;
16105
16106 #[derive(Clone, Default, PartialEq)]
16108 #[non_exhaustive]
16109 pub struct GkeNodeConfig {
16110 pub machine_type: std::string::String,
16113
16114 pub local_ssd_count: i32,
16118
16119 pub preemptible: bool,
16132
16133 pub accelerators:
16137 std::vec::Vec<crate::model::gke_node_pool_config::GkeNodePoolAcceleratorConfig>,
16138
16139 pub min_cpu_platform: std::string::String,
16145
16146 pub boot_disk_kms_key: std::string::String,
16152
16153 pub spot: bool,
16166
16167 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16168 }
16169
16170 impl GkeNodeConfig {
16171 pub fn new() -> Self {
16172 std::default::Default::default()
16173 }
16174
16175 pub fn set_machine_type<T: std::convert::Into<std::string::String>>(
16177 mut self,
16178 v: T,
16179 ) -> Self {
16180 self.machine_type = v.into();
16181 self
16182 }
16183
16184 pub fn set_local_ssd_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16186 self.local_ssd_count = v.into();
16187 self
16188 }
16189
16190 pub fn set_preemptible<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16192 self.preemptible = v.into();
16193 self
16194 }
16195
16196 pub fn set_accelerators<T, V>(mut self, v: T) -> Self
16198 where
16199 T: std::iter::IntoIterator<Item = V>,
16200 V: std::convert::Into<crate::model::gke_node_pool_config::GkeNodePoolAcceleratorConfig>,
16201 {
16202 use std::iter::Iterator;
16203 self.accelerators = v.into_iter().map(|i| i.into()).collect();
16204 self
16205 }
16206
16207 pub fn set_min_cpu_platform<T: std::convert::Into<std::string::String>>(
16209 mut self,
16210 v: T,
16211 ) -> Self {
16212 self.min_cpu_platform = v.into();
16213 self
16214 }
16215
16216 pub fn set_boot_disk_kms_key<T: std::convert::Into<std::string::String>>(
16218 mut self,
16219 v: T,
16220 ) -> Self {
16221 self.boot_disk_kms_key = v.into();
16222 self
16223 }
16224
16225 pub fn set_spot<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16227 self.spot = v.into();
16228 self
16229 }
16230 }
16231
16232 impl wkt::message::Message for GkeNodeConfig {
16233 fn typename() -> &'static str {
16234 "type.googleapis.com/google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig"
16235 }
16236 }
16237
16238 #[derive(Clone, Default, PartialEq)]
16241 #[non_exhaustive]
16242 pub struct GkeNodePoolAcceleratorConfig {
16243 pub accelerator_count: i64,
16245
16246 pub accelerator_type: std::string::String,
16248
16249 pub gpu_partition_size: std::string::String,
16253
16254 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16255 }
16256
16257 impl GkeNodePoolAcceleratorConfig {
16258 pub fn new() -> Self {
16259 std::default::Default::default()
16260 }
16261
16262 pub fn set_accelerator_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
16264 self.accelerator_count = v.into();
16265 self
16266 }
16267
16268 pub fn set_accelerator_type<T: std::convert::Into<std::string::String>>(
16270 mut self,
16271 v: T,
16272 ) -> Self {
16273 self.accelerator_type = v.into();
16274 self
16275 }
16276
16277 pub fn set_gpu_partition_size<T: std::convert::Into<std::string::String>>(
16279 mut self,
16280 v: T,
16281 ) -> Self {
16282 self.gpu_partition_size = v.into();
16283 self
16284 }
16285 }
16286
16287 impl wkt::message::Message for GkeNodePoolAcceleratorConfig {
16288 fn typename() -> &'static str {
16289 "type.googleapis.com/google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig"
16290 }
16291 }
16292
16293 #[derive(Clone, Default, PartialEq)]
16296 #[non_exhaustive]
16297 pub struct GkeNodePoolAutoscalingConfig {
16298 pub min_node_count: i32,
16301
16302 pub max_node_count: i32,
16306
16307 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16308 }
16309
16310 impl GkeNodePoolAutoscalingConfig {
16311 pub fn new() -> Self {
16312 std::default::Default::default()
16313 }
16314
16315 pub fn set_min_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16317 self.min_node_count = v.into();
16318 self
16319 }
16320
16321 pub fn set_max_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16323 self.max_node_count = v.into();
16324 self
16325 }
16326 }
16327
16328 impl wkt::message::Message for GkeNodePoolAutoscalingConfig {
16329 fn typename() -> &'static str {
16330 "type.googleapis.com/google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig"
16331 }
16332 }
16333}
16334
16335#[derive(Clone, Default, PartialEq)]
16340#[non_exhaustive]
16341pub struct AuthenticationConfig {
16342 pub user_workload_authentication_type: crate::model::authentication_config::AuthenticationType,
16344
16345 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16346}
16347
16348impl AuthenticationConfig {
16349 pub fn new() -> Self {
16350 std::default::Default::default()
16351 }
16352
16353 pub fn set_user_workload_authentication_type<
16355 T: std::convert::Into<crate::model::authentication_config::AuthenticationType>,
16356 >(
16357 mut self,
16358 v: T,
16359 ) -> Self {
16360 self.user_workload_authentication_type = v.into();
16361 self
16362 }
16363}
16364
16365impl wkt::message::Message for AuthenticationConfig {
16366 fn typename() -> &'static str {
16367 "type.googleapis.com/google.cloud.dataproc.v1.AuthenticationConfig"
16368 }
16369}
16370
16371pub mod authentication_config {
16373 #[allow(unused_imports)]
16374 use super::*;
16375
16376 #[derive(Clone, Debug, PartialEq)]
16392 #[non_exhaustive]
16393 pub enum AuthenticationType {
16394 Unspecified,
16398 ServiceAccount,
16400 EndUserCredentials,
16403 UnknownValue(authentication_type::UnknownValue),
16408 }
16409
16410 #[doc(hidden)]
16411 pub mod authentication_type {
16412 #[allow(unused_imports)]
16413 use super::*;
16414 #[derive(Clone, Debug, PartialEq)]
16415 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16416 }
16417
16418 impl AuthenticationType {
16419 pub fn value(&self) -> std::option::Option<i32> {
16424 match self {
16425 Self::Unspecified => std::option::Option::Some(0),
16426 Self::ServiceAccount => std::option::Option::Some(1),
16427 Self::EndUserCredentials => std::option::Option::Some(2),
16428 Self::UnknownValue(u) => u.0.value(),
16429 }
16430 }
16431
16432 pub fn name(&self) -> std::option::Option<&str> {
16437 match self {
16438 Self::Unspecified => std::option::Option::Some("AUTHENTICATION_TYPE_UNSPECIFIED"),
16439 Self::ServiceAccount => std::option::Option::Some("SERVICE_ACCOUNT"),
16440 Self::EndUserCredentials => std::option::Option::Some("END_USER_CREDENTIALS"),
16441 Self::UnknownValue(u) => u.0.name(),
16442 }
16443 }
16444 }
16445
16446 impl std::default::Default for AuthenticationType {
16447 fn default() -> Self {
16448 use std::convert::From;
16449 Self::from(0)
16450 }
16451 }
16452
16453 impl std::fmt::Display for AuthenticationType {
16454 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16455 wkt::internal::display_enum(f, self.name(), self.value())
16456 }
16457 }
16458
16459 impl std::convert::From<i32> for AuthenticationType {
16460 fn from(value: i32) -> Self {
16461 match value {
16462 0 => Self::Unspecified,
16463 1 => Self::ServiceAccount,
16464 2 => Self::EndUserCredentials,
16465 _ => Self::UnknownValue(authentication_type::UnknownValue(
16466 wkt::internal::UnknownEnumValue::Integer(value),
16467 )),
16468 }
16469 }
16470 }
16471
16472 impl std::convert::From<&str> for AuthenticationType {
16473 fn from(value: &str) -> Self {
16474 use std::string::ToString;
16475 match value {
16476 "AUTHENTICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
16477 "SERVICE_ACCOUNT" => Self::ServiceAccount,
16478 "END_USER_CREDENTIALS" => Self::EndUserCredentials,
16479 _ => Self::UnknownValue(authentication_type::UnknownValue(
16480 wkt::internal::UnknownEnumValue::String(value.to_string()),
16481 )),
16482 }
16483 }
16484 }
16485
16486 impl serde::ser::Serialize for AuthenticationType {
16487 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16488 where
16489 S: serde::Serializer,
16490 {
16491 match self {
16492 Self::Unspecified => serializer.serialize_i32(0),
16493 Self::ServiceAccount => serializer.serialize_i32(1),
16494 Self::EndUserCredentials => serializer.serialize_i32(2),
16495 Self::UnknownValue(u) => u.0.serialize(serializer),
16496 }
16497 }
16498 }
16499
16500 impl<'de> serde::de::Deserialize<'de> for AuthenticationType {
16501 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16502 where
16503 D: serde::Deserializer<'de>,
16504 {
16505 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthenticationType>::new(
16506 ".google.cloud.dataproc.v1.AuthenticationConfig.AuthenticationType",
16507 ))
16508 }
16509 }
16510}
16511
16512#[derive(Clone, Default, PartialEq)]
16514#[non_exhaustive]
16515pub struct AutotuningConfig {
16516 pub scenarios: std::vec::Vec<crate::model::autotuning_config::Scenario>,
16518
16519 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16520}
16521
16522impl AutotuningConfig {
16523 pub fn new() -> Self {
16524 std::default::Default::default()
16525 }
16526
16527 pub fn set_scenarios<T, V>(mut self, v: T) -> Self
16529 where
16530 T: std::iter::IntoIterator<Item = V>,
16531 V: std::convert::Into<crate::model::autotuning_config::Scenario>,
16532 {
16533 use std::iter::Iterator;
16534 self.scenarios = v.into_iter().map(|i| i.into()).collect();
16535 self
16536 }
16537}
16538
16539impl wkt::message::Message for AutotuningConfig {
16540 fn typename() -> &'static str {
16541 "type.googleapis.com/google.cloud.dataproc.v1.AutotuningConfig"
16542 }
16543}
16544
16545pub mod autotuning_config {
16547 #[allow(unused_imports)]
16548 use super::*;
16549
16550 #[derive(Clone, Debug, PartialEq)]
16567 #[non_exhaustive]
16568 pub enum Scenario {
16569 Unspecified,
16571 Scaling,
16573 BroadcastHashJoin,
16575 Memory,
16577 None,
16579 Auto,
16581 UnknownValue(scenario::UnknownValue),
16586 }
16587
16588 #[doc(hidden)]
16589 pub mod scenario {
16590 #[allow(unused_imports)]
16591 use super::*;
16592 #[derive(Clone, Debug, PartialEq)]
16593 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16594 }
16595
16596 impl Scenario {
16597 pub fn value(&self) -> std::option::Option<i32> {
16602 match self {
16603 Self::Unspecified => std::option::Option::Some(0),
16604 Self::Scaling => std::option::Option::Some(2),
16605 Self::BroadcastHashJoin => std::option::Option::Some(3),
16606 Self::Memory => std::option::Option::Some(4),
16607 Self::None => std::option::Option::Some(5),
16608 Self::Auto => std::option::Option::Some(6),
16609 Self::UnknownValue(u) => u.0.value(),
16610 }
16611 }
16612
16613 pub fn name(&self) -> std::option::Option<&str> {
16618 match self {
16619 Self::Unspecified => std::option::Option::Some("SCENARIO_UNSPECIFIED"),
16620 Self::Scaling => std::option::Option::Some("SCALING"),
16621 Self::BroadcastHashJoin => std::option::Option::Some("BROADCAST_HASH_JOIN"),
16622 Self::Memory => std::option::Option::Some("MEMORY"),
16623 Self::None => std::option::Option::Some("NONE"),
16624 Self::Auto => std::option::Option::Some("AUTO"),
16625 Self::UnknownValue(u) => u.0.name(),
16626 }
16627 }
16628 }
16629
16630 impl std::default::Default for Scenario {
16631 fn default() -> Self {
16632 use std::convert::From;
16633 Self::from(0)
16634 }
16635 }
16636
16637 impl std::fmt::Display for Scenario {
16638 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16639 wkt::internal::display_enum(f, self.name(), self.value())
16640 }
16641 }
16642
16643 impl std::convert::From<i32> for Scenario {
16644 fn from(value: i32) -> Self {
16645 match value {
16646 0 => Self::Unspecified,
16647 2 => Self::Scaling,
16648 3 => Self::BroadcastHashJoin,
16649 4 => Self::Memory,
16650 5 => Self::None,
16651 6 => Self::Auto,
16652 _ => Self::UnknownValue(scenario::UnknownValue(
16653 wkt::internal::UnknownEnumValue::Integer(value),
16654 )),
16655 }
16656 }
16657 }
16658
16659 impl std::convert::From<&str> for Scenario {
16660 fn from(value: &str) -> Self {
16661 use std::string::ToString;
16662 match value {
16663 "SCENARIO_UNSPECIFIED" => Self::Unspecified,
16664 "SCALING" => Self::Scaling,
16665 "BROADCAST_HASH_JOIN" => Self::BroadcastHashJoin,
16666 "MEMORY" => Self::Memory,
16667 "NONE" => Self::None,
16668 "AUTO" => Self::Auto,
16669 _ => Self::UnknownValue(scenario::UnknownValue(
16670 wkt::internal::UnknownEnumValue::String(value.to_string()),
16671 )),
16672 }
16673 }
16674 }
16675
16676 impl serde::ser::Serialize for Scenario {
16677 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16678 where
16679 S: serde::Serializer,
16680 {
16681 match self {
16682 Self::Unspecified => serializer.serialize_i32(0),
16683 Self::Scaling => serializer.serialize_i32(2),
16684 Self::BroadcastHashJoin => serializer.serialize_i32(3),
16685 Self::Memory => serializer.serialize_i32(4),
16686 Self::None => serializer.serialize_i32(5),
16687 Self::Auto => serializer.serialize_i32(6),
16688 Self::UnknownValue(u) => u.0.serialize(serializer),
16689 }
16690 }
16691 }
16692
16693 impl<'de> serde::de::Deserialize<'de> for Scenario {
16694 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16695 where
16696 D: serde::Deserializer<'de>,
16697 {
16698 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scenario>::new(
16699 ".google.cloud.dataproc.v1.AutotuningConfig.Scenario",
16700 ))
16701 }
16702 }
16703}
16704
16705#[derive(Clone, Default, PartialEq)]
16707#[non_exhaustive]
16708pub struct RepositoryConfig {
16709 pub pypi_repository_config: std::option::Option<crate::model::PyPiRepositoryConfig>,
16711
16712 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16713}
16714
16715impl RepositoryConfig {
16716 pub fn new() -> Self {
16717 std::default::Default::default()
16718 }
16719
16720 pub fn set_pypi_repository_config<T>(mut self, v: T) -> Self
16722 where
16723 T: std::convert::Into<crate::model::PyPiRepositoryConfig>,
16724 {
16725 self.pypi_repository_config = std::option::Option::Some(v.into());
16726 self
16727 }
16728
16729 pub fn set_or_clear_pypi_repository_config<T>(mut self, v: std::option::Option<T>) -> Self
16731 where
16732 T: std::convert::Into<crate::model::PyPiRepositoryConfig>,
16733 {
16734 self.pypi_repository_config = v.map(|x| x.into());
16735 self
16736 }
16737}
16738
16739impl wkt::message::Message for RepositoryConfig {
16740 fn typename() -> &'static str {
16741 "type.googleapis.com/google.cloud.dataproc.v1.RepositoryConfig"
16742 }
16743}
16744
16745#[derive(Clone, Default, PartialEq)]
16747#[non_exhaustive]
16748pub struct PyPiRepositoryConfig {
16749 pub pypi_repository: std::string::String,
16751
16752 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16753}
16754
16755impl PyPiRepositoryConfig {
16756 pub fn new() -> Self {
16757 std::default::Default::default()
16758 }
16759
16760 pub fn set_pypi_repository<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16762 self.pypi_repository = v.into();
16763 self
16764 }
16765}
16766
16767impl wkt::message::Message for PyPiRepositoryConfig {
16768 fn typename() -> &'static str {
16769 "type.googleapis.com/google.cloud.dataproc.v1.PyPiRepositoryConfig"
16770 }
16771}
16772
16773#[derive(Clone, Default, PartialEq)]
16775#[non_exhaustive]
16776pub struct WorkflowTemplate {
16777 pub id: std::string::String,
16778
16779 pub name: std::string::String,
16791
16792 pub version: i32,
16802
16803 pub create_time: std::option::Option<wkt::Timestamp>,
16805
16806 pub update_time: std::option::Option<wkt::Timestamp>,
16808
16809 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
16822
16823 pub placement: std::option::Option<crate::model::WorkflowTemplatePlacement>,
16825
16826 pub jobs: std::vec::Vec<crate::model::OrderedJob>,
16828
16829 pub parameters: std::vec::Vec<crate::model::TemplateParameter>,
16833
16834 pub dag_timeout: std::option::Option<wkt::Duration>,
16845
16846 pub encryption_config: std::option::Option<crate::model::workflow_template::EncryptionConfig>,
16849
16850 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16851}
16852
16853impl WorkflowTemplate {
16854 pub fn new() -> Self {
16855 std::default::Default::default()
16856 }
16857
16858 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16860 self.id = v.into();
16861 self
16862 }
16863
16864 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16866 self.name = v.into();
16867 self
16868 }
16869
16870 pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16872 self.version = v.into();
16873 self
16874 }
16875
16876 pub fn set_create_time<T>(mut self, v: T) -> Self
16878 where
16879 T: std::convert::Into<wkt::Timestamp>,
16880 {
16881 self.create_time = std::option::Option::Some(v.into());
16882 self
16883 }
16884
16885 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16887 where
16888 T: std::convert::Into<wkt::Timestamp>,
16889 {
16890 self.create_time = v.map(|x| x.into());
16891 self
16892 }
16893
16894 pub fn set_update_time<T>(mut self, v: T) -> Self
16896 where
16897 T: std::convert::Into<wkt::Timestamp>,
16898 {
16899 self.update_time = std::option::Option::Some(v.into());
16900 self
16901 }
16902
16903 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16905 where
16906 T: std::convert::Into<wkt::Timestamp>,
16907 {
16908 self.update_time = v.map(|x| x.into());
16909 self
16910 }
16911
16912 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
16914 where
16915 T: std::iter::IntoIterator<Item = (K, V)>,
16916 K: std::convert::Into<std::string::String>,
16917 V: std::convert::Into<std::string::String>,
16918 {
16919 use std::iter::Iterator;
16920 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16921 self
16922 }
16923
16924 pub fn set_placement<T>(mut self, v: T) -> Self
16926 where
16927 T: std::convert::Into<crate::model::WorkflowTemplatePlacement>,
16928 {
16929 self.placement = std::option::Option::Some(v.into());
16930 self
16931 }
16932
16933 pub fn set_or_clear_placement<T>(mut self, v: std::option::Option<T>) -> Self
16935 where
16936 T: std::convert::Into<crate::model::WorkflowTemplatePlacement>,
16937 {
16938 self.placement = v.map(|x| x.into());
16939 self
16940 }
16941
16942 pub fn set_jobs<T, V>(mut self, v: T) -> Self
16944 where
16945 T: std::iter::IntoIterator<Item = V>,
16946 V: std::convert::Into<crate::model::OrderedJob>,
16947 {
16948 use std::iter::Iterator;
16949 self.jobs = v.into_iter().map(|i| i.into()).collect();
16950 self
16951 }
16952
16953 pub fn set_parameters<T, V>(mut self, v: T) -> Self
16955 where
16956 T: std::iter::IntoIterator<Item = V>,
16957 V: std::convert::Into<crate::model::TemplateParameter>,
16958 {
16959 use std::iter::Iterator;
16960 self.parameters = v.into_iter().map(|i| i.into()).collect();
16961 self
16962 }
16963
16964 pub fn set_dag_timeout<T>(mut self, v: T) -> Self
16966 where
16967 T: std::convert::Into<wkt::Duration>,
16968 {
16969 self.dag_timeout = std::option::Option::Some(v.into());
16970 self
16971 }
16972
16973 pub fn set_or_clear_dag_timeout<T>(mut self, v: std::option::Option<T>) -> Self
16975 where
16976 T: std::convert::Into<wkt::Duration>,
16977 {
16978 self.dag_timeout = v.map(|x| x.into());
16979 self
16980 }
16981
16982 pub fn set_encryption_config<T>(mut self, v: T) -> Self
16984 where
16985 T: std::convert::Into<crate::model::workflow_template::EncryptionConfig>,
16986 {
16987 self.encryption_config = std::option::Option::Some(v.into());
16988 self
16989 }
16990
16991 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
16993 where
16994 T: std::convert::Into<crate::model::workflow_template::EncryptionConfig>,
16995 {
16996 self.encryption_config = v.map(|x| x.into());
16997 self
16998 }
16999}
17000
17001impl wkt::message::Message for WorkflowTemplate {
17002 fn typename() -> &'static str {
17003 "type.googleapis.com/google.cloud.dataproc.v1.WorkflowTemplate"
17004 }
17005}
17006
17007pub mod workflow_template {
17009 #[allow(unused_imports)]
17010 use super::*;
17011
17012 #[derive(Clone, Default, PartialEq)]
17014 #[non_exhaustive]
17015 pub struct EncryptionConfig {
17016 pub kms_key: std::string::String,
17045
17046 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17047 }
17048
17049 impl EncryptionConfig {
17050 pub fn new() -> Self {
17051 std::default::Default::default()
17052 }
17053
17054 pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17056 self.kms_key = v.into();
17057 self
17058 }
17059 }
17060
17061 impl wkt::message::Message for EncryptionConfig {
17062 fn typename() -> &'static str {
17063 "type.googleapis.com/google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig"
17064 }
17065 }
17066}
17067
17068#[derive(Clone, Default, PartialEq)]
17072#[non_exhaustive]
17073pub struct WorkflowTemplatePlacement {
17074 pub placement: std::option::Option<crate::model::workflow_template_placement::Placement>,
17077
17078 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17079}
17080
17081impl WorkflowTemplatePlacement {
17082 pub fn new() -> Self {
17083 std::default::Default::default()
17084 }
17085
17086 pub fn set_placement<
17091 T: std::convert::Into<
17092 std::option::Option<crate::model::workflow_template_placement::Placement>,
17093 >,
17094 >(
17095 mut self,
17096 v: T,
17097 ) -> Self {
17098 self.placement = v.into();
17099 self
17100 }
17101
17102 pub fn managed_cluster(
17106 &self,
17107 ) -> std::option::Option<&std::boxed::Box<crate::model::ManagedCluster>> {
17108 #[allow(unreachable_patterns)]
17109 self.placement.as_ref().and_then(|v| match v {
17110 crate::model::workflow_template_placement::Placement::ManagedCluster(v) => {
17111 std::option::Option::Some(v)
17112 }
17113 _ => std::option::Option::None,
17114 })
17115 }
17116
17117 pub fn set_managed_cluster<
17123 T: std::convert::Into<std::boxed::Box<crate::model::ManagedCluster>>,
17124 >(
17125 mut self,
17126 v: T,
17127 ) -> Self {
17128 self.placement = std::option::Option::Some(
17129 crate::model::workflow_template_placement::Placement::ManagedCluster(v.into()),
17130 );
17131 self
17132 }
17133
17134 pub fn cluster_selector(
17138 &self,
17139 ) -> std::option::Option<&std::boxed::Box<crate::model::ClusterSelector>> {
17140 #[allow(unreachable_patterns)]
17141 self.placement.as_ref().and_then(|v| match v {
17142 crate::model::workflow_template_placement::Placement::ClusterSelector(v) => {
17143 std::option::Option::Some(v)
17144 }
17145 _ => std::option::Option::None,
17146 })
17147 }
17148
17149 pub fn set_cluster_selector<
17155 T: std::convert::Into<std::boxed::Box<crate::model::ClusterSelector>>,
17156 >(
17157 mut self,
17158 v: T,
17159 ) -> Self {
17160 self.placement = std::option::Option::Some(
17161 crate::model::workflow_template_placement::Placement::ClusterSelector(v.into()),
17162 );
17163 self
17164 }
17165}
17166
17167impl wkt::message::Message for WorkflowTemplatePlacement {
17168 fn typename() -> &'static str {
17169 "type.googleapis.com/google.cloud.dataproc.v1.WorkflowTemplatePlacement"
17170 }
17171}
17172
17173pub mod workflow_template_placement {
17175 #[allow(unused_imports)]
17176 use super::*;
17177
17178 #[derive(Clone, Debug, PartialEq)]
17181 #[non_exhaustive]
17182 pub enum Placement {
17183 ManagedCluster(std::boxed::Box<crate::model::ManagedCluster>),
17185 ClusterSelector(std::boxed::Box<crate::model::ClusterSelector>),
17190 }
17191}
17192
17193#[derive(Clone, Default, PartialEq)]
17195#[non_exhaustive]
17196pub struct ManagedCluster {
17197 pub cluster_name: std::string::String,
17204
17205 pub config: std::option::Option<crate::model::ClusterConfig>,
17207
17208 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
17219
17220 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17221}
17222
17223impl ManagedCluster {
17224 pub fn new() -> Self {
17225 std::default::Default::default()
17226 }
17227
17228 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17230 self.cluster_name = v.into();
17231 self
17232 }
17233
17234 pub fn set_config<T>(mut self, v: T) -> Self
17236 where
17237 T: std::convert::Into<crate::model::ClusterConfig>,
17238 {
17239 self.config = std::option::Option::Some(v.into());
17240 self
17241 }
17242
17243 pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
17245 where
17246 T: std::convert::Into<crate::model::ClusterConfig>,
17247 {
17248 self.config = v.map(|x| x.into());
17249 self
17250 }
17251
17252 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
17254 where
17255 T: std::iter::IntoIterator<Item = (K, V)>,
17256 K: std::convert::Into<std::string::String>,
17257 V: std::convert::Into<std::string::String>,
17258 {
17259 use std::iter::Iterator;
17260 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17261 self
17262 }
17263}
17264
17265impl wkt::message::Message for ManagedCluster {
17266 fn typename() -> &'static str {
17267 "type.googleapis.com/google.cloud.dataproc.v1.ManagedCluster"
17268 }
17269}
17270
17271#[derive(Clone, Default, PartialEq)]
17273#[non_exhaustive]
17274pub struct ClusterSelector {
17275 pub zone: std::string::String,
17281
17282 pub cluster_labels: std::collections::HashMap<std::string::String, std::string::String>,
17285
17286 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17287}
17288
17289impl ClusterSelector {
17290 pub fn new() -> Self {
17291 std::default::Default::default()
17292 }
17293
17294 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17296 self.zone = v.into();
17297 self
17298 }
17299
17300 pub fn set_cluster_labels<T, K, V>(mut self, v: T) -> Self
17302 where
17303 T: std::iter::IntoIterator<Item = (K, V)>,
17304 K: std::convert::Into<std::string::String>,
17305 V: std::convert::Into<std::string::String>,
17306 {
17307 use std::iter::Iterator;
17308 self.cluster_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17309 self
17310 }
17311}
17312
17313impl wkt::message::Message for ClusterSelector {
17314 fn typename() -> &'static str {
17315 "type.googleapis.com/google.cloud.dataproc.v1.ClusterSelector"
17316 }
17317}
17318
17319#[derive(Clone, Default, PartialEq)]
17321#[non_exhaustive]
17322pub struct OrderedJob {
17323 pub step_id: std::string::String,
17337
17338 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
17349
17350 pub scheduling: std::option::Option<crate::model::JobScheduling>,
17352
17353 pub prerequisite_step_ids: std::vec::Vec<std::string::String>,
17356
17357 pub job_type: std::option::Option<crate::model::ordered_job::JobType>,
17359
17360 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17361}
17362
17363impl OrderedJob {
17364 pub fn new() -> Self {
17365 std::default::Default::default()
17366 }
17367
17368 pub fn set_step_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17370 self.step_id = v.into();
17371 self
17372 }
17373
17374 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
17376 where
17377 T: std::iter::IntoIterator<Item = (K, V)>,
17378 K: std::convert::Into<std::string::String>,
17379 V: std::convert::Into<std::string::String>,
17380 {
17381 use std::iter::Iterator;
17382 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17383 self
17384 }
17385
17386 pub fn set_scheduling<T>(mut self, v: T) -> Self
17388 where
17389 T: std::convert::Into<crate::model::JobScheduling>,
17390 {
17391 self.scheduling = std::option::Option::Some(v.into());
17392 self
17393 }
17394
17395 pub fn set_or_clear_scheduling<T>(mut self, v: std::option::Option<T>) -> Self
17397 where
17398 T: std::convert::Into<crate::model::JobScheduling>,
17399 {
17400 self.scheduling = v.map(|x| x.into());
17401 self
17402 }
17403
17404 pub fn set_prerequisite_step_ids<T, V>(mut self, v: T) -> Self
17406 where
17407 T: std::iter::IntoIterator<Item = V>,
17408 V: std::convert::Into<std::string::String>,
17409 {
17410 use std::iter::Iterator;
17411 self.prerequisite_step_ids = v.into_iter().map(|i| i.into()).collect();
17412 self
17413 }
17414
17415 pub fn set_job_type<
17420 T: std::convert::Into<std::option::Option<crate::model::ordered_job::JobType>>,
17421 >(
17422 mut self,
17423 v: T,
17424 ) -> Self {
17425 self.job_type = v.into();
17426 self
17427 }
17428
17429 pub fn hadoop_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::HadoopJob>> {
17433 #[allow(unreachable_patterns)]
17434 self.job_type.as_ref().and_then(|v| match v {
17435 crate::model::ordered_job::JobType::HadoopJob(v) => std::option::Option::Some(v),
17436 _ => std::option::Option::None,
17437 })
17438 }
17439
17440 pub fn set_hadoop_job<T: std::convert::Into<std::boxed::Box<crate::model::HadoopJob>>>(
17446 mut self,
17447 v: T,
17448 ) -> Self {
17449 self.job_type =
17450 std::option::Option::Some(crate::model::ordered_job::JobType::HadoopJob(v.into()));
17451 self
17452 }
17453
17454 pub fn spark_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkJob>> {
17458 #[allow(unreachable_patterns)]
17459 self.job_type.as_ref().and_then(|v| match v {
17460 crate::model::ordered_job::JobType::SparkJob(v) => std::option::Option::Some(v),
17461 _ => std::option::Option::None,
17462 })
17463 }
17464
17465 pub fn set_spark_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkJob>>>(
17471 mut self,
17472 v: T,
17473 ) -> Self {
17474 self.job_type =
17475 std::option::Option::Some(crate::model::ordered_job::JobType::SparkJob(v.into()));
17476 self
17477 }
17478
17479 pub fn pyspark_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PySparkJob>> {
17483 #[allow(unreachable_patterns)]
17484 self.job_type.as_ref().and_then(|v| match v {
17485 crate::model::ordered_job::JobType::PysparkJob(v) => std::option::Option::Some(v),
17486 _ => std::option::Option::None,
17487 })
17488 }
17489
17490 pub fn set_pyspark_job<T: std::convert::Into<std::boxed::Box<crate::model::PySparkJob>>>(
17496 mut self,
17497 v: T,
17498 ) -> Self {
17499 self.job_type =
17500 std::option::Option::Some(crate::model::ordered_job::JobType::PysparkJob(v.into()));
17501 self
17502 }
17503
17504 pub fn hive_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::HiveJob>> {
17508 #[allow(unreachable_patterns)]
17509 self.job_type.as_ref().and_then(|v| match v {
17510 crate::model::ordered_job::JobType::HiveJob(v) => std::option::Option::Some(v),
17511 _ => std::option::Option::None,
17512 })
17513 }
17514
17515 pub fn set_hive_job<T: std::convert::Into<std::boxed::Box<crate::model::HiveJob>>>(
17521 mut self,
17522 v: T,
17523 ) -> Self {
17524 self.job_type =
17525 std::option::Option::Some(crate::model::ordered_job::JobType::HiveJob(v.into()));
17526 self
17527 }
17528
17529 pub fn pig_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PigJob>> {
17533 #[allow(unreachable_patterns)]
17534 self.job_type.as_ref().and_then(|v| match v {
17535 crate::model::ordered_job::JobType::PigJob(v) => std::option::Option::Some(v),
17536 _ => std::option::Option::None,
17537 })
17538 }
17539
17540 pub fn set_pig_job<T: std::convert::Into<std::boxed::Box<crate::model::PigJob>>>(
17546 mut self,
17547 v: T,
17548 ) -> Self {
17549 self.job_type =
17550 std::option::Option::Some(crate::model::ordered_job::JobType::PigJob(v.into()));
17551 self
17552 }
17553
17554 pub fn spark_r_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkRJob>> {
17558 #[allow(unreachable_patterns)]
17559 self.job_type.as_ref().and_then(|v| match v {
17560 crate::model::ordered_job::JobType::SparkRJob(v) => std::option::Option::Some(v),
17561 _ => std::option::Option::None,
17562 })
17563 }
17564
17565 pub fn set_spark_r_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkRJob>>>(
17571 mut self,
17572 v: T,
17573 ) -> Self {
17574 self.job_type =
17575 std::option::Option::Some(crate::model::ordered_job::JobType::SparkRJob(v.into()));
17576 self
17577 }
17578
17579 pub fn spark_sql_job(
17583 &self,
17584 ) -> std::option::Option<&std::boxed::Box<crate::model::SparkSqlJob>> {
17585 #[allow(unreachable_patterns)]
17586 self.job_type.as_ref().and_then(|v| match v {
17587 crate::model::ordered_job::JobType::SparkSqlJob(v) => std::option::Option::Some(v),
17588 _ => std::option::Option::None,
17589 })
17590 }
17591
17592 pub fn set_spark_sql_job<T: std::convert::Into<std::boxed::Box<crate::model::SparkSqlJob>>>(
17598 mut self,
17599 v: T,
17600 ) -> Self {
17601 self.job_type =
17602 std::option::Option::Some(crate::model::ordered_job::JobType::SparkSqlJob(v.into()));
17603 self
17604 }
17605
17606 pub fn presto_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::PrestoJob>> {
17610 #[allow(unreachable_patterns)]
17611 self.job_type.as_ref().and_then(|v| match v {
17612 crate::model::ordered_job::JobType::PrestoJob(v) => std::option::Option::Some(v),
17613 _ => std::option::Option::None,
17614 })
17615 }
17616
17617 pub fn set_presto_job<T: std::convert::Into<std::boxed::Box<crate::model::PrestoJob>>>(
17623 mut self,
17624 v: T,
17625 ) -> Self {
17626 self.job_type =
17627 std::option::Option::Some(crate::model::ordered_job::JobType::PrestoJob(v.into()));
17628 self
17629 }
17630
17631 pub fn trino_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::TrinoJob>> {
17635 #[allow(unreachable_patterns)]
17636 self.job_type.as_ref().and_then(|v| match v {
17637 crate::model::ordered_job::JobType::TrinoJob(v) => std::option::Option::Some(v),
17638 _ => std::option::Option::None,
17639 })
17640 }
17641
17642 pub fn set_trino_job<T: std::convert::Into<std::boxed::Box<crate::model::TrinoJob>>>(
17648 mut self,
17649 v: T,
17650 ) -> Self {
17651 self.job_type =
17652 std::option::Option::Some(crate::model::ordered_job::JobType::TrinoJob(v.into()));
17653 self
17654 }
17655
17656 pub fn flink_job(&self) -> std::option::Option<&std::boxed::Box<crate::model::FlinkJob>> {
17660 #[allow(unreachable_patterns)]
17661 self.job_type.as_ref().and_then(|v| match v {
17662 crate::model::ordered_job::JobType::FlinkJob(v) => std::option::Option::Some(v),
17663 _ => std::option::Option::None,
17664 })
17665 }
17666
17667 pub fn set_flink_job<T: std::convert::Into<std::boxed::Box<crate::model::FlinkJob>>>(
17673 mut self,
17674 v: T,
17675 ) -> Self {
17676 self.job_type =
17677 std::option::Option::Some(crate::model::ordered_job::JobType::FlinkJob(v.into()));
17678 self
17679 }
17680}
17681
17682impl wkt::message::Message for OrderedJob {
17683 fn typename() -> &'static str {
17684 "type.googleapis.com/google.cloud.dataproc.v1.OrderedJob"
17685 }
17686}
17687
17688pub mod ordered_job {
17690 #[allow(unused_imports)]
17691 use super::*;
17692
17693 #[derive(Clone, Debug, PartialEq)]
17695 #[non_exhaustive]
17696 pub enum JobType {
17697 HadoopJob(std::boxed::Box<crate::model::HadoopJob>),
17699 SparkJob(std::boxed::Box<crate::model::SparkJob>),
17701 PysparkJob(std::boxed::Box<crate::model::PySparkJob>),
17703 HiveJob(std::boxed::Box<crate::model::HiveJob>),
17705 PigJob(std::boxed::Box<crate::model::PigJob>),
17707 SparkRJob(std::boxed::Box<crate::model::SparkRJob>),
17709 SparkSqlJob(std::boxed::Box<crate::model::SparkSqlJob>),
17711 PrestoJob(std::boxed::Box<crate::model::PrestoJob>),
17713 TrinoJob(std::boxed::Box<crate::model::TrinoJob>),
17715 FlinkJob(std::boxed::Box<crate::model::FlinkJob>),
17717 }
17718}
17719
17720#[derive(Clone, Default, PartialEq)]
17731#[non_exhaustive]
17732pub struct TemplateParameter {
17733 pub name: std::string::String,
17741
17742 pub fields: std::vec::Vec<std::string::String>,
17790
17791 pub description: std::string::String,
17794
17795 pub validation: std::option::Option<crate::model::ParameterValidation>,
17797
17798 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17799}
17800
17801impl TemplateParameter {
17802 pub fn new() -> Self {
17803 std::default::Default::default()
17804 }
17805
17806 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17808 self.name = v.into();
17809 self
17810 }
17811
17812 pub fn set_fields<T, V>(mut self, v: T) -> Self
17814 where
17815 T: std::iter::IntoIterator<Item = V>,
17816 V: std::convert::Into<std::string::String>,
17817 {
17818 use std::iter::Iterator;
17819 self.fields = v.into_iter().map(|i| i.into()).collect();
17820 self
17821 }
17822
17823 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17825 self.description = v.into();
17826 self
17827 }
17828
17829 pub fn set_validation<T>(mut self, v: T) -> Self
17831 where
17832 T: std::convert::Into<crate::model::ParameterValidation>,
17833 {
17834 self.validation = std::option::Option::Some(v.into());
17835 self
17836 }
17837
17838 pub fn set_or_clear_validation<T>(mut self, v: std::option::Option<T>) -> Self
17840 where
17841 T: std::convert::Into<crate::model::ParameterValidation>,
17842 {
17843 self.validation = v.map(|x| x.into());
17844 self
17845 }
17846}
17847
17848impl wkt::message::Message for TemplateParameter {
17849 fn typename() -> &'static str {
17850 "type.googleapis.com/google.cloud.dataproc.v1.TemplateParameter"
17851 }
17852}
17853
17854#[derive(Clone, Default, PartialEq)]
17856#[non_exhaustive]
17857pub struct ParameterValidation {
17858 pub validation_type: std::option::Option<crate::model::parameter_validation::ValidationType>,
17860
17861 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17862}
17863
17864impl ParameterValidation {
17865 pub fn new() -> Self {
17866 std::default::Default::default()
17867 }
17868
17869 pub fn set_validation_type<
17874 T: std::convert::Into<std::option::Option<crate::model::parameter_validation::ValidationType>>,
17875 >(
17876 mut self,
17877 v: T,
17878 ) -> Self {
17879 self.validation_type = v.into();
17880 self
17881 }
17882
17883 pub fn regex(&self) -> std::option::Option<&std::boxed::Box<crate::model::RegexValidation>> {
17887 #[allow(unreachable_patterns)]
17888 self.validation_type.as_ref().and_then(|v| match v {
17889 crate::model::parameter_validation::ValidationType::Regex(v) => {
17890 std::option::Option::Some(v)
17891 }
17892 _ => std::option::Option::None,
17893 })
17894 }
17895
17896 pub fn set_regex<T: std::convert::Into<std::boxed::Box<crate::model::RegexValidation>>>(
17902 mut self,
17903 v: T,
17904 ) -> Self {
17905 self.validation_type = std::option::Option::Some(
17906 crate::model::parameter_validation::ValidationType::Regex(v.into()),
17907 );
17908 self
17909 }
17910
17911 pub fn values(&self) -> std::option::Option<&std::boxed::Box<crate::model::ValueValidation>> {
17915 #[allow(unreachable_patterns)]
17916 self.validation_type.as_ref().and_then(|v| match v {
17917 crate::model::parameter_validation::ValidationType::Values(v) => {
17918 std::option::Option::Some(v)
17919 }
17920 _ => std::option::Option::None,
17921 })
17922 }
17923
17924 pub fn set_values<T: std::convert::Into<std::boxed::Box<crate::model::ValueValidation>>>(
17930 mut self,
17931 v: T,
17932 ) -> Self {
17933 self.validation_type = std::option::Option::Some(
17934 crate::model::parameter_validation::ValidationType::Values(v.into()),
17935 );
17936 self
17937 }
17938}
17939
17940impl wkt::message::Message for ParameterValidation {
17941 fn typename() -> &'static str {
17942 "type.googleapis.com/google.cloud.dataproc.v1.ParameterValidation"
17943 }
17944}
17945
17946pub mod parameter_validation {
17948 #[allow(unused_imports)]
17949 use super::*;
17950
17951 #[derive(Clone, Debug, PartialEq)]
17953 #[non_exhaustive]
17954 pub enum ValidationType {
17955 Regex(std::boxed::Box<crate::model::RegexValidation>),
17957 Values(std::boxed::Box<crate::model::ValueValidation>),
17959 }
17960}
17961
17962#[derive(Clone, Default, PartialEq)]
17964#[non_exhaustive]
17965pub struct RegexValidation {
17966 pub regexes: std::vec::Vec<std::string::String>,
17970
17971 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17972}
17973
17974impl RegexValidation {
17975 pub fn new() -> Self {
17976 std::default::Default::default()
17977 }
17978
17979 pub fn set_regexes<T, V>(mut self, v: T) -> Self
17981 where
17982 T: std::iter::IntoIterator<Item = V>,
17983 V: std::convert::Into<std::string::String>,
17984 {
17985 use std::iter::Iterator;
17986 self.regexes = v.into_iter().map(|i| i.into()).collect();
17987 self
17988 }
17989}
17990
17991impl wkt::message::Message for RegexValidation {
17992 fn typename() -> &'static str {
17993 "type.googleapis.com/google.cloud.dataproc.v1.RegexValidation"
17994 }
17995}
17996
17997#[derive(Clone, Default, PartialEq)]
17999#[non_exhaustive]
18000pub struct ValueValidation {
18001 pub values: std::vec::Vec<std::string::String>,
18003
18004 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18005}
18006
18007impl ValueValidation {
18008 pub fn new() -> Self {
18009 std::default::Default::default()
18010 }
18011
18012 pub fn set_values<T, V>(mut self, v: T) -> Self
18014 where
18015 T: std::iter::IntoIterator<Item = V>,
18016 V: std::convert::Into<std::string::String>,
18017 {
18018 use std::iter::Iterator;
18019 self.values = v.into_iter().map(|i| i.into()).collect();
18020 self
18021 }
18022}
18023
18024impl wkt::message::Message for ValueValidation {
18025 fn typename() -> &'static str {
18026 "type.googleapis.com/google.cloud.dataproc.v1.ValueValidation"
18027 }
18028}
18029
18030#[derive(Clone, Default, PartialEq)]
18032#[non_exhaustive]
18033pub struct WorkflowMetadata {
18034 pub template: std::string::String,
18046
18047 pub version: i32,
18050
18051 pub create_cluster: std::option::Option<crate::model::ClusterOperation>,
18053
18054 pub graph: std::option::Option<crate::model::WorkflowGraph>,
18056
18057 pub delete_cluster: std::option::Option<crate::model::ClusterOperation>,
18059
18060 pub state: crate::model::workflow_metadata::State,
18062
18063 pub cluster_name: std::string::String,
18065
18066 pub parameters: std::collections::HashMap<std::string::String, std::string::String>,
18068
18069 pub start_time: std::option::Option<wkt::Timestamp>,
18071
18072 pub end_time: std::option::Option<wkt::Timestamp>,
18074
18075 pub cluster_uuid: std::string::String,
18077
18078 pub dag_timeout: std::option::Option<wkt::Duration>,
18082
18083 pub dag_start_time: std::option::Option<wkt::Timestamp>,
18089
18090 pub dag_end_time: std::option::Option<wkt::Timestamp>,
18096
18097 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18098}
18099
18100impl WorkflowMetadata {
18101 pub fn new() -> Self {
18102 std::default::Default::default()
18103 }
18104
18105 pub fn set_template<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18107 self.template = v.into();
18108 self
18109 }
18110
18111 pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18113 self.version = v.into();
18114 self
18115 }
18116
18117 pub fn set_create_cluster<T>(mut self, v: T) -> Self
18119 where
18120 T: std::convert::Into<crate::model::ClusterOperation>,
18121 {
18122 self.create_cluster = std::option::Option::Some(v.into());
18123 self
18124 }
18125
18126 pub fn set_or_clear_create_cluster<T>(mut self, v: std::option::Option<T>) -> Self
18128 where
18129 T: std::convert::Into<crate::model::ClusterOperation>,
18130 {
18131 self.create_cluster = v.map(|x| x.into());
18132 self
18133 }
18134
18135 pub fn set_graph<T>(mut self, v: T) -> Self
18137 where
18138 T: std::convert::Into<crate::model::WorkflowGraph>,
18139 {
18140 self.graph = std::option::Option::Some(v.into());
18141 self
18142 }
18143
18144 pub fn set_or_clear_graph<T>(mut self, v: std::option::Option<T>) -> Self
18146 where
18147 T: std::convert::Into<crate::model::WorkflowGraph>,
18148 {
18149 self.graph = v.map(|x| x.into());
18150 self
18151 }
18152
18153 pub fn set_delete_cluster<T>(mut self, v: T) -> Self
18155 where
18156 T: std::convert::Into<crate::model::ClusterOperation>,
18157 {
18158 self.delete_cluster = std::option::Option::Some(v.into());
18159 self
18160 }
18161
18162 pub fn set_or_clear_delete_cluster<T>(mut self, v: std::option::Option<T>) -> Self
18164 where
18165 T: std::convert::Into<crate::model::ClusterOperation>,
18166 {
18167 self.delete_cluster = v.map(|x| x.into());
18168 self
18169 }
18170
18171 pub fn set_state<T: std::convert::Into<crate::model::workflow_metadata::State>>(
18173 mut self,
18174 v: T,
18175 ) -> Self {
18176 self.state = v.into();
18177 self
18178 }
18179
18180 pub fn set_cluster_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18182 self.cluster_name = v.into();
18183 self
18184 }
18185
18186 pub fn set_parameters<T, K, V>(mut self, v: T) -> Self
18188 where
18189 T: std::iter::IntoIterator<Item = (K, V)>,
18190 K: std::convert::Into<std::string::String>,
18191 V: std::convert::Into<std::string::String>,
18192 {
18193 use std::iter::Iterator;
18194 self.parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18195 self
18196 }
18197
18198 pub fn set_start_time<T>(mut self, v: T) -> Self
18200 where
18201 T: std::convert::Into<wkt::Timestamp>,
18202 {
18203 self.start_time = std::option::Option::Some(v.into());
18204 self
18205 }
18206
18207 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
18209 where
18210 T: std::convert::Into<wkt::Timestamp>,
18211 {
18212 self.start_time = v.map(|x| x.into());
18213 self
18214 }
18215
18216 pub fn set_end_time<T>(mut self, v: T) -> Self
18218 where
18219 T: std::convert::Into<wkt::Timestamp>,
18220 {
18221 self.end_time = std::option::Option::Some(v.into());
18222 self
18223 }
18224
18225 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
18227 where
18228 T: std::convert::Into<wkt::Timestamp>,
18229 {
18230 self.end_time = v.map(|x| x.into());
18231 self
18232 }
18233
18234 pub fn set_cluster_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18236 self.cluster_uuid = v.into();
18237 self
18238 }
18239
18240 pub fn set_dag_timeout<T>(mut self, v: T) -> Self
18242 where
18243 T: std::convert::Into<wkt::Duration>,
18244 {
18245 self.dag_timeout = std::option::Option::Some(v.into());
18246 self
18247 }
18248
18249 pub fn set_or_clear_dag_timeout<T>(mut self, v: std::option::Option<T>) -> Self
18251 where
18252 T: std::convert::Into<wkt::Duration>,
18253 {
18254 self.dag_timeout = v.map(|x| x.into());
18255 self
18256 }
18257
18258 pub fn set_dag_start_time<T>(mut self, v: T) -> Self
18260 where
18261 T: std::convert::Into<wkt::Timestamp>,
18262 {
18263 self.dag_start_time = std::option::Option::Some(v.into());
18264 self
18265 }
18266
18267 pub fn set_or_clear_dag_start_time<T>(mut self, v: std::option::Option<T>) -> Self
18269 where
18270 T: std::convert::Into<wkt::Timestamp>,
18271 {
18272 self.dag_start_time = v.map(|x| x.into());
18273 self
18274 }
18275
18276 pub fn set_dag_end_time<T>(mut self, v: T) -> Self
18278 where
18279 T: std::convert::Into<wkt::Timestamp>,
18280 {
18281 self.dag_end_time = std::option::Option::Some(v.into());
18282 self
18283 }
18284
18285 pub fn set_or_clear_dag_end_time<T>(mut self, v: std::option::Option<T>) -> Self
18287 where
18288 T: std::convert::Into<wkt::Timestamp>,
18289 {
18290 self.dag_end_time = v.map(|x| x.into());
18291 self
18292 }
18293}
18294
18295impl wkt::message::Message for WorkflowMetadata {
18296 fn typename() -> &'static str {
18297 "type.googleapis.com/google.cloud.dataproc.v1.WorkflowMetadata"
18298 }
18299}
18300
18301pub mod workflow_metadata {
18303 #[allow(unused_imports)]
18304 use super::*;
18305
18306 #[derive(Clone, Debug, PartialEq)]
18322 #[non_exhaustive]
18323 pub enum State {
18324 Unknown,
18326 Pending,
18328 Running,
18330 Done,
18332 UnknownValue(state::UnknownValue),
18337 }
18338
18339 #[doc(hidden)]
18340 pub mod state {
18341 #[allow(unused_imports)]
18342 use super::*;
18343 #[derive(Clone, Debug, PartialEq)]
18344 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18345 }
18346
18347 impl State {
18348 pub fn value(&self) -> std::option::Option<i32> {
18353 match self {
18354 Self::Unknown => std::option::Option::Some(0),
18355 Self::Pending => std::option::Option::Some(1),
18356 Self::Running => std::option::Option::Some(2),
18357 Self::Done => std::option::Option::Some(3),
18358 Self::UnknownValue(u) => u.0.value(),
18359 }
18360 }
18361
18362 pub fn name(&self) -> std::option::Option<&str> {
18367 match self {
18368 Self::Unknown => std::option::Option::Some("UNKNOWN"),
18369 Self::Pending => std::option::Option::Some("PENDING"),
18370 Self::Running => std::option::Option::Some("RUNNING"),
18371 Self::Done => std::option::Option::Some("DONE"),
18372 Self::UnknownValue(u) => u.0.name(),
18373 }
18374 }
18375 }
18376
18377 impl std::default::Default for State {
18378 fn default() -> Self {
18379 use std::convert::From;
18380 Self::from(0)
18381 }
18382 }
18383
18384 impl std::fmt::Display for State {
18385 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18386 wkt::internal::display_enum(f, self.name(), self.value())
18387 }
18388 }
18389
18390 impl std::convert::From<i32> for State {
18391 fn from(value: i32) -> Self {
18392 match value {
18393 0 => Self::Unknown,
18394 1 => Self::Pending,
18395 2 => Self::Running,
18396 3 => Self::Done,
18397 _ => Self::UnknownValue(state::UnknownValue(
18398 wkt::internal::UnknownEnumValue::Integer(value),
18399 )),
18400 }
18401 }
18402 }
18403
18404 impl std::convert::From<&str> for State {
18405 fn from(value: &str) -> Self {
18406 use std::string::ToString;
18407 match value {
18408 "UNKNOWN" => Self::Unknown,
18409 "PENDING" => Self::Pending,
18410 "RUNNING" => Self::Running,
18411 "DONE" => Self::Done,
18412 _ => Self::UnknownValue(state::UnknownValue(
18413 wkt::internal::UnknownEnumValue::String(value.to_string()),
18414 )),
18415 }
18416 }
18417 }
18418
18419 impl serde::ser::Serialize for State {
18420 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18421 where
18422 S: serde::Serializer,
18423 {
18424 match self {
18425 Self::Unknown => serializer.serialize_i32(0),
18426 Self::Pending => serializer.serialize_i32(1),
18427 Self::Running => serializer.serialize_i32(2),
18428 Self::Done => serializer.serialize_i32(3),
18429 Self::UnknownValue(u) => u.0.serialize(serializer),
18430 }
18431 }
18432 }
18433
18434 impl<'de> serde::de::Deserialize<'de> for State {
18435 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18436 where
18437 D: serde::Deserializer<'de>,
18438 {
18439 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
18440 ".google.cloud.dataproc.v1.WorkflowMetadata.State",
18441 ))
18442 }
18443 }
18444}
18445
18446#[derive(Clone, Default, PartialEq)]
18448#[non_exhaustive]
18449pub struct ClusterOperation {
18450 pub operation_id: std::string::String,
18452
18453 pub error: std::string::String,
18455
18456 pub done: bool,
18458
18459 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18460}
18461
18462impl ClusterOperation {
18463 pub fn new() -> Self {
18464 std::default::Default::default()
18465 }
18466
18467 pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18469 self.operation_id = v.into();
18470 self
18471 }
18472
18473 pub fn set_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18475 self.error = v.into();
18476 self
18477 }
18478
18479 pub fn set_done<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18481 self.done = v.into();
18482 self
18483 }
18484}
18485
18486impl wkt::message::Message for ClusterOperation {
18487 fn typename() -> &'static str {
18488 "type.googleapis.com/google.cloud.dataproc.v1.ClusterOperation"
18489 }
18490}
18491
18492#[derive(Clone, Default, PartialEq)]
18494#[non_exhaustive]
18495pub struct WorkflowGraph {
18496 pub nodes: std::vec::Vec<crate::model::WorkflowNode>,
18498
18499 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18500}
18501
18502impl WorkflowGraph {
18503 pub fn new() -> Self {
18504 std::default::Default::default()
18505 }
18506
18507 pub fn set_nodes<T, V>(mut self, v: T) -> Self
18509 where
18510 T: std::iter::IntoIterator<Item = V>,
18511 V: std::convert::Into<crate::model::WorkflowNode>,
18512 {
18513 use std::iter::Iterator;
18514 self.nodes = v.into_iter().map(|i| i.into()).collect();
18515 self
18516 }
18517}
18518
18519impl wkt::message::Message for WorkflowGraph {
18520 fn typename() -> &'static str {
18521 "type.googleapis.com/google.cloud.dataproc.v1.WorkflowGraph"
18522 }
18523}
18524
18525#[derive(Clone, Default, PartialEq)]
18527#[non_exhaustive]
18528pub struct WorkflowNode {
18529 pub step_id: std::string::String,
18531
18532 pub prerequisite_step_ids: std::vec::Vec<std::string::String>,
18534
18535 pub job_id: std::string::String,
18537
18538 pub state: crate::model::workflow_node::NodeState,
18540
18541 pub error: std::string::String,
18543
18544 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18545}
18546
18547impl WorkflowNode {
18548 pub fn new() -> Self {
18549 std::default::Default::default()
18550 }
18551
18552 pub fn set_step_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18554 self.step_id = v.into();
18555 self
18556 }
18557
18558 pub fn set_prerequisite_step_ids<T, V>(mut self, v: T) -> Self
18560 where
18561 T: std::iter::IntoIterator<Item = V>,
18562 V: std::convert::Into<std::string::String>,
18563 {
18564 use std::iter::Iterator;
18565 self.prerequisite_step_ids = v.into_iter().map(|i| i.into()).collect();
18566 self
18567 }
18568
18569 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18571 self.job_id = v.into();
18572 self
18573 }
18574
18575 pub fn set_state<T: std::convert::Into<crate::model::workflow_node::NodeState>>(
18577 mut self,
18578 v: T,
18579 ) -> Self {
18580 self.state = v.into();
18581 self
18582 }
18583
18584 pub fn set_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18586 self.error = v.into();
18587 self
18588 }
18589}
18590
18591impl wkt::message::Message for WorkflowNode {
18592 fn typename() -> &'static str {
18593 "type.googleapis.com/google.cloud.dataproc.v1.WorkflowNode"
18594 }
18595}
18596
18597pub mod workflow_node {
18599 #[allow(unused_imports)]
18600 use super::*;
18601
18602 #[derive(Clone, Debug, PartialEq)]
18618 #[non_exhaustive]
18619 pub enum NodeState {
18620 Unspecified,
18622 Blocked,
18624 Runnable,
18626 Running,
18628 Completed,
18630 Failed,
18633 UnknownValue(node_state::UnknownValue),
18638 }
18639
18640 #[doc(hidden)]
18641 pub mod node_state {
18642 #[allow(unused_imports)]
18643 use super::*;
18644 #[derive(Clone, Debug, PartialEq)]
18645 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18646 }
18647
18648 impl NodeState {
18649 pub fn value(&self) -> std::option::Option<i32> {
18654 match self {
18655 Self::Unspecified => std::option::Option::Some(0),
18656 Self::Blocked => std::option::Option::Some(1),
18657 Self::Runnable => std::option::Option::Some(2),
18658 Self::Running => std::option::Option::Some(3),
18659 Self::Completed => std::option::Option::Some(4),
18660 Self::Failed => std::option::Option::Some(5),
18661 Self::UnknownValue(u) => u.0.value(),
18662 }
18663 }
18664
18665 pub fn name(&self) -> std::option::Option<&str> {
18670 match self {
18671 Self::Unspecified => std::option::Option::Some("NODE_STATE_UNSPECIFIED"),
18672 Self::Blocked => std::option::Option::Some("BLOCKED"),
18673 Self::Runnable => std::option::Option::Some("RUNNABLE"),
18674 Self::Running => std::option::Option::Some("RUNNING"),
18675 Self::Completed => std::option::Option::Some("COMPLETED"),
18676 Self::Failed => std::option::Option::Some("FAILED"),
18677 Self::UnknownValue(u) => u.0.name(),
18678 }
18679 }
18680 }
18681
18682 impl std::default::Default for NodeState {
18683 fn default() -> Self {
18684 use std::convert::From;
18685 Self::from(0)
18686 }
18687 }
18688
18689 impl std::fmt::Display for NodeState {
18690 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18691 wkt::internal::display_enum(f, self.name(), self.value())
18692 }
18693 }
18694
18695 impl std::convert::From<i32> for NodeState {
18696 fn from(value: i32) -> Self {
18697 match value {
18698 0 => Self::Unspecified,
18699 1 => Self::Blocked,
18700 2 => Self::Runnable,
18701 3 => Self::Running,
18702 4 => Self::Completed,
18703 5 => Self::Failed,
18704 _ => Self::UnknownValue(node_state::UnknownValue(
18705 wkt::internal::UnknownEnumValue::Integer(value),
18706 )),
18707 }
18708 }
18709 }
18710
18711 impl std::convert::From<&str> for NodeState {
18712 fn from(value: &str) -> Self {
18713 use std::string::ToString;
18714 match value {
18715 "NODE_STATE_UNSPECIFIED" => Self::Unspecified,
18716 "BLOCKED" => Self::Blocked,
18717 "RUNNABLE" => Self::Runnable,
18718 "RUNNING" => Self::Running,
18719 "COMPLETED" => Self::Completed,
18720 "FAILED" => Self::Failed,
18721 _ => Self::UnknownValue(node_state::UnknownValue(
18722 wkt::internal::UnknownEnumValue::String(value.to_string()),
18723 )),
18724 }
18725 }
18726 }
18727
18728 impl serde::ser::Serialize for NodeState {
18729 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18730 where
18731 S: serde::Serializer,
18732 {
18733 match self {
18734 Self::Unspecified => serializer.serialize_i32(0),
18735 Self::Blocked => serializer.serialize_i32(1),
18736 Self::Runnable => serializer.serialize_i32(2),
18737 Self::Running => serializer.serialize_i32(3),
18738 Self::Completed => serializer.serialize_i32(4),
18739 Self::Failed => serializer.serialize_i32(5),
18740 Self::UnknownValue(u) => u.0.serialize(serializer),
18741 }
18742 }
18743 }
18744
18745 impl<'de> serde::de::Deserialize<'de> for NodeState {
18746 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18747 where
18748 D: serde::Deserializer<'de>,
18749 {
18750 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NodeState>::new(
18751 ".google.cloud.dataproc.v1.WorkflowNode.NodeState",
18752 ))
18753 }
18754 }
18755}
18756
18757#[derive(Clone, Default, PartialEq)]
18759#[non_exhaustive]
18760pub struct CreateWorkflowTemplateRequest {
18761 pub parent: std::string::String,
18773
18774 pub template: std::option::Option<crate::model::WorkflowTemplate>,
18776
18777 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18778}
18779
18780impl CreateWorkflowTemplateRequest {
18781 pub fn new() -> Self {
18782 std::default::Default::default()
18783 }
18784
18785 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18787 self.parent = v.into();
18788 self
18789 }
18790
18791 pub fn set_template<T>(mut self, v: T) -> Self
18793 where
18794 T: std::convert::Into<crate::model::WorkflowTemplate>,
18795 {
18796 self.template = std::option::Option::Some(v.into());
18797 self
18798 }
18799
18800 pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
18802 where
18803 T: std::convert::Into<crate::model::WorkflowTemplate>,
18804 {
18805 self.template = v.map(|x| x.into());
18806 self
18807 }
18808}
18809
18810impl wkt::message::Message for CreateWorkflowTemplateRequest {
18811 fn typename() -> &'static str {
18812 "type.googleapis.com/google.cloud.dataproc.v1.CreateWorkflowTemplateRequest"
18813 }
18814}
18815
18816#[derive(Clone, Default, PartialEq)]
18818#[non_exhaustive]
18819pub struct GetWorkflowTemplateRequest {
18820 pub name: std::string::String,
18832
18833 pub version: i32,
18838
18839 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18840}
18841
18842impl GetWorkflowTemplateRequest {
18843 pub fn new() -> Self {
18844 std::default::Default::default()
18845 }
18846
18847 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18849 self.name = v.into();
18850 self
18851 }
18852
18853 pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18855 self.version = v.into();
18856 self
18857 }
18858}
18859
18860impl wkt::message::Message for GetWorkflowTemplateRequest {
18861 fn typename() -> &'static str {
18862 "type.googleapis.com/google.cloud.dataproc.v1.GetWorkflowTemplateRequest"
18863 }
18864}
18865
18866#[derive(Clone, Default, PartialEq)]
18868#[non_exhaustive]
18869pub struct InstantiateWorkflowTemplateRequest {
18870 pub name: std::string::String,
18882
18883 pub version: i32,
18890
18891 pub request_id: std::string::String,
18901
18902 pub parameters: std::collections::HashMap<std::string::String, std::string::String>,
18905
18906 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18907}
18908
18909impl InstantiateWorkflowTemplateRequest {
18910 pub fn new() -> Self {
18911 std::default::Default::default()
18912 }
18913
18914 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18916 self.name = v.into();
18917 self
18918 }
18919
18920 pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18922 self.version = v.into();
18923 self
18924 }
18925
18926 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18928 self.request_id = v.into();
18929 self
18930 }
18931
18932 pub fn set_parameters<T, K, V>(mut self, v: T) -> Self
18934 where
18935 T: std::iter::IntoIterator<Item = (K, V)>,
18936 K: std::convert::Into<std::string::String>,
18937 V: std::convert::Into<std::string::String>,
18938 {
18939 use std::iter::Iterator;
18940 self.parameters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18941 self
18942 }
18943}
18944
18945impl wkt::message::Message for InstantiateWorkflowTemplateRequest {
18946 fn typename() -> &'static str {
18947 "type.googleapis.com/google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest"
18948 }
18949}
18950
18951#[derive(Clone, Default, PartialEq)]
18953#[non_exhaustive]
18954pub struct InstantiateInlineWorkflowTemplateRequest {
18955 pub parent: std::string::String,
18967
18968 pub template: std::option::Option<crate::model::WorkflowTemplate>,
18970
18971 pub request_id: std::string::String,
18981
18982 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18983}
18984
18985impl InstantiateInlineWorkflowTemplateRequest {
18986 pub fn new() -> Self {
18987 std::default::Default::default()
18988 }
18989
18990 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18992 self.parent = v.into();
18993 self
18994 }
18995
18996 pub fn set_template<T>(mut self, v: T) -> Self
18998 where
18999 T: std::convert::Into<crate::model::WorkflowTemplate>,
19000 {
19001 self.template = std::option::Option::Some(v.into());
19002 self
19003 }
19004
19005 pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
19007 where
19008 T: std::convert::Into<crate::model::WorkflowTemplate>,
19009 {
19010 self.template = v.map(|x| x.into());
19011 self
19012 }
19013
19014 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19016 self.request_id = v.into();
19017 self
19018 }
19019}
19020
19021impl wkt::message::Message for InstantiateInlineWorkflowTemplateRequest {
19022 fn typename() -> &'static str {
19023 "type.googleapis.com/google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest"
19024 }
19025}
19026
19027#[derive(Clone, Default, PartialEq)]
19029#[non_exhaustive]
19030pub struct UpdateWorkflowTemplateRequest {
19031 pub template: std::option::Option<crate::model::WorkflowTemplate>,
19035
19036 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19037}
19038
19039impl UpdateWorkflowTemplateRequest {
19040 pub fn new() -> Self {
19041 std::default::Default::default()
19042 }
19043
19044 pub fn set_template<T>(mut self, v: T) -> Self
19046 where
19047 T: std::convert::Into<crate::model::WorkflowTemplate>,
19048 {
19049 self.template = std::option::Option::Some(v.into());
19050 self
19051 }
19052
19053 pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
19055 where
19056 T: std::convert::Into<crate::model::WorkflowTemplate>,
19057 {
19058 self.template = v.map(|x| x.into());
19059 self
19060 }
19061}
19062
19063impl wkt::message::Message for UpdateWorkflowTemplateRequest {
19064 fn typename() -> &'static str {
19065 "type.googleapis.com/google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest"
19066 }
19067}
19068
19069#[derive(Clone, Default, PartialEq)]
19071#[non_exhaustive]
19072pub struct ListWorkflowTemplatesRequest {
19073 pub parent: std::string::String,
19085
19086 pub page_size: i32,
19088
19089 pub page_token: std::string::String,
19092
19093 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19094}
19095
19096impl ListWorkflowTemplatesRequest {
19097 pub fn new() -> Self {
19098 std::default::Default::default()
19099 }
19100
19101 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19103 self.parent = v.into();
19104 self
19105 }
19106
19107 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19109 self.page_size = v.into();
19110 self
19111 }
19112
19113 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19115 self.page_token = v.into();
19116 self
19117 }
19118}
19119
19120impl wkt::message::Message for ListWorkflowTemplatesRequest {
19121 fn typename() -> &'static str {
19122 "type.googleapis.com/google.cloud.dataproc.v1.ListWorkflowTemplatesRequest"
19123 }
19124}
19125
19126#[derive(Clone, Default, PartialEq)]
19128#[non_exhaustive]
19129pub struct ListWorkflowTemplatesResponse {
19130 pub templates: std::vec::Vec<crate::model::WorkflowTemplate>,
19132
19133 pub next_page_token: std::string::String,
19137
19138 pub unreachable: std::vec::Vec<std::string::String>,
19142
19143 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19144}
19145
19146impl ListWorkflowTemplatesResponse {
19147 pub fn new() -> Self {
19148 std::default::Default::default()
19149 }
19150
19151 pub fn set_templates<T, V>(mut self, v: T) -> Self
19153 where
19154 T: std::iter::IntoIterator<Item = V>,
19155 V: std::convert::Into<crate::model::WorkflowTemplate>,
19156 {
19157 use std::iter::Iterator;
19158 self.templates = v.into_iter().map(|i| i.into()).collect();
19159 self
19160 }
19161
19162 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19164 self.next_page_token = v.into();
19165 self
19166 }
19167
19168 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
19170 where
19171 T: std::iter::IntoIterator<Item = V>,
19172 V: std::convert::Into<std::string::String>,
19173 {
19174 use std::iter::Iterator;
19175 self.unreachable = v.into_iter().map(|i| i.into()).collect();
19176 self
19177 }
19178}
19179
19180impl wkt::message::Message for ListWorkflowTemplatesResponse {
19181 fn typename() -> &'static str {
19182 "type.googleapis.com/google.cloud.dataproc.v1.ListWorkflowTemplatesResponse"
19183 }
19184}
19185
19186#[doc(hidden)]
19187impl gax::paginator::internal::PageableResponse for ListWorkflowTemplatesResponse {
19188 type PageItem = crate::model::WorkflowTemplate;
19189
19190 fn items(self) -> std::vec::Vec<Self::PageItem> {
19191 self.templates
19192 }
19193
19194 fn next_page_token(&self) -> std::string::String {
19195 use std::clone::Clone;
19196 self.next_page_token.clone()
19197 }
19198}
19199
19200#[derive(Clone, Default, PartialEq)]
19204#[non_exhaustive]
19205pub struct DeleteWorkflowTemplateRequest {
19206 pub name: std::string::String,
19218
19219 pub version: i32,
19223
19224 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19225}
19226
19227impl DeleteWorkflowTemplateRequest {
19228 pub fn new() -> Self {
19229 std::default::Default::default()
19230 }
19231
19232 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19234 self.name = v.into();
19235 self
19236 }
19237
19238 pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19240 self.version = v.into();
19241 self
19242 }
19243}
19244
19245impl wkt::message::Message for DeleteWorkflowTemplateRequest {
19246 fn typename() -> &'static str {
19247 "type.googleapis.com/google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest"
19248 }
19249}
19250
19251#[derive(Clone, Debug, PartialEq)]
19267#[non_exhaustive]
19268pub enum Component {
19269 Unspecified,
19271 Anaconda,
19277 Delta,
19279 Docker,
19281 Druid,
19283 Flink,
19285 Hbase,
19287 HiveWebhcat,
19289 Hudi,
19291 Iceberg,
19293 Jupyter,
19295 JupyterKernelGateway,
19297 Pig,
19299 Presto,
19301 Trino,
19303 Ranger,
19305 Solr,
19307 Zeppelin,
19309 Zookeeper,
19311 UnknownValue(component::UnknownValue),
19316}
19317
19318#[doc(hidden)]
19319pub mod component {
19320 #[allow(unused_imports)]
19321 use super::*;
19322 #[derive(Clone, Debug, PartialEq)]
19323 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19324}
19325
19326impl Component {
19327 pub fn value(&self) -> std::option::Option<i32> {
19332 match self {
19333 Self::Unspecified => std::option::Option::Some(0),
19334 Self::Anaconda => std::option::Option::Some(5),
19335 Self::Delta => std::option::Option::Some(20),
19336 Self::Docker => std::option::Option::Some(13),
19337 Self::Druid => std::option::Option::Some(9),
19338 Self::Flink => std::option::Option::Some(14),
19339 Self::Hbase => std::option::Option::Some(11),
19340 Self::HiveWebhcat => std::option::Option::Some(3),
19341 Self::Hudi => std::option::Option::Some(18),
19342 Self::Iceberg => std::option::Option::Some(19),
19343 Self::Jupyter => std::option::Option::Some(1),
19344 Self::JupyterKernelGateway => std::option::Option::Some(22),
19345 Self::Pig => std::option::Option::Some(21),
19346 Self::Presto => std::option::Option::Some(6),
19347 Self::Trino => std::option::Option::Some(17),
19348 Self::Ranger => std::option::Option::Some(12),
19349 Self::Solr => std::option::Option::Some(10),
19350 Self::Zeppelin => std::option::Option::Some(4),
19351 Self::Zookeeper => std::option::Option::Some(8),
19352 Self::UnknownValue(u) => u.0.value(),
19353 }
19354 }
19355
19356 pub fn name(&self) -> std::option::Option<&str> {
19361 match self {
19362 Self::Unspecified => std::option::Option::Some("COMPONENT_UNSPECIFIED"),
19363 Self::Anaconda => std::option::Option::Some("ANACONDA"),
19364 Self::Delta => std::option::Option::Some("DELTA"),
19365 Self::Docker => std::option::Option::Some("DOCKER"),
19366 Self::Druid => std::option::Option::Some("DRUID"),
19367 Self::Flink => std::option::Option::Some("FLINK"),
19368 Self::Hbase => std::option::Option::Some("HBASE"),
19369 Self::HiveWebhcat => std::option::Option::Some("HIVE_WEBHCAT"),
19370 Self::Hudi => std::option::Option::Some("HUDI"),
19371 Self::Iceberg => std::option::Option::Some("ICEBERG"),
19372 Self::Jupyter => std::option::Option::Some("JUPYTER"),
19373 Self::JupyterKernelGateway => std::option::Option::Some("JUPYTER_KERNEL_GATEWAY"),
19374 Self::Pig => std::option::Option::Some("PIG"),
19375 Self::Presto => std::option::Option::Some("PRESTO"),
19376 Self::Trino => std::option::Option::Some("TRINO"),
19377 Self::Ranger => std::option::Option::Some("RANGER"),
19378 Self::Solr => std::option::Option::Some("SOLR"),
19379 Self::Zeppelin => std::option::Option::Some("ZEPPELIN"),
19380 Self::Zookeeper => std::option::Option::Some("ZOOKEEPER"),
19381 Self::UnknownValue(u) => u.0.name(),
19382 }
19383 }
19384}
19385
19386impl std::default::Default for Component {
19387 fn default() -> Self {
19388 use std::convert::From;
19389 Self::from(0)
19390 }
19391}
19392
19393impl std::fmt::Display for Component {
19394 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19395 wkt::internal::display_enum(f, self.name(), self.value())
19396 }
19397}
19398
19399impl std::convert::From<i32> for Component {
19400 fn from(value: i32) -> Self {
19401 match value {
19402 0 => Self::Unspecified,
19403 1 => Self::Jupyter,
19404 3 => Self::HiveWebhcat,
19405 4 => Self::Zeppelin,
19406 5 => Self::Anaconda,
19407 6 => Self::Presto,
19408 8 => Self::Zookeeper,
19409 9 => Self::Druid,
19410 10 => Self::Solr,
19411 11 => Self::Hbase,
19412 12 => Self::Ranger,
19413 13 => Self::Docker,
19414 14 => Self::Flink,
19415 17 => Self::Trino,
19416 18 => Self::Hudi,
19417 19 => Self::Iceberg,
19418 20 => Self::Delta,
19419 21 => Self::Pig,
19420 22 => Self::JupyterKernelGateway,
19421 _ => Self::UnknownValue(component::UnknownValue(
19422 wkt::internal::UnknownEnumValue::Integer(value),
19423 )),
19424 }
19425 }
19426}
19427
19428impl std::convert::From<&str> for Component {
19429 fn from(value: &str) -> Self {
19430 use std::string::ToString;
19431 match value {
19432 "COMPONENT_UNSPECIFIED" => Self::Unspecified,
19433 "ANACONDA" => Self::Anaconda,
19434 "DELTA" => Self::Delta,
19435 "DOCKER" => Self::Docker,
19436 "DRUID" => Self::Druid,
19437 "FLINK" => Self::Flink,
19438 "HBASE" => Self::Hbase,
19439 "HIVE_WEBHCAT" => Self::HiveWebhcat,
19440 "HUDI" => Self::Hudi,
19441 "ICEBERG" => Self::Iceberg,
19442 "JUPYTER" => Self::Jupyter,
19443 "JUPYTER_KERNEL_GATEWAY" => Self::JupyterKernelGateway,
19444 "PIG" => Self::Pig,
19445 "PRESTO" => Self::Presto,
19446 "TRINO" => Self::Trino,
19447 "RANGER" => Self::Ranger,
19448 "SOLR" => Self::Solr,
19449 "ZEPPELIN" => Self::Zeppelin,
19450 "ZOOKEEPER" => Self::Zookeeper,
19451 _ => Self::UnknownValue(component::UnknownValue(
19452 wkt::internal::UnknownEnumValue::String(value.to_string()),
19453 )),
19454 }
19455 }
19456}
19457
19458impl serde::ser::Serialize for Component {
19459 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19460 where
19461 S: serde::Serializer,
19462 {
19463 match self {
19464 Self::Unspecified => serializer.serialize_i32(0),
19465 Self::Anaconda => serializer.serialize_i32(5),
19466 Self::Delta => serializer.serialize_i32(20),
19467 Self::Docker => serializer.serialize_i32(13),
19468 Self::Druid => serializer.serialize_i32(9),
19469 Self::Flink => serializer.serialize_i32(14),
19470 Self::Hbase => serializer.serialize_i32(11),
19471 Self::HiveWebhcat => serializer.serialize_i32(3),
19472 Self::Hudi => serializer.serialize_i32(18),
19473 Self::Iceberg => serializer.serialize_i32(19),
19474 Self::Jupyter => serializer.serialize_i32(1),
19475 Self::JupyterKernelGateway => serializer.serialize_i32(22),
19476 Self::Pig => serializer.serialize_i32(21),
19477 Self::Presto => serializer.serialize_i32(6),
19478 Self::Trino => serializer.serialize_i32(17),
19479 Self::Ranger => serializer.serialize_i32(12),
19480 Self::Solr => serializer.serialize_i32(10),
19481 Self::Zeppelin => serializer.serialize_i32(4),
19482 Self::Zookeeper => serializer.serialize_i32(8),
19483 Self::UnknownValue(u) => u.0.serialize(serializer),
19484 }
19485 }
19486}
19487
19488impl<'de> serde::de::Deserialize<'de> for Component {
19489 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19490 where
19491 D: serde::Deserializer<'de>,
19492 {
19493 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Component>::new(
19494 ".google.cloud.dataproc.v1.Component",
19495 ))
19496 }
19497}
19498
19499#[derive(Clone, Debug, PartialEq)]
19515#[non_exhaustive]
19516pub enum FailureAction {
19517 Unspecified,
19519 NoAction,
19522 Delete,
19524 UnknownValue(failure_action::UnknownValue),
19529}
19530
19531#[doc(hidden)]
19532pub mod failure_action {
19533 #[allow(unused_imports)]
19534 use super::*;
19535 #[derive(Clone, Debug, PartialEq)]
19536 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19537}
19538
19539impl FailureAction {
19540 pub fn value(&self) -> std::option::Option<i32> {
19545 match self {
19546 Self::Unspecified => std::option::Option::Some(0),
19547 Self::NoAction => std::option::Option::Some(1),
19548 Self::Delete => std::option::Option::Some(2),
19549 Self::UnknownValue(u) => u.0.value(),
19550 }
19551 }
19552
19553 pub fn name(&self) -> std::option::Option<&str> {
19558 match self {
19559 Self::Unspecified => std::option::Option::Some("FAILURE_ACTION_UNSPECIFIED"),
19560 Self::NoAction => std::option::Option::Some("NO_ACTION"),
19561 Self::Delete => std::option::Option::Some("DELETE"),
19562 Self::UnknownValue(u) => u.0.name(),
19563 }
19564 }
19565}
19566
19567impl std::default::Default for FailureAction {
19568 fn default() -> Self {
19569 use std::convert::From;
19570 Self::from(0)
19571 }
19572}
19573
19574impl std::fmt::Display for FailureAction {
19575 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19576 wkt::internal::display_enum(f, self.name(), self.value())
19577 }
19578}
19579
19580impl std::convert::From<i32> for FailureAction {
19581 fn from(value: i32) -> Self {
19582 match value {
19583 0 => Self::Unspecified,
19584 1 => Self::NoAction,
19585 2 => Self::Delete,
19586 _ => Self::UnknownValue(failure_action::UnknownValue(
19587 wkt::internal::UnknownEnumValue::Integer(value),
19588 )),
19589 }
19590 }
19591}
19592
19593impl std::convert::From<&str> for FailureAction {
19594 fn from(value: &str) -> Self {
19595 use std::string::ToString;
19596 match value {
19597 "FAILURE_ACTION_UNSPECIFIED" => Self::Unspecified,
19598 "NO_ACTION" => Self::NoAction,
19599 "DELETE" => Self::Delete,
19600 _ => Self::UnknownValue(failure_action::UnknownValue(
19601 wkt::internal::UnknownEnumValue::String(value.to_string()),
19602 )),
19603 }
19604 }
19605}
19606
19607impl serde::ser::Serialize for FailureAction {
19608 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19609 where
19610 S: serde::Serializer,
19611 {
19612 match self {
19613 Self::Unspecified => serializer.serialize_i32(0),
19614 Self::NoAction => serializer.serialize_i32(1),
19615 Self::Delete => serializer.serialize_i32(2),
19616 Self::UnknownValue(u) => u.0.serialize(serializer),
19617 }
19618 }
19619}
19620
19621impl<'de> serde::de::Deserialize<'de> for FailureAction {
19622 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19623 where
19624 D: serde::Deserializer<'de>,
19625 {
19626 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FailureAction>::new(
19627 ".google.cloud.dataproc.v1.FailureAction",
19628 ))
19629 }
19630}