google_cloud_dataproc_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![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/// Describes an autoscaling policy for Dataproc cluster autoscaler.
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct AutoscalingPolicy {
45    /// Required. The policy id.
46    ///
47    /// The id must contain only letters (a-z, A-Z), numbers (0-9),
48    /// underscores (_), and hyphens (-). Cannot begin or end with underscore
49    /// or hyphen. Must consist of between 3 and 50 characters.
50    pub id: std::string::String,
51
52    /// Output only. The "resource name" of the autoscaling policy, as described
53    /// in <https://cloud.google.com/apis/design/resource_names>.
54    ///
55    /// * For `projects.regions.autoscalingPolicies`, the resource name of the
56    ///   policy has the following format:
57    ///   `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}`
58    ///
59    /// * For `projects.locations.autoscalingPolicies`, the resource name of the
60    ///   policy has the following format:
61    ///   `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}`
62    ///
63    pub name: std::string::String,
64
65    /// Required. Describes how the autoscaler will operate for primary workers.
66    pub worker_config: std::option::Option<crate::model::InstanceGroupAutoscalingPolicyConfig>,
67
68    /// Optional. Describes how the autoscaler will operate for secondary workers.
69    pub secondary_worker_config:
70        std::option::Option<crate::model::InstanceGroupAutoscalingPolicyConfig>,
71
72    /// Optional. The labels to associate with this autoscaling policy.
73    /// Label **keys** must contain 1 to 63 characters, and must conform to
74    /// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
75    /// Label **values** may be empty, but, if present, must contain 1 to 63
76    /// characters, and must conform to [RFC
77    /// 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
78    /// associated with an autoscaling policy.
79    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
80
81    /// Autoscaling algorithm for policy.
82    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    /// Sets the value of [id][crate::model::AutoscalingPolicy::id].
93    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    /// Sets the value of [name][crate::model::AutoscalingPolicy::name].
99    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    /// Sets the value of [worker_config][crate::model::AutoscalingPolicy::worker_config].
105    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    /// Sets or clears the value of [worker_config][crate::model::AutoscalingPolicy::worker_config].
114    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    /// Sets the value of [secondary_worker_config][crate::model::AutoscalingPolicy::secondary_worker_config].
123    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    /// Sets or clears the value of [secondary_worker_config][crate::model::AutoscalingPolicy::secondary_worker_config].
132    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    /// Sets the value of [labels][crate::model::AutoscalingPolicy::labels].
141    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    /// Sets the value of [algorithm][crate::model::AutoscalingPolicy::algorithm].
153    ///
154    /// Note that all the setters affecting `algorithm` are mutually
155    /// exclusive.
156    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    /// The value of [algorithm][crate::model::AutoscalingPolicy::algorithm]
167    /// if it holds a `BasicAlgorithm`, `None` if the field is not set or
168    /// holds a different branch.
169    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    /// Sets the value of [algorithm][crate::model::AutoscalingPolicy::algorithm]
182    /// to hold a `BasicAlgorithm`.
183    ///
184    /// Note that all the setters affecting `algorithm` are
185    /// mutually exclusive.
186    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
205/// Defines additional types related to [AutoscalingPolicy].
206pub mod autoscaling_policy {
207    #[allow(unused_imports)]
208    use super::*;
209
210    /// Autoscaling algorithm for policy.
211    #[derive(Clone, Debug, PartialEq)]
212    #[non_exhaustive]
213    pub enum Algorithm {
214        BasicAlgorithm(std::boxed::Box<crate::model::BasicAutoscalingAlgorithm>),
215    }
216}
217
218/// Basic algorithm for autoscaling.
219#[derive(Clone, Default, PartialEq)]
220#[non_exhaustive]
221pub struct BasicAutoscalingAlgorithm {
222    /// Optional. Duration between scaling events. A scaling period starts after
223    /// the update operation from the previous event has completed.
224    ///
225    /// Bounds: [2m, 1d]. Default: 2m.
226    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    /// Sets the value of [cooldown_period][crate::model::BasicAutoscalingAlgorithm::cooldown_period].
239    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    /// Sets or clears the value of [cooldown_period][crate::model::BasicAutoscalingAlgorithm::cooldown_period].
248    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    /// Sets the value of [config][crate::model::BasicAutoscalingAlgorithm::config].
257    ///
258    /// Note that all the setters affecting `config` are mutually
259    /// exclusive.
260    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    /// The value of [config][crate::model::BasicAutoscalingAlgorithm::config]
271    /// if it holds a `YarnConfig`, `None` if the field is not set or
272    /// holds a different branch.
273    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    /// Sets the value of [config][crate::model::BasicAutoscalingAlgorithm::config]
286    /// to hold a `YarnConfig`.
287    ///
288    /// Note that all the setters affecting `config` are
289    /// mutually exclusive.
290    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
309/// Defines additional types related to [BasicAutoscalingAlgorithm].
310pub 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        /// Required. YARN autoscaling configuration.
318        YarnConfig(std::boxed::Box<crate::model::BasicYarnAutoscalingConfig>),
319    }
320}
321
322/// Basic autoscaling configurations for YARN.
323#[derive(Clone, Default, PartialEq)]
324#[non_exhaustive]
325pub struct BasicYarnAutoscalingConfig {
326    /// Required. Timeout for YARN graceful decommissioning of Node Managers.
327    /// Specifies the duration to wait for jobs to complete before forcefully
328    /// removing workers (and potentially interrupting jobs). Only applicable to
329    /// downscaling operations.
330    ///
331    /// Bounds: [0s, 1d].
332    pub graceful_decommission_timeout: std::option::Option<wkt::Duration>,
333
334    /// Required. Fraction of average YARN pending memory in the last cooldown
335    /// period for which to add workers. A scale-up factor of 1.0 will result in
336    /// scaling up so that there is no pending memory remaining after the update
337    /// (more aggressive scaling). A scale-up factor closer to 0 will result in a
338    /// smaller magnitude of scaling up (less aggressive scaling). See [How
339    /// autoscaling
340    /// works](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/autoscaling#how_autoscaling_works)
341    /// for more information.
342    ///
343    /// Bounds: [0.0, 1.0].
344    pub scale_up_factor: f64,
345
346    /// Required. Fraction of average YARN pending memory in the last cooldown
347    /// period for which to remove workers. A scale-down factor of 1 will result in
348    /// scaling down so that there is no available memory remaining after the
349    /// update (more aggressive scaling). A scale-down factor of 0 disables
350    /// removing workers, which can be beneficial for autoscaling a single job.
351    /// See [How autoscaling
352    /// works](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/autoscaling#how_autoscaling_works)
353    /// for more information.
354    ///
355    /// Bounds: [0.0, 1.0].
356    pub scale_down_factor: f64,
357
358    /// Optional. Minimum scale-up threshold as a fraction of total cluster size
359    /// before scaling occurs. For example, in a 20-worker cluster, a threshold of
360    /// 0.1 means the autoscaler must recommend at least a 2-worker scale-up for
361    /// the cluster to scale. A threshold of 0 means the autoscaler will scale up
362    /// on any recommended change.
363    ///
364    /// Bounds: [0.0, 1.0]. Default: 0.0.
365    pub scale_up_min_worker_fraction: f64,
366
367    /// Optional. Minimum scale-down threshold as a fraction of total cluster size
368    /// before scaling occurs. For example, in a 20-worker cluster, a threshold of
369    /// 0.1 means the autoscaler must recommend at least a 2 worker scale-down for
370    /// the cluster to scale. A threshold of 0 means the autoscaler will scale down
371    /// on any recommended change.
372    ///
373    /// Bounds: [0.0, 1.0]. Default: 0.0.
374    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    /// Sets the value of [graceful_decommission_timeout][crate::model::BasicYarnAutoscalingConfig::graceful_decommission_timeout].
385    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    /// Sets or clears the value of [graceful_decommission_timeout][crate::model::BasicYarnAutoscalingConfig::graceful_decommission_timeout].
394    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    /// Sets the value of [scale_up_factor][crate::model::BasicYarnAutoscalingConfig::scale_up_factor].
406    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    /// Sets the value of [scale_down_factor][crate::model::BasicYarnAutoscalingConfig::scale_down_factor].
412    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    /// Sets the value of [scale_up_min_worker_fraction][crate::model::BasicYarnAutoscalingConfig::scale_up_min_worker_fraction].
418    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    /// Sets the value of [scale_down_min_worker_fraction][crate::model::BasicYarnAutoscalingConfig::scale_down_min_worker_fraction].
424    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/// Configuration for the size bounds of an instance group, including its
437/// proportional size to other groups.
438#[derive(Clone, Default, PartialEq)]
439#[non_exhaustive]
440pub struct InstanceGroupAutoscalingPolicyConfig {
441    /// Optional. Minimum number of instances for this group.
442    ///
443    /// Primary workers - Bounds: [2, max_instances]. Default: 2.
444    /// Secondary workers - Bounds: [0, max_instances]. Default: 0.
445    pub min_instances: i32,
446
447    /// Required. Maximum number of instances for this group. Required for primary
448    /// workers. Note that by default, clusters will not use secondary workers.
449    /// Required for secondary workers if the minimum secondary instances is set.
450    ///
451    /// Primary workers - Bounds: [min_instances, ).
452    /// Secondary workers - Bounds: [min_instances, ). Default: 0.
453    pub max_instances: i32,
454
455    /// Optional. Weight for the instance group, which is used to determine the
456    /// fraction of total workers in the cluster from this instance group.
457    /// For example, if primary workers have weight 2, and secondary workers have
458    /// weight 1, the cluster will have approximately 2 primary workers for each
459    /// secondary worker.
460    ///
461    /// The cluster may not reach the specified balance if constrained
462    /// by min/max bounds or other autoscaling settings. For example, if
463    /// `max_instances` for secondary workers is 0, then only primary workers will
464    /// be added. The cluster can also be out of balance when created.
465    ///
466    /// If weight is not set on any instance group, the cluster will default to
467    /// equal weight for all groups: the cluster will attempt to maintain an equal
468    /// number of workers in each group within the configured size bounds for each
469    /// group. If weight is set for one group only, the cluster will default to
470    /// zero weight on the unset group. For example if weight is set only on
471    /// primary workers, the cluster will use primary workers only and no
472    /// secondary workers.
473    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    /// Sets the value of [min_instances][crate::model::InstanceGroupAutoscalingPolicyConfig::min_instances].
484    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    /// Sets the value of [max_instances][crate::model::InstanceGroupAutoscalingPolicyConfig::max_instances].
490    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    /// Sets the value of [weight][crate::model::InstanceGroupAutoscalingPolicyConfig::weight].
496    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/// A request to create an autoscaling policy.
509#[derive(Clone, Default, PartialEq)]
510#[non_exhaustive]
511pub struct CreateAutoscalingPolicyRequest {
512    /// Required. The "resource name" of the region or location, as described
513    /// in <https://cloud.google.com/apis/design/resource_names>.
514    ///
515    /// * For `projects.regions.autoscalingPolicies.create`, the resource name
516    ///   of the region has the following format:
517    ///   `projects/{project_id}/regions/{region}`
518    ///
519    /// * For `projects.locations.autoscalingPolicies.create`, the resource name
520    ///   of the location has the following format:
521    ///   `projects/{project_id}/locations/{location}`
522    ///
523    pub parent: std::string::String,
524
525    /// Required. The autoscaling policy to create.
526    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    /// Sets the value of [parent][crate::model::CreateAutoscalingPolicyRequest::parent].
537    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    /// Sets the value of [policy][crate::model::CreateAutoscalingPolicyRequest::policy].
543    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    /// Sets or clears the value of [policy][crate::model::CreateAutoscalingPolicyRequest::policy].
552    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/// A request to fetch an autoscaling policy.
568#[derive(Clone, Default, PartialEq)]
569#[non_exhaustive]
570pub struct GetAutoscalingPolicyRequest {
571    /// Required. The "resource name" of the autoscaling policy, as described
572    /// in <https://cloud.google.com/apis/design/resource_names>.
573    ///
574    /// * For `projects.regions.autoscalingPolicies.get`, the resource name
575    ///   of the policy has the following format:
576    ///   `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}`
577    ///
578    /// * For `projects.locations.autoscalingPolicies.get`, the resource name
579    ///   of the policy has the following format:
580    ///   `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}`
581    ///
582    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    /// Sets the value of [name][crate::model::GetAutoscalingPolicyRequest::name].
593    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/// A request to update an autoscaling policy.
606#[derive(Clone, Default, PartialEq)]
607#[non_exhaustive]
608pub struct UpdateAutoscalingPolicyRequest {
609    /// Required. The updated autoscaling policy.
610    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    /// Sets the value of [policy][crate::model::UpdateAutoscalingPolicyRequest::policy].
621    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    /// Sets or clears the value of [policy][crate::model::UpdateAutoscalingPolicyRequest::policy].
630    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/// A request to delete an autoscaling policy.
646///
647/// Autoscaling policies in use by one or more clusters will not be deleted.
648#[derive(Clone, Default, PartialEq)]
649#[non_exhaustive]
650pub struct DeleteAutoscalingPolicyRequest {
651    /// Required. The "resource name" of the autoscaling policy, as described
652    /// in <https://cloud.google.com/apis/design/resource_names>.
653    ///
654    /// * For `projects.regions.autoscalingPolicies.delete`, the resource name
655    ///   of the policy has the following format:
656    ///   `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}`
657    ///
658    /// * For `projects.locations.autoscalingPolicies.delete`, the resource name
659    ///   of the policy has the following format:
660    ///   `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}`
661    ///
662    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    /// Sets the value of [name][crate::model::DeleteAutoscalingPolicyRequest::name].
673    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/// A request to list autoscaling policies in a project.
686#[derive(Clone, Default, PartialEq)]
687#[non_exhaustive]
688pub struct ListAutoscalingPoliciesRequest {
689    /// Required. The "resource name" of the region or location, as described
690    /// in <https://cloud.google.com/apis/design/resource_names>.
691    ///
692    /// * For `projects.regions.autoscalingPolicies.list`, the resource name
693    ///   of the region has the following format:
694    ///   `projects/{project_id}/regions/{region}`
695    ///
696    /// * For `projects.locations.autoscalingPolicies.list`, the resource name
697    ///   of the location has the following format:
698    ///   `projects/{project_id}/locations/{location}`
699    ///
700    pub parent: std::string::String,
701
702    /// Optional. The maximum number of results to return in each response.
703    /// Must be less than or equal to 1000. Defaults to 100.
704    pub page_size: i32,
705
706    /// Optional. The page token, returned by a previous call, to request the
707    /// next page of results.
708    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    /// Sets the value of [parent][crate::model::ListAutoscalingPoliciesRequest::parent].
719    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    /// Sets the value of [page_size][crate::model::ListAutoscalingPoliciesRequest::page_size].
725    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    /// Sets the value of [page_token][crate::model::ListAutoscalingPoliciesRequest::page_token].
731    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/// A response to a request to list autoscaling policies in a project.
744#[derive(Clone, Default, PartialEq)]
745#[non_exhaustive]
746pub struct ListAutoscalingPoliciesResponse {
747    /// Output only. Autoscaling policies list.
748    pub policies: std::vec::Vec<crate::model::AutoscalingPolicy>,
749
750    /// Output only. This token is included in the response if there are more
751    /// results to fetch.
752    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    /// Sets the value of [policies][crate::model::ListAutoscalingPoliciesResponse::policies].
763    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    /// Sets the value of [next_page_token][crate::model::ListAutoscalingPoliciesResponse::next_page_token].
774    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/// A request to create a batch workload.
801#[derive(Clone, Default, PartialEq)]
802#[non_exhaustive]
803pub struct CreateBatchRequest {
804    /// Required. The parent resource where this batch will be created.
805    pub parent: std::string::String,
806
807    /// Required. The batch to create.
808    pub batch: std::option::Option<crate::model::Batch>,
809
810    /// Optional. The ID to use for the batch, which will become the final
811    /// component of the batch's resource name.
812    ///
813    /// This value must be 4-63 characters. Valid characters are `/[a-z][0-9]-/`.
814    pub batch_id: std::string::String,
815
816    /// Optional. A unique ID used to identify the request. If the service
817    /// receives two
818    /// [CreateBatchRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateBatchRequest)s
819    /// with the same request_id, the second request is ignored and the
820    /// Operation that corresponds to the first Batch created and stored
821    /// in the backend is returned.
822    ///
823    /// Recommendation: Set this value to a
824    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
825    ///
826    /// The value must contain only letters (a-z, A-Z), numbers (0-9),
827    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
828    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    /// Sets the value of [parent][crate::model::CreateBatchRequest::parent].
839    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    /// Sets the value of [batch][crate::model::CreateBatchRequest::batch].
845    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    /// Sets or clears the value of [batch][crate::model::CreateBatchRequest::batch].
854    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    /// Sets the value of [batch_id][crate::model::CreateBatchRequest::batch_id].
863    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    /// Sets the value of [request_id][crate::model::CreateBatchRequest::request_id].
869    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/// A request to get the resource representation for a batch workload.
882#[derive(Clone, Default, PartialEq)]
883#[non_exhaustive]
884pub struct GetBatchRequest {
885    /// Required. The fully qualified name of the batch to retrieve
886    /// in the format
887    /// "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID"
888    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    /// Sets the value of [name][crate::model::GetBatchRequest::name].
899    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/// A request to list batch workloads in a project.
912#[derive(Clone, Default, PartialEq)]
913#[non_exhaustive]
914pub struct ListBatchesRequest {
915    /// Required. The parent, which owns this collection of batches.
916    pub parent: std::string::String,
917
918    /// Optional. The maximum number of batches to return in each response.
919    /// The service may return fewer than this value.
920    /// The default page size is 20; the maximum page size is 1000.
921    pub page_size: i32,
922
923    /// Optional. A page token received from a previous `ListBatches` call.
924    /// Provide this token to retrieve the subsequent page.
925    pub page_token: std::string::String,
926
927    /// Optional. A filter for the batches to return in the response.
928    ///
929    /// A filter is a logical expression constraining the values of various fields
930    /// in each batch resource. Filters are case sensitive, and may contain
931    /// multiple clauses combined with logical operators (AND/OR).
932    /// Supported fields are `batch_id`, `batch_uuid`, `state`, and `create_time`.
933    ///
934    /// e.g. `state = RUNNING and create_time < "2023-01-01T00:00:00Z"`
935    /// filters for batches in state RUNNING that were created before 2023-01-01
936    ///
937    /// See <https://google.aip.dev/assets/misc/ebnf-filtering.txt> for a detailed
938    /// description of the filter syntax and a list of supported comparisons.
939    pub filter: std::string::String,
940
941    /// Optional. Field(s) on which to sort the list of batches.
942    ///
943    /// Currently the only supported sort orders are unspecified (empty) and
944    /// `create_time desc` to sort by most recently created batches first.
945    ///
946    /// See <https://google.aip.dev/132#ordering> for more details.
947    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    /// Sets the value of [parent][crate::model::ListBatchesRequest::parent].
958    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    /// Sets the value of [page_size][crate::model::ListBatchesRequest::page_size].
964    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    /// Sets the value of [page_token][crate::model::ListBatchesRequest::page_token].
970    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    /// Sets the value of [filter][crate::model::ListBatchesRequest::filter].
976    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    /// Sets the value of [order_by][crate::model::ListBatchesRequest::order_by].
982    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/// A list of batch workloads.
995#[derive(Clone, Default, PartialEq)]
996#[non_exhaustive]
997pub struct ListBatchesResponse {
998    /// The batches from the specified collection.
999    pub batches: std::vec::Vec<crate::model::Batch>,
1000
1001    /// A token, which can be sent as `page_token` to retrieve the next page.
1002    /// If this field is omitted, there are no subsequent pages.
1003    pub next_page_token: std::string::String,
1004
1005    /// Output only. List of Batches that could not be included in the response.
1006    /// Attempting to get one of these resources may indicate why it was not
1007    /// included in the list response.
1008    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    /// Sets the value of [batches][crate::model::ListBatchesResponse::batches].
1019    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    /// Sets the value of [next_page_token][crate::model::ListBatchesResponse::next_page_token].
1030    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    /// Sets the value of [unreachable][crate::model::ListBatchesResponse::unreachable].
1036    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/// A request to delete a batch workload.
1068#[derive(Clone, Default, PartialEq)]
1069#[non_exhaustive]
1070pub struct DeleteBatchRequest {
1071    /// Required. The fully qualified name of the batch to retrieve
1072    /// in the format
1073    /// "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID"
1074    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    /// Sets the value of [name][crate::model::DeleteBatchRequest::name].
1085    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/// A representation of a batch workload in the service.
1098#[derive(Clone, Default, PartialEq)]
1099#[non_exhaustive]
1100pub struct Batch {
1101    /// Output only. The resource name of the batch.
1102    pub name: std::string::String,
1103
1104    /// Output only. A batch UUID (Unique Universal Identifier). The service
1105    /// generates this value when it creates the batch.
1106    pub uuid: std::string::String,
1107
1108    /// Output only. The time when the batch was created.
1109    pub create_time: std::option::Option<wkt::Timestamp>,
1110
1111    /// Output only. Runtime information about batch execution.
1112    pub runtime_info: std::option::Option<crate::model::RuntimeInfo>,
1113
1114    /// Output only. The state of the batch.
1115    pub state: crate::model::batch::State,
1116
1117    /// Output only. Batch state details, such as a failure
1118    /// description if the state is `FAILED`.
1119    pub state_message: std::string::String,
1120
1121    /// Output only. The time when the batch entered a current state.
1122    pub state_time: std::option::Option<wkt::Timestamp>,
1123
1124    /// Output only. The email address of the user who created the batch.
1125    pub creator: std::string::String,
1126
1127    /// Optional. The labels to associate with this batch.
1128    /// Label **keys** must contain 1 to 63 characters, and must conform to
1129    /// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
1130    /// Label **values** may be empty, but, if present, must contain 1 to 63
1131    /// characters, and must conform to [RFC
1132    /// 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
1133    /// associated with a batch.
1134    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1135
1136    /// Optional. Runtime configuration for the batch execution.
1137    pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
1138
1139    /// Optional. Environment configuration for the batch execution.
1140    pub environment_config: std::option::Option<crate::model::EnvironmentConfig>,
1141
1142    /// Output only. The resource name of the operation associated with this batch.
1143    pub operation: std::string::String,
1144
1145    /// Output only. Historical state information for the batch.
1146    pub state_history: std::vec::Vec<crate::model::batch::StateHistory>,
1147
1148    /// The application/framework-specific portion of the batch configuration.
1149    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    /// Sets the value of [name][crate::model::Batch::name].
1160    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    /// Sets the value of [uuid][crate::model::Batch::uuid].
1166    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    /// Sets the value of [create_time][crate::model::Batch::create_time].
1172    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    /// Sets or clears the value of [create_time][crate::model::Batch::create_time].
1181    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    /// Sets the value of [runtime_info][crate::model::Batch::runtime_info].
1190    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    /// Sets or clears the value of [runtime_info][crate::model::Batch::runtime_info].
1199    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    /// Sets the value of [state][crate::model::Batch::state].
1208    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    /// Sets the value of [state_message][crate::model::Batch::state_message].
1214    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    /// Sets the value of [state_time][crate::model::Batch::state_time].
1220    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    /// Sets or clears the value of [state_time][crate::model::Batch::state_time].
1229    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    /// Sets the value of [creator][crate::model::Batch::creator].
1238    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    /// Sets the value of [labels][crate::model::Batch::labels].
1244    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    /// Sets the value of [runtime_config][crate::model::Batch::runtime_config].
1256    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    /// Sets or clears the value of [runtime_config][crate::model::Batch::runtime_config].
1265    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    /// Sets the value of [environment_config][crate::model::Batch::environment_config].
1274    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    /// Sets or clears the value of [environment_config][crate::model::Batch::environment_config].
1283    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    /// Sets the value of [operation][crate::model::Batch::operation].
1292    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    /// Sets the value of [state_history][crate::model::Batch::state_history].
1298    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    /// Sets the value of [batch_config][crate::model::Batch::batch_config].
1309    ///
1310    /// Note that all the setters affecting `batch_config` are mutually
1311    /// exclusive.
1312    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    /// The value of [batch_config][crate::model::Batch::batch_config]
1323    /// if it holds a `PysparkBatch`, `None` if the field is not set or
1324    /// holds a different branch.
1325    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    /// Sets the value of [batch_config][crate::model::Batch::batch_config]
1336    /// to hold a `PysparkBatch`.
1337    ///
1338    /// Note that all the setters affecting `batch_config` are
1339    /// mutually exclusive.
1340    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    /// The value of [batch_config][crate::model::Batch::batch_config]
1350    /// if it holds a `SparkBatch`, `None` if the field is not set or
1351    /// holds a different branch.
1352    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    /// Sets the value of [batch_config][crate::model::Batch::batch_config]
1361    /// to hold a `SparkBatch`.
1362    ///
1363    /// Note that all the setters affecting `batch_config` are
1364    /// mutually exclusive.
1365    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    /// The value of [batch_config][crate::model::Batch::batch_config]
1375    /// if it holds a `SparkRBatch`, `None` if the field is not set or
1376    /// holds a different branch.
1377    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    /// Sets the value of [batch_config][crate::model::Batch::batch_config]
1388    /// to hold a `SparkRBatch`.
1389    ///
1390    /// Note that all the setters affecting `batch_config` are
1391    /// mutually exclusive.
1392    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    /// The value of [batch_config][crate::model::Batch::batch_config]
1402    /// if it holds a `SparkSqlBatch`, `None` if the field is not set or
1403    /// holds a different branch.
1404    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    /// Sets the value of [batch_config][crate::model::Batch::batch_config]
1415    /// to hold a `SparkSqlBatch`.
1416    ///
1417    /// Note that all the setters affecting `batch_config` are
1418    /// mutually exclusive.
1419    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
1437/// Defines additional types related to [Batch].
1438pub mod batch {
1439    #[allow(unused_imports)]
1440    use super::*;
1441
1442    /// Historical state information.
1443    #[derive(Clone, Default, PartialEq)]
1444    #[non_exhaustive]
1445    pub struct StateHistory {
1446        /// Output only. The state of the batch at this point in history.
1447        pub state: crate::model::batch::State,
1448
1449        /// Output only. Details about the state at this point in history.
1450        pub state_message: std::string::String,
1451
1452        /// Output only. The time when the batch entered the historical state.
1453        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        /// Sets the value of [state][crate::model::batch::StateHistory::state].
1464        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        /// Sets the value of [state_message][crate::model::batch::StateHistory::state_message].
1473        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        /// Sets the value of [state_start_time][crate::model::batch::StateHistory::state_start_time].
1482        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        /// Sets or clears the value of [state_start_time][crate::model::batch::StateHistory::state_start_time].
1491        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    /// The batch state.
1507    ///
1508    /// # Working with unknown values
1509    ///
1510    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1511    /// additional enum variants at any time. Adding new variants is not considered
1512    /// a breaking change. Applications should write their code in anticipation of:
1513    ///
1514    /// - New values appearing in future releases of the client library, **and**
1515    /// - New values received dynamically, without application changes.
1516    ///
1517    /// Please consult the [Working with enums] section in the user guide for some
1518    /// guidelines.
1519    ///
1520    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1521    #[derive(Clone, Debug, PartialEq)]
1522    #[non_exhaustive]
1523    pub enum State {
1524        /// The batch state is unknown.
1525        Unspecified,
1526        /// The batch is created before running.
1527        Pending,
1528        /// The batch is running.
1529        Running,
1530        /// The batch is cancelling.
1531        Cancelling,
1532        /// The batch cancellation was successful.
1533        Cancelled,
1534        /// The batch completed successfully.
1535        Succeeded,
1536        /// The batch is no longer running due to an error.
1537        Failed,
1538        /// If set, the enum was initialized with an unknown value.
1539        ///
1540        /// Applications can examine the value using [State::value] or
1541        /// [State::name].
1542        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        /// Gets the enum value.
1555        ///
1556        /// Returns `None` if the enum contains an unknown value deserialized from
1557        /// the string representation of enums.
1558        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        /// Gets the enum value as a string.
1572        ///
1573        /// Returns `None` if the enum contains an unknown value deserialized from
1574        /// the integer representation of enums.
1575        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    /// The application/framework-specific portion of the batch configuration.
1667    #[derive(Clone, Debug, PartialEq)]
1668    #[non_exhaustive]
1669    pub enum BatchConfig {
1670        /// Optional. PySpark batch config.
1671        PysparkBatch(std::boxed::Box<crate::model::PySparkBatch>),
1672        /// Optional. Spark batch config.
1673        SparkBatch(std::boxed::Box<crate::model::SparkBatch>),
1674        /// Optional. SparkR batch config.
1675        SparkRBatch(std::boxed::Box<crate::model::SparkRBatch>),
1676        /// Optional. SparkSql batch config.
1677        SparkSqlBatch(std::boxed::Box<crate::model::SparkSqlBatch>),
1678    }
1679}
1680
1681/// A configuration for running an
1682/// [Apache
1683/// PySpark](https://spark.apache.org/docs/latest/api/python/getting_started/quickstart.html)
1684/// batch workload.
1685#[derive(Clone, Default, PartialEq)]
1686#[non_exhaustive]
1687pub struct PySparkBatch {
1688    /// Required. The HCFS URI of the main Python file to use as the Spark driver.
1689    /// Must be a .py file.
1690    pub main_python_file_uri: std::string::String,
1691
1692    /// Optional. The arguments to pass to the driver. Do not include arguments
1693    /// that can be set as batch properties, such as `--conf`, since a collision
1694    /// can occur that causes an incorrect batch submission.
1695    pub args: std::vec::Vec<std::string::String>,
1696
1697    /// Optional. HCFS file URIs of Python files to pass to the PySpark
1698    /// framework. Supported file types: `.py`, `.egg`, and `.zip`.
1699    pub python_file_uris: std::vec::Vec<std::string::String>,
1700
1701    /// Optional. HCFS URIs of jar files to add to the classpath of the
1702    /// Spark driver and tasks.
1703    pub jar_file_uris: std::vec::Vec<std::string::String>,
1704
1705    /// Optional. HCFS URIs of files to be placed in the working directory of
1706    /// each executor.
1707    pub file_uris: std::vec::Vec<std::string::String>,
1708
1709    /// Optional. HCFS URIs of archives to be extracted into the working directory
1710    /// of each executor. Supported file types:
1711    /// `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`.
1712    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    /// Sets the value of [main_python_file_uri][crate::model::PySparkBatch::main_python_file_uri].
1723    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    /// Sets the value of [args][crate::model::PySparkBatch::args].
1732    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    /// Sets the value of [python_file_uris][crate::model::PySparkBatch::python_file_uris].
1743    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    /// Sets the value of [jar_file_uris][crate::model::PySparkBatch::jar_file_uris].
1754    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    /// Sets the value of [file_uris][crate::model::PySparkBatch::file_uris].
1765    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    /// Sets the value of [archive_uris][crate::model::PySparkBatch::archive_uris].
1776    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/// A configuration for running an [Apache Spark](https://spark.apache.org/)
1794/// batch workload.
1795#[derive(Clone, Default, PartialEq)]
1796#[non_exhaustive]
1797pub struct SparkBatch {
1798    /// Optional. The arguments to pass to the driver. Do not include arguments
1799    /// that can be set as batch properties, such as `--conf`, since a collision
1800    /// can occur that causes an incorrect batch submission.
1801    pub args: std::vec::Vec<std::string::String>,
1802
1803    /// Optional. HCFS URIs of jar files to add to the classpath of the
1804    /// Spark driver and tasks.
1805    pub jar_file_uris: std::vec::Vec<std::string::String>,
1806
1807    /// Optional. HCFS URIs of files to be placed in the working directory of
1808    /// each executor.
1809    pub file_uris: std::vec::Vec<std::string::String>,
1810
1811    /// Optional. HCFS URIs of archives to be extracted into the working directory
1812    /// of each executor. Supported file types:
1813    /// `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`.
1814    pub archive_uris: std::vec::Vec<std::string::String>,
1815
1816    /// The specification of the main method to call to drive the Spark
1817    /// workload. Specify either the jar file that contains the main class or the
1818    /// main class name. To pass both a main jar and a main class in that jar, add
1819    /// the jar to `jar_file_uris`, and then specify the main class
1820    /// name in `main_class`.
1821    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    /// Sets the value of [args][crate::model::SparkBatch::args].
1832    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    /// Sets the value of [jar_file_uris][crate::model::SparkBatch::jar_file_uris].
1843    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    /// Sets the value of [file_uris][crate::model::SparkBatch::file_uris].
1854    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    /// Sets the value of [archive_uris][crate::model::SparkBatch::archive_uris].
1865    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    /// Sets the value of [driver][crate::model::SparkBatch::driver].
1876    ///
1877    /// Note that all the setters affecting `driver` are mutually
1878    /// exclusive.
1879    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    /// The value of [driver][crate::model::SparkBatch::driver]
1890    /// if it holds a `MainJarFileUri`, `None` if the field is not set or
1891    /// holds a different branch.
1892    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    /// Sets the value of [driver][crate::model::SparkBatch::driver]
1901    /// to hold a `MainJarFileUri`.
1902    ///
1903    /// Note that all the setters affecting `driver` are
1904    /// mutually exclusive.
1905    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    /// The value of [driver][crate::model::SparkBatch::driver]
1915    /// if it holds a `MainClass`, `None` if the field is not set or
1916    /// holds a different branch.
1917    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    /// Sets the value of [driver][crate::model::SparkBatch::driver]
1926    /// to hold a `MainClass`.
1927    ///
1928    /// Note that all the setters affecting `driver` are
1929    /// mutually exclusive.
1930    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
1943/// Defines additional types related to [SparkBatch].
1944pub mod spark_batch {
1945    #[allow(unused_imports)]
1946    use super::*;
1947
1948    /// The specification of the main method to call to drive the Spark
1949    /// workload. Specify either the jar file that contains the main class or the
1950    /// main class name. To pass both a main jar and a main class in that jar, add
1951    /// the jar to `jar_file_uris`, and then specify the main class
1952    /// name in `main_class`.
1953    #[derive(Clone, Debug, PartialEq)]
1954    #[non_exhaustive]
1955    pub enum Driver {
1956        /// Optional. The HCFS URI of the jar file that contains the main class.
1957        MainJarFileUri(std::string::String),
1958        /// Optional. The name of the driver main class. The jar file that contains
1959        /// the class must be in the classpath or specified in `jar_file_uris`.
1960        MainClass(std::string::String),
1961    }
1962}
1963
1964/// A configuration for running an
1965/// [Apache SparkR](https://spark.apache.org/docs/latest/sparkr.html)
1966/// batch workload.
1967#[derive(Clone, Default, PartialEq)]
1968#[non_exhaustive]
1969pub struct SparkRBatch {
1970    /// Required. The HCFS URI of the main R file to use as the driver.
1971    /// Must be a `.R` or `.r` file.
1972    pub main_r_file_uri: std::string::String,
1973
1974    /// Optional. The arguments to pass to the Spark driver. Do not include
1975    /// arguments that can be set as batch properties, such as `--conf`, since a
1976    /// collision can occur that causes an incorrect batch submission.
1977    pub args: std::vec::Vec<std::string::String>,
1978
1979    /// Optional. HCFS URIs of files to be placed in the working directory of
1980    /// each executor.
1981    pub file_uris: std::vec::Vec<std::string::String>,
1982
1983    /// Optional. HCFS URIs of archives to be extracted into the working directory
1984    /// of each executor. Supported file types:
1985    /// `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`.
1986    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    /// Sets the value of [main_r_file_uri][crate::model::SparkRBatch::main_r_file_uri].
1997    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    /// Sets the value of [args][crate::model::SparkRBatch::args].
2003    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    /// Sets the value of [file_uris][crate::model::SparkRBatch::file_uris].
2014    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    /// Sets the value of [archive_uris][crate::model::SparkRBatch::archive_uris].
2025    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/// A configuration for running
2043/// [Apache Spark SQL](https://spark.apache.org/sql/) queries as a batch
2044/// workload.
2045#[derive(Clone, Default, PartialEq)]
2046#[non_exhaustive]
2047pub struct SparkSqlBatch {
2048    /// Required. The HCFS URI of the script that contains Spark SQL queries to
2049    /// execute.
2050    pub query_file_uri: std::string::String,
2051
2052    /// Optional. Mapping of query variable names to values (equivalent to the
2053    /// Spark SQL command: `SET name="value";`).
2054    pub query_variables: std::collections::HashMap<std::string::String, std::string::String>,
2055
2056    /// Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH.
2057    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    /// Sets the value of [query_file_uri][crate::model::SparkSqlBatch::query_file_uri].
2068    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    /// Sets the value of [query_variables][crate::model::SparkSqlBatch::query_variables].
2074    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    /// Sets the value of [jar_file_uris][crate::model::SparkSqlBatch::jar_file_uris].
2086    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/// Describes the identifying information, config, and status of
2104/// a Dataproc cluster
2105#[derive(Clone, Default, PartialEq)]
2106#[non_exhaustive]
2107pub struct Cluster {
2108    /// Required. The Google Cloud Platform project ID that the cluster belongs to.
2109    pub project_id: std::string::String,
2110
2111    /// Required. The cluster name, which must be unique within a project.
2112    /// The name must start with a lowercase letter, and can contain
2113    /// up to 51 lowercase letters, numbers, and hyphens. It cannot end
2114    /// with a hyphen. The name of a deleted cluster can be reused.
2115    pub cluster_name: std::string::String,
2116
2117    /// Optional. The cluster config for a cluster of Compute Engine Instances.
2118    /// Note that Dataproc may set default values, and values may change
2119    /// when clusters are updated.
2120    ///
2121    /// Exactly one of ClusterConfig or VirtualClusterConfig must be specified.
2122    pub config: std::option::Option<crate::model::ClusterConfig>,
2123
2124    /// Optional. The virtual cluster config is used when creating a Dataproc
2125    /// cluster that does not directly control the underlying compute resources,
2126    /// for example, when creating a [Dataproc-on-GKE
2127    /// cluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke-overview).
2128    /// Dataproc may set default values, and values may change when
2129    /// clusters are updated. Exactly one of
2130    /// [config][google.cloud.dataproc.v1.Cluster.config] or
2131    /// [virtual_cluster_config][google.cloud.dataproc.v1.Cluster.virtual_cluster_config]
2132    /// must be specified.
2133    ///
2134    /// [google.cloud.dataproc.v1.Cluster.config]: crate::model::Cluster::config
2135    /// [google.cloud.dataproc.v1.Cluster.virtual_cluster_config]: crate::model::Cluster::virtual_cluster_config
2136    pub virtual_cluster_config: std::option::Option<crate::model::VirtualClusterConfig>,
2137
2138    /// Optional. The labels to associate with this cluster.
2139    /// Label **keys** must contain 1 to 63 characters, and must conform to
2140    /// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
2141    /// Label **values** may be empty, but, if present, must contain 1 to 63
2142    /// characters, and must conform to [RFC
2143    /// 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
2144    /// associated with a cluster.
2145    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2146
2147    /// Output only. Cluster status.
2148    pub status: std::option::Option<crate::model::ClusterStatus>,
2149
2150    /// Output only. The previous cluster status.
2151    pub status_history: std::vec::Vec<crate::model::ClusterStatus>,
2152
2153    /// Output only. A cluster UUID (Unique Universal Identifier). Dataproc
2154    /// generates this value when it creates the cluster.
2155    pub cluster_uuid: std::string::String,
2156
2157    /// Output only. Contains cluster daemon metrics such as HDFS and YARN stats.
2158    ///
2159    /// **Beta Feature**: This report is available for testing purposes only. It
2160    /// may be changed before final release.
2161    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    /// Sets the value of [project_id][crate::model::Cluster::project_id].
2172    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    /// Sets the value of [cluster_name][crate::model::Cluster::cluster_name].
2178    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    /// Sets the value of [config][crate::model::Cluster::config].
2184    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    /// Sets or clears the value of [config][crate::model::Cluster::config].
2193    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    /// Sets the value of [virtual_cluster_config][crate::model::Cluster::virtual_cluster_config].
2202    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    /// Sets or clears the value of [virtual_cluster_config][crate::model::Cluster::virtual_cluster_config].
2211    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    /// Sets the value of [labels][crate::model::Cluster::labels].
2220    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    /// Sets the value of [status][crate::model::Cluster::status].
2232    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    /// Sets or clears the value of [status][crate::model::Cluster::status].
2241    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    /// Sets the value of [status_history][crate::model::Cluster::status_history].
2250    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    /// Sets the value of [cluster_uuid][crate::model::Cluster::cluster_uuid].
2261    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    /// Sets the value of [metrics][crate::model::Cluster::metrics].
2267    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    /// Sets or clears the value of [metrics][crate::model::Cluster::metrics].
2276    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/// The cluster config.
2292#[derive(Clone, Default, PartialEq)]
2293#[non_exhaustive]
2294pub struct ClusterConfig {
2295    /// Optional. The cluster tier.
2296    pub cluster_tier: crate::model::cluster_config::ClusterTier,
2297
2298    /// Optional. A Cloud Storage bucket used to stage job
2299    /// dependencies, config files, and job driver console output.
2300    /// If you do not specify a staging bucket, Cloud
2301    /// Dataproc will determine a Cloud Storage location (US,
2302    /// ASIA, or EU) for your cluster's staging bucket according to the
2303    /// Compute Engine zone where your cluster is deployed, and then create
2304    /// and manage this project-level, per-location bucket (see
2305    /// [Dataproc staging and temp
2306    /// buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)).
2307    /// **This field requires a Cloud Storage bucket name, not a `gs://...` URI to
2308    /// a Cloud Storage bucket.**
2309    pub config_bucket: std::string::String,
2310
2311    /// Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs
2312    /// data, such as Spark and MapReduce history files. If you do not specify a
2313    /// temp bucket, Dataproc will determine a Cloud Storage location (US, ASIA, or
2314    /// EU) for your cluster's temp bucket according to the Compute Engine zone
2315    /// where your cluster is deployed, and then create and manage this
2316    /// project-level, per-location bucket. The default bucket has a TTL of 90
2317    /// days, but you can use any TTL (or none) if you specify a bucket (see
2318    /// [Dataproc staging and temp
2319    /// buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)).
2320    /// **This field requires a Cloud Storage bucket name, not a `gs://...` URI to
2321    /// a Cloud Storage bucket.**
2322    pub temp_bucket: std::string::String,
2323
2324    /// Optional. The shared Compute Engine config settings for
2325    /// all instances in a cluster.
2326    pub gce_cluster_config: std::option::Option<crate::model::GceClusterConfig>,
2327
2328    /// Optional. The Compute Engine config settings for
2329    /// the cluster's master instance.
2330    pub master_config: std::option::Option<crate::model::InstanceGroupConfig>,
2331
2332    /// Optional. The Compute Engine config settings for
2333    /// the cluster's worker instances.
2334    pub worker_config: std::option::Option<crate::model::InstanceGroupConfig>,
2335
2336    /// Optional. The Compute Engine config settings for
2337    /// a cluster's secondary worker instances
2338    pub secondary_worker_config: std::option::Option<crate::model::InstanceGroupConfig>,
2339
2340    /// Optional. The config settings for cluster software.
2341    pub software_config: std::option::Option<crate::model::SoftwareConfig>,
2342
2343    /// Optional. Commands to execute on each node after config is
2344    /// completed. By default, executables are run on master and all worker nodes.
2345    /// You can test a node's `role` metadata to run an executable on
2346    /// a master or worker node, as shown below using `curl` (you can also use
2347    /// `wget`):
2348    ///
2349    /// ```norust
2350    /// ROLE=$(curl -H Metadata-Flavor:Google
2351    /// http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
2352    /// if [[ "${ROLE}" == 'Master' ]]; then
2353    ///   ... master specific actions ...
2354    /// else
2355    ///   ... worker specific actions ...
2356    /// fi
2357    /// ```
2358    pub initialization_actions: std::vec::Vec<crate::model::NodeInitializationAction>,
2359
2360    /// Optional. Encryption settings for the cluster.
2361    pub encryption_config: std::option::Option<crate::model::EncryptionConfig>,
2362
2363    /// Optional. Autoscaling config for the policy associated with the cluster.
2364    /// Cluster does not autoscale if this field is unset.
2365    pub autoscaling_config: std::option::Option<crate::model::AutoscalingConfig>,
2366
2367    /// Optional. Security settings for the cluster.
2368    pub security_config: std::option::Option<crate::model::SecurityConfig>,
2369
2370    /// Optional. Lifecycle setting for the cluster.
2371    pub lifecycle_config: std::option::Option<crate::model::LifecycleConfig>,
2372
2373    /// Optional. Port/endpoint configuration for this cluster
2374    pub endpoint_config: std::option::Option<crate::model::EndpointConfig>,
2375
2376    /// Optional. Metastore configuration.
2377    pub metastore_config: std::option::Option<crate::model::MetastoreConfig>,
2378
2379    /// Optional. The config for Dataproc metrics.
2380    pub dataproc_metric_config: std::option::Option<crate::model::DataprocMetricConfig>,
2381
2382    /// Optional. The node group settings.
2383    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    /// Sets the value of [cluster_tier][crate::model::ClusterConfig::cluster_tier].
2394    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    /// Sets the value of [config_bucket][crate::model::ClusterConfig::config_bucket].
2403    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    /// Sets the value of [temp_bucket][crate::model::ClusterConfig::temp_bucket].
2409    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    /// Sets the value of [gce_cluster_config][crate::model::ClusterConfig::gce_cluster_config].
2415    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    /// Sets or clears the value of [gce_cluster_config][crate::model::ClusterConfig::gce_cluster_config].
2424    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    /// Sets the value of [master_config][crate::model::ClusterConfig::master_config].
2433    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    /// Sets or clears the value of [master_config][crate::model::ClusterConfig::master_config].
2442    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    /// Sets the value of [worker_config][crate::model::ClusterConfig::worker_config].
2451    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    /// Sets or clears the value of [worker_config][crate::model::ClusterConfig::worker_config].
2460    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    /// Sets the value of [secondary_worker_config][crate::model::ClusterConfig::secondary_worker_config].
2469    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    /// Sets or clears the value of [secondary_worker_config][crate::model::ClusterConfig::secondary_worker_config].
2478    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    /// Sets the value of [software_config][crate::model::ClusterConfig::software_config].
2487    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    /// Sets or clears the value of [software_config][crate::model::ClusterConfig::software_config].
2496    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    /// Sets the value of [initialization_actions][crate::model::ClusterConfig::initialization_actions].
2505    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    /// Sets the value of [encryption_config][crate::model::ClusterConfig::encryption_config].
2516    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    /// Sets or clears the value of [encryption_config][crate::model::ClusterConfig::encryption_config].
2525    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    /// Sets the value of [autoscaling_config][crate::model::ClusterConfig::autoscaling_config].
2534    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    /// Sets or clears the value of [autoscaling_config][crate::model::ClusterConfig::autoscaling_config].
2543    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    /// Sets the value of [security_config][crate::model::ClusterConfig::security_config].
2552    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    /// Sets or clears the value of [security_config][crate::model::ClusterConfig::security_config].
2561    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    /// Sets the value of [lifecycle_config][crate::model::ClusterConfig::lifecycle_config].
2570    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    /// Sets or clears the value of [lifecycle_config][crate::model::ClusterConfig::lifecycle_config].
2579    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    /// Sets the value of [endpoint_config][crate::model::ClusterConfig::endpoint_config].
2588    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    /// Sets or clears the value of [endpoint_config][crate::model::ClusterConfig::endpoint_config].
2597    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    /// Sets the value of [metastore_config][crate::model::ClusterConfig::metastore_config].
2606    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    /// Sets or clears the value of [metastore_config][crate::model::ClusterConfig::metastore_config].
2615    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    /// Sets the value of [dataproc_metric_config][crate::model::ClusterConfig::dataproc_metric_config].
2624    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    /// Sets or clears the value of [dataproc_metric_config][crate::model::ClusterConfig::dataproc_metric_config].
2633    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    /// Sets the value of [auxiliary_node_groups][crate::model::ClusterConfig::auxiliary_node_groups].
2642    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
2659/// Defines additional types related to [ClusterConfig].
2660pub mod cluster_config {
2661    #[allow(unused_imports)]
2662    use super::*;
2663
2664    /// The cluster tier.
2665    ///
2666    /// # Working with unknown values
2667    ///
2668    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2669    /// additional enum variants at any time. Adding new variants is not considered
2670    /// a breaking change. Applications should write their code in anticipation of:
2671    ///
2672    /// - New values appearing in future releases of the client library, **and**
2673    /// - New values received dynamically, without application changes.
2674    ///
2675    /// Please consult the [Working with enums] section in the user guide for some
2676    /// guidelines.
2677    ///
2678    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2679    #[derive(Clone, Debug, PartialEq)]
2680    #[non_exhaustive]
2681    pub enum ClusterTier {
2682        /// Not set. Works the same as CLUSTER_TIER_STANDARD.
2683        Unspecified,
2684        /// Standard Dataproc cluster.
2685        Standard,
2686        /// Premium Dataproc cluster.
2687        Premium,
2688        /// If set, the enum was initialized with an unknown value.
2689        ///
2690        /// Applications can examine the value using [ClusterTier::value] or
2691        /// [ClusterTier::name].
2692        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        /// Gets the enum value.
2705        ///
2706        /// Returns `None` if the enum contains an unknown value deserialized from
2707        /// the string representation of enums.
2708        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        /// Gets the enum value as a string.
2718        ///
2719        /// Returns `None` if the enum contains an unknown value deserialized from
2720        /// the integer representation of enums.
2721        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/// The Dataproc cluster config for a cluster that does not directly control the
2798/// underlying compute resources, such as a [Dataproc-on-GKE
2799/// cluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke-overview).
2800#[derive(Clone, Default, PartialEq)]
2801#[non_exhaustive]
2802pub struct VirtualClusterConfig {
2803    /// Optional. A Cloud Storage bucket used to stage job
2804    /// dependencies, config files, and job driver console output.
2805    /// If you do not specify a staging bucket, Cloud
2806    /// Dataproc will determine a Cloud Storage location (US,
2807    /// ASIA, or EU) for your cluster's staging bucket according to the
2808    /// Compute Engine zone where your cluster is deployed, and then create
2809    /// and manage this project-level, per-location bucket (see
2810    /// [Dataproc staging and temp
2811    /// buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)).
2812    /// **This field requires a Cloud Storage bucket name, not a `gs://...` URI to
2813    /// a Cloud Storage bucket.**
2814    pub staging_bucket: std::string::String,
2815
2816    /// Optional. Configuration of auxiliary services used by this cluster.
2817    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    /// Sets the value of [staging_bucket][crate::model::VirtualClusterConfig::staging_bucket].
2831    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    /// Sets the value of [auxiliary_services_config][crate::model::VirtualClusterConfig::auxiliary_services_config].
2837    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    /// Sets or clears the value of [auxiliary_services_config][crate::model::VirtualClusterConfig::auxiliary_services_config].
2846    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    /// Sets the value of [infrastructure_config][crate::model::VirtualClusterConfig::infrastructure_config].
2855    ///
2856    /// Note that all the setters affecting `infrastructure_config` are mutually
2857    /// exclusive.
2858    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    /// The value of [infrastructure_config][crate::model::VirtualClusterConfig::infrastructure_config]
2871    /// if it holds a `KubernetesClusterConfig`, `None` if the field is not set or
2872    /// holds a different branch.
2873    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    /// Sets the value of [infrastructure_config][crate::model::VirtualClusterConfig::infrastructure_config]
2886    /// to hold a `KubernetesClusterConfig`.
2887    ///
2888    /// Note that all the setters affecting `infrastructure_config` are
2889    /// mutually exclusive.
2890    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
2911/// Defines additional types related to [VirtualClusterConfig].
2912pub 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        /// Required. The configuration for running the Dataproc cluster on
2920        /// Kubernetes.
2921        KubernetesClusterConfig(std::boxed::Box<crate::model::KubernetesClusterConfig>),
2922    }
2923}
2924
2925/// Auxiliary services configuration for a Cluster.
2926#[derive(Clone, Default, PartialEq)]
2927#[non_exhaustive]
2928pub struct AuxiliaryServicesConfig {
2929    /// Optional. The Hive Metastore configuration for this workload.
2930    pub metastore_config: std::option::Option<crate::model::MetastoreConfig>,
2931
2932    /// Optional. The Spark History Server configuration for the workload.
2933    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    /// Sets the value of [metastore_config][crate::model::AuxiliaryServicesConfig::metastore_config].
2944    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    /// Sets or clears the value of [metastore_config][crate::model::AuxiliaryServicesConfig::metastore_config].
2953    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    /// Sets the value of [spark_history_server_config][crate::model::AuxiliaryServicesConfig::spark_history_server_config].
2962    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    /// Sets or clears the value of [spark_history_server_config][crate::model::AuxiliaryServicesConfig::spark_history_server_config].
2971    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/// Endpoint config for this cluster
2987#[derive(Clone, Default, PartialEq)]
2988#[non_exhaustive]
2989pub struct EndpointConfig {
2990    /// Output only. The map of port descriptions to URLs. Will only be populated
2991    /// if enable_http_port_access is true.
2992    pub http_ports: std::collections::HashMap<std::string::String, std::string::String>,
2993
2994    /// Optional. If true, enable http access to specific ports on the cluster
2995    /// from external sources. Defaults to false.
2996    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    /// Sets the value of [http_ports][crate::model::EndpointConfig::http_ports].
3007    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    /// Sets the value of [enable_http_port_access][crate::model::EndpointConfig::enable_http_port_access].
3019    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/// Autoscaling Policy config associated with the cluster.
3032#[derive(Clone, Default, PartialEq)]
3033#[non_exhaustive]
3034pub struct AutoscalingConfig {
3035    /// Optional. The autoscaling policy used by the cluster.
3036    ///
3037    /// Only resource names including projectid and location (region) are valid.
3038    /// Examples:
3039    ///
3040    /// * `<https://www.googleapis.com/compute/v1/projects/>[project_id]/locations/[dataproc_region]/autoscalingPolicies/[policy_id]`
3041    /// * `projects/[project_id]/locations/[dataproc_region]/autoscalingPolicies/[policy_id]`
3042    ///
3043    /// Note that the policy must be in the same project and Dataproc region.
3044    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    /// Sets the value of [policy_uri][crate::model::AutoscalingConfig::policy_uri].
3055    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/// Encryption settings for the cluster.
3068#[derive(Clone, Default, PartialEq)]
3069#[non_exhaustive]
3070pub struct EncryptionConfig {
3071    /// Optional. The Cloud KMS key resource name to use for persistent disk
3072    /// encryption for all instances in the cluster. See [Use CMEK with cluster
3073    /// data]
3074    /// (<https://cloud.google.com//dataproc/docs/concepts/configuring-clusters/customer-managed-encryption#use_cmek_with_cluster_data>)
3075    /// for more information.
3076    pub gce_pd_kms_key_name: std::string::String,
3077
3078    /// Optional. The Cloud KMS key resource name to use for cluster persistent
3079    /// disk and job argument encryption. See [Use CMEK with cluster data]
3080    /// (<https://cloud.google.com//dataproc/docs/concepts/configuring-clusters/customer-managed-encryption#use_cmek_with_cluster_data>)
3081    /// for more information.
3082    ///
3083    /// When this key resource name is provided, the following job arguments of
3084    /// the following job types submitted to the cluster are encrypted using CMEK:
3085    ///
3086    /// * [FlinkJob
3087    ///   args](https://cloud.google.com/dataproc/docs/reference/rest/v1/FlinkJob)
3088    /// * [HadoopJob
3089    ///   args](https://cloud.google.com/dataproc/docs/reference/rest/v1/HadoopJob)
3090    /// * [SparkJob
3091    ///   args](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkJob)
3092    /// * [SparkRJob
3093    ///   args](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkRJob)
3094    /// * [PySparkJob
3095    ///   args](https://cloud.google.com/dataproc/docs/reference/rest/v1/PySparkJob)
3096    /// * [SparkSqlJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkSqlJob)
3097    ///   scriptVariables and queryList.queries
3098    /// * [HiveJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/HiveJob)
3099    ///   scriptVariables and queryList.queries
3100    /// * [PigJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/PigJob)
3101    ///   scriptVariables and queryList.queries
3102    /// * [PrestoJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/PrestoJob)
3103    ///   scriptVariables and queryList.queries
3104    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    /// Sets the value of [gce_pd_kms_key_name][crate::model::EncryptionConfig::gce_pd_kms_key_name].
3115    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    /// Sets the value of [kms_key][crate::model::EncryptionConfig::kms_key].
3124    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/// Common config settings for resources of Compute Engine cluster
3137/// instances, applicable to all instances in the cluster.
3138#[derive(Clone, Default, PartialEq)]
3139#[non_exhaustive]
3140pub struct GceClusterConfig {
3141    /// Optional. The Compute Engine zone where the Dataproc cluster will be
3142    /// located. If omitted, the service will pick a zone in the cluster's Compute
3143    /// Engine region. On a get request, zone will always be present.
3144    ///
3145    /// A full URL, partial URI, or short name are valid. Examples:
3146    ///
3147    /// * `<https://www.googleapis.com/compute/v1/projects/>[project_id]/zones/[zone]`
3148    /// * `projects/[project_id]/zones/[zone]`
3149    /// * `[zone]`
3150    pub zone_uri: std::string::String,
3151
3152    /// Optional. The Compute Engine network to be used for machine
3153    /// communications. Cannot be specified with subnetwork_uri. If neither
3154    /// `network_uri` nor `subnetwork_uri` is specified, the "default" network of
3155    /// the project is used, if it exists. Cannot be a "Custom Subnet Network" (see
3156    /// [Using Subnetworks](https://cloud.google.com/compute/docs/subnetworks) for
3157    /// more information).
3158    ///
3159    /// A full URL, partial URI, or short name are valid. Examples:
3160    ///
3161    /// * `<https://www.googleapis.com/compute/v1/projects/>[project_id]/global/networks/default`
3162    /// * `projects/[project_id]/global/networks/default`
3163    /// * `default`
3164    pub network_uri: std::string::String,
3165
3166    /// Optional. The Compute Engine subnetwork to be used for machine
3167    /// communications. Cannot be specified with network_uri.
3168    ///
3169    /// A full URL, partial URI, or short name are valid. Examples:
3170    ///
3171    /// * `<https://www.googleapis.com/compute/v1/projects/>[project_id]/regions/[region]/subnetworks/sub0`
3172    /// * `projects/[project_id]/regions/[region]/subnetworks/sub0`
3173    /// * `sub0`
3174    pub subnetwork_uri: std::string::String,
3175
3176    /// Optional. This setting applies to subnetwork-enabled networks. It is set to
3177    /// `true` by default in clusters created with image versions 2.2.x.
3178    ///
3179    /// When set to `true`:
3180    ///
3181    /// * All cluster VMs have internal IP addresses.
3182    /// * [Google Private Access]
3183    ///   (<https://cloud.google.com/vpc/docs/private-google-access>)
3184    ///   must be enabled to access Dataproc and other Google Cloud APIs.
3185    /// * Off-cluster dependencies must be configured to be accessible
3186    ///   without external IP addresses.
3187    ///
3188    /// When set to `false`:
3189    ///
3190    /// * Cluster VMs are not restricted to internal IP addresses.
3191    /// * Ephemeral external IP addresses are assigned to each cluster VM.
3192    pub internal_ip_only: std::option::Option<bool>,
3193
3194    /// Optional. The type of IPv6 access for a cluster.
3195    pub private_ipv6_google_access: crate::model::gce_cluster_config::PrivateIpv6GoogleAccess,
3196
3197    /// Optional. The [Dataproc service
3198    /// account](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/service-accounts#service_accounts_in_dataproc)
3199    /// (also see [VM Data Plane
3200    /// identity](https://cloud.google.com/dataproc/docs/concepts/iam/dataproc-principals#vm_service_account_data_plane_identity))
3201    /// used by Dataproc cluster VM instances to access Google Cloud Platform
3202    /// services.
3203    ///
3204    /// If not specified, the
3205    /// [Compute Engine default service
3206    /// account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account)
3207    /// is used.
3208    pub service_account: std::string::String,
3209
3210    /// Optional. The URIs of service account scopes to be included in
3211    /// Compute Engine instances. The following base set of scopes is always
3212    /// included:
3213    ///
3214    /// * <https://www.googleapis.com/auth/cloud.useraccounts.readonly>
3215    /// * <https://www.googleapis.com/auth/devstorage.read_write>
3216    /// * <https://www.googleapis.com/auth/logging.write>
3217    ///
3218    /// If no scopes are specified, the following defaults are also provided:
3219    ///
3220    /// * <https://www.googleapis.com/auth/bigquery>
3221    /// * <https://www.googleapis.com/auth/bigtable.admin.table>
3222    /// * <https://www.googleapis.com/auth/bigtable.data>
3223    /// * <https://www.googleapis.com/auth/devstorage.full_control>
3224    pub service_account_scopes: std::vec::Vec<std::string::String>,
3225
3226    /// The Compute Engine network tags to add to all instances (see [Tagging
3227    /// instances](https://cloud.google.com/vpc/docs/add-remove-network-tags)).
3228    pub tags: std::vec::Vec<std::string::String>,
3229
3230    /// Optional. The Compute Engine metadata entries to add to all instances (see
3231    /// [Project and instance
3232    /// metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).
3233    pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
3234
3235    /// Optional. Reservation Affinity for consuming Zonal reservation.
3236    pub reservation_affinity: std::option::Option<crate::model::ReservationAffinity>,
3237
3238    /// Optional. Node Group Affinity for sole-tenant clusters.
3239    pub node_group_affinity: std::option::Option<crate::model::NodeGroupAffinity>,
3240
3241    /// Optional. Shielded Instance Config for clusters using [Compute Engine
3242    /// Shielded
3243    /// VMs](https://cloud.google.com/security/shielded-cloud/shielded-vm).
3244    pub shielded_instance_config: std::option::Option<crate::model::ShieldedInstanceConfig>,
3245
3246    /// Optional. Confidential Instance Config for clusters using [Confidential
3247    /// VMs](https://cloud.google.com/compute/confidential-vm/docs).
3248    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    /// Sets the value of [zone_uri][crate::model::GceClusterConfig::zone_uri].
3259    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    /// Sets the value of [network_uri][crate::model::GceClusterConfig::network_uri].
3265    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    /// Sets the value of [subnetwork_uri][crate::model::GceClusterConfig::subnetwork_uri].
3271    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    /// Sets the value of [internal_ip_only][crate::model::GceClusterConfig::internal_ip_only].
3277    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    /// Sets or clears the value of [internal_ip_only][crate::model::GceClusterConfig::internal_ip_only].
3286    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    /// Sets the value of [private_ipv6_google_access][crate::model::GceClusterConfig::private_ipv6_google_access].
3295    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    /// Sets the value of [service_account][crate::model::GceClusterConfig::service_account].
3306    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    /// Sets the value of [service_account_scopes][crate::model::GceClusterConfig::service_account_scopes].
3312    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    /// Sets the value of [tags][crate::model::GceClusterConfig::tags].
3323    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    /// Sets the value of [metadata][crate::model::GceClusterConfig::metadata].
3334    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    /// Sets the value of [reservation_affinity][crate::model::GceClusterConfig::reservation_affinity].
3346    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    /// Sets or clears the value of [reservation_affinity][crate::model::GceClusterConfig::reservation_affinity].
3355    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    /// Sets the value of [node_group_affinity][crate::model::GceClusterConfig::node_group_affinity].
3364    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    /// Sets or clears the value of [node_group_affinity][crate::model::GceClusterConfig::node_group_affinity].
3373    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    /// Sets the value of [shielded_instance_config][crate::model::GceClusterConfig::shielded_instance_config].
3382    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    /// Sets or clears the value of [shielded_instance_config][crate::model::GceClusterConfig::shielded_instance_config].
3391    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    /// Sets the value of [confidential_instance_config][crate::model::GceClusterConfig::confidential_instance_config].
3400    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    /// Sets or clears the value of [confidential_instance_config][crate::model::GceClusterConfig::confidential_instance_config].
3409    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
3424/// Defines additional types related to [GceClusterConfig].
3425pub mod gce_cluster_config {
3426    #[allow(unused_imports)]
3427    use super::*;
3428
3429    /// `PrivateIpv6GoogleAccess` controls whether and how Dataproc cluster nodes
3430    /// can communicate with Google Services through gRPC over IPv6.
3431    /// These values are directly mapped to corresponding values in the
3432    /// [Compute Engine Instance
3433    /// fields](https://cloud.google.com/compute/docs/reference/rest/v1/instances).
3434    ///
3435    /// # Working with unknown values
3436    ///
3437    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3438    /// additional enum variants at any time. Adding new variants is not considered
3439    /// a breaking change. Applications should write their code in anticipation of:
3440    ///
3441    /// - New values appearing in future releases of the client library, **and**
3442    /// - New values received dynamically, without application changes.
3443    ///
3444    /// Please consult the [Working with enums] section in the user guide for some
3445    /// guidelines.
3446    ///
3447    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3448    #[derive(Clone, Debug, PartialEq)]
3449    #[non_exhaustive]
3450    pub enum PrivateIpv6GoogleAccess {
3451        /// If unspecified, Compute Engine default behavior will apply, which
3452        /// is the same as
3453        /// [INHERIT_FROM_SUBNETWORK][google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess.INHERIT_FROM_SUBNETWORK].
3454        ///
3455        /// [google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess.INHERIT_FROM_SUBNETWORK]: crate::model::gce_cluster_config::PrivateIpv6GoogleAccess::InheritFromSubnetwork
3456        Unspecified,
3457        /// Private access to and from Google Services configuration
3458        /// inherited from the subnetwork configuration. This is the
3459        /// default Compute Engine behavior.
3460        InheritFromSubnetwork,
3461        /// Enables outbound private IPv6 access to Google Services from the Dataproc
3462        /// cluster.
3463        Outbound,
3464        /// Enables bidirectional private IPv6 access between Google Services and the
3465        /// Dataproc cluster.
3466        Bidirectional,
3467        /// If set, the enum was initialized with an unknown value.
3468        ///
3469        /// Applications can examine the value using [PrivateIpv6GoogleAccess::value] or
3470        /// [PrivateIpv6GoogleAccess::name].
3471        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        /// Gets the enum value.
3484        ///
3485        /// Returns `None` if the enum contains an unknown value deserialized from
3486        /// the string representation of enums.
3487        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        /// Gets the enum value as a string.
3498        ///
3499        /// Returns `None` if the enum contains an unknown value deserialized from
3500        /// the integer representation of enums.
3501        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/// Node Group Affinity for clusters using sole-tenant node groups.
3586/// **The Dataproc `NodeGroupAffinity` resource is not related to the
3587/// Dataproc [NodeGroup][google.cloud.dataproc.v1.NodeGroup] resource.**
3588///
3589/// [google.cloud.dataproc.v1.NodeGroup]: crate::model::NodeGroup
3590#[derive(Clone, Default, PartialEq)]
3591#[non_exhaustive]
3592pub struct NodeGroupAffinity {
3593    /// Required. The URI of a
3594    /// sole-tenant [node group
3595    /// resource](https://cloud.google.com/compute/docs/reference/rest/v1/nodeGroups)
3596    /// that the cluster will be created on.
3597    ///
3598    /// A full URL, partial URI, or node group name are valid. Examples:
3599    ///
3600    /// * `<https://www.googleapis.com/compute/v1/projects/>[project_id]/zones/[zone]/nodeGroups/node-group-1`
3601    /// * `projects/[project_id]/zones/[zone]/nodeGroups/node-group-1`
3602    /// * `node-group-1`
3603    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    /// Sets the value of [node_group_uri][crate::model::NodeGroupAffinity::node_group_uri].
3614    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/// Shielded Instance Config for clusters using [Compute Engine Shielded
3627/// VMs](https://cloud.google.com/security/shielded-cloud/shielded-vm).
3628#[derive(Clone, Default, PartialEq)]
3629#[non_exhaustive]
3630pub struct ShieldedInstanceConfig {
3631    /// Optional. Defines whether instances have Secure Boot enabled.
3632    pub enable_secure_boot: std::option::Option<bool>,
3633
3634    /// Optional. Defines whether instances have the vTPM enabled.
3635    pub enable_vtpm: std::option::Option<bool>,
3636
3637    /// Optional. Defines whether instances have integrity monitoring enabled.
3638    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    /// Sets the value of [enable_secure_boot][crate::model::ShieldedInstanceConfig::enable_secure_boot].
3649    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    /// Sets or clears the value of [enable_secure_boot][crate::model::ShieldedInstanceConfig::enable_secure_boot].
3658    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    /// Sets the value of [enable_vtpm][crate::model::ShieldedInstanceConfig::enable_vtpm].
3667    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    /// Sets or clears the value of [enable_vtpm][crate::model::ShieldedInstanceConfig::enable_vtpm].
3676    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    /// Sets the value of [enable_integrity_monitoring][crate::model::ShieldedInstanceConfig::enable_integrity_monitoring].
3685    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    /// Sets or clears the value of [enable_integrity_monitoring][crate::model::ShieldedInstanceConfig::enable_integrity_monitoring].
3694    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/// Confidential Instance Config for clusters using [Confidential
3710/// VMs](https://cloud.google.com/compute/confidential-vm/docs)
3711#[derive(Clone, Default, PartialEq)]
3712#[non_exhaustive]
3713pub struct ConfidentialInstanceConfig {
3714    /// Optional. Defines whether the instance should have confidential compute
3715    /// enabled.
3716    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    /// Sets the value of [enable_confidential_compute][crate::model::ConfidentialInstanceConfig::enable_confidential_compute].
3727    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/// The config settings for Compute Engine resources in
3740/// an instance group, such as a master or worker group.
3741#[derive(Clone, Default, PartialEq)]
3742#[non_exhaustive]
3743pub struct InstanceGroupConfig {
3744    /// Optional. The number of VM instances in the instance group.
3745    /// For [HA
3746    /// cluster](/dataproc/docs/concepts/configuring-clusters/high-availability)
3747    /// [master_config](#FIELDS.master_config) groups, **must be set to 3**.
3748    /// For standard cluster [master_config](#FIELDS.master_config) groups,
3749    /// **must be set to 1**.
3750    pub num_instances: i32,
3751
3752    /// Output only. The list of instance names. Dataproc derives the names
3753    /// from `cluster_name`, `num_instances`, and the instance group.
3754    pub instance_names: std::vec::Vec<std::string::String>,
3755
3756    /// Output only. List of references to Compute Engine instances.
3757    pub instance_references: std::vec::Vec<crate::model::InstanceReference>,
3758
3759    /// Optional. The Compute Engine image resource used for cluster instances.
3760    ///
3761    /// The URI can represent an image or image family.
3762    ///
3763    /// Image examples:
3764    ///
3765    /// * `<https://www.googleapis.com/compute/v1/projects/>[project_id]/global/images/[image-id]`
3766    /// * `projects/[project_id]/global/images/[image-id]`
3767    /// * `image-id`
3768    ///
3769    /// Image family examples. Dataproc will use the most recent
3770    /// image from the family:
3771    ///
3772    /// * `<https://www.googleapis.com/compute/v1/projects/>[project_id]/global/images/family/[custom-image-family-name]`
3773    /// * `projects/[project_id]/global/images/family/[custom-image-family-name]`
3774    ///
3775    /// If the URI is unspecified, it will be inferred from
3776    /// `SoftwareConfig.image_version` or the system default.
3777    pub image_uri: std::string::String,
3778
3779    /// Optional. The Compute Engine machine type used for cluster instances.
3780    ///
3781    /// A full URL, partial URI, or short name are valid. Examples:
3782    ///
3783    /// * `<https://www.googleapis.com/compute/v1/projects/>[project_id]/zones/[zone]/machineTypes/n1-standard-2`
3784    /// * `projects/[project_id]/zones/[zone]/machineTypes/n1-standard-2`
3785    /// * `n1-standard-2`
3786    ///
3787    /// **Auto Zone Exception**: If you are using the Dataproc
3788    /// [Auto Zone
3789    /// Placement](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement)
3790    /// feature, you must use the short name of the machine type
3791    /// resource, for example, `n1-standard-2`.
3792    pub machine_type_uri: std::string::String,
3793
3794    /// Optional. Disk option config settings.
3795    pub disk_config: std::option::Option<crate::model::DiskConfig>,
3796
3797    /// Output only. Specifies that this instance group contains preemptible
3798    /// instances.
3799    pub is_preemptible: bool,
3800
3801    /// Optional. Specifies the preemptibility of the instance group.
3802    ///
3803    /// The default value for master and worker groups is
3804    /// `NON_PREEMPTIBLE`. This default cannot be changed.
3805    ///
3806    /// The default value for secondary instances is
3807    /// `PREEMPTIBLE`.
3808    pub preemptibility: crate::model::instance_group_config::Preemptibility,
3809
3810    /// Output only. The config for Compute Engine Instance Group
3811    /// Manager that manages this group.
3812    /// This is only used for preemptible instance groups.
3813    pub managed_group_config: std::option::Option<crate::model::ManagedGroupConfig>,
3814
3815    /// Optional. The Compute Engine accelerator configuration for these
3816    /// instances.
3817    pub accelerators: std::vec::Vec<crate::model::AcceleratorConfig>,
3818
3819    /// Optional. Specifies the minimum cpu platform for the Instance Group.
3820    /// See [Dataproc -> Minimum CPU
3821    /// Platform](https://cloud.google.com/dataproc/docs/concepts/compute/dataproc-min-cpu).
3822    pub min_cpu_platform: std::string::String,
3823
3824    /// Optional. The minimum number of primary worker instances to create.
3825    /// If `min_num_instances` is set, cluster creation will succeed if
3826    /// the number of primary workers created is at least equal to the
3827    /// `min_num_instances` number.
3828    ///
3829    /// Example: Cluster creation request with `num_instances` = `5` and
3830    /// `min_num_instances` = `3`:
3831    ///
3832    /// * If 4 VMs are created and 1 instance fails,
3833    ///   the failed VM is deleted. The cluster is
3834    ///   resized to 4 instances and placed in a `RUNNING` state.
3835    /// * If 2 instances are created and 3 instances fail,
3836    ///   the cluster in placed in an `ERROR` state. The failed VMs
3837    ///   are not deleted.
3838    pub min_num_instances: i32,
3839
3840    /// Optional. Instance flexibility Policy allowing a mixture of VM shapes and
3841    /// provisioning models.
3842    pub instance_flexibility_policy: std::option::Option<crate::model::InstanceFlexibilityPolicy>,
3843
3844    /// Optional. Configuration to handle the startup of instances during cluster
3845    /// create and update process.
3846    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    /// Sets the value of [num_instances][crate::model::InstanceGroupConfig::num_instances].
3857    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    /// Sets the value of [instance_names][crate::model::InstanceGroupConfig::instance_names].
3863    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    /// Sets the value of [instance_references][crate::model::InstanceGroupConfig::instance_references].
3874    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    /// Sets the value of [image_uri][crate::model::InstanceGroupConfig::image_uri].
3885    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    /// Sets the value of [machine_type_uri][crate::model::InstanceGroupConfig::machine_type_uri].
3891    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    /// Sets the value of [disk_config][crate::model::InstanceGroupConfig::disk_config].
3900    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    /// Sets or clears the value of [disk_config][crate::model::InstanceGroupConfig::disk_config].
3909    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    /// Sets the value of [is_preemptible][crate::model::InstanceGroupConfig::is_preemptible].
3918    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    /// Sets the value of [preemptibility][crate::model::InstanceGroupConfig::preemptibility].
3924    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    /// Sets the value of [managed_group_config][crate::model::InstanceGroupConfig::managed_group_config].
3935    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    /// Sets or clears the value of [managed_group_config][crate::model::InstanceGroupConfig::managed_group_config].
3944    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    /// Sets the value of [accelerators][crate::model::InstanceGroupConfig::accelerators].
3953    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    /// Sets the value of [min_cpu_platform][crate::model::InstanceGroupConfig::min_cpu_platform].
3964    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    /// Sets the value of [min_num_instances][crate::model::InstanceGroupConfig::min_num_instances].
3973    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    /// Sets the value of [instance_flexibility_policy][crate::model::InstanceGroupConfig::instance_flexibility_policy].
3979    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    /// Sets or clears the value of [instance_flexibility_policy][crate::model::InstanceGroupConfig::instance_flexibility_policy].
3988    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    /// Sets the value of [startup_config][crate::model::InstanceGroupConfig::startup_config].
3997    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    /// Sets or clears the value of [startup_config][crate::model::InstanceGroupConfig::startup_config].
4006    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
4021/// Defines additional types related to [InstanceGroupConfig].
4022pub mod instance_group_config {
4023    #[allow(unused_imports)]
4024    use super::*;
4025
4026    /// Controls the use of preemptible instances within the group.
4027    ///
4028    /// # Working with unknown values
4029    ///
4030    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4031    /// additional enum variants at any time. Adding new variants is not considered
4032    /// a breaking change. Applications should write their code in anticipation of:
4033    ///
4034    /// - New values appearing in future releases of the client library, **and**
4035    /// - New values received dynamically, without application changes.
4036    ///
4037    /// Please consult the [Working with enums] section in the user guide for some
4038    /// guidelines.
4039    ///
4040    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4041    #[derive(Clone, Debug, PartialEq)]
4042    #[non_exhaustive]
4043    pub enum Preemptibility {
4044        /// Preemptibility is unspecified, the system will choose the
4045        /// appropriate setting for each instance group.
4046        Unspecified,
4047        /// Instances are non-preemptible.
4048        ///
4049        /// This option is allowed for all instance groups and is the only valid
4050        /// value for Master and Worker instance groups.
4051        NonPreemptible,
4052        /// Instances are [preemptible]
4053        /// (<https://cloud.google.com/compute/docs/instances/preemptible>).
4054        ///
4055        /// This option is allowed only for [secondary worker]
4056        /// (<https://cloud.google.com/dataproc/docs/concepts/compute/secondary-vms>)
4057        /// groups.
4058        Preemptible,
4059        /// Instances are [Spot VMs]
4060        /// (<https://cloud.google.com/compute/docs/instances/spot>).
4061        ///
4062        /// This option is allowed only for [secondary worker]
4063        /// (<https://cloud.google.com/dataproc/docs/concepts/compute/secondary-vms>)
4064        /// groups. Spot VMs are the latest version of [preemptible VMs]
4065        /// (<https://cloud.google.com/compute/docs/instances/preemptible>), and
4066        /// provide additional features.
4067        Spot,
4068        /// If set, the enum was initialized with an unknown value.
4069        ///
4070        /// Applications can examine the value using [Preemptibility::value] or
4071        /// [Preemptibility::name].
4072        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        /// Gets the enum value.
4085        ///
4086        /// Returns `None` if the enum contains an unknown value deserialized from
4087        /// the string representation of enums.
4088        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        /// Gets the enum value as a string.
4099        ///
4100        /// Returns `None` if the enum contains an unknown value deserialized from
4101        /// the integer representation of enums.
4102        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/// Configuration to handle the startup of instances during cluster create and
4183/// update process.
4184#[derive(Clone, Default, PartialEq)]
4185#[non_exhaustive]
4186pub struct StartupConfig {
4187    /// Optional. The config setting to enable cluster creation/ updation to be
4188    /// successful only after required_registration_fraction of instances are up
4189    /// and running. This configuration is applicable to only secondary workers for
4190    /// now. The cluster will fail if required_registration_fraction of instances
4191    /// are not available. This will include instance creation, agent registration,
4192    /// and service registration (if enabled).
4193    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    /// Sets the value of [required_registration_fraction][crate::model::StartupConfig::required_registration_fraction].
4204    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    /// Sets or clears the value of [required_registration_fraction][crate::model::StartupConfig::required_registration_fraction].
4213    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/// A reference to a Compute Engine instance.
4232#[derive(Clone, Default, PartialEq)]
4233#[non_exhaustive]
4234pub struct InstanceReference {
4235    /// The user-friendly name of the Compute Engine instance.
4236    pub instance_name: std::string::String,
4237
4238    /// The unique identifier of the Compute Engine instance.
4239    pub instance_id: std::string::String,
4240
4241    /// The public RSA key used for sharing data with this instance.
4242    pub public_key: std::string::String,
4243
4244    /// The public ECIES key used for sharing data with this instance.
4245    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    /// Sets the value of [instance_name][crate::model::InstanceReference::instance_name].
4256    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    /// Sets the value of [instance_id][crate::model::InstanceReference::instance_id].
4262    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    /// Sets the value of [public_key][crate::model::InstanceReference::public_key].
4268    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    /// Sets the value of [public_ecies_key][crate::model::InstanceReference::public_ecies_key].
4274    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/// Specifies the resources used to actively manage an instance group.
4290#[derive(Clone, Default, PartialEq)]
4291#[non_exhaustive]
4292pub struct ManagedGroupConfig {
4293    /// Output only. The name of the Instance Template used for the Managed
4294    /// Instance Group.
4295    pub instance_template_name: std::string::String,
4296
4297    /// Output only. The name of the Instance Group Manager for this group.
4298    pub instance_group_manager_name: std::string::String,
4299
4300    /// Output only. The partial URI to the instance group manager for this group.
4301    /// E.g. projects/my-project/regions/us-central1/instanceGroupManagers/my-igm.
4302    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    /// Sets the value of [instance_template_name][crate::model::ManagedGroupConfig::instance_template_name].
4313    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    /// Sets the value of [instance_group_manager_name][crate::model::ManagedGroupConfig::instance_group_manager_name].
4322    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    /// Sets the value of [instance_group_manager_uri][crate::model::ManagedGroupConfig::instance_group_manager_uri].
4331    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/// Instance flexibility Policy allowing a mixture of VM shapes and provisioning
4347/// models.
4348#[derive(Clone, Default, PartialEq)]
4349#[non_exhaustive]
4350pub struct InstanceFlexibilityPolicy {
4351    /// Optional. Defines how the Group selects the provisioning model to ensure
4352    /// required reliability.
4353    pub provisioning_model_mix:
4354        std::option::Option<crate::model::instance_flexibility_policy::ProvisioningModelMix>,
4355
4356    /// Optional. List of instance selection options that the group will use when
4357    /// creating new VMs.
4358    pub instance_selection_list:
4359        std::vec::Vec<crate::model::instance_flexibility_policy::InstanceSelection>,
4360
4361    /// Output only. A list of instance selection results in the group.
4362    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    /// Sets the value of [provisioning_model_mix][crate::model::InstanceFlexibilityPolicy::provisioning_model_mix].
4374    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    /// Sets or clears the value of [provisioning_model_mix][crate::model::InstanceFlexibilityPolicy::provisioning_model_mix].
4383    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    /// Sets the value of [instance_selection_list][crate::model::InstanceFlexibilityPolicy::instance_selection_list].
4392    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    /// Sets the value of [instance_selection_results][crate::model::InstanceFlexibilityPolicy::instance_selection_results].
4403    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
4420/// Defines additional types related to [InstanceFlexibilityPolicy].
4421pub mod instance_flexibility_policy {
4422    #[allow(unused_imports)]
4423    use super::*;
4424
4425    /// Defines how Dataproc should create VMs with a mixture of provisioning
4426    /// models.
4427    #[derive(Clone, Default, PartialEq)]
4428    #[non_exhaustive]
4429    pub struct ProvisioningModelMix {
4430        /// Optional. The base capacity that will always use Standard VMs to avoid
4431        /// risk of more preemption than the minimum capacity you need. Dataproc will
4432        /// create only standard VMs until it reaches standard_capacity_base, then it
4433        /// will start using standard_capacity_percent_above_base to mix Spot with
4434        /// Standard VMs. eg. If 15 instances are requested and
4435        /// standard_capacity_base is 5, Dataproc will create 5 standard VMs and then
4436        /// start mixing spot and standard VMs for remaining 10 instances.
4437        pub standard_capacity_base: std::option::Option<i32>,
4438
4439        /// Optional. The percentage of target capacity that should use Standard VM.
4440        /// The remaining percentage will use Spot VMs. The percentage applies only
4441        /// to the capacity above standard_capacity_base. eg. If 15 instances are
4442        /// requested and standard_capacity_base is 5 and
4443        /// standard_capacity_percent_above_base is 30, Dataproc will create 5
4444        /// standard VMs and then start mixing spot and standard VMs for remaining 10
4445        /// instances. The mix will be 30% standard and 70% spot.
4446        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        /// Sets the value of [standard_capacity_base][crate::model::instance_flexibility_policy::ProvisioningModelMix::standard_capacity_base].
4457        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        /// Sets or clears the value of [standard_capacity_base][crate::model::instance_flexibility_policy::ProvisioningModelMix::standard_capacity_base].
4466        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        /// Sets the value of [standard_capacity_percent_above_base][crate::model::instance_flexibility_policy::ProvisioningModelMix::standard_capacity_percent_above_base].
4475        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        /// Sets or clears the value of [standard_capacity_percent_above_base][crate::model::instance_flexibility_policy::ProvisioningModelMix::standard_capacity_percent_above_base].
4484        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    /// Defines machines types and a rank to which the machines types belong.
4503    #[derive(Clone, Default, PartialEq)]
4504    #[non_exhaustive]
4505    pub struct InstanceSelection {
4506        /// Optional. Full machine-type names, e.g. "n1-standard-16".
4507        pub machine_types: std::vec::Vec<std::string::String>,
4508
4509        /// Optional. Preference of this instance selection. Lower number means
4510        /// higher preference. Dataproc will first try to create a VM based on the
4511        /// machine-type with priority rank and fallback to next rank based on
4512        /// availability. Machine types and instance selections with the same
4513        /// priority have the same preference.
4514        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        /// Sets the value of [machine_types][crate::model::instance_flexibility_policy::InstanceSelection::machine_types].
4525        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        /// Sets the value of [rank][crate::model::instance_flexibility_policy::InstanceSelection::rank].
4536        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    /// Defines a mapping from machine types to the number of VMs that are created
4549    /// with each machine type.
4550    #[derive(Clone, Default, PartialEq)]
4551    #[non_exhaustive]
4552    pub struct InstanceSelectionResult {
4553        /// Output only. Full machine-type names, e.g. "n1-standard-16".
4554        pub machine_type: std::option::Option<std::string::String>,
4555
4556        /// Output only. Number of VM provisioned with the machine_type.
4557        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        /// Sets the value of [machine_type][crate::model::instance_flexibility_policy::InstanceSelectionResult::machine_type].
4568        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        /// Sets or clears the value of [machine_type][crate::model::instance_flexibility_policy::InstanceSelectionResult::machine_type].
4577        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        /// Sets the value of [vm_count][crate::model::instance_flexibility_policy::InstanceSelectionResult::vm_count].
4586        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        /// Sets or clears the value of [vm_count][crate::model::instance_flexibility_policy::InstanceSelectionResult::vm_count].
4595        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/// Specifies the type and number of accelerator cards attached to the instances
4612/// of an instance. See [GPUs on Compute
4613/// Engine](https://cloud.google.com/compute/docs/gpus/).
4614#[derive(Clone, Default, PartialEq)]
4615#[non_exhaustive]
4616pub struct AcceleratorConfig {
4617    /// Full URL, partial URI, or short name of the accelerator type resource to
4618    /// expose to this instance. See
4619    /// [Compute Engine
4620    /// AcceleratorTypes](https://cloud.google.com/compute/docs/reference/v1/acceleratorTypes).
4621    ///
4622    /// Examples:
4623    ///
4624    /// * `<https://www.googleapis.com/compute/v1/projects/>[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-t4`
4625    /// * `projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-t4`
4626    /// * `nvidia-tesla-t4`
4627    ///
4628    /// **Auto Zone Exception**: If you are using the Dataproc
4629    /// [Auto Zone
4630    /// Placement](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement)
4631    /// feature, you must use the short name of the accelerator type
4632    /// resource, for example, `nvidia-tesla-t4`.
4633    pub accelerator_type_uri: std::string::String,
4634
4635    /// The number of the accelerator cards of this type exposed to this instance.
4636    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    /// Sets the value of [accelerator_type_uri][crate::model::AcceleratorConfig::accelerator_type_uri].
4647    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    /// Sets the value of [accelerator_count][crate::model::AcceleratorConfig::accelerator_count].
4656    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/// Specifies the config of disk options for a group of VM instances.
4669#[derive(Clone, Default, PartialEq)]
4670#[non_exhaustive]
4671pub struct DiskConfig {
4672    /// Optional. Type of the boot disk (default is "pd-standard").
4673    /// Valid values: "pd-balanced" (Persistent Disk Balanced Solid State Drive),
4674    /// "pd-ssd" (Persistent Disk Solid State Drive),
4675    /// or "pd-standard" (Persistent Disk Hard Disk Drive).
4676    /// See [Disk types](https://cloud.google.com/compute/docs/disks#disk-types).
4677    pub boot_disk_type: std::string::String,
4678
4679    /// Optional. Size in GB of the boot disk (default is 500GB).
4680    pub boot_disk_size_gb: i32,
4681
4682    /// Optional. Number of attached SSDs, from 0 to 8 (default is 0).
4683    /// If SSDs are not attached, the boot disk is used to store runtime logs and
4684    /// [HDFS](https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data.
4685    /// If one or more SSDs are attached, this runtime bulk
4686    /// data is spread across them, and the boot disk contains only basic
4687    /// config and installed binaries.
4688    ///
4689    /// Note: Local SSD options may vary by machine type and number of vCPUs
4690    /// selected.
4691    pub num_local_ssds: i32,
4692
4693    /// Optional. Interface type of local SSDs (default is "scsi").
4694    /// Valid values: "scsi" (Small Computer System Interface),
4695    /// "nvme" (Non-Volatile Memory Express).
4696    /// See [local SSD
4697    /// performance](https://cloud.google.com/compute/docs/disks/local-ssd#performance).
4698    pub local_ssd_interface: std::string::String,
4699
4700    /// Optional. Indicates how many IOPS to provision for the disk. This sets the
4701    /// number of I/O operations per second that the disk can handle. Note: This
4702    /// field is only supported if boot_disk_type is hyperdisk-balanced.
4703    pub boot_disk_provisioned_iops: std::option::Option<i64>,
4704
4705    /// Optional. Indicates how much throughput to provision for the disk. This
4706    /// sets the number of throughput mb per second that the disk can handle.
4707    /// Values must be greater than or equal to 1. Note: This field is only
4708    /// supported if boot_disk_type is hyperdisk-balanced.
4709    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    /// Sets the value of [boot_disk_type][crate::model::DiskConfig::boot_disk_type].
4720    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    /// Sets the value of [boot_disk_size_gb][crate::model::DiskConfig::boot_disk_size_gb].
4726    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    /// Sets the value of [num_local_ssds][crate::model::DiskConfig::num_local_ssds].
4732    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    /// Sets the value of [local_ssd_interface][crate::model::DiskConfig::local_ssd_interface].
4738    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    /// Sets the value of [boot_disk_provisioned_iops][crate::model::DiskConfig::boot_disk_provisioned_iops].
4747    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    /// Sets or clears the value of [boot_disk_provisioned_iops][crate::model::DiskConfig::boot_disk_provisioned_iops].
4756    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    /// Sets the value of [boot_disk_provisioned_throughput][crate::model::DiskConfig::boot_disk_provisioned_throughput].
4765    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    /// Sets or clears the value of [boot_disk_provisioned_throughput][crate::model::DiskConfig::boot_disk_provisioned_throughput].
4774    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/// Node group identification and configuration information.
4793#[derive(Clone, Default, PartialEq)]
4794#[non_exhaustive]
4795pub struct AuxiliaryNodeGroup {
4796    /// Required. Node group configuration.
4797    pub node_group: std::option::Option<crate::model::NodeGroup>,
4798
4799    /// Optional. A node group ID. Generated if not specified.
4800    ///
4801    /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
4802    /// underscores (_), and hyphens (-). Cannot begin or end with underscore
4803    /// or hyphen. Must consist of from 3 to 33 characters.
4804    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    /// Sets the value of [node_group][crate::model::AuxiliaryNodeGroup::node_group].
4815    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    /// Sets or clears the value of [node_group][crate::model::AuxiliaryNodeGroup::node_group].
4824    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    /// Sets the value of [node_group_id][crate::model::AuxiliaryNodeGroup::node_group_id].
4833    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/// Dataproc Node Group.
4846/// **The Dataproc `NodeGroup` resource is not related to the
4847/// Dataproc [NodeGroupAffinity][google.cloud.dataproc.v1.NodeGroupAffinity]
4848/// resource.**
4849///
4850/// [google.cloud.dataproc.v1.NodeGroupAffinity]: crate::model::NodeGroupAffinity
4851#[derive(Clone, Default, PartialEq)]
4852#[non_exhaustive]
4853pub struct NodeGroup {
4854    /// The Node group [resource name](https://aip.dev/122).
4855    pub name: std::string::String,
4856
4857    /// Required. Node group roles.
4858    pub roles: std::vec::Vec<crate::model::node_group::Role>,
4859
4860    /// Optional. The node group instance group configuration.
4861    pub node_group_config: std::option::Option<crate::model::InstanceGroupConfig>,
4862
4863    /// Optional. Node group labels.
4864    ///
4865    /// * Label **keys** must consist of from 1 to 63 characters and conform to
4866    ///   [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
4867    /// * Label **values** can be empty. If specified, they must consist of from
4868    ///   1 to 63 characters and conform to [RFC 1035]
4869    ///   (<https://www.ietf.org/rfc/rfc1035.txt>).
4870    /// * The node group must have no more than 32 labels.
4871    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    /// Sets the value of [name][crate::model::NodeGroup::name].
4882    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    /// Sets the value of [roles][crate::model::NodeGroup::roles].
4888    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    /// Sets the value of [node_group_config][crate::model::NodeGroup::node_group_config].
4899    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    /// Sets or clears the value of [node_group_config][crate::model::NodeGroup::node_group_config].
4908    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    /// Sets the value of [labels][crate::model::NodeGroup::labels].
4917    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
4935/// Defines additional types related to [NodeGroup].
4936pub mod node_group {
4937    #[allow(unused_imports)]
4938    use super::*;
4939
4940    /// Node pool roles.
4941    ///
4942    /// # Working with unknown values
4943    ///
4944    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4945    /// additional enum variants at any time. Adding new variants is not considered
4946    /// a breaking change. Applications should write their code in anticipation of:
4947    ///
4948    /// - New values appearing in future releases of the client library, **and**
4949    /// - New values received dynamically, without application changes.
4950    ///
4951    /// Please consult the [Working with enums] section in the user guide for some
4952    /// guidelines.
4953    ///
4954    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4955    #[derive(Clone, Debug, PartialEq)]
4956    #[non_exhaustive]
4957    pub enum Role {
4958        /// Required unspecified role.
4959        Unspecified,
4960        /// Job drivers run on the node pool.
4961        Driver,
4962        /// If set, the enum was initialized with an unknown value.
4963        ///
4964        /// Applications can examine the value using [Role::value] or
4965        /// [Role::name].
4966        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        /// Gets the enum value.
4979        ///
4980        /// Returns `None` if the enum contains an unknown value deserialized from
4981        /// the string representation of enums.
4982        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        /// Gets the enum value as a string.
4991        ///
4992        /// Returns `None` if the enum contains an unknown value deserialized from
4993        /// the integer representation of enums.
4994        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/// Specifies an executable to run on a fully configured node and a
5067/// timeout period for executable completion.
5068#[derive(Clone, Default, PartialEq)]
5069#[non_exhaustive]
5070pub struct NodeInitializationAction {
5071    /// Required. Cloud Storage URI of executable file.
5072    pub executable_file: std::string::String,
5073
5074    /// Optional. Amount of time executable has to complete. Default is
5075    /// 10 minutes (see JSON representation of
5076    /// [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)).
5077    ///
5078    /// Cluster creation fails with an explanatory error message (the
5079    /// name of the executable that caused the error and the exceeded timeout
5080    /// period) if the executable is not completed at end of the timeout period.
5081    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    /// Sets the value of [executable_file][crate::model::NodeInitializationAction::executable_file].
5092    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    /// Sets the value of [execution_timeout][crate::model::NodeInitializationAction::execution_timeout].
5098    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    /// Sets or clears the value of [execution_timeout][crate::model::NodeInitializationAction::execution_timeout].
5107    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/// The status of a cluster and its instances.
5123#[derive(Clone, Default, PartialEq)]
5124#[non_exhaustive]
5125pub struct ClusterStatus {
5126    /// Output only. The cluster's state.
5127    pub state: crate::model::cluster_status::State,
5128
5129    /// Optional. Output only. Details of cluster's state.
5130    pub detail: std::string::String,
5131
5132    /// Output only. Time when this state was entered (see JSON representation of
5133    /// [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)).
5134    pub state_start_time: std::option::Option<wkt::Timestamp>,
5135
5136    /// Output only. Additional state information that includes
5137    /// status reported by the agent.
5138    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    /// Sets the value of [state][crate::model::ClusterStatus::state].
5149    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    /// Sets the value of [detail][crate::model::ClusterStatus::detail].
5158    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    /// Sets the value of [state_start_time][crate::model::ClusterStatus::state_start_time].
5164    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    /// Sets or clears the value of [state_start_time][crate::model::ClusterStatus::state_start_time].
5173    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    /// Sets the value of [substate][crate::model::ClusterStatus::substate].
5182    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
5197/// Defines additional types related to [ClusterStatus].
5198pub mod cluster_status {
5199    #[allow(unused_imports)]
5200    use super::*;
5201
5202    /// The cluster state.
5203    ///
5204    /// # Working with unknown values
5205    ///
5206    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5207    /// additional enum variants at any time. Adding new variants is not considered
5208    /// a breaking change. Applications should write their code in anticipation of:
5209    ///
5210    /// - New values appearing in future releases of the client library, **and**
5211    /// - New values received dynamically, without application changes.
5212    ///
5213    /// Please consult the [Working with enums] section in the user guide for some
5214    /// guidelines.
5215    ///
5216    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5217    #[derive(Clone, Debug, PartialEq)]
5218    #[non_exhaustive]
5219    pub enum State {
5220        /// The cluster state is unknown.
5221        Unknown,
5222        /// The cluster is being created and set up. It is not ready for use.
5223        Creating,
5224        /// The cluster is currently running and healthy. It is ready for use.
5225        ///
5226        /// **Note:** The cluster state changes from "creating" to "running" status
5227        /// after the master node(s), first two primary worker nodes (and the last
5228        /// primary worker node if primary workers > 2) are running.
5229        Running,
5230        /// The cluster encountered an error. It is not ready for use.
5231        Error,
5232        /// The cluster has encountered an error while being updated. Jobs can
5233        /// be submitted to the cluster, but the cluster cannot be updated.
5234        ErrorDueToUpdate,
5235        /// The cluster is being deleted. It cannot be used.
5236        Deleting,
5237        /// The cluster is being updated. It continues to accept and process jobs.
5238        Updating,
5239        /// The cluster is being stopped. It cannot be used.
5240        Stopping,
5241        /// The cluster is currently stopped. It is not ready for use.
5242        Stopped,
5243        /// The cluster is being started. It is not ready for use.
5244        Starting,
5245        /// The cluster is being repaired. It is not ready for use.
5246        Repairing,
5247        /// If set, the enum was initialized with an unknown value.
5248        ///
5249        /// Applications can examine the value using [State::value] or
5250        /// [State::name].
5251        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        /// Gets the enum value.
5264        ///
5265        /// Returns `None` if the enum contains an unknown value deserialized from
5266        /// the string representation of enums.
5267        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        /// Gets the enum value as a string.
5285        ///
5286        /// Returns `None` if the enum contains an unknown value deserialized from
5287        /// the integer representation of enums.
5288        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    /// The cluster substate.
5396    ///
5397    /// # Working with unknown values
5398    ///
5399    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5400    /// additional enum variants at any time. Adding new variants is not considered
5401    /// a breaking change. Applications should write their code in anticipation of:
5402    ///
5403    /// - New values appearing in future releases of the client library, **and**
5404    /// - New values received dynamically, without application changes.
5405    ///
5406    /// Please consult the [Working with enums] section in the user guide for some
5407    /// guidelines.
5408    ///
5409    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5410    #[derive(Clone, Debug, PartialEq)]
5411    #[non_exhaustive]
5412    pub enum Substate {
5413        /// The cluster substate is unknown.
5414        Unspecified,
5415        /// The cluster is known to be in an unhealthy state
5416        /// (for example, critical daemons are not running or HDFS capacity is
5417        /// exhausted).
5418        ///
5419        /// Applies to RUNNING state.
5420        Unhealthy,
5421        /// The agent-reported status is out of date (may occur if
5422        /// Dataproc loses communication with Agent).
5423        ///
5424        /// Applies to RUNNING state.
5425        StaleStatus,
5426        /// If set, the enum was initialized with an unknown value.
5427        ///
5428        /// Applications can examine the value using [Substate::value] or
5429        /// [Substate::name].
5430        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        /// Gets the enum value.
5443        ///
5444        /// Returns `None` if the enum contains an unknown value deserialized from
5445        /// the string representation of enums.
5446        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        /// Gets the enum value as a string.
5456        ///
5457        /// Returns `None` if the enum contains an unknown value deserialized from
5458        /// the integer representation of enums.
5459        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/// Security related configuration, including encryption, Kerberos, etc.
5536#[derive(Clone, Default, PartialEq)]
5537#[non_exhaustive]
5538pub struct SecurityConfig {
5539    /// Optional. Kerberos related configuration.
5540    pub kerberos_config: std::option::Option<crate::model::KerberosConfig>,
5541
5542    /// Optional. Identity related configuration, including service account based
5543    /// secure multi-tenancy user mappings.
5544    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    /// Sets the value of [kerberos_config][crate::model::SecurityConfig::kerberos_config].
5555    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    /// Sets or clears the value of [kerberos_config][crate::model::SecurityConfig::kerberos_config].
5564    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    /// Sets the value of [identity_config][crate::model::SecurityConfig::identity_config].
5573    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    /// Sets or clears the value of [identity_config][crate::model::SecurityConfig::identity_config].
5582    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/// Specifies Kerberos related configuration.
5598#[derive(Clone, Default, PartialEq)]
5599#[non_exhaustive]
5600pub struct KerberosConfig {
5601    /// Optional. Flag to indicate whether to Kerberize the cluster (default:
5602    /// false). Set this field to true to enable Kerberos on a cluster.
5603    pub enable_kerberos: bool,
5604
5605    /// Optional. The Cloud Storage URI of a KMS encrypted file containing the root
5606    /// principal password.
5607    pub root_principal_password_uri: std::string::String,
5608
5609    /// Optional. The URI of the KMS key used to encrypt sensitive
5610    /// files.
5611    pub kms_key_uri: std::string::String,
5612
5613    /// Optional. The Cloud Storage URI of the keystore file used for SSL
5614    /// encryption. If not provided, Dataproc will provide a self-signed
5615    /// certificate.
5616    pub keystore_uri: std::string::String,
5617
5618    /// Optional. The Cloud Storage URI of the truststore file used for SSL
5619    /// encryption. If not provided, Dataproc will provide a self-signed
5620    /// certificate.
5621    pub truststore_uri: std::string::String,
5622
5623    /// Optional. The Cloud Storage URI of a KMS encrypted file containing the
5624    /// password to the user provided keystore. For the self-signed certificate,
5625    /// this password is generated by Dataproc.
5626    pub keystore_password_uri: std::string::String,
5627
5628    /// Optional. The Cloud Storage URI of a KMS encrypted file containing the
5629    /// password to the user provided key. For the self-signed certificate, this
5630    /// password is generated by Dataproc.
5631    pub key_password_uri: std::string::String,
5632
5633    /// Optional. The Cloud Storage URI of a KMS encrypted file containing the
5634    /// password to the user provided truststore. For the self-signed certificate,
5635    /// this password is generated by Dataproc.
5636    pub truststore_password_uri: std::string::String,
5637
5638    /// Optional. The remote realm the Dataproc on-cluster KDC will trust, should
5639    /// the user enable cross realm trust.
5640    pub cross_realm_trust_realm: std::string::String,
5641
5642    /// Optional. The KDC (IP or hostname) for the remote trusted realm in a cross
5643    /// realm trust relationship.
5644    pub cross_realm_trust_kdc: std::string::String,
5645
5646    /// Optional. The admin server (IP or hostname) for the remote trusted realm in
5647    /// a cross realm trust relationship.
5648    pub cross_realm_trust_admin_server: std::string::String,
5649
5650    /// Optional. The Cloud Storage URI of a KMS encrypted file containing the
5651    /// shared password between the on-cluster Kerberos realm and the remote
5652    /// trusted realm, in a cross realm trust relationship.
5653    pub cross_realm_trust_shared_password_uri: std::string::String,
5654
5655    /// Optional. The Cloud Storage URI of a KMS encrypted file containing the
5656    /// master key of the KDC database.
5657    pub kdc_db_key_uri: std::string::String,
5658
5659    /// Optional. The lifetime of the ticket granting ticket, in hours.
5660    /// If not specified, or user specifies 0, then default value 10
5661    /// will be used.
5662    pub tgt_lifetime_hours: i32,
5663
5664    /// Optional. The name of the on-cluster Kerberos realm.
5665    /// If not specified, the uppercased domain of hostnames will be the realm.
5666    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    /// Sets the value of [enable_kerberos][crate::model::KerberosConfig::enable_kerberos].
5677    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    /// Sets the value of [root_principal_password_uri][crate::model::KerberosConfig::root_principal_password_uri].
5683    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    /// Sets the value of [kms_key_uri][crate::model::KerberosConfig::kms_key_uri].
5692    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    /// Sets the value of [keystore_uri][crate::model::KerberosConfig::keystore_uri].
5698    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    /// Sets the value of [truststore_uri][crate::model::KerberosConfig::truststore_uri].
5704    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    /// Sets the value of [keystore_password_uri][crate::model::KerberosConfig::keystore_password_uri].
5710    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    /// Sets the value of [key_password_uri][crate::model::KerberosConfig::key_password_uri].
5719    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    /// Sets the value of [truststore_password_uri][crate::model::KerberosConfig::truststore_password_uri].
5728    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    /// Sets the value of [cross_realm_trust_realm][crate::model::KerberosConfig::cross_realm_trust_realm].
5737    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    /// Sets the value of [cross_realm_trust_kdc][crate::model::KerberosConfig::cross_realm_trust_kdc].
5746    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    /// Sets the value of [cross_realm_trust_admin_server][crate::model::KerberosConfig::cross_realm_trust_admin_server].
5755    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    /// Sets the value of [cross_realm_trust_shared_password_uri][crate::model::KerberosConfig::cross_realm_trust_shared_password_uri].
5764    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    /// Sets the value of [kdc_db_key_uri][crate::model::KerberosConfig::kdc_db_key_uri].
5773    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    /// Sets the value of [tgt_lifetime_hours][crate::model::KerberosConfig::tgt_lifetime_hours].
5779    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    /// Sets the value of [realm][crate::model::KerberosConfig::realm].
5785    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/// Identity related configuration, including service account based
5798/// secure multi-tenancy user mappings.
5799#[derive(Clone, Default, PartialEq)]
5800#[non_exhaustive]
5801pub struct IdentityConfig {
5802    /// Required. Map of user to service account.
5803    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    /// Sets the value of [user_service_account_mapping][crate::model::IdentityConfig::user_service_account_mapping].
5815    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/// Specifies the selection and config of software inside the cluster.
5835#[derive(Clone, Default, PartialEq)]
5836#[non_exhaustive]
5837pub struct SoftwareConfig {
5838    /// Optional. The version of software inside the cluster. It must be one of the
5839    /// supported [Dataproc
5840    /// Versions](https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#supported-dataproc-image-versions),
5841    /// such as "1.2" (including a subminor version, such as "1.2.29"), or the
5842    /// ["preview"
5843    /// version](https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#other_versions).
5844    /// If unspecified, it defaults to the latest Debian version.
5845    pub image_version: std::string::String,
5846
5847    /// Optional. The properties to set on daemon config files.
5848    ///
5849    /// Property keys are specified in `prefix:property` format, for example
5850    /// `core:hadoop.tmp.dir`. The following are supported prefixes
5851    /// and their mappings:
5852    ///
5853    /// * capacity-scheduler: `capacity-scheduler.xml`
5854    /// * core:   `core-site.xml`
5855    /// * distcp: `distcp-default.xml`
5856    /// * hdfs:   `hdfs-site.xml`
5857    /// * hive:   `hive-site.xml`
5858    /// * mapred: `mapred-site.xml`
5859    /// * pig:    `pig.properties`
5860    /// * spark:  `spark-defaults.conf`
5861    /// * yarn:   `yarn-site.xml`
5862    ///
5863    /// For more information, see [Cluster
5864    /// properties](https://cloud.google.com/dataproc/docs/concepts/cluster-properties).
5865    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
5866
5867    /// Optional. The set of components to activate on the cluster.
5868    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    /// Sets the value of [image_version][crate::model::SoftwareConfig::image_version].
5879    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    /// Sets the value of [properties][crate::model::SoftwareConfig::properties].
5885    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    /// Sets the value of [optional_components][crate::model::SoftwareConfig::optional_components].
5897    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/// Specifies the cluster auto-delete schedule configuration.
5915#[derive(Clone, Default, PartialEq)]
5916#[non_exhaustive]
5917pub struct LifecycleConfig {
5918    /// Optional. The duration to keep the cluster alive while idling (when no jobs
5919    /// are running). Passing this threshold will cause the cluster to be
5920    /// deleted. Minimum value is 5 minutes; maximum value is 14 days (see JSON
5921    /// representation of
5922    /// [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)).
5923    pub idle_delete_ttl: std::option::Option<wkt::Duration>,
5924
5925    /// Output only. The time when cluster became idle (most recent job finished)
5926    /// and became eligible for deletion due to idleness (see JSON representation
5927    /// of
5928    /// [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)).
5929    pub idle_start_time: std::option::Option<wkt::Timestamp>,
5930
5931    /// Either the exact time the cluster should be deleted at or
5932    /// the cluster maximum age.
5933    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    /// Sets the value of [idle_delete_ttl][crate::model::LifecycleConfig::idle_delete_ttl].
5944    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    /// Sets or clears the value of [idle_delete_ttl][crate::model::LifecycleConfig::idle_delete_ttl].
5953    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    /// Sets the value of [idle_start_time][crate::model::LifecycleConfig::idle_start_time].
5962    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    /// Sets or clears the value of [idle_start_time][crate::model::LifecycleConfig::idle_start_time].
5971    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    /// Sets the value of [ttl][crate::model::LifecycleConfig::ttl].
5980    ///
5981    /// Note that all the setters affecting `ttl` are mutually
5982    /// exclusive.
5983    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    /// The value of [ttl][crate::model::LifecycleConfig::ttl]
5994    /// if it holds a `AutoDeleteTime`, `None` if the field is not set or
5995    /// holds a different branch.
5996    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    /// Sets the value of [ttl][crate::model::LifecycleConfig::ttl]
6005    /// to hold a `AutoDeleteTime`.
6006    ///
6007    /// Note that all the setters affecting `ttl` are
6008    /// mutually exclusive.
6009    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    /// The value of [ttl][crate::model::LifecycleConfig::ttl]
6020    /// if it holds a `AutoDeleteTtl`, `None` if the field is not set or
6021    /// holds a different branch.
6022    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    /// Sets the value of [ttl][crate::model::LifecycleConfig::ttl]
6031    /// to hold a `AutoDeleteTtl`.
6032    ///
6033    /// Note that all the setters affecting `ttl` are
6034    /// mutually exclusive.
6035    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
6051/// Defines additional types related to [LifecycleConfig].
6052pub mod lifecycle_config {
6053    #[allow(unused_imports)]
6054    use super::*;
6055
6056    /// Either the exact time the cluster should be deleted at or
6057    /// the cluster maximum age.
6058    #[derive(Clone, Debug, PartialEq)]
6059    #[non_exhaustive]
6060    pub enum Ttl {
6061        /// Optional. The time when cluster will be auto-deleted (see JSON
6062        /// representation of
6063        /// [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)).
6064        AutoDeleteTime(std::boxed::Box<wkt::Timestamp>),
6065        /// Optional. The lifetime duration of cluster. The cluster will be
6066        /// auto-deleted at the end of this period. Minimum value is 10 minutes;
6067        /// maximum value is 14 days (see JSON representation of
6068        /// [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)).
6069        AutoDeleteTtl(std::boxed::Box<wkt::Duration>),
6070    }
6071}
6072
6073/// Specifies a Metastore configuration.
6074#[derive(Clone, Default, PartialEq)]
6075#[non_exhaustive]
6076pub struct MetastoreConfig {
6077    /// Required. Resource name of an existing Dataproc Metastore service.
6078    ///
6079    /// Example:
6080    ///
6081    /// * `projects/[project_id]/locations/[dataproc_region]/services/[service-name]`
6082    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    /// Sets the value of [dataproc_metastore_service][crate::model::MetastoreConfig::dataproc_metastore_service].
6093    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/// Contains cluster daemon metrics, such as HDFS and YARN stats.
6109///
6110/// **Beta Feature**: This report is available for testing purposes only. It may
6111/// be changed before final release.
6112#[derive(Clone, Default, PartialEq)]
6113#[non_exhaustive]
6114pub struct ClusterMetrics {
6115    /// The HDFS metrics.
6116    pub hdfs_metrics: std::collections::HashMap<std::string::String, i64>,
6117
6118    /// YARN metrics.
6119    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    /// Sets the value of [hdfs_metrics][crate::model::ClusterMetrics::hdfs_metrics].
6130    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    /// Sets the value of [yarn_metrics][crate::model::ClusterMetrics::yarn_metrics].
6142    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/// Dataproc metric config.
6161#[derive(Clone, Default, PartialEq)]
6162#[non_exhaustive]
6163pub struct DataprocMetricConfig {
6164    /// Required. Metrics sources to enable.
6165    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    /// Sets the value of [metrics][crate::model::DataprocMetricConfig::metrics].
6176    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
6193/// Defines additional types related to [DataprocMetricConfig].
6194pub mod dataproc_metric_config {
6195    #[allow(unused_imports)]
6196    use super::*;
6197
6198    /// A Dataproc custom metric.
6199    #[derive(Clone, Default, PartialEq)]
6200    #[non_exhaustive]
6201    pub struct Metric {
6202        /// Required. A standard set of metrics is collected unless `metricOverrides`
6203        /// are specified for the metric source (see [Custom metrics]
6204        /// (<https://cloud.google.com/dataproc/docs/guides/dataproc-metrics#custom_metrics>)
6205        /// for more information).
6206        pub metric_source: crate::model::dataproc_metric_config::MetricSource,
6207
6208        /// Optional. Specify one or more [Custom metrics]
6209        /// (<https://cloud.google.com/dataproc/docs/guides/dataproc-metrics#custom_metrics>)
6210        /// to collect for the metric course (for the `SPARK` metric source (any
6211        /// [Spark metric]
6212        /// (<https://spark.apache.org/docs/latest/monitoring.html#metrics>) can be
6213        /// specified).
6214        ///
6215        /// Provide metrics in the following format:
6216        /// \<code\>\<var\>METRIC_SOURCE\</var\>:\<var\>INSTANCE\</var\>:\<var\>GROUP\</var\>:\<var\>METRIC\</var\>\</code\>
6217        /// Use camelcase as appropriate.
6218        ///
6219        /// Examples:
6220        ///
6221        /// ```norust
6222        /// yarn:ResourceManager:QueueMetrics:AppsCompleted
6223        /// spark:driver:DAGScheduler:job.allJobs
6224        /// sparkHistoryServer:JVM:Memory:NonHeapMemoryUsage.committed
6225        /// hiveserver2:JVM:Memory:NonHeapMemoryUsage.used
6226        /// ```
6227        ///
6228        /// Notes:
6229        ///
6230        /// * Only the specified overridden metrics are collected for the
6231        ///   metric source. For example, if one or more `spark:executive` metrics
6232        ///   are listed as metric overrides, other `SPARK` metrics are not
6233        ///   collected. The collection of the metrics for other enabled custom
6234        ///   metric sources is unaffected. For example, if both `SPARK` andd `YARN`
6235        ///   metric sources are enabled, and overrides are provided for Spark
6236        ///   metrics only, all YARN metrics are collected.
6237        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        /// Sets the value of [metric_source][crate::model::dataproc_metric_config::Metric::metric_source].
6248        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        /// Sets the value of [metric_overrides][crate::model::dataproc_metric_config::Metric::metric_overrides].
6259        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    /// A source for the collection of Dataproc custom metrics (see [Custom
6277    /// metrics]
6278    /// (<https://cloud.google.com//dataproc/docs/guides/dataproc-metrics#custom_metrics>)).
6279    ///
6280    /// # Working with unknown values
6281    ///
6282    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6283    /// additional enum variants at any time. Adding new variants is not considered
6284    /// a breaking change. Applications should write their code in anticipation of:
6285    ///
6286    /// - New values appearing in future releases of the client library, **and**
6287    /// - New values received dynamically, without application changes.
6288    ///
6289    /// Please consult the [Working with enums] section in the user guide for some
6290    /// guidelines.
6291    ///
6292    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6293    #[derive(Clone, Debug, PartialEq)]
6294    #[non_exhaustive]
6295    pub enum MetricSource {
6296        /// Required unspecified metric source.
6297        Unspecified,
6298        /// Monitoring agent metrics. If this source is enabled,
6299        /// Dataproc enables the monitoring agent in Compute Engine,
6300        /// and collects monitoring agent metrics, which are published
6301        /// with an `agent.googleapis.com` prefix.
6302        MonitoringAgentDefaults,
6303        /// HDFS metric source.
6304        Hdfs,
6305        /// Spark metric source.
6306        Spark,
6307        /// YARN metric source.
6308        Yarn,
6309        /// Spark History Server metric source.
6310        SparkHistoryServer,
6311        /// Hiveserver2 metric source.
6312        Hiveserver2,
6313        /// hivemetastore metric source
6314        Hivemetastore,
6315        /// flink metric source
6316        Flink,
6317        /// If set, the enum was initialized with an unknown value.
6318        ///
6319        /// Applications can examine the value using [MetricSource::value] or
6320        /// [MetricSource::name].
6321        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        /// Gets the enum value.
6334        ///
6335        /// Returns `None` if the enum contains an unknown value deserialized from
6336        /// the string representation of enums.
6337        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        /// Gets the enum value as a string.
6353        ///
6354        /// Returns `None` if the enum contains an unknown value deserialized from
6355        /// the integer representation of enums.
6356        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/// A request to create a cluster.
6459#[derive(Clone, Default, PartialEq)]
6460#[non_exhaustive]
6461pub struct CreateClusterRequest {
6462    /// Required. The ID of the Google Cloud Platform project that the cluster
6463    /// belongs to.
6464    pub project_id: std::string::String,
6465
6466    /// Required. The Dataproc region in which to handle the request.
6467    pub region: std::string::String,
6468
6469    /// Required. The cluster to create.
6470    pub cluster: std::option::Option<crate::model::Cluster>,
6471
6472    /// Optional. A unique ID used to identify the request. If the server receives
6473    /// two
6474    /// [CreateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s
6475    /// with the same id, then the second request will be ignored and the
6476    /// first [google.longrunning.Operation][google.longrunning.Operation] created
6477    /// and stored in the backend is returned.
6478    ///
6479    /// It is recommended to always set this value to a
6480    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
6481    ///
6482    /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
6483    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
6484    ///
6485    /// [google.longrunning.Operation]: longrunning::model::Operation
6486    pub request_id: std::string::String,
6487
6488    /// Optional. Failure action when primary worker creation fails.
6489    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    /// Sets the value of [project_id][crate::model::CreateClusterRequest::project_id].
6500    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    /// Sets the value of [region][crate::model::CreateClusterRequest::region].
6506    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    /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
6512    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    /// Sets or clears the value of [cluster][crate::model::CreateClusterRequest::cluster].
6521    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    /// Sets the value of [request_id][crate::model::CreateClusterRequest::request_id].
6530    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    /// Sets the value of [action_on_failed_primary_workers][crate::model::CreateClusterRequest::action_on_failed_primary_workers].
6536    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/// A request to update a cluster.
6554#[derive(Clone, Default, PartialEq)]
6555#[non_exhaustive]
6556pub struct UpdateClusterRequest {
6557    /// Required. The ID of the Google Cloud Platform project the
6558    /// cluster belongs to.
6559    pub project_id: std::string::String,
6560
6561    /// Required. The Dataproc region in which to handle the request.
6562    pub region: std::string::String,
6563
6564    /// Required. The cluster name.
6565    pub cluster_name: std::string::String,
6566
6567    /// Required. The changes to the cluster.
6568    pub cluster: std::option::Option<crate::model::Cluster>,
6569
6570    /// Optional. Timeout for graceful YARN decommissioning. Graceful
6571    /// decommissioning allows removing nodes from the cluster without
6572    /// interrupting jobs in progress. Timeout specifies how long to wait for jobs
6573    /// in progress to finish before forcefully removing nodes (and potentially
6574    /// interrupting jobs). Default timeout is 0 (for forceful decommission), and
6575    /// the maximum allowed timeout is 1 day. (see JSON representation of
6576    /// [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)).
6577    ///
6578    /// Only supported on Dataproc image versions 1.2 and higher.
6579    pub graceful_decommission_timeout: std::option::Option<wkt::Duration>,
6580
6581    /// Required. Specifies the path, relative to `Cluster`, of
6582    /// the field to update. For example, to change the number of workers
6583    /// in a cluster to 5, the `update_mask` parameter would be
6584    /// specified as `config.worker_config.num_instances`,
6585    /// and the `PATCH` request body would specify the new value, as follows:
6586    ///
6587    /// ```norust
6588    /// {
6589    ///   "config":{
6590    ///     "workerConfig":{
6591    ///       "numInstances":"5"
6592    ///     }
6593    ///   }
6594    /// }
6595    /// ```
6596    ///
6597    /// Similarly, to change the number of preemptible workers in a cluster to 5,
6598    /// the `update_mask` parameter would be
6599    /// `config.secondary_worker_config.num_instances`, and the `PATCH` request
6600    /// body would be set as follows:
6601    ///
6602    /// ```norust
6603    /// {
6604    ///   "config":{
6605    ///     "secondaryWorkerConfig":{
6606    ///       "numInstances":"5"
6607    ///     }
6608    ///   }
6609    /// }
6610    /// ```
6611    ///
6612    /// \<strong\>Note:\</strong\> Currently, only the following fields can be updated:
6613    pub update_mask: std::option::Option<wkt::FieldMask>,
6614
6615    /// Optional. A unique ID used to identify the request. If the server
6616    /// receives two
6617    /// [UpdateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s
6618    /// with the same id, then the second request will be ignored and the
6619    /// first [google.longrunning.Operation][google.longrunning.Operation] created
6620    /// and stored in the backend is returned.
6621    ///
6622    /// It is recommended to always set this value to a
6623    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
6624    ///
6625    /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
6626    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
6627    ///
6628    /// [google.longrunning.Operation]: longrunning::model::Operation
6629    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    /// Sets the value of [project_id][crate::model::UpdateClusterRequest::project_id].
6640    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    /// Sets the value of [region][crate::model::UpdateClusterRequest::region].
6646    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    /// Sets the value of [cluster_name][crate::model::UpdateClusterRequest::cluster_name].
6652    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    /// Sets the value of [cluster][crate::model::UpdateClusterRequest::cluster].
6658    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    /// Sets or clears the value of [cluster][crate::model::UpdateClusterRequest::cluster].
6667    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    /// Sets the value of [graceful_decommission_timeout][crate::model::UpdateClusterRequest::graceful_decommission_timeout].
6676    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    /// Sets or clears the value of [graceful_decommission_timeout][crate::model::UpdateClusterRequest::graceful_decommission_timeout].
6685    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    /// Sets the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
6697    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    /// Sets or clears the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
6706    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    /// Sets the value of [request_id][crate::model::UpdateClusterRequest::request_id].
6715    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/// A request to stop a cluster.
6728#[derive(Clone, Default, PartialEq)]
6729#[non_exhaustive]
6730pub struct StopClusterRequest {
6731    /// Required. The ID of the Google Cloud Platform project the
6732    /// cluster belongs to.
6733    pub project_id: std::string::String,
6734
6735    /// Required. The Dataproc region in which to handle the request.
6736    pub region: std::string::String,
6737
6738    /// Required. The cluster name.
6739    pub cluster_name: std::string::String,
6740
6741    /// Optional. Specifying the `cluster_uuid` means the RPC will fail
6742    /// (with error NOT_FOUND) if a cluster with the specified UUID does not exist.
6743    pub cluster_uuid: std::string::String,
6744
6745    /// Optional. A unique ID used to identify the request. If the server
6746    /// receives two
6747    /// [StopClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s
6748    /// with the same id, then the second request will be ignored and the
6749    /// first [google.longrunning.Operation][google.longrunning.Operation] created
6750    /// and stored in the backend is returned.
6751    ///
6752    /// Recommendation: Set this value to a
6753    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
6754    ///
6755    /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
6756    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
6757    ///
6758    /// [google.longrunning.Operation]: longrunning::model::Operation
6759    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    /// Sets the value of [project_id][crate::model::StopClusterRequest::project_id].
6770    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    /// Sets the value of [region][crate::model::StopClusterRequest::region].
6776    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    /// Sets the value of [cluster_name][crate::model::StopClusterRequest::cluster_name].
6782    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    /// Sets the value of [cluster_uuid][crate::model::StopClusterRequest::cluster_uuid].
6788    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    /// Sets the value of [request_id][crate::model::StopClusterRequest::request_id].
6794    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/// A request to start a cluster.
6807#[derive(Clone, Default, PartialEq)]
6808#[non_exhaustive]
6809pub struct StartClusterRequest {
6810    /// Required. The ID of the Google Cloud Platform project the
6811    /// cluster belongs to.
6812    pub project_id: std::string::String,
6813
6814    /// Required. The Dataproc region in which to handle the request.
6815    pub region: std::string::String,
6816
6817    /// Required. The cluster name.
6818    pub cluster_name: std::string::String,
6819
6820    /// Optional. Specifying the `cluster_uuid` means the RPC will fail
6821    /// (with error NOT_FOUND) if a cluster with the specified UUID does not exist.
6822    pub cluster_uuid: std::string::String,
6823
6824    /// Optional. A unique ID used to identify the request. If the server
6825    /// receives two
6826    /// [StartClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s
6827    /// with the same id, then the second request will be ignored and the
6828    /// first [google.longrunning.Operation][google.longrunning.Operation] created
6829    /// and stored in the backend is returned.
6830    ///
6831    /// Recommendation: Set this value to a
6832    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
6833    ///
6834    /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
6835    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
6836    ///
6837    /// [google.longrunning.Operation]: longrunning::model::Operation
6838    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    /// Sets the value of [project_id][crate::model::StartClusterRequest::project_id].
6849    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    /// Sets the value of [region][crate::model::StartClusterRequest::region].
6855    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    /// Sets the value of [cluster_name][crate::model::StartClusterRequest::cluster_name].
6861    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    /// Sets the value of [cluster_uuid][crate::model::StartClusterRequest::cluster_uuid].
6867    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    /// Sets the value of [request_id][crate::model::StartClusterRequest::request_id].
6873    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/// A request to delete a cluster.
6886#[derive(Clone, Default, PartialEq)]
6887#[non_exhaustive]
6888pub struct DeleteClusterRequest {
6889    /// Required. The ID of the Google Cloud Platform project that the cluster
6890    /// belongs to.
6891    pub project_id: std::string::String,
6892
6893    /// Required. The Dataproc region in which to handle the request.
6894    pub region: std::string::String,
6895
6896    /// Required. The cluster name.
6897    pub cluster_name: std::string::String,
6898
6899    /// Optional. Specifying the `cluster_uuid` means the RPC should fail
6900    /// (with error NOT_FOUND) if cluster with specified UUID does not exist.
6901    pub cluster_uuid: std::string::String,
6902
6903    /// Optional. A unique ID used to identify the request. If the server
6904    /// receives two
6905    /// [DeleteClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s
6906    /// with the same id, then the second request will be ignored and the
6907    /// first [google.longrunning.Operation][google.longrunning.Operation] created
6908    /// and stored in the backend is returned.
6909    ///
6910    /// It is recommended to always set this value to a
6911    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
6912    ///
6913    /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
6914    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
6915    ///
6916    /// [google.longrunning.Operation]: longrunning::model::Operation
6917    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    /// Sets the value of [project_id][crate::model::DeleteClusterRequest::project_id].
6928    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    /// Sets the value of [region][crate::model::DeleteClusterRequest::region].
6934    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    /// Sets the value of [cluster_name][crate::model::DeleteClusterRequest::cluster_name].
6940    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    /// Sets the value of [cluster_uuid][crate::model::DeleteClusterRequest::cluster_uuid].
6946    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    /// Sets the value of [request_id][crate::model::DeleteClusterRequest::request_id].
6952    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/// Request to get the resource representation for a cluster in a project.
6965#[derive(Clone, Default, PartialEq)]
6966#[non_exhaustive]
6967pub struct GetClusterRequest {
6968    /// Required. The ID of the Google Cloud Platform project that the cluster
6969    /// belongs to.
6970    pub project_id: std::string::String,
6971
6972    /// Required. The Dataproc region in which to handle the request.
6973    pub region: std::string::String,
6974
6975    /// Required. The cluster name.
6976    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    /// Sets the value of [project_id][crate::model::GetClusterRequest::project_id].
6987    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    /// Sets the value of [region][crate::model::GetClusterRequest::region].
6993    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    /// Sets the value of [cluster_name][crate::model::GetClusterRequest::cluster_name].
6999    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/// A request to list the clusters in a project.
7012#[derive(Clone, Default, PartialEq)]
7013#[non_exhaustive]
7014pub struct ListClustersRequest {
7015    /// Required. The ID of the Google Cloud Platform project that the cluster
7016    /// belongs to.
7017    pub project_id: std::string::String,
7018
7019    /// Required. The Dataproc region in which to handle the request.
7020    pub region: std::string::String,
7021
7022    /// Optional. A filter constraining the clusters to list. Filters are
7023    /// case-sensitive and have the following syntax:
7024    ///
7025    /// field = value [AND [field = value]] ...
7026    ///
7027    /// where **field** is one of `status.state`, `clusterName`, or `labels.[KEY]`,
7028    /// and `[KEY]` is a label key. **value** can be `*` to match all values.
7029    /// `status.state` can be one of the following: `ACTIVE`, `INACTIVE`,
7030    /// `CREATING`, `RUNNING`, `ERROR`, `DELETING`, `UPDATING`, `STOPPING`, or
7031    /// `STOPPED`. `ACTIVE` contains the `CREATING`, `UPDATING`, and `RUNNING`
7032    /// states. `INACTIVE` contains the `DELETING`, `ERROR`, `STOPPING`, and
7033    /// `STOPPED` states. `clusterName` is the name of the cluster provided at
7034    /// creation time. Only the logical `AND` operator is supported;
7035    /// space-separated items are treated as having an implicit `AND` operator.
7036    ///
7037    /// Example filter:
7038    ///
7039    /// status.state = ACTIVE AND clusterName = mycluster
7040    /// AND labels.env = staging AND labels.starred = *
7041    pub filter: std::string::String,
7042
7043    /// Optional. The standard List page size.
7044    pub page_size: i32,
7045
7046    /// Optional. The standard List page token.
7047    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    /// Sets the value of [project_id][crate::model::ListClustersRequest::project_id].
7058    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    /// Sets the value of [region][crate::model::ListClustersRequest::region].
7064    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    /// Sets the value of [filter][crate::model::ListClustersRequest::filter].
7070    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    /// Sets the value of [page_size][crate::model::ListClustersRequest::page_size].
7076    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    /// Sets the value of [page_token][crate::model::ListClustersRequest::page_token].
7082    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/// The list of all clusters in a project.
7095#[derive(Clone, Default, PartialEq)]
7096#[non_exhaustive]
7097pub struct ListClustersResponse {
7098    /// Output only. The clusters in the project.
7099    pub clusters: std::vec::Vec<crate::model::Cluster>,
7100
7101    /// Output only. This token is included in the response if there are more
7102    /// results to fetch. To fetch additional results, provide this value as the
7103    /// `page_token` in a subsequent `ListClustersRequest`.
7104    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    /// Sets the value of [clusters][crate::model::ListClustersResponse::clusters].
7115    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    /// Sets the value of [next_page_token][crate::model::ListClustersResponse::next_page_token].
7126    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/// A request to collect cluster diagnostic information.
7153#[derive(Clone, Default, PartialEq)]
7154#[non_exhaustive]
7155pub struct DiagnoseClusterRequest {
7156    /// Required. The ID of the Google Cloud Platform project that the cluster
7157    /// belongs to.
7158    pub project_id: std::string::String,
7159
7160    /// Required. The Dataproc region in which to handle the request.
7161    pub region: std::string::String,
7162
7163    /// Required. The cluster name.
7164    pub cluster_name: std::string::String,
7165
7166    /// Optional. (Optional) The output Cloud Storage directory for the diagnostic
7167    /// tarball. If not specified, a task-specific directory in the cluster's
7168    /// staging bucket will be used.
7169    pub tarball_gcs_dir: std::string::String,
7170
7171    /// Optional. (Optional) The access type to the diagnostic tarball. If not
7172    /// specified, falls back to default access of the bucket
7173    pub tarball_access: crate::model::diagnose_cluster_request::TarballAccess,
7174
7175    /// Optional. Time interval in which diagnosis should be carried out on the
7176    /// cluster.
7177    pub diagnosis_interval: std::option::Option<gtype::model::Interval>,
7178
7179    /// Optional. Specifies a list of jobs on which diagnosis is to be performed.
7180    /// Format: projects/{project}/regions/{region}/jobs/{job}
7181    pub jobs: std::vec::Vec<std::string::String>,
7182
7183    /// Optional. Specifies a list of yarn applications on which diagnosis is to be
7184    /// performed.
7185    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    /// Sets the value of [project_id][crate::model::DiagnoseClusterRequest::project_id].
7196    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    /// Sets the value of [region][crate::model::DiagnoseClusterRequest::region].
7202    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    /// Sets the value of [cluster_name][crate::model::DiagnoseClusterRequest::cluster_name].
7208    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    /// Sets the value of [tarball_gcs_dir][crate::model::DiagnoseClusterRequest::tarball_gcs_dir].
7214    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    /// Sets the value of [tarball_access][crate::model::DiagnoseClusterRequest::tarball_access].
7220    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    /// Sets the value of [diagnosis_interval][crate::model::DiagnoseClusterRequest::diagnosis_interval].
7231    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    /// Sets or clears the value of [diagnosis_interval][crate::model::DiagnoseClusterRequest::diagnosis_interval].
7240    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    /// Sets the value of [jobs][crate::model::DiagnoseClusterRequest::jobs].
7249    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    /// Sets the value of [yarn_application_ids][crate::model::DiagnoseClusterRequest::yarn_application_ids].
7260    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
7277/// Defines additional types related to [DiagnoseClusterRequest].
7278pub mod diagnose_cluster_request {
7279    #[allow(unused_imports)]
7280    use super::*;
7281
7282    /// Defines who has access to the diagnostic tarball
7283    ///
7284    /// # Working with unknown values
7285    ///
7286    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7287    /// additional enum variants at any time. Adding new variants is not considered
7288    /// a breaking change. Applications should write their code in anticipation of:
7289    ///
7290    /// - New values appearing in future releases of the client library, **and**
7291    /// - New values received dynamically, without application changes.
7292    ///
7293    /// Please consult the [Working with enums] section in the user guide for some
7294    /// guidelines.
7295    ///
7296    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7297    #[derive(Clone, Debug, PartialEq)]
7298    #[non_exhaustive]
7299    pub enum TarballAccess {
7300        /// Tarball Access unspecified. Falls back to default access of the bucket
7301        Unspecified,
7302        /// Google Cloud Support group has read access to the
7303        /// diagnostic tarball
7304        GoogleCloudSupport,
7305        /// Google Cloud Dataproc Diagnose service account has read access to the
7306        /// diagnostic tarball
7307        GoogleDataprocDiagnose,
7308        /// If set, the enum was initialized with an unknown value.
7309        ///
7310        /// Applications can examine the value using [TarballAccess::value] or
7311        /// [TarballAccess::name].
7312        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        /// Gets the enum value.
7325        ///
7326        /// Returns `None` if the enum contains an unknown value deserialized from
7327        /// the string representation of enums.
7328        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        /// Gets the enum value as a string.
7338        ///
7339        /// Returns `None` if the enum contains an unknown value deserialized from
7340        /// the integer representation of enums.
7341        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/// The location of diagnostic output.
7420#[derive(Clone, Default, PartialEq)]
7421#[non_exhaustive]
7422pub struct DiagnoseClusterResults {
7423    /// Output only. The Cloud Storage URI of the diagnostic output.
7424    /// The output report is a plain text file with a summary of collected
7425    /// diagnostics.
7426    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    /// Sets the value of [output_uri][crate::model::DiagnoseClusterResults::output_uri].
7437    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/// Reservation Affinity for consuming Zonal reservation.
7450#[derive(Clone, Default, PartialEq)]
7451#[non_exhaustive]
7452pub struct ReservationAffinity {
7453    /// Optional. Type of reservation to consume
7454    pub consume_reservation_type: crate::model::reservation_affinity::Type,
7455
7456    /// Optional. Corresponds to the label key of reservation resource.
7457    pub key: std::string::String,
7458
7459    /// Optional. Corresponds to the label values of reservation resource.
7460    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    /// Sets the value of [consume_reservation_type][crate::model::ReservationAffinity::consume_reservation_type].
7471    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    /// Sets the value of [key][crate::model::ReservationAffinity::key].
7482    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    /// Sets the value of [values][crate::model::ReservationAffinity::values].
7488    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
7505/// Defines additional types related to [ReservationAffinity].
7506pub mod reservation_affinity {
7507    #[allow(unused_imports)]
7508    use super::*;
7509
7510    /// Indicates whether to consume capacity from an reservation or not.
7511    ///
7512    /// # Working with unknown values
7513    ///
7514    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7515    /// additional enum variants at any time. Adding new variants is not considered
7516    /// a breaking change. Applications should write their code in anticipation of:
7517    ///
7518    /// - New values appearing in future releases of the client library, **and**
7519    /// - New values received dynamically, without application changes.
7520    ///
7521    /// Please consult the [Working with enums] section in the user guide for some
7522    /// guidelines.
7523    ///
7524    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7525    #[derive(Clone, Debug, PartialEq)]
7526    #[non_exhaustive]
7527    pub enum Type {
7528        Unspecified,
7529        /// Do not consume from any allocated capacity.
7530        NoReservation,
7531        /// Consume any reservation available.
7532        AnyReservation,
7533        /// Must consume from a specific reservation. Must specify key value fields
7534        /// for specifying the reservations.
7535        SpecificReservation,
7536        /// If set, the enum was initialized with an unknown value.
7537        ///
7538        /// Applications can examine the value using [Type::value] or
7539        /// [Type::name].
7540        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        /// Gets the enum value.
7553        ///
7554        /// Returns `None` if the enum contains an unknown value deserialized from
7555        /// the string representation of enums.
7556        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        /// Gets the enum value as a string.
7567        ///
7568        /// Returns `None` if the enum contains an unknown value deserialized from
7569        /// the integer representation of enums.
7570        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/// The runtime logging config of the job.
7651#[derive(Clone, Default, PartialEq)]
7652#[non_exhaustive]
7653pub struct LoggingConfig {
7654    /// The per-package log levels for the driver. This can include
7655    /// "root" package name to configure rootLogger.
7656    /// Examples:
7657    ///
7658    /// - 'com.google = FATAL'
7659    /// - 'root = INFO'
7660    /// - 'org.apache = DEBUG'
7661    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    /// Sets the value of [driver_log_levels][crate::model::LoggingConfig::driver_log_levels].
7673    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
7691/// Defines additional types related to [LoggingConfig].
7692pub mod logging_config {
7693    #[allow(unused_imports)]
7694    use super::*;
7695
7696    /// The Log4j level for job execution. When running an
7697    /// [Apache Hive](https://hive.apache.org/) job, Cloud
7698    /// Dataproc configures the Hive client to an equivalent verbosity level.
7699    ///
7700    /// # Working with unknown values
7701    ///
7702    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7703    /// additional enum variants at any time. Adding new variants is not considered
7704    /// a breaking change. Applications should write their code in anticipation of:
7705    ///
7706    /// - New values appearing in future releases of the client library, **and**
7707    /// - New values received dynamically, without application changes.
7708    ///
7709    /// Please consult the [Working with enums] section in the user guide for some
7710    /// guidelines.
7711    ///
7712    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7713    #[derive(Clone, Debug, PartialEq)]
7714    #[non_exhaustive]
7715    pub enum Level {
7716        /// Level is unspecified. Use default level for log4j.
7717        Unspecified,
7718        /// Use ALL level for log4j.
7719        All,
7720        /// Use TRACE level for log4j.
7721        Trace,
7722        /// Use DEBUG level for log4j.
7723        Debug,
7724        /// Use INFO level for log4j.
7725        Info,
7726        /// Use WARN level for log4j.
7727        Warn,
7728        /// Use ERROR level for log4j.
7729        Error,
7730        /// Use FATAL level for log4j.
7731        Fatal,
7732        /// Turn off log4j.
7733        Off,
7734        /// If set, the enum was initialized with an unknown value.
7735        ///
7736        /// Applications can examine the value using [Level::value] or
7737        /// [Level::name].
7738        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        /// Gets the enum value.
7751        ///
7752        /// Returns `None` if the enum contains an unknown value deserialized from
7753        /// the string representation of enums.
7754        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        /// Gets the enum value as a string.
7770        ///
7771        /// Returns `None` if the enum contains an unknown value deserialized from
7772        /// the integer representation of enums.
7773        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/// A Dataproc job for running
7874/// [Apache Hadoop
7875/// MapReduce](https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html)
7876/// jobs on [Apache Hadoop
7877/// YARN](https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html).
7878#[derive(Clone, Default, PartialEq)]
7879#[non_exhaustive]
7880pub struct HadoopJob {
7881    /// Optional. The arguments to pass to the driver. Do not
7882    /// include arguments, such as `-libjars` or `-Dfoo=bar`, that can be set as
7883    /// job properties, since a collision might occur that causes an incorrect job
7884    /// submission.
7885    pub args: std::vec::Vec<std::string::String>,
7886
7887    /// Optional. Jar file URIs to add to the CLASSPATHs of the
7888    /// Hadoop driver and tasks.
7889    pub jar_file_uris: std::vec::Vec<std::string::String>,
7890
7891    /// Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied
7892    /// to the working directory of Hadoop drivers and distributed tasks. Useful
7893    /// for naively parallel tasks.
7894    pub file_uris: std::vec::Vec<std::string::String>,
7895
7896    /// Optional. HCFS URIs of archives to be extracted in the working directory of
7897    /// Hadoop drivers and tasks. Supported file types:
7898    /// .jar, .tar, .tar.gz, .tgz, or .zip.
7899    pub archive_uris: std::vec::Vec<std::string::String>,
7900
7901    /// Optional. A mapping of property names to values, used to configure Hadoop.
7902    /// Properties that conflict with values set by the Dataproc API might be
7903    /// overwritten. Can include properties set in `/etc/hadoop/conf/*-site` and
7904    /// classes in user code.
7905    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
7906
7907    /// Optional. The runtime log config for job execution.
7908    pub logging_config: std::option::Option<crate::model::LoggingConfig>,
7909
7910    /// Required. Indicates the location of the driver's main class. Specify
7911    /// either the jar file that contains the main class or the main class name.
7912    /// To specify both, add the jar file to `jar_file_uris`, and then specify
7913    /// the main class name in this property.
7914    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    /// Sets the value of [args][crate::model::HadoopJob::args].
7925    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    /// Sets the value of [jar_file_uris][crate::model::HadoopJob::jar_file_uris].
7936    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    /// Sets the value of [file_uris][crate::model::HadoopJob::file_uris].
7947    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    /// Sets the value of [archive_uris][crate::model::HadoopJob::archive_uris].
7958    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    /// Sets the value of [properties][crate::model::HadoopJob::properties].
7969    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    /// Sets the value of [logging_config][crate::model::HadoopJob::logging_config].
7981    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    /// Sets or clears the value of [logging_config][crate::model::HadoopJob::logging_config].
7990    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    /// Sets the value of [driver][crate::model::HadoopJob::driver].
7999    ///
8000    /// Note that all the setters affecting `driver` are mutually
8001    /// exclusive.
8002    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    /// The value of [driver][crate::model::HadoopJob::driver]
8013    /// if it holds a `MainJarFileUri`, `None` if the field is not set or
8014    /// holds a different branch.
8015    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    /// Sets the value of [driver][crate::model::HadoopJob::driver]
8024    /// to hold a `MainJarFileUri`.
8025    ///
8026    /// Note that all the setters affecting `driver` are
8027    /// mutually exclusive.
8028    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    /// The value of [driver][crate::model::HadoopJob::driver]
8038    /// if it holds a `MainClass`, `None` if the field is not set or
8039    /// holds a different branch.
8040    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    /// Sets the value of [driver][crate::model::HadoopJob::driver]
8049    /// to hold a `MainClass`.
8050    ///
8051    /// Note that all the setters affecting `driver` are
8052    /// mutually exclusive.
8053    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
8066/// Defines additional types related to [HadoopJob].
8067pub mod hadoop_job {
8068    #[allow(unused_imports)]
8069    use super::*;
8070
8071    /// Required. Indicates the location of the driver's main class. Specify
8072    /// either the jar file that contains the main class or the main class name.
8073    /// To specify both, add the jar file to `jar_file_uris`, and then specify
8074    /// the main class name in this property.
8075    #[derive(Clone, Debug, PartialEq)]
8076    #[non_exhaustive]
8077    pub enum Driver {
8078        /// The HCFS URI of the jar file containing the main class.
8079        /// Examples:
8080        /// 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar'
8081        /// 'hdfs:/tmp/test-samples/custom-wordcount.jar'
8082        /// 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar'
8083        MainJarFileUri(std::string::String),
8084        /// The name of the driver's main class. The jar file containing the class
8085        /// must be in the default CLASSPATH or specified in `jar_file_uris`.
8086        MainClass(std::string::String),
8087    }
8088}
8089
8090/// A Dataproc job for running [Apache Spark](https://spark.apache.org/)
8091/// applications on YARN.
8092#[derive(Clone, Default, PartialEq)]
8093#[non_exhaustive]
8094pub struct SparkJob {
8095    /// Optional. The arguments to pass to the driver. Do not include arguments,
8096    /// such as `--conf`, that can be set as job properties, since a collision may
8097    /// occur that causes an incorrect job submission.
8098    pub args: std::vec::Vec<std::string::String>,
8099
8100    /// Optional. HCFS URIs of jar files to add to the CLASSPATHs of the
8101    /// Spark driver and tasks.
8102    pub jar_file_uris: std::vec::Vec<std::string::String>,
8103
8104    /// Optional. HCFS URIs of files to be placed in the working directory of
8105    /// each executor. Useful for naively parallel tasks.
8106    pub file_uris: std::vec::Vec<std::string::String>,
8107
8108    /// Optional. HCFS URIs of archives to be extracted into the working directory
8109    /// of each executor. Supported file types:
8110    /// .jar, .tar, .tar.gz, .tgz, and .zip.
8111    pub archive_uris: std::vec::Vec<std::string::String>,
8112
8113    /// Optional. A mapping of property names to values, used to configure Spark.
8114    /// Properties that conflict with values set by the Dataproc API might be
8115    /// overwritten. Can include properties set in
8116    /// /etc/spark/conf/spark-defaults.conf and classes in user code.
8117    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
8118
8119    /// Optional. The runtime log config for job execution.
8120    pub logging_config: std::option::Option<crate::model::LoggingConfig>,
8121
8122    /// Required. The specification of the main method to call to drive the job.
8123    /// Specify either the jar file that contains the main class or the main class
8124    /// name. To pass both a main jar and a main class in that jar, add the jar to
8125    /// [jarFileUris][google.cloud.dataproc.v1.SparkJob.jar_file_uris], and then
8126    /// specify the main class name in
8127    /// [mainClass][google.cloud.dataproc.v1.SparkJob.main_class].
8128    ///
8129    /// [google.cloud.dataproc.v1.SparkJob.jar_file_uris]: crate::model::SparkJob::jar_file_uris
8130    /// [google.cloud.dataproc.v1.SparkJob.main_class]: crate::model::SparkJob::driver
8131    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    /// Sets the value of [args][crate::model::SparkJob::args].
8142    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    /// Sets the value of [jar_file_uris][crate::model::SparkJob::jar_file_uris].
8153    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    /// Sets the value of [file_uris][crate::model::SparkJob::file_uris].
8164    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    /// Sets the value of [archive_uris][crate::model::SparkJob::archive_uris].
8175    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    /// Sets the value of [properties][crate::model::SparkJob::properties].
8186    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    /// Sets the value of [logging_config][crate::model::SparkJob::logging_config].
8198    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    /// Sets or clears the value of [logging_config][crate::model::SparkJob::logging_config].
8207    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    /// Sets the value of [driver][crate::model::SparkJob::driver].
8216    ///
8217    /// Note that all the setters affecting `driver` are mutually
8218    /// exclusive.
8219    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    /// The value of [driver][crate::model::SparkJob::driver]
8230    /// if it holds a `MainJarFileUri`, `None` if the field is not set or
8231    /// holds a different branch.
8232    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    /// Sets the value of [driver][crate::model::SparkJob::driver]
8241    /// to hold a `MainJarFileUri`.
8242    ///
8243    /// Note that all the setters affecting `driver` are
8244    /// mutually exclusive.
8245    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    /// The value of [driver][crate::model::SparkJob::driver]
8255    /// if it holds a `MainClass`, `None` if the field is not set or
8256    /// holds a different branch.
8257    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    /// Sets the value of [driver][crate::model::SparkJob::driver]
8266    /// to hold a `MainClass`.
8267    ///
8268    /// Note that all the setters affecting `driver` are
8269    /// mutually exclusive.
8270    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
8283/// Defines additional types related to [SparkJob].
8284pub mod spark_job {
8285    #[allow(unused_imports)]
8286    use super::*;
8287
8288    /// Required. The specification of the main method to call to drive the job.
8289    /// Specify either the jar file that contains the main class or the main class
8290    /// name. To pass both a main jar and a main class in that jar, add the jar to
8291    /// [jarFileUris][google.cloud.dataproc.v1.SparkJob.jar_file_uris], and then
8292    /// specify the main class name in
8293    /// [mainClass][google.cloud.dataproc.v1.SparkJob.main_class].
8294    ///
8295    /// [google.cloud.dataproc.v1.SparkJob.jar_file_uris]: crate::model::SparkJob::jar_file_uris
8296    /// [google.cloud.dataproc.v1.SparkJob.main_class]: crate::model::SparkJob::driver
8297    #[derive(Clone, Debug, PartialEq)]
8298    #[non_exhaustive]
8299    pub enum Driver {
8300        /// The HCFS URI of the jar file that contains the main class.
8301        MainJarFileUri(std::string::String),
8302        /// The name of the driver's main class. The jar file that contains the class
8303        /// must be in the default CLASSPATH or specified in
8304        /// SparkJob.jar_file_uris.
8305        MainClass(std::string::String),
8306    }
8307}
8308
8309/// A Dataproc job for running
8310/// [Apache
8311/// PySpark](https://spark.apache.org/docs/0.9.0/python-programming-guide.html)
8312/// applications on YARN.
8313#[derive(Clone, Default, PartialEq)]
8314#[non_exhaustive]
8315pub struct PySparkJob {
8316    /// Required. The HCFS URI of the main Python file to use as the driver. Must
8317    /// be a .py file.
8318    pub main_python_file_uri: std::string::String,
8319
8320    /// Optional. The arguments to pass to the driver.  Do not include arguments,
8321    /// such as `--conf`, that can be set as job properties, since a collision may
8322    /// occur that causes an incorrect job submission.
8323    pub args: std::vec::Vec<std::string::String>,
8324
8325    /// Optional. HCFS file URIs of Python files to pass to the PySpark
8326    /// framework. Supported file types: .py, .egg, and .zip.
8327    pub python_file_uris: std::vec::Vec<std::string::String>,
8328
8329    /// Optional. HCFS URIs of jar files to add to the CLASSPATHs of the
8330    /// Python driver and tasks.
8331    pub jar_file_uris: std::vec::Vec<std::string::String>,
8332
8333    /// Optional. HCFS URIs of files to be placed in the working directory of
8334    /// each executor. Useful for naively parallel tasks.
8335    pub file_uris: std::vec::Vec<std::string::String>,
8336
8337    /// Optional. HCFS URIs of archives to be extracted into the working directory
8338    /// of each executor. Supported file types:
8339    /// .jar, .tar, .tar.gz, .tgz, and .zip.
8340    pub archive_uris: std::vec::Vec<std::string::String>,
8341
8342    /// Optional. A mapping of property names to values, used to configure PySpark.
8343    /// Properties that conflict with values set by the Dataproc API might be
8344    /// overwritten. Can include properties set in
8345    /// /etc/spark/conf/spark-defaults.conf and classes in user code.
8346    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
8347
8348    /// Optional. The runtime log config for job execution.
8349    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    /// Sets the value of [main_python_file_uri][crate::model::PySparkJob::main_python_file_uri].
8360    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    /// Sets the value of [args][crate::model::PySparkJob::args].
8369    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    /// Sets the value of [python_file_uris][crate::model::PySparkJob::python_file_uris].
8380    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    /// Sets the value of [jar_file_uris][crate::model::PySparkJob::jar_file_uris].
8391    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    /// Sets the value of [file_uris][crate::model::PySparkJob::file_uris].
8402    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    /// Sets the value of [archive_uris][crate::model::PySparkJob::archive_uris].
8413    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    /// Sets the value of [properties][crate::model::PySparkJob::properties].
8424    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    /// Sets the value of [logging_config][crate::model::PySparkJob::logging_config].
8436    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    /// Sets or clears the value of [logging_config][crate::model::PySparkJob::logging_config].
8445    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/// A list of queries to run on a cluster.
8461#[derive(Clone, Default, PartialEq)]
8462#[non_exhaustive]
8463pub struct QueryList {
8464    /// Required. The queries to execute. You do not need to end a query expression
8465    /// with a semicolon. Multiple queries can be specified in one
8466    /// string by separating each with a semicolon. Here is an example of a
8467    /// Dataproc API snippet that uses a QueryList to specify a HiveJob:
8468    ///
8469    /// ```norust
8470    /// "hiveJob": {
8471    ///   "queryList": {
8472    ///     "queries": [
8473    ///       "query1",
8474    ///       "query2",
8475    ///       "query3;query4",
8476    ///     ]
8477    ///   }
8478    /// }
8479    /// ```
8480    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    /// Sets the value of [queries][crate::model::QueryList::queries].
8491    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/// A Dataproc job for running [Apache Hive](https://hive.apache.org/)
8509/// queries on YARN.
8510#[derive(Clone, Default, PartialEq)]
8511#[non_exhaustive]
8512pub struct HiveJob {
8513    /// Optional. Whether to continue executing queries if a query fails.
8514    /// The default value is `false`. Setting to `true` can be useful when
8515    /// executing independent parallel queries.
8516    pub continue_on_failure: bool,
8517
8518    /// Optional. Mapping of query variable names to values (equivalent to the
8519    /// Hive command: `SET name="value";`).
8520    pub script_variables: std::collections::HashMap<std::string::String, std::string::String>,
8521
8522    /// Optional. A mapping of property names and values, used to configure Hive.
8523    /// Properties that conflict with values set by the Dataproc API might be
8524    /// overwritten. Can include properties set in `/etc/hadoop/conf/*-site.xml`,
8525    /// /etc/hive/conf/hive-site.xml, and classes in user code.
8526    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
8527
8528    /// Optional. HCFS URIs of jar files to add to the CLASSPATH of the
8529    /// Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes
8530    /// and UDFs.
8531    pub jar_file_uris: std::vec::Vec<std::string::String>,
8532
8533    /// Required. The sequence of Hive queries to execute, specified as either
8534    /// an HCFS file URI or a list of queries.
8535    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    /// Sets the value of [continue_on_failure][crate::model::HiveJob::continue_on_failure].
8546    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    /// Sets the value of [script_variables][crate::model::HiveJob::script_variables].
8552    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    /// Sets the value of [properties][crate::model::HiveJob::properties].
8564    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    /// Sets the value of [jar_file_uris][crate::model::HiveJob::jar_file_uris].
8576    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    /// Sets the value of [queries][crate::model::HiveJob::queries].
8587    ///
8588    /// Note that all the setters affecting `queries` are mutually
8589    /// exclusive.
8590    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    /// The value of [queries][crate::model::HiveJob::queries]
8601    /// if it holds a `QueryFileUri`, `None` if the field is not set or
8602    /// holds a different branch.
8603    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    /// Sets the value of [queries][crate::model::HiveJob::queries]
8612    /// to hold a `QueryFileUri`.
8613    ///
8614    /// Note that all the setters affecting `queries` are
8615    /// mutually exclusive.
8616    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    /// The value of [queries][crate::model::HiveJob::queries]
8623    /// if it holds a `QueryList`, `None` if the field is not set or
8624    /// holds a different branch.
8625    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    /// Sets the value of [queries][crate::model::HiveJob::queries]
8634    /// to hold a `QueryList`.
8635    ///
8636    /// Note that all the setters affecting `queries` are
8637    /// mutually exclusive.
8638    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
8654/// Defines additional types related to [HiveJob].
8655pub mod hive_job {
8656    #[allow(unused_imports)]
8657    use super::*;
8658
8659    /// Required. The sequence of Hive queries to execute, specified as either
8660    /// an HCFS file URI or a list of queries.
8661    #[derive(Clone, Debug, PartialEq)]
8662    #[non_exhaustive]
8663    pub enum Queries {
8664        /// The HCFS URI of the script that contains Hive queries.
8665        QueryFileUri(std::string::String),
8666        /// A list of queries.
8667        QueryList(std::boxed::Box<crate::model::QueryList>),
8668    }
8669}
8670
8671/// A Dataproc job for running [Apache Spark
8672/// SQL](https://spark.apache.org/sql/) queries.
8673#[derive(Clone, Default, PartialEq)]
8674#[non_exhaustive]
8675pub struct SparkSqlJob {
8676    /// Optional. Mapping of query variable names to values (equivalent to the
8677    /// Spark SQL command: SET `name="value";`).
8678    pub script_variables: std::collections::HashMap<std::string::String, std::string::String>,
8679
8680    /// Optional. A mapping of property names to values, used to configure
8681    /// Spark SQL's SparkConf. Properties that conflict with values set by the
8682    /// Dataproc API might be overwritten.
8683    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
8684
8685    /// Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH.
8686    pub jar_file_uris: std::vec::Vec<std::string::String>,
8687
8688    /// Optional. The runtime log config for job execution.
8689    pub logging_config: std::option::Option<crate::model::LoggingConfig>,
8690
8691    /// Required. The sequence of Spark SQL queries to execute, specified as
8692    /// either an HCFS file URI or as a list of queries.
8693    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    /// Sets the value of [script_variables][crate::model::SparkSqlJob::script_variables].
8704    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    /// Sets the value of [properties][crate::model::SparkSqlJob::properties].
8716    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    /// Sets the value of [jar_file_uris][crate::model::SparkSqlJob::jar_file_uris].
8728    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    /// Sets the value of [logging_config][crate::model::SparkSqlJob::logging_config].
8739    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    /// Sets or clears the value of [logging_config][crate::model::SparkSqlJob::logging_config].
8748    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    /// Sets the value of [queries][crate::model::SparkSqlJob::queries].
8757    ///
8758    /// Note that all the setters affecting `queries` are mutually
8759    /// exclusive.
8760    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    /// The value of [queries][crate::model::SparkSqlJob::queries]
8771    /// if it holds a `QueryFileUri`, `None` if the field is not set or
8772    /// holds a different branch.
8773    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    /// Sets the value of [queries][crate::model::SparkSqlJob::queries]
8782    /// to hold a `QueryFileUri`.
8783    ///
8784    /// Note that all the setters affecting `queries` are
8785    /// mutually exclusive.
8786    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    /// The value of [queries][crate::model::SparkSqlJob::queries]
8793    /// if it holds a `QueryList`, `None` if the field is not set or
8794    /// holds a different branch.
8795    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    /// Sets the value of [queries][crate::model::SparkSqlJob::queries]
8804    /// to hold a `QueryList`.
8805    ///
8806    /// Note that all the setters affecting `queries` are
8807    /// mutually exclusive.
8808    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
8824/// Defines additional types related to [SparkSqlJob].
8825pub mod spark_sql_job {
8826    #[allow(unused_imports)]
8827    use super::*;
8828
8829    /// Required. The sequence of Spark SQL queries to execute, specified as
8830    /// either an HCFS file URI or as a list of queries.
8831    #[derive(Clone, Debug, PartialEq)]
8832    #[non_exhaustive]
8833    pub enum Queries {
8834        /// The HCFS URI of the script that contains SQL queries.
8835        QueryFileUri(std::string::String),
8836        /// A list of queries.
8837        QueryList(std::boxed::Box<crate::model::QueryList>),
8838    }
8839}
8840
8841/// A Dataproc job for running [Apache Pig](https://pig.apache.org/)
8842/// queries on YARN.
8843#[derive(Clone, Default, PartialEq)]
8844#[non_exhaustive]
8845pub struct PigJob {
8846    /// Optional. Whether to continue executing queries if a query fails.
8847    /// The default value is `false`. Setting to `true` can be useful when
8848    /// executing independent parallel queries.
8849    pub continue_on_failure: bool,
8850
8851    /// Optional. Mapping of query variable names to values (equivalent to the Pig
8852    /// command: `name=[value]`).
8853    pub script_variables: std::collections::HashMap<std::string::String, std::string::String>,
8854
8855    /// Optional. A mapping of property names to values, used to configure Pig.
8856    /// Properties that conflict with values set by the Dataproc API might be
8857    /// overwritten. Can include properties set in `/etc/hadoop/conf/*-site.xml`,
8858    /// /etc/pig/conf/pig.properties, and classes in user code.
8859    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
8860
8861    /// Optional. HCFS URIs of jar files to add to the CLASSPATH of
8862    /// the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.
8863    pub jar_file_uris: std::vec::Vec<std::string::String>,
8864
8865    /// Optional. The runtime log config for job execution.
8866    pub logging_config: std::option::Option<crate::model::LoggingConfig>,
8867
8868    /// Required. The sequence of Pig queries to execute, specified as an HCFS
8869    /// file URI or a list of queries.
8870    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    /// Sets the value of [continue_on_failure][crate::model::PigJob::continue_on_failure].
8881    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    /// Sets the value of [script_variables][crate::model::PigJob::script_variables].
8887    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    /// Sets the value of [properties][crate::model::PigJob::properties].
8899    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    /// Sets the value of [jar_file_uris][crate::model::PigJob::jar_file_uris].
8911    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    /// Sets the value of [logging_config][crate::model::PigJob::logging_config].
8922    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    /// Sets or clears the value of [logging_config][crate::model::PigJob::logging_config].
8931    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    /// Sets the value of [queries][crate::model::PigJob::queries].
8940    ///
8941    /// Note that all the setters affecting `queries` are mutually
8942    /// exclusive.
8943    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    /// The value of [queries][crate::model::PigJob::queries]
8954    /// if it holds a `QueryFileUri`, `None` if the field is not set or
8955    /// holds a different branch.
8956    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    /// Sets the value of [queries][crate::model::PigJob::queries]
8965    /// to hold a `QueryFileUri`.
8966    ///
8967    /// Note that all the setters affecting `queries` are
8968    /// mutually exclusive.
8969    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    /// The value of [queries][crate::model::PigJob::queries]
8976    /// if it holds a `QueryList`, `None` if the field is not set or
8977    /// holds a different branch.
8978    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    /// Sets the value of [queries][crate::model::PigJob::queries]
8987    /// to hold a `QueryList`.
8988    ///
8989    /// Note that all the setters affecting `queries` are
8990    /// mutually exclusive.
8991    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
9007/// Defines additional types related to [PigJob].
9008pub mod pig_job {
9009    #[allow(unused_imports)]
9010    use super::*;
9011
9012    /// Required. The sequence of Pig queries to execute, specified as an HCFS
9013    /// file URI or a list of queries.
9014    #[derive(Clone, Debug, PartialEq)]
9015    #[non_exhaustive]
9016    pub enum Queries {
9017        /// The HCFS URI of the script that contains the Pig queries.
9018        QueryFileUri(std::string::String),
9019        /// A list of queries.
9020        QueryList(std::boxed::Box<crate::model::QueryList>),
9021    }
9022}
9023
9024/// A Dataproc job for running
9025/// [Apache SparkR](https://spark.apache.org/docs/latest/sparkr.html)
9026/// applications on YARN.
9027#[derive(Clone, Default, PartialEq)]
9028#[non_exhaustive]
9029pub struct SparkRJob {
9030    /// Required. The HCFS URI of the main R file to use as the driver.
9031    /// Must be a .R file.
9032    pub main_r_file_uri: std::string::String,
9033
9034    /// Optional. The arguments to pass to the driver.  Do not include arguments,
9035    /// such as `--conf`, that can be set as job properties, since a collision may
9036    /// occur that causes an incorrect job submission.
9037    pub args: std::vec::Vec<std::string::String>,
9038
9039    /// Optional. HCFS URIs of files to be placed in the working directory of
9040    /// each executor. Useful for naively parallel tasks.
9041    pub file_uris: std::vec::Vec<std::string::String>,
9042
9043    /// Optional. HCFS URIs of archives to be extracted into the working directory
9044    /// of each executor. Supported file types:
9045    /// .jar, .tar, .tar.gz, .tgz, and .zip.
9046    pub archive_uris: std::vec::Vec<std::string::String>,
9047
9048    /// Optional. A mapping of property names to values, used to configure SparkR.
9049    /// Properties that conflict with values set by the Dataproc API might be
9050    /// overwritten. Can include properties set in
9051    /// /etc/spark/conf/spark-defaults.conf and classes in user code.
9052    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
9053
9054    /// Optional. The runtime log config for job execution.
9055    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    /// Sets the value of [main_r_file_uri][crate::model::SparkRJob::main_r_file_uri].
9066    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    /// Sets the value of [args][crate::model::SparkRJob::args].
9072    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    /// Sets the value of [file_uris][crate::model::SparkRJob::file_uris].
9083    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    /// Sets the value of [archive_uris][crate::model::SparkRJob::archive_uris].
9094    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    /// Sets the value of [properties][crate::model::SparkRJob::properties].
9105    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    /// Sets the value of [logging_config][crate::model::SparkRJob::logging_config].
9117    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    /// Sets or clears the value of [logging_config][crate::model::SparkRJob::logging_config].
9126    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/// A Dataproc job for running [Presto](https://prestosql.io/) queries.
9142/// **IMPORTANT**: The [Dataproc Presto Optional
9143/// Component](https://cloud.google.com/dataproc/docs/concepts/components/presto)
9144/// must be enabled when the cluster is created to submit a Presto job to the
9145/// cluster.
9146#[derive(Clone, Default, PartialEq)]
9147#[non_exhaustive]
9148pub struct PrestoJob {
9149    /// Optional. Whether to continue executing queries if a query fails.
9150    /// The default value is `false`. Setting to `true` can be useful when
9151    /// executing independent parallel queries.
9152    pub continue_on_failure: bool,
9153
9154    /// Optional. The format in which query output will be displayed. See the
9155    /// Presto documentation for supported output formats
9156    pub output_format: std::string::String,
9157
9158    /// Optional. Presto client tags to attach to this query
9159    pub client_tags: std::vec::Vec<std::string::String>,
9160
9161    /// Optional. A mapping of property names to values. Used to set Presto
9162    /// [session properties](https://prestodb.io/docs/current/sql/set-session.html)
9163    /// Equivalent to using the --session flag in the Presto CLI
9164    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
9165
9166    /// Optional. The runtime log config for job execution.
9167    pub logging_config: std::option::Option<crate::model::LoggingConfig>,
9168
9169    /// Required. The sequence of Presto queries to execute, specified as
9170    /// either an HCFS file URI or as a list of queries.
9171    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    /// Sets the value of [continue_on_failure][crate::model::PrestoJob::continue_on_failure].
9182    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    /// Sets the value of [output_format][crate::model::PrestoJob::output_format].
9188    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    /// Sets the value of [client_tags][crate::model::PrestoJob::client_tags].
9194    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    /// Sets the value of [properties][crate::model::PrestoJob::properties].
9205    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    /// Sets the value of [logging_config][crate::model::PrestoJob::logging_config].
9217    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    /// Sets or clears the value of [logging_config][crate::model::PrestoJob::logging_config].
9226    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    /// Sets the value of [queries][crate::model::PrestoJob::queries].
9235    ///
9236    /// Note that all the setters affecting `queries` are mutually
9237    /// exclusive.
9238    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    /// The value of [queries][crate::model::PrestoJob::queries]
9249    /// if it holds a `QueryFileUri`, `None` if the field is not set or
9250    /// holds a different branch.
9251    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    /// Sets the value of [queries][crate::model::PrestoJob::queries]
9260    /// to hold a `QueryFileUri`.
9261    ///
9262    /// Note that all the setters affecting `queries` are
9263    /// mutually exclusive.
9264    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    /// The value of [queries][crate::model::PrestoJob::queries]
9271    /// if it holds a `QueryList`, `None` if the field is not set or
9272    /// holds a different branch.
9273    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    /// Sets the value of [queries][crate::model::PrestoJob::queries]
9282    /// to hold a `QueryList`.
9283    ///
9284    /// Note that all the setters affecting `queries` are
9285    /// mutually exclusive.
9286    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
9302/// Defines additional types related to [PrestoJob].
9303pub mod presto_job {
9304    #[allow(unused_imports)]
9305    use super::*;
9306
9307    /// Required. The sequence of Presto queries to execute, specified as
9308    /// either an HCFS file URI or as a list of queries.
9309    #[derive(Clone, Debug, PartialEq)]
9310    #[non_exhaustive]
9311    pub enum Queries {
9312        /// The HCFS URI of the script that contains SQL queries.
9313        QueryFileUri(std::string::String),
9314        /// A list of queries.
9315        QueryList(std::boxed::Box<crate::model::QueryList>),
9316    }
9317}
9318
9319/// A Dataproc job for running [Trino](https://trino.io/) queries.
9320/// **IMPORTANT**: The [Dataproc Trino Optional
9321/// Component](https://cloud.google.com/dataproc/docs/concepts/components/trino)
9322/// must be enabled when the cluster is created to submit a Trino job to the
9323/// cluster.
9324#[derive(Clone, Default, PartialEq)]
9325#[non_exhaustive]
9326pub struct TrinoJob {
9327    /// Optional. Whether to continue executing queries if a query fails.
9328    /// The default value is `false`. Setting to `true` can be useful when
9329    /// executing independent parallel queries.
9330    pub continue_on_failure: bool,
9331
9332    /// Optional. The format in which query output will be displayed. See the
9333    /// Trino documentation for supported output formats
9334    pub output_format: std::string::String,
9335
9336    /// Optional. Trino client tags to attach to this query
9337    pub client_tags: std::vec::Vec<std::string::String>,
9338
9339    /// Optional. A mapping of property names to values. Used to set Trino
9340    /// [session properties](https://trino.io/docs/current/sql/set-session.html)
9341    /// Equivalent to using the --session flag in the Trino CLI
9342    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
9343
9344    /// Optional. The runtime log config for job execution.
9345    pub logging_config: std::option::Option<crate::model::LoggingConfig>,
9346
9347    /// Required. The sequence of Trino queries to execute, specified as
9348    /// either an HCFS file URI or as a list of queries.
9349    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    /// Sets the value of [continue_on_failure][crate::model::TrinoJob::continue_on_failure].
9360    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    /// Sets the value of [output_format][crate::model::TrinoJob::output_format].
9366    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    /// Sets the value of [client_tags][crate::model::TrinoJob::client_tags].
9372    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    /// Sets the value of [properties][crate::model::TrinoJob::properties].
9383    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    /// Sets the value of [logging_config][crate::model::TrinoJob::logging_config].
9395    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    /// Sets or clears the value of [logging_config][crate::model::TrinoJob::logging_config].
9404    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    /// Sets the value of [queries][crate::model::TrinoJob::queries].
9413    ///
9414    /// Note that all the setters affecting `queries` are mutually
9415    /// exclusive.
9416    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    /// The value of [queries][crate::model::TrinoJob::queries]
9427    /// if it holds a `QueryFileUri`, `None` if the field is not set or
9428    /// holds a different branch.
9429    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    /// Sets the value of [queries][crate::model::TrinoJob::queries]
9438    /// to hold a `QueryFileUri`.
9439    ///
9440    /// Note that all the setters affecting `queries` are
9441    /// mutually exclusive.
9442    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    /// The value of [queries][crate::model::TrinoJob::queries]
9449    /// if it holds a `QueryList`, `None` if the field is not set or
9450    /// holds a different branch.
9451    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    /// Sets the value of [queries][crate::model::TrinoJob::queries]
9460    /// to hold a `QueryList`.
9461    ///
9462    /// Note that all the setters affecting `queries` are
9463    /// mutually exclusive.
9464    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
9480/// Defines additional types related to [TrinoJob].
9481pub mod trino_job {
9482    #[allow(unused_imports)]
9483    use super::*;
9484
9485    /// Required. The sequence of Trino queries to execute, specified as
9486    /// either an HCFS file URI or as a list of queries.
9487    #[derive(Clone, Debug, PartialEq)]
9488    #[non_exhaustive]
9489    pub enum Queries {
9490        /// The HCFS URI of the script that contains SQL queries.
9491        QueryFileUri(std::string::String),
9492        /// A list of queries.
9493        QueryList(std::boxed::Box<crate::model::QueryList>),
9494    }
9495}
9496
9497/// A Dataproc job for running Apache Flink applications on YARN.
9498#[derive(Clone, Default, PartialEq)]
9499#[non_exhaustive]
9500pub struct FlinkJob {
9501    /// Optional. The arguments to pass to the driver. Do not include arguments,
9502    /// such as `--conf`, that can be set as job properties, since a collision
9503    /// might occur that causes an incorrect job submission.
9504    pub args: std::vec::Vec<std::string::String>,
9505
9506    /// Optional. HCFS URIs of jar files to add to the CLASSPATHs of the
9507    /// Flink driver and tasks.
9508    pub jar_file_uris: std::vec::Vec<std::string::String>,
9509
9510    /// Optional. HCFS URI of the savepoint, which contains the last saved progress
9511    /// for starting the current job.
9512    pub savepoint_uri: std::string::String,
9513
9514    /// Optional. A mapping of property names to values, used to configure Flink.
9515    /// Properties that conflict with values set by the Dataproc API might be
9516    /// overwritten. Can include properties set in
9517    /// `/etc/flink/conf/flink-defaults.conf` and classes in user code.
9518    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
9519
9520    /// Optional. The runtime log config for job execution.
9521    pub logging_config: std::option::Option<crate::model::LoggingConfig>,
9522
9523    /// Required. The specification of the main method to call to drive the job.
9524    /// Specify either the jar file that contains the main class or the main class
9525    /// name. To pass both a main jar and a main class in the jar, add the jar to
9526    /// [jarFileUris][google.cloud.dataproc.v1.FlinkJob.jar_file_uris], and then
9527    /// specify the main class name in
9528    /// [mainClass][google.cloud.dataproc.v1.FlinkJob.main_class].
9529    ///
9530    /// [google.cloud.dataproc.v1.FlinkJob.jar_file_uris]: crate::model::FlinkJob::jar_file_uris
9531    /// [google.cloud.dataproc.v1.FlinkJob.main_class]: crate::model::FlinkJob::driver
9532    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    /// Sets the value of [args][crate::model::FlinkJob::args].
9543    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    /// Sets the value of [jar_file_uris][crate::model::FlinkJob::jar_file_uris].
9554    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    /// Sets the value of [savepoint_uri][crate::model::FlinkJob::savepoint_uri].
9565    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    /// Sets the value of [properties][crate::model::FlinkJob::properties].
9571    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    /// Sets the value of [logging_config][crate::model::FlinkJob::logging_config].
9583    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    /// Sets or clears the value of [logging_config][crate::model::FlinkJob::logging_config].
9592    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    /// Sets the value of [driver][crate::model::FlinkJob::driver].
9601    ///
9602    /// Note that all the setters affecting `driver` are mutually
9603    /// exclusive.
9604    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    /// The value of [driver][crate::model::FlinkJob::driver]
9615    /// if it holds a `MainJarFileUri`, `None` if the field is not set or
9616    /// holds a different branch.
9617    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    /// Sets the value of [driver][crate::model::FlinkJob::driver]
9626    /// to hold a `MainJarFileUri`.
9627    ///
9628    /// Note that all the setters affecting `driver` are
9629    /// mutually exclusive.
9630    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    /// The value of [driver][crate::model::FlinkJob::driver]
9640    /// if it holds a `MainClass`, `None` if the field is not set or
9641    /// holds a different branch.
9642    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    /// Sets the value of [driver][crate::model::FlinkJob::driver]
9651    /// to hold a `MainClass`.
9652    ///
9653    /// Note that all the setters affecting `driver` are
9654    /// mutually exclusive.
9655    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
9668/// Defines additional types related to [FlinkJob].
9669pub mod flink_job {
9670    #[allow(unused_imports)]
9671    use super::*;
9672
9673    /// Required. The specification of the main method to call to drive the job.
9674    /// Specify either the jar file that contains the main class or the main class
9675    /// name. To pass both a main jar and a main class in the jar, add the jar to
9676    /// [jarFileUris][google.cloud.dataproc.v1.FlinkJob.jar_file_uris], and then
9677    /// specify the main class name in
9678    /// [mainClass][google.cloud.dataproc.v1.FlinkJob.main_class].
9679    ///
9680    /// [google.cloud.dataproc.v1.FlinkJob.jar_file_uris]: crate::model::FlinkJob::jar_file_uris
9681    /// [google.cloud.dataproc.v1.FlinkJob.main_class]: crate::model::FlinkJob::driver
9682    #[derive(Clone, Debug, PartialEq)]
9683    #[non_exhaustive]
9684    pub enum Driver {
9685        /// The HCFS URI of the jar file that contains the main class.
9686        MainJarFileUri(std::string::String),
9687        /// The name of the driver's main class. The jar file that contains the class
9688        /// must be in the default CLASSPATH or specified in
9689        /// [jarFileUris][google.cloud.dataproc.v1.FlinkJob.jar_file_uris].
9690        ///
9691        /// [google.cloud.dataproc.v1.FlinkJob.jar_file_uris]: crate::model::FlinkJob::jar_file_uris
9692        MainClass(std::string::String),
9693    }
9694}
9695
9696/// Dataproc job config.
9697#[derive(Clone, Default, PartialEq)]
9698#[non_exhaustive]
9699pub struct JobPlacement {
9700    /// Required. The name of the cluster where the job will be submitted.
9701    pub cluster_name: std::string::String,
9702
9703    /// Output only. A cluster UUID generated by the Dataproc service when
9704    /// the job is submitted.
9705    pub cluster_uuid: std::string::String,
9706
9707    /// Optional. Cluster labels to identify a cluster where the job will be
9708    /// submitted.
9709    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    /// Sets the value of [cluster_name][crate::model::JobPlacement::cluster_name].
9720    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    /// Sets the value of [cluster_uuid][crate::model::JobPlacement::cluster_uuid].
9726    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    /// Sets the value of [cluster_labels][crate::model::JobPlacement::cluster_labels].
9732    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/// Dataproc job status.
9751#[derive(Clone, Default, PartialEq)]
9752#[non_exhaustive]
9753pub struct JobStatus {
9754    /// Output only. A state message specifying the overall job state.
9755    pub state: crate::model::job_status::State,
9756
9757    /// Optional. Output only. Job state details, such as an error
9758    /// description if the state is `ERROR`.
9759    pub details: std::string::String,
9760
9761    /// Output only. The time when this state was entered.
9762    pub state_start_time: std::option::Option<wkt::Timestamp>,
9763
9764    /// Output only. Additional state information, which includes
9765    /// status reported by the agent.
9766    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    /// Sets the value of [state][crate::model::JobStatus::state].
9777    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    /// Sets the value of [details][crate::model::JobStatus::details].
9786    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    /// Sets the value of [state_start_time][crate::model::JobStatus::state_start_time].
9792    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    /// Sets or clears the value of [state_start_time][crate::model::JobStatus::state_start_time].
9801    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    /// Sets the value of [substate][crate::model::JobStatus::substate].
9810    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
9825/// Defines additional types related to [JobStatus].
9826pub mod job_status {
9827    #[allow(unused_imports)]
9828    use super::*;
9829
9830    /// The job state.
9831    ///
9832    /// # Working with unknown values
9833    ///
9834    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9835    /// additional enum variants at any time. Adding new variants is not considered
9836    /// a breaking change. Applications should write their code in anticipation of:
9837    ///
9838    /// - New values appearing in future releases of the client library, **and**
9839    /// - New values received dynamically, without application changes.
9840    ///
9841    /// Please consult the [Working with enums] section in the user guide for some
9842    /// guidelines.
9843    ///
9844    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9845    #[derive(Clone, Debug, PartialEq)]
9846    #[non_exhaustive]
9847    pub enum State {
9848        /// The job state is unknown.
9849        Unspecified,
9850        /// The job is pending; it has been submitted, but is not yet running.
9851        Pending,
9852        /// Job has been received by the service and completed initial setup;
9853        /// it will soon be submitted to the cluster.
9854        SetupDone,
9855        /// The job is running on the cluster.
9856        Running,
9857        /// A CancelJob request has been received, but is pending.
9858        CancelPending,
9859        /// Transient in-flight resources have been canceled, and the request to
9860        /// cancel the running job has been issued to the cluster.
9861        CancelStarted,
9862        /// The job cancellation was successful.
9863        Cancelled,
9864        /// The job has completed successfully.
9865        Done,
9866        /// The job has completed, but encountered an error.
9867        Error,
9868        /// Job attempt has failed. The detail field contains failure details for
9869        /// this attempt.
9870        ///
9871        /// Applies to restartable jobs only.
9872        AttemptFailure,
9873        /// If set, the enum was initialized with an unknown value.
9874        ///
9875        /// Applications can examine the value using [State::value] or
9876        /// [State::name].
9877        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        /// Gets the enum value.
9890        ///
9891        /// Returns `None` if the enum contains an unknown value deserialized from
9892        /// the string representation of enums.
9893        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        /// Gets the enum value as a string.
9910        ///
9911        /// Returns `None` if the enum contains an unknown value deserialized from
9912        /// the integer representation of enums.
9913        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    /// The job substate.
10017    ///
10018    /// # Working with unknown values
10019    ///
10020    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10021    /// additional enum variants at any time. Adding new variants is not considered
10022    /// a breaking change. Applications should write their code in anticipation of:
10023    ///
10024    /// - New values appearing in future releases of the client library, **and**
10025    /// - New values received dynamically, without application changes.
10026    ///
10027    /// Please consult the [Working with enums] section in the user guide for some
10028    /// guidelines.
10029    ///
10030    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10031    #[derive(Clone, Debug, PartialEq)]
10032    #[non_exhaustive]
10033    pub enum Substate {
10034        /// The job substate is unknown.
10035        Unspecified,
10036        /// The Job is submitted to the agent.
10037        ///
10038        /// Applies to RUNNING state.
10039        Submitted,
10040        /// The Job has been received and is awaiting execution (it might be waiting
10041        /// for a condition to be met). See the "details" field for the reason for
10042        /// the delay.
10043        ///
10044        /// Applies to RUNNING state.
10045        Queued,
10046        /// The agent-reported status is out of date, which can be caused by a
10047        /// loss of communication between the agent and Dataproc. If the
10048        /// agent does not send a timely update, the job will fail.
10049        ///
10050        /// Applies to RUNNING state.
10051        StaleStatus,
10052        /// If set, the enum was initialized with an unknown value.
10053        ///
10054        /// Applications can examine the value using [Substate::value] or
10055        /// [Substate::name].
10056        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        /// Gets the enum value.
10069        ///
10070        /// Returns `None` if the enum contains an unknown value deserialized from
10071        /// the string representation of enums.
10072        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        /// Gets the enum value as a string.
10083        ///
10084        /// Returns `None` if the enum contains an unknown value deserialized from
10085        /// the integer representation of enums.
10086        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/// Encapsulates the full scoping used to reference a job.
10167#[derive(Clone, Default, PartialEq)]
10168#[non_exhaustive]
10169pub struct JobReference {
10170    /// Optional. The ID of the Google Cloud Platform project that the job belongs
10171    /// to. If specified, must match the request project ID.
10172    pub project_id: std::string::String,
10173
10174    /// Optional. The job ID, which must be unique within the project.
10175    ///
10176    /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
10177    /// underscores (_), or hyphens (-). The maximum length is 100 characters.
10178    ///
10179    /// If not specified by the caller, the job ID will be provided by the server.
10180    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    /// Sets the value of [project_id][crate::model::JobReference::project_id].
10191    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    /// Sets the value of [job_id][crate::model::JobReference::job_id].
10197    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/// A YARN application created by a job. Application information is a subset of
10210/// \<code\>org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto\</code\>.
10211///
10212/// **Beta Feature**: This report is available for testing purposes only. It may
10213/// be changed before final release.
10214#[derive(Clone, Default, PartialEq)]
10215#[non_exhaustive]
10216pub struct YarnApplication {
10217    /// Required. The application name.
10218    pub name: std::string::String,
10219
10220    /// Required. The application state.
10221    pub state: crate::model::yarn_application::State,
10222
10223    /// Required. The numerical progress of the application, from 1 to 100.
10224    pub progress: f32,
10225
10226    /// Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or
10227    /// TimelineServer that provides application-specific information. The URL uses
10228    /// the internal hostname, and requires a proxy server for resolution and,
10229    /// possibly, access.
10230    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    /// Sets the value of [name][crate::model::YarnApplication::name].
10241    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    /// Sets the value of [state][crate::model::YarnApplication::state].
10247    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    /// Sets the value of [progress][crate::model::YarnApplication::progress].
10256    pub fn set_progress<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
10257        self.progress = v.into();
10258        self
10259    }
10260
10261    /// Sets the value of [tracking_url][crate::model::YarnApplication::tracking_url].
10262    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
10274/// Defines additional types related to [YarnApplication].
10275pub mod yarn_application {
10276    #[allow(unused_imports)]
10277    use super::*;
10278
10279    /// The application state, corresponding to
10280    /// \<code\>YarnProtos.YarnApplicationStateProto\</code\>.
10281    ///
10282    /// # Working with unknown values
10283    ///
10284    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10285    /// additional enum variants at any time. Adding new variants is not considered
10286    /// a breaking change. Applications should write their code in anticipation of:
10287    ///
10288    /// - New values appearing in future releases of the client library, **and**
10289    /// - New values received dynamically, without application changes.
10290    ///
10291    /// Please consult the [Working with enums] section in the user guide for some
10292    /// guidelines.
10293    ///
10294    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10295    #[derive(Clone, Debug, PartialEq)]
10296    #[non_exhaustive]
10297    pub enum State {
10298        /// Status is unspecified.
10299        Unspecified,
10300        /// Status is NEW.
10301        New,
10302        /// Status is NEW_SAVING.
10303        NewSaving,
10304        /// Status is SUBMITTED.
10305        Submitted,
10306        /// Status is ACCEPTED.
10307        Accepted,
10308        /// Status is RUNNING.
10309        Running,
10310        /// Status is FINISHED.
10311        Finished,
10312        /// Status is FAILED.
10313        Failed,
10314        /// Status is KILLED.
10315        Killed,
10316        /// If set, the enum was initialized with an unknown value.
10317        ///
10318        /// Applications can examine the value using [State::value] or
10319        /// [State::name].
10320        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        /// Gets the enum value.
10333        ///
10334        /// Returns `None` if the enum contains an unknown value deserialized from
10335        /// the string representation of enums.
10336        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        /// Gets the enum value as a string.
10352        ///
10353        /// Returns `None` if the enum contains an unknown value deserialized from
10354        /// the integer representation of enums.
10355        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/// A Dataproc job resource.
10456#[derive(Clone, Default, PartialEq)]
10457#[non_exhaustive]
10458pub struct Job {
10459    /// Optional. The fully qualified reference to the job, which can be used to
10460    /// obtain the equivalent REST path of the job resource. If this property
10461    /// is not specified when a job is created, the server generates a
10462    /// \<code\>job_id\</code\>.
10463    pub reference: std::option::Option<crate::model::JobReference>,
10464
10465    /// Required. Job information, including how, when, and where to
10466    /// run the job.
10467    pub placement: std::option::Option<crate::model::JobPlacement>,
10468
10469    /// Output only. The job status. Additional application-specific
10470    /// status information might be contained in the \<code\>type_job\</code\>
10471    /// and \<code\>yarn_applications\</code\> fields.
10472    pub status: std::option::Option<crate::model::JobStatus>,
10473
10474    /// Output only. The previous job status.
10475    pub status_history: std::vec::Vec<crate::model::JobStatus>,
10476
10477    /// Output only. The collection of YARN applications spun up by this job.
10478    ///
10479    /// **Beta** Feature: This report is available for testing purposes only. It
10480    /// might be changed before final release.
10481    pub yarn_applications: std::vec::Vec<crate::model::YarnApplication>,
10482
10483    /// Output only. A URI pointing to the location of the stdout of the job's
10484    /// driver program.
10485    pub driver_output_resource_uri: std::string::String,
10486
10487    /// Output only. If present, the location of miscellaneous control files
10488    /// which can be used as part of job setup and handling. If not present,
10489    /// control files might be placed in the same location as `driver_output_uri`.
10490    pub driver_control_files_uri: std::string::String,
10491
10492    /// Optional. The labels to associate with this job.
10493    /// Label **keys** must contain 1 to 63 characters, and must conform to
10494    /// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
10495    /// Label **values** can be empty, but, if present, must contain 1 to 63
10496    /// characters, and must conform to [RFC
10497    /// 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
10498    /// associated with a job.
10499    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10500
10501    /// Optional. Job scheduling configuration.
10502    pub scheduling: std::option::Option<crate::model::JobScheduling>,
10503
10504    /// Output only. A UUID that uniquely identifies a job within the project
10505    /// over time. This is in contrast to a user-settable reference.job_id that
10506    /// might be reused over time.
10507    pub job_uuid: std::string::String,
10508
10509    /// Output only. Indicates whether the job is completed. If the value is
10510    /// `false`, the job is still in progress. If `true`, the job is completed, and
10511    /// `status.state` field will indicate if it was successful, failed,
10512    /// or cancelled.
10513    pub done: bool,
10514
10515    /// Optional. Driver scheduling configuration.
10516    pub driver_scheduling_config: std::option::Option<crate::model::DriverSchedulingConfig>,
10517
10518    /// Required. The application/framework-specific portion of the job.
10519    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    /// Sets the value of [reference][crate::model::Job::reference].
10530    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    /// Sets or clears the value of [reference][crate::model::Job::reference].
10539    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    /// Sets the value of [placement][crate::model::Job::placement].
10548    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    /// Sets or clears the value of [placement][crate::model::Job::placement].
10557    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    /// Sets the value of [status][crate::model::Job::status].
10566    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    /// Sets or clears the value of [status][crate::model::Job::status].
10575    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    /// Sets the value of [status_history][crate::model::Job::status_history].
10584    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    /// Sets the value of [yarn_applications][crate::model::Job::yarn_applications].
10595    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    /// Sets the value of [driver_output_resource_uri][crate::model::Job::driver_output_resource_uri].
10606    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    /// Sets the value of [driver_control_files_uri][crate::model::Job::driver_control_files_uri].
10615    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    /// Sets the value of [labels][crate::model::Job::labels].
10624    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    /// Sets the value of [scheduling][crate::model::Job::scheduling].
10636    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    /// Sets or clears the value of [scheduling][crate::model::Job::scheduling].
10645    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    /// Sets the value of [job_uuid][crate::model::Job::job_uuid].
10654    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    /// Sets the value of [done][crate::model::Job::done].
10660    pub fn set_done<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10661        self.done = v.into();
10662        self
10663    }
10664
10665    /// Sets the value of [driver_scheduling_config][crate::model::Job::driver_scheduling_config].
10666    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    /// Sets or clears the value of [driver_scheduling_config][crate::model::Job::driver_scheduling_config].
10675    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    /// Sets the value of [type_job][crate::model::Job::type_job].
10684    ///
10685    /// Note that all the setters affecting `type_job` are mutually
10686    /// exclusive.
10687    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    /// The value of [type_job][crate::model::Job::type_job]
10696    /// if it holds a `HadoopJob`, `None` if the field is not set or
10697    /// holds a different branch.
10698    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    /// Sets the value of [type_job][crate::model::Job::type_job]
10707    /// to hold a `HadoopJob`.
10708    ///
10709    /// Note that all the setters affecting `type_job` are
10710    /// mutually exclusive.
10711    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    /// The value of [type_job][crate::model::Job::type_job]
10720    /// if it holds a `SparkJob`, `None` if the field is not set or
10721    /// holds a different branch.
10722    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    /// Sets the value of [type_job][crate::model::Job::type_job]
10731    /// to hold a `SparkJob`.
10732    ///
10733    /// Note that all the setters affecting `type_job` are
10734    /// mutually exclusive.
10735    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    /// The value of [type_job][crate::model::Job::type_job]
10744    /// if it holds a `PysparkJob`, `None` if the field is not set or
10745    /// holds a different branch.
10746    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    /// Sets the value of [type_job][crate::model::Job::type_job]
10755    /// to hold a `PysparkJob`.
10756    ///
10757    /// Note that all the setters affecting `type_job` are
10758    /// mutually exclusive.
10759    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    /// The value of [type_job][crate::model::Job::type_job]
10768    /// if it holds a `HiveJob`, `None` if the field is not set or
10769    /// holds a different branch.
10770    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    /// Sets the value of [type_job][crate::model::Job::type_job]
10779    /// to hold a `HiveJob`.
10780    ///
10781    /// Note that all the setters affecting `type_job` are
10782    /// mutually exclusive.
10783    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    /// The value of [type_job][crate::model::Job::type_job]
10792    /// if it holds a `PigJob`, `None` if the field is not set or
10793    /// holds a different branch.
10794    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    /// Sets the value of [type_job][crate::model::Job::type_job]
10803    /// to hold a `PigJob`.
10804    ///
10805    /// Note that all the setters affecting `type_job` are
10806    /// mutually exclusive.
10807    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    /// The value of [type_job][crate::model::Job::type_job]
10816    /// if it holds a `SparkRJob`, `None` if the field is not set or
10817    /// holds a different branch.
10818    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    /// Sets the value of [type_job][crate::model::Job::type_job]
10827    /// to hold a `SparkRJob`.
10828    ///
10829    /// Note that all the setters affecting `type_job` are
10830    /// mutually exclusive.
10831    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    /// The value of [type_job][crate::model::Job::type_job]
10840    /// if it holds a `SparkSqlJob`, `None` if the field is not set or
10841    /// holds a different branch.
10842    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    /// Sets the value of [type_job][crate::model::Job::type_job]
10853    /// to hold a `SparkSqlJob`.
10854    ///
10855    /// Note that all the setters affecting `type_job` are
10856    /// mutually exclusive.
10857    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    /// The value of [type_job][crate::model::Job::type_job]
10867    /// if it holds a `PrestoJob`, `None` if the field is not set or
10868    /// holds a different branch.
10869    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    /// Sets the value of [type_job][crate::model::Job::type_job]
10878    /// to hold a `PrestoJob`.
10879    ///
10880    /// Note that all the setters affecting `type_job` are
10881    /// mutually exclusive.
10882    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    /// The value of [type_job][crate::model::Job::type_job]
10891    /// if it holds a `TrinoJob`, `None` if the field is not set or
10892    /// holds a different branch.
10893    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    /// Sets the value of [type_job][crate::model::Job::type_job]
10902    /// to hold a `TrinoJob`.
10903    ///
10904    /// Note that all the setters affecting `type_job` are
10905    /// mutually exclusive.
10906    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    /// The value of [type_job][crate::model::Job::type_job]
10915    /// if it holds a `FlinkJob`, `None` if the field is not set or
10916    /// holds a different branch.
10917    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    /// Sets the value of [type_job][crate::model::Job::type_job]
10926    /// to hold a `FlinkJob`.
10927    ///
10928    /// Note that all the setters affecting `type_job` are
10929    /// mutually exclusive.
10930    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
10945/// Defines additional types related to [Job].
10946pub mod job {
10947    #[allow(unused_imports)]
10948    use super::*;
10949
10950    /// Required. The application/framework-specific portion of the job.
10951    #[derive(Clone, Debug, PartialEq)]
10952    #[non_exhaustive]
10953    pub enum TypeJob {
10954        /// Optional. Job is a Hadoop job.
10955        HadoopJob(std::boxed::Box<crate::model::HadoopJob>),
10956        /// Optional. Job is a Spark job.
10957        SparkJob(std::boxed::Box<crate::model::SparkJob>),
10958        /// Optional. Job is a PySpark job.
10959        PysparkJob(std::boxed::Box<crate::model::PySparkJob>),
10960        /// Optional. Job is a Hive job.
10961        HiveJob(std::boxed::Box<crate::model::HiveJob>),
10962        /// Optional. Job is a Pig job.
10963        PigJob(std::boxed::Box<crate::model::PigJob>),
10964        /// Optional. Job is a SparkR job.
10965        SparkRJob(std::boxed::Box<crate::model::SparkRJob>),
10966        /// Optional. Job is a SparkSql job.
10967        SparkSqlJob(std::boxed::Box<crate::model::SparkSqlJob>),
10968        /// Optional. Job is a Presto job.
10969        PrestoJob(std::boxed::Box<crate::model::PrestoJob>),
10970        /// Optional. Job is a Trino job.
10971        TrinoJob(std::boxed::Box<crate::model::TrinoJob>),
10972        /// Optional. Job is a Flink job.
10973        FlinkJob(std::boxed::Box<crate::model::FlinkJob>),
10974    }
10975}
10976
10977/// Driver scheduling configuration.
10978#[derive(Clone, Default, PartialEq)]
10979#[non_exhaustive]
10980pub struct DriverSchedulingConfig {
10981    /// Required. The amount of memory in MB the driver is requesting.
10982    pub memory_mb: i32,
10983
10984    /// Required. The number of vCPUs the driver is requesting.
10985    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    /// Sets the value of [memory_mb][crate::model::DriverSchedulingConfig::memory_mb].
10996    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    /// Sets the value of [vcores][crate::model::DriverSchedulingConfig::vcores].
11002    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/// Job scheduling options.
11015#[derive(Clone, Default, PartialEq)]
11016#[non_exhaustive]
11017pub struct JobScheduling {
11018    /// Optional. Maximum number of times per hour a driver can be restarted as
11019    /// a result of driver exiting with non-zero code before job is
11020    /// reported failed.
11021    ///
11022    /// A job might be reported as thrashing if the driver exits with a non-zero
11023    /// code four times within a 10-minute window.
11024    ///
11025    /// Maximum value is 10.
11026    ///
11027    /// **Note:** This restartable job option is not supported in Dataproc
11028    /// [workflow templates]
11029    /// (<https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template>).
11030    pub max_failures_per_hour: i32,
11031
11032    /// Optional. Maximum total number of times a driver can be restarted as a
11033    /// result of the driver exiting with a non-zero code. After the maximum number
11034    /// is reached, the job will be reported as failed.
11035    ///
11036    /// Maximum value is 240.
11037    ///
11038    /// **Note:** Currently, this restartable job option is
11039    /// not supported in Dataproc
11040    /// [workflow
11041    /// templates](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template).
11042    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    /// Sets the value of [max_failures_per_hour][crate::model::JobScheduling::max_failures_per_hour].
11053    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    /// Sets the value of [max_failures_total][crate::model::JobScheduling::max_failures_total].
11059    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/// A request to submit a job.
11072#[derive(Clone, Default, PartialEq)]
11073#[non_exhaustive]
11074pub struct SubmitJobRequest {
11075    /// Required. The ID of the Google Cloud Platform project that the job
11076    /// belongs to.
11077    pub project_id: std::string::String,
11078
11079    /// Required. The Dataproc region in which to handle the request.
11080    pub region: std::string::String,
11081
11082    /// Required. The job resource.
11083    pub job: std::option::Option<crate::model::Job>,
11084
11085    /// Optional. A unique id used to identify the request. If the server
11086    /// receives two
11087    /// [SubmitJobRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s
11088    /// with the same id, then the second request will be ignored and the
11089    /// first [Job][google.cloud.dataproc.v1.Job] created and stored in the backend
11090    /// is returned.
11091    ///
11092    /// It is recommended to always set this value to a
11093    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
11094    ///
11095    /// The id must contain only letters (a-z, A-Z), numbers (0-9),
11096    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
11097    ///
11098    /// [google.cloud.dataproc.v1.Job]: crate::model::Job
11099    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    /// Sets the value of [project_id][crate::model::SubmitJobRequest::project_id].
11110    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    /// Sets the value of [region][crate::model::SubmitJobRequest::region].
11116    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    /// Sets the value of [job][crate::model::SubmitJobRequest::job].
11122    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    /// Sets or clears the value of [job][crate::model::SubmitJobRequest::job].
11131    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    /// Sets the value of [request_id][crate::model::SubmitJobRequest::request_id].
11140    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/// Job Operation metadata.
11153#[derive(Clone, Default, PartialEq)]
11154#[non_exhaustive]
11155pub struct JobMetadata {
11156    /// Output only. The job id.
11157    pub job_id: std::string::String,
11158
11159    /// Output only. Most recent job status.
11160    pub status: std::option::Option<crate::model::JobStatus>,
11161
11162    /// Output only. Operation type.
11163    pub operation_type: std::string::String,
11164
11165    /// Output only. Job submission time.
11166    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    /// Sets the value of [job_id][crate::model::JobMetadata::job_id].
11177    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    /// Sets the value of [status][crate::model::JobMetadata::status].
11183    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    /// Sets or clears the value of [status][crate::model::JobMetadata::status].
11192    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    /// Sets the value of [operation_type][crate::model::JobMetadata::operation_type].
11201    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    /// Sets the value of [start_time][crate::model::JobMetadata::start_time].
11207    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    /// Sets or clears the value of [start_time][crate::model::JobMetadata::start_time].
11216    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/// A request to get the resource representation for a job in a project.
11232#[derive(Clone, Default, PartialEq)]
11233#[non_exhaustive]
11234pub struct GetJobRequest {
11235    /// Required. The ID of the Google Cloud Platform project that the job
11236    /// belongs to.
11237    pub project_id: std::string::String,
11238
11239    /// Required. The Dataproc region in which to handle the request.
11240    pub region: std::string::String,
11241
11242    /// Required. The job ID.
11243    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    /// Sets the value of [project_id][crate::model::GetJobRequest::project_id].
11254    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    /// Sets the value of [region][crate::model::GetJobRequest::region].
11260    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    /// Sets the value of [job_id][crate::model::GetJobRequest::job_id].
11266    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/// A request to list jobs in a project.
11279#[derive(Clone, Default, PartialEq)]
11280#[non_exhaustive]
11281pub struct ListJobsRequest {
11282    /// Required. The ID of the Google Cloud Platform project that the job
11283    /// belongs to.
11284    pub project_id: std::string::String,
11285
11286    /// Required. The Dataproc region in which to handle the request.
11287    pub region: std::string::String,
11288
11289    /// Optional. The number of results to return in each response.
11290    pub page_size: i32,
11291
11292    /// Optional. The page token, returned by a previous call, to request the
11293    /// next page of results.
11294    pub page_token: std::string::String,
11295
11296    /// Optional. If set, the returned jobs list includes only jobs that were
11297    /// submitted to the named cluster.
11298    pub cluster_name: std::string::String,
11299
11300    /// Optional. Specifies enumerated categories of jobs to list.
11301    /// (default = match ALL jobs).
11302    ///
11303    /// If `filter` is provided, `jobStateMatcher` will be ignored.
11304    pub job_state_matcher: crate::model::list_jobs_request::JobStateMatcher,
11305
11306    /// Optional. A filter constraining the jobs to list. Filters are
11307    /// case-sensitive and have the following syntax:
11308    ///
11309    /// [field = value] AND [field [= value]] ...
11310    ///
11311    /// where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label
11312    /// key. **value** can be `*` to match all values.
11313    /// `status.state` can be either `ACTIVE` or `NON_ACTIVE`.
11314    /// Only the logical `AND` operator is supported; space-separated items are
11315    /// treated as having an implicit `AND` operator.
11316    ///
11317    /// Example filter:
11318    ///
11319    /// status.state = ACTIVE AND labels.env = staging AND labels.starred = *
11320    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    /// Sets the value of [project_id][crate::model::ListJobsRequest::project_id].
11331    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    /// Sets the value of [region][crate::model::ListJobsRequest::region].
11337    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    /// Sets the value of [page_size][crate::model::ListJobsRequest::page_size].
11343    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    /// Sets the value of [page_token][crate::model::ListJobsRequest::page_token].
11349    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    /// Sets the value of [cluster_name][crate::model::ListJobsRequest::cluster_name].
11355    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    /// Sets the value of [job_state_matcher][crate::model::ListJobsRequest::job_state_matcher].
11361    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    /// Sets the value of [filter][crate::model::ListJobsRequest::filter].
11372    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
11384/// Defines additional types related to [ListJobsRequest].
11385pub mod list_jobs_request {
11386    #[allow(unused_imports)]
11387    use super::*;
11388
11389    /// A matcher that specifies categories of job states.
11390    ///
11391    /// # Working with unknown values
11392    ///
11393    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11394    /// additional enum variants at any time. Adding new variants is not considered
11395    /// a breaking change. Applications should write their code in anticipation of:
11396    ///
11397    /// - New values appearing in future releases of the client library, **and**
11398    /// - New values received dynamically, without application changes.
11399    ///
11400    /// Please consult the [Working with enums] section in the user guide for some
11401    /// guidelines.
11402    ///
11403    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11404    #[derive(Clone, Debug, PartialEq)]
11405    #[non_exhaustive]
11406    pub enum JobStateMatcher {
11407        /// Match all jobs, regardless of state.
11408        All,
11409        /// Only match jobs in non-terminal states: PENDING, RUNNING, or
11410        /// CANCEL_PENDING.
11411        Active,
11412        /// Only match jobs in terminal states: CANCELLED, DONE, or ERROR.
11413        NonActive,
11414        /// If set, the enum was initialized with an unknown value.
11415        ///
11416        /// Applications can examine the value using [JobStateMatcher::value] or
11417        /// [JobStateMatcher::name].
11418        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        /// Gets the enum value.
11431        ///
11432        /// Returns `None` if the enum contains an unknown value deserialized from
11433        /// the string representation of enums.
11434        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        /// Gets the enum value as a string.
11444        ///
11445        /// Returns `None` if the enum contains an unknown value deserialized from
11446        /// the integer representation of enums.
11447        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/// A request to update a job.
11524#[derive(Clone, Default, PartialEq)]
11525#[non_exhaustive]
11526pub struct UpdateJobRequest {
11527    /// Required. The ID of the Google Cloud Platform project that the job
11528    /// belongs to.
11529    pub project_id: std::string::String,
11530
11531    /// Required. The Dataproc region in which to handle the request.
11532    pub region: std::string::String,
11533
11534    /// Required. The job ID.
11535    pub job_id: std::string::String,
11536
11537    /// Required. The changes to the job.
11538    pub job: std::option::Option<crate::model::Job>,
11539
11540    /// Required. Specifies the path, relative to \<code\>Job\</code\>, of
11541    /// the field to update. For example, to update the labels of a Job the
11542    /// \<code\>update_mask\</code\> parameter would be specified as
11543    /// \<code\>labels\</code\>, and the `PATCH` request body would specify the new
11544    /// value. \<strong\>Note:\</strong\> Currently, \<code\>labels\</code\> is the only
11545    /// field that can be updated.
11546    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    /// Sets the value of [project_id][crate::model::UpdateJobRequest::project_id].
11557    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    /// Sets the value of [region][crate::model::UpdateJobRequest::region].
11563    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    /// Sets the value of [job_id][crate::model::UpdateJobRequest::job_id].
11569    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    /// Sets the value of [job][crate::model::UpdateJobRequest::job].
11575    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    /// Sets or clears the value of [job][crate::model::UpdateJobRequest::job].
11584    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    /// Sets the value of [update_mask][crate::model::UpdateJobRequest::update_mask].
11593    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    /// Sets or clears the value of [update_mask][crate::model::UpdateJobRequest::update_mask].
11602    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/// A list of jobs in a project.
11618#[derive(Clone, Default, PartialEq)]
11619#[non_exhaustive]
11620pub struct ListJobsResponse {
11621    /// Output only. Jobs list.
11622    pub jobs: std::vec::Vec<crate::model::Job>,
11623
11624    /// Optional. This token is included in the response if there are more results
11625    /// to fetch. To fetch additional results, provide this value as the
11626    /// `page_token` in a subsequent \<code\>ListJobsRequest\</code\>.
11627    pub next_page_token: std::string::String,
11628
11629    /// Output only. List of jobs with
11630    /// [kms_key][google.cloud.dataproc.v1.EncryptionConfig.kms_key]-encrypted
11631    /// parameters that could not be decrypted. A response to a `jobs.get` request
11632    /// may indicate the reason for the decryption failure for a specific job.
11633    ///
11634    /// [google.cloud.dataproc.v1.EncryptionConfig.kms_key]: crate::model::EncryptionConfig::kms_key
11635    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    /// Sets the value of [jobs][crate::model::ListJobsResponse::jobs].
11646    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    /// Sets the value of [next_page_token][crate::model::ListJobsResponse::next_page_token].
11657    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    /// Sets the value of [unreachable][crate::model::ListJobsResponse::unreachable].
11663    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/// A request to cancel a job.
11695#[derive(Clone, Default, PartialEq)]
11696#[non_exhaustive]
11697pub struct CancelJobRequest {
11698    /// Required. The ID of the Google Cloud Platform project that the job
11699    /// belongs to.
11700    pub project_id: std::string::String,
11701
11702    /// Required. The Dataproc region in which to handle the request.
11703    pub region: std::string::String,
11704
11705    /// Required. The job ID.
11706    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    /// Sets the value of [project_id][crate::model::CancelJobRequest::project_id].
11717    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    /// Sets the value of [region][crate::model::CancelJobRequest::region].
11723    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    /// Sets the value of [job_id][crate::model::CancelJobRequest::job_id].
11729    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/// A request to delete a job.
11742#[derive(Clone, Default, PartialEq)]
11743#[non_exhaustive]
11744pub struct DeleteJobRequest {
11745    /// Required. The ID of the Google Cloud Platform project that the job
11746    /// belongs to.
11747    pub project_id: std::string::String,
11748
11749    /// Required. The Dataproc region in which to handle the request.
11750    pub region: std::string::String,
11751
11752    /// Required. The job ID.
11753    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    /// Sets the value of [project_id][crate::model::DeleteJobRequest::project_id].
11764    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    /// Sets the value of [region][crate::model::DeleteJobRequest::region].
11770    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    /// Sets the value of [job_id][crate::model::DeleteJobRequest::job_id].
11776    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/// A request to create a node group.
11789#[derive(Clone, Default, PartialEq)]
11790#[non_exhaustive]
11791pub struct CreateNodeGroupRequest {
11792    /// Required. The parent resource where this node group will be created.
11793    /// Format: `projects/{project}/regions/{region}/clusters/{cluster}`
11794    pub parent: std::string::String,
11795
11796    /// Required. The node group to create.
11797    pub node_group: std::option::Option<crate::model::NodeGroup>,
11798
11799    /// Optional. An optional node group ID. Generated if not specified.
11800    ///
11801    /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
11802    /// underscores (_), and hyphens (-). Cannot begin or end with underscore
11803    /// or hyphen. Must consist of from 3 to 33 characters.
11804    pub node_group_id: std::string::String,
11805
11806    /// Optional. A unique ID used to identify the request. If the server receives
11807    /// two
11808    /// [CreateNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests)
11809    /// with the same ID, the second request is ignored and the
11810    /// first [google.longrunning.Operation][google.longrunning.Operation] created
11811    /// and stored in the backend is returned.
11812    ///
11813    /// Recommendation: Set this value to a
11814    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
11815    ///
11816    /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
11817    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
11818    ///
11819    /// [google.longrunning.Operation]: longrunning::model::Operation
11820    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    /// Sets the value of [parent][crate::model::CreateNodeGroupRequest::parent].
11831    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    /// Sets the value of [node_group][crate::model::CreateNodeGroupRequest::node_group].
11837    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    /// Sets or clears the value of [node_group][crate::model::CreateNodeGroupRequest::node_group].
11846    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    /// Sets the value of [node_group_id][crate::model::CreateNodeGroupRequest::node_group_id].
11855    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    /// Sets the value of [request_id][crate::model::CreateNodeGroupRequest::request_id].
11861    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/// A request to resize a node group.
11874#[derive(Clone, Default, PartialEq)]
11875#[non_exhaustive]
11876pub struct ResizeNodeGroupRequest {
11877    /// Required. The name of the node group to resize.
11878    /// Format:
11879    /// `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}`
11880    pub name: std::string::String,
11881
11882    /// Required. The number of running instances for the node group to maintain.
11883    /// The group adds or removes instances to maintain the number of instances
11884    /// specified by this parameter.
11885    pub size: i32,
11886
11887    /// Optional. A unique ID used to identify the request. If the server receives
11888    /// two
11889    /// [ResizeNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests)
11890    /// with the same ID, the second request is ignored and the
11891    /// first [google.longrunning.Operation][google.longrunning.Operation] created
11892    /// and stored in the backend is returned.
11893    ///
11894    /// Recommendation: Set this value to a
11895    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
11896    ///
11897    /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
11898    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
11899    ///
11900    /// [google.longrunning.Operation]: longrunning::model::Operation
11901    pub request_id: std::string::String,
11902
11903    /// Optional. Timeout for graceful YARN decommissioning. [Graceful
11904    /// decommissioning]
11905    /// (<https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning>)
11906    /// allows the removal of nodes from the Compute Engine node group
11907    /// without interrupting jobs in progress. This timeout specifies how long to
11908    /// wait for jobs in progress to finish before forcefully removing nodes (and
11909    /// potentially interrupting jobs). Default timeout is 0 (for forceful
11910    /// decommission), and the maximum allowed timeout is 1 day. (see JSON
11911    /// representation of
11912    /// [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)).
11913    ///
11914    /// Only supported on Dataproc image versions 1.2 and higher.
11915    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    /// Sets the value of [name][crate::model::ResizeNodeGroupRequest::name].
11926    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    /// Sets the value of [size][crate::model::ResizeNodeGroupRequest::size].
11932    pub fn set_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11933        self.size = v.into();
11934        self
11935    }
11936
11937    /// Sets the value of [request_id][crate::model::ResizeNodeGroupRequest::request_id].
11938    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    /// Sets the value of [graceful_decommission_timeout][crate::model::ResizeNodeGroupRequest::graceful_decommission_timeout].
11944    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    /// Sets or clears the value of [graceful_decommission_timeout][crate::model::ResizeNodeGroupRequest::graceful_decommission_timeout].
11953    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/// A request to get a node group .
11972#[derive(Clone, Default, PartialEq)]
11973#[non_exhaustive]
11974pub struct GetNodeGroupRequest {
11975    /// Required. The name of the node group to retrieve.
11976    /// Format:
11977    /// `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}`
11978    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    /// Sets the value of [name][crate::model::GetNodeGroupRequest::name].
11989    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/// Metadata describing the Batch operation.
12002#[derive(Clone, Default, PartialEq)]
12003#[non_exhaustive]
12004pub struct BatchOperationMetadata {
12005    /// Name of the batch for the operation.
12006    pub batch: std::string::String,
12007
12008    /// Batch UUID for the operation.
12009    pub batch_uuid: std::string::String,
12010
12011    /// The time when the operation was created.
12012    pub create_time: std::option::Option<wkt::Timestamp>,
12013
12014    /// The time when the operation finished.
12015    pub done_time: std::option::Option<wkt::Timestamp>,
12016
12017    /// The operation type.
12018    pub operation_type: crate::model::batch_operation_metadata::BatchOperationType,
12019
12020    /// Short description of the operation.
12021    pub description: std::string::String,
12022
12023    /// Labels associated with the operation.
12024    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12025
12026    /// Warnings encountered during operation execution.
12027    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    /// Sets the value of [batch][crate::model::BatchOperationMetadata::batch].
12038    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    /// Sets the value of [batch_uuid][crate::model::BatchOperationMetadata::batch_uuid].
12044    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    /// Sets the value of [create_time][crate::model::BatchOperationMetadata::create_time].
12050    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    /// Sets or clears the value of [create_time][crate::model::BatchOperationMetadata::create_time].
12059    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    /// Sets the value of [done_time][crate::model::BatchOperationMetadata::done_time].
12068    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    /// Sets or clears the value of [done_time][crate::model::BatchOperationMetadata::done_time].
12077    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    /// Sets the value of [operation_type][crate::model::BatchOperationMetadata::operation_type].
12086    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    /// Sets the value of [description][crate::model::BatchOperationMetadata::description].
12097    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    /// Sets the value of [labels][crate::model::BatchOperationMetadata::labels].
12103    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    /// Sets the value of [warnings][crate::model::BatchOperationMetadata::warnings].
12115    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
12132/// Defines additional types related to [BatchOperationMetadata].
12133pub mod batch_operation_metadata {
12134    #[allow(unused_imports)]
12135    use super::*;
12136
12137    /// Operation type for Batch resources
12138    ///
12139    /// # Working with unknown values
12140    ///
12141    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12142    /// additional enum variants at any time. Adding new variants is not considered
12143    /// a breaking change. Applications should write their code in anticipation of:
12144    ///
12145    /// - New values appearing in future releases of the client library, **and**
12146    /// - New values received dynamically, without application changes.
12147    ///
12148    /// Please consult the [Working with enums] section in the user guide for some
12149    /// guidelines.
12150    ///
12151    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12152    #[derive(Clone, Debug, PartialEq)]
12153    #[non_exhaustive]
12154    pub enum BatchOperationType {
12155        /// Batch operation type is unknown.
12156        Unspecified,
12157        /// Batch operation type.
12158        Batch,
12159        /// If set, the enum was initialized with an unknown value.
12160        ///
12161        /// Applications can examine the value using [BatchOperationType::value] or
12162        /// [BatchOperationType::name].
12163        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        /// Gets the enum value.
12176        ///
12177        /// Returns `None` if the enum contains an unknown value deserialized from
12178        /// the string representation of enums.
12179        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        /// Gets the enum value as a string.
12188        ///
12189        /// Returns `None` if the enum contains an unknown value deserialized from
12190        /// the integer representation of enums.
12191        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/// Metadata describing the Session operation.
12264#[derive(Clone, Default, PartialEq)]
12265#[non_exhaustive]
12266pub struct SessionOperationMetadata {
12267    /// Name of the session for the operation.
12268    pub session: std::string::String,
12269
12270    /// Session UUID for the operation.
12271    pub session_uuid: std::string::String,
12272
12273    /// The time when the operation was created.
12274    pub create_time: std::option::Option<wkt::Timestamp>,
12275
12276    /// The time when the operation was finished.
12277    pub done_time: std::option::Option<wkt::Timestamp>,
12278
12279    /// The operation type.
12280    pub operation_type: crate::model::session_operation_metadata::SessionOperationType,
12281
12282    /// Short description of the operation.
12283    pub description: std::string::String,
12284
12285    /// Labels associated with the operation.
12286    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12287
12288    /// Warnings encountered during operation execution.
12289    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    /// Sets the value of [session][crate::model::SessionOperationMetadata::session].
12300    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    /// Sets the value of [session_uuid][crate::model::SessionOperationMetadata::session_uuid].
12306    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    /// Sets the value of [create_time][crate::model::SessionOperationMetadata::create_time].
12312    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    /// Sets or clears the value of [create_time][crate::model::SessionOperationMetadata::create_time].
12321    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    /// Sets the value of [done_time][crate::model::SessionOperationMetadata::done_time].
12330    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    /// Sets or clears the value of [done_time][crate::model::SessionOperationMetadata::done_time].
12339    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    /// Sets the value of [operation_type][crate::model::SessionOperationMetadata::operation_type].
12348    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    /// Sets the value of [description][crate::model::SessionOperationMetadata::description].
12359    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    /// Sets the value of [labels][crate::model::SessionOperationMetadata::labels].
12365    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    /// Sets the value of [warnings][crate::model::SessionOperationMetadata::warnings].
12377    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
12394/// Defines additional types related to [SessionOperationMetadata].
12395pub mod session_operation_metadata {
12396    #[allow(unused_imports)]
12397    use super::*;
12398
12399    /// Operation type for Session resources
12400    ///
12401    /// # Working with unknown values
12402    ///
12403    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12404    /// additional enum variants at any time. Adding new variants is not considered
12405    /// a breaking change. Applications should write their code in anticipation of:
12406    ///
12407    /// - New values appearing in future releases of the client library, **and**
12408    /// - New values received dynamically, without application changes.
12409    ///
12410    /// Please consult the [Working with enums] section in the user guide for some
12411    /// guidelines.
12412    ///
12413    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12414    #[derive(Clone, Debug, PartialEq)]
12415    #[non_exhaustive]
12416    pub enum SessionOperationType {
12417        /// Session operation type is unknown.
12418        Unspecified,
12419        /// Create Session operation type.
12420        Create,
12421        /// Terminate Session operation type.
12422        Terminate,
12423        /// Delete Session operation type.
12424        Delete,
12425        /// If set, the enum was initialized with an unknown value.
12426        ///
12427        /// Applications can examine the value using [SessionOperationType::value] or
12428        /// [SessionOperationType::name].
12429        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        /// Gets the enum value.
12442        ///
12443        /// Returns `None` if the enum contains an unknown value deserialized from
12444        /// the string representation of enums.
12445        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        /// Gets the enum value as a string.
12456        ///
12457        /// Returns `None` if the enum contains an unknown value deserialized from
12458        /// the integer representation of enums.
12459        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/// The status of the operation.
12542#[derive(Clone, Default, PartialEq)]
12543#[non_exhaustive]
12544pub struct ClusterOperationStatus {
12545    /// Output only. A message containing the operation state.
12546    pub state: crate::model::cluster_operation_status::State,
12547
12548    /// Output only. A message containing the detailed operation state.
12549    pub inner_state: std::string::String,
12550
12551    /// Output only. A message containing any operation metadata details.
12552    pub details: std::string::String,
12553
12554    /// Output only. The time this state was entered.
12555    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    /// Sets the value of [state][crate::model::ClusterOperationStatus::state].
12566    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    /// Sets the value of [inner_state][crate::model::ClusterOperationStatus::inner_state].
12575    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    /// Sets the value of [details][crate::model::ClusterOperationStatus::details].
12581    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    /// Sets the value of [state_start_time][crate::model::ClusterOperationStatus::state_start_time].
12587    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    /// Sets or clears the value of [state_start_time][crate::model::ClusterOperationStatus::state_start_time].
12596    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
12611/// Defines additional types related to [ClusterOperationStatus].
12612pub mod cluster_operation_status {
12613    #[allow(unused_imports)]
12614    use super::*;
12615
12616    /// The operation state.
12617    ///
12618    /// # Working with unknown values
12619    ///
12620    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12621    /// additional enum variants at any time. Adding new variants is not considered
12622    /// a breaking change. Applications should write their code in anticipation of:
12623    ///
12624    /// - New values appearing in future releases of the client library, **and**
12625    /// - New values received dynamically, without application changes.
12626    ///
12627    /// Please consult the [Working with enums] section in the user guide for some
12628    /// guidelines.
12629    ///
12630    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12631    #[derive(Clone, Debug, PartialEq)]
12632    #[non_exhaustive]
12633    pub enum State {
12634        /// Unused.
12635        Unknown,
12636        /// The operation has been created.
12637        Pending,
12638        /// The operation is running.
12639        Running,
12640        /// The operation is done; either cancelled or completed.
12641        Done,
12642        /// If set, the enum was initialized with an unknown value.
12643        ///
12644        /// Applications can examine the value using [State::value] or
12645        /// [State::name].
12646        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        /// Gets the enum value.
12659        ///
12660        /// Returns `None` if the enum contains an unknown value deserialized from
12661        /// the string representation of enums.
12662        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        /// Gets the enum value as a string.
12673        ///
12674        /// Returns `None` if the enum contains an unknown value deserialized from
12675        /// the integer representation of enums.
12676        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/// Metadata describing the operation.
12757#[derive(Clone, Default, PartialEq)]
12758#[non_exhaustive]
12759pub struct ClusterOperationMetadata {
12760    /// Output only. Name of the cluster for the operation.
12761    pub cluster_name: std::string::String,
12762
12763    /// Output only. Cluster UUID for the operation.
12764    pub cluster_uuid: std::string::String,
12765
12766    /// Output only. Current operation status.
12767    pub status: std::option::Option<crate::model::ClusterOperationStatus>,
12768
12769    /// Output only. The previous operation status.
12770    pub status_history: std::vec::Vec<crate::model::ClusterOperationStatus>,
12771
12772    /// Output only. The operation type.
12773    pub operation_type: std::string::String,
12774
12775    /// Output only. Short description of operation.
12776    pub description: std::string::String,
12777
12778    /// Output only. Labels associated with the operation
12779    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12780
12781    /// Output only. Errors encountered during operation execution.
12782    pub warnings: std::vec::Vec<std::string::String>,
12783
12784    /// Output only. Child operation ids
12785    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    /// Sets the value of [cluster_name][crate::model::ClusterOperationMetadata::cluster_name].
12796    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    /// Sets the value of [cluster_uuid][crate::model::ClusterOperationMetadata::cluster_uuid].
12802    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    /// Sets the value of [status][crate::model::ClusterOperationMetadata::status].
12808    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    /// Sets or clears the value of [status][crate::model::ClusterOperationMetadata::status].
12817    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    /// Sets the value of [status_history][crate::model::ClusterOperationMetadata::status_history].
12826    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    /// Sets the value of [operation_type][crate::model::ClusterOperationMetadata::operation_type].
12837    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    /// Sets the value of [description][crate::model::ClusterOperationMetadata::description].
12843    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    /// Sets the value of [labels][crate::model::ClusterOperationMetadata::labels].
12849    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    /// Sets the value of [warnings][crate::model::ClusterOperationMetadata::warnings].
12861    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    /// Sets the value of [child_operation_ids][crate::model::ClusterOperationMetadata::child_operation_ids].
12872    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/// Metadata describing the node group operation.
12890#[derive(Clone, Default, PartialEq)]
12891#[non_exhaustive]
12892pub struct NodeGroupOperationMetadata {
12893    /// Output only. Node group ID for the operation.
12894    pub node_group_id: std::string::String,
12895
12896    /// Output only. Cluster UUID associated with the node group operation.
12897    pub cluster_uuid: std::string::String,
12898
12899    /// Output only. Current operation status.
12900    pub status: std::option::Option<crate::model::ClusterOperationStatus>,
12901
12902    /// Output only. The previous operation status.
12903    pub status_history: std::vec::Vec<crate::model::ClusterOperationStatus>,
12904
12905    /// The operation type.
12906    pub operation_type: crate::model::node_group_operation_metadata::NodeGroupOperationType,
12907
12908    /// Output only. Short description of operation.
12909    pub description: std::string::String,
12910
12911    /// Output only. Labels associated with the operation.
12912    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12913
12914    /// Output only. Errors encountered during operation execution.
12915    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    /// Sets the value of [node_group_id][crate::model::NodeGroupOperationMetadata::node_group_id].
12926    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    /// Sets the value of [cluster_uuid][crate::model::NodeGroupOperationMetadata::cluster_uuid].
12932    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    /// Sets the value of [status][crate::model::NodeGroupOperationMetadata::status].
12938    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    /// Sets or clears the value of [status][crate::model::NodeGroupOperationMetadata::status].
12947    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    /// Sets the value of [status_history][crate::model::NodeGroupOperationMetadata::status_history].
12956    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    /// Sets the value of [operation_type][crate::model::NodeGroupOperationMetadata::operation_type].
12967    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    /// Sets the value of [description][crate::model::NodeGroupOperationMetadata::description].
12978    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    /// Sets the value of [labels][crate::model::NodeGroupOperationMetadata::labels].
12984    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    /// Sets the value of [warnings][crate::model::NodeGroupOperationMetadata::warnings].
12996    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
13013/// Defines additional types related to [NodeGroupOperationMetadata].
13014pub mod node_group_operation_metadata {
13015    #[allow(unused_imports)]
13016    use super::*;
13017
13018    /// Operation type for node group resources.
13019    ///
13020    /// # Working with unknown values
13021    ///
13022    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13023    /// additional enum variants at any time. Adding new variants is not considered
13024    /// a breaking change. Applications should write their code in anticipation of:
13025    ///
13026    /// - New values appearing in future releases of the client library, **and**
13027    /// - New values received dynamically, without application changes.
13028    ///
13029    /// Please consult the [Working with enums] section in the user guide for some
13030    /// guidelines.
13031    ///
13032    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13033    #[derive(Clone, Debug, PartialEq)]
13034    #[non_exhaustive]
13035    pub enum NodeGroupOperationType {
13036        /// Node group operation type is unknown.
13037        Unspecified,
13038        /// Create node group operation type.
13039        Create,
13040        /// Update node group operation type.
13041        Update,
13042        /// Delete node group operation type.
13043        Delete,
13044        /// Resize node group operation type.
13045        Resize,
13046        /// If set, the enum was initialized with an unknown value.
13047        ///
13048        /// Applications can examine the value using [NodeGroupOperationType::value] or
13049        /// [NodeGroupOperationType::name].
13050        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        /// Gets the enum value.
13063        ///
13064        /// Returns `None` if the enum contains an unknown value deserialized from
13065        /// the string representation of enums.
13066        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        /// Gets the enum value as a string.
13078        ///
13079        /// Returns `None` if the enum contains an unknown value deserialized from
13080        /// the integer representation of enums.
13081        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/// A request to create a session template.
13168#[derive(Clone, Default, PartialEq)]
13169#[non_exhaustive]
13170pub struct CreateSessionTemplateRequest {
13171    /// Required. The parent resource where this session template will be created.
13172    pub parent: std::string::String,
13173
13174    /// Required. The session template to create.
13175    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    /// Sets the value of [parent][crate::model::CreateSessionTemplateRequest::parent].
13186    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    /// Sets the value of [session_template][crate::model::CreateSessionTemplateRequest::session_template].
13192    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    /// Sets or clears the value of [session_template][crate::model::CreateSessionTemplateRequest::session_template].
13201    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/// A request to update a session template.
13217#[derive(Clone, Default, PartialEq)]
13218#[non_exhaustive]
13219pub struct UpdateSessionTemplateRequest {
13220    /// Required. The updated session template.
13221    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    /// Sets the value of [session_template][crate::model::UpdateSessionTemplateRequest::session_template].
13232    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    /// Sets or clears the value of [session_template][crate::model::UpdateSessionTemplateRequest::session_template].
13241    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/// A request to get the resource representation for a session template.
13257#[derive(Clone, Default, PartialEq)]
13258#[non_exhaustive]
13259pub struct GetSessionTemplateRequest {
13260    /// Required. The name of the session template to retrieve.
13261    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    /// Sets the value of [name][crate::model::GetSessionTemplateRequest::name].
13272    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/// A request to list session templates in a project.
13285#[derive(Clone, Default, PartialEq)]
13286#[non_exhaustive]
13287pub struct ListSessionTemplatesRequest {
13288    /// Required. The parent that owns this collection of session templates.
13289    pub parent: std::string::String,
13290
13291    /// Optional. The maximum number of sessions to return in each response.
13292    /// The service may return fewer than this value.
13293    pub page_size: i32,
13294
13295    /// Optional. A page token received from a previous `ListSessions` call.
13296    /// Provide this token to retrieve the subsequent page.
13297    pub page_token: std::string::String,
13298
13299    /// Optional. A filter for the session templates to return in the response.
13300    /// Filters are case sensitive and have the following syntax:
13301    ///
13302    /// [field = value] AND [field [= value]] ...
13303    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    /// Sets the value of [parent][crate::model::ListSessionTemplatesRequest::parent].
13314    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    /// Sets the value of [page_size][crate::model::ListSessionTemplatesRequest::page_size].
13320    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    /// Sets the value of [page_token][crate::model::ListSessionTemplatesRequest::page_token].
13326    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    /// Sets the value of [filter][crate::model::ListSessionTemplatesRequest::filter].
13332    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/// A list of session templates.
13345#[derive(Clone, Default, PartialEq)]
13346#[non_exhaustive]
13347pub struct ListSessionTemplatesResponse {
13348    /// Output only. Session template list
13349    pub session_templates: std::vec::Vec<crate::model::SessionTemplate>,
13350
13351    /// A token, which can be sent as `page_token` to retrieve the next page.
13352    /// If this field is omitted, there are no subsequent pages.
13353    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    /// Sets the value of [session_templates][crate::model::ListSessionTemplatesResponse::session_templates].
13364    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    /// Sets the value of [next_page_token][crate::model::ListSessionTemplatesResponse::next_page_token].
13375    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/// A request to delete a session template.
13402#[derive(Clone, Default, PartialEq)]
13403#[non_exhaustive]
13404pub struct DeleteSessionTemplateRequest {
13405    /// Required. The name of the session template resource to delete.
13406    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    /// Sets the value of [name][crate::model::DeleteSessionTemplateRequest::name].
13417    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/// A representation of a session template.
13430#[derive(Clone, Default, PartialEq)]
13431#[non_exhaustive]
13432pub struct SessionTemplate {
13433    /// Required. The resource name of the session template.
13434    pub name: std::string::String,
13435
13436    /// Optional. Brief description of the template.
13437    pub description: std::string::String,
13438
13439    /// Output only. The time when the template was created.
13440    pub create_time: std::option::Option<wkt::Timestamp>,
13441
13442    /// Output only. The email address of the user who created the template.
13443    pub creator: std::string::String,
13444
13445    /// Optional. Labels to associate with sessions created using this template.
13446    /// Label **keys** must contain 1 to 63 characters, and must conform to
13447    /// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
13448    /// Label **values** can be empty, but, if present, must contain 1 to 63
13449    /// characters and conform to [RFC
13450    /// 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
13451    /// associated with a session.
13452    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
13453
13454    /// Optional. Runtime configuration for session execution.
13455    pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
13456
13457    /// Optional. Environment configuration for session execution.
13458    pub environment_config: std::option::Option<crate::model::EnvironmentConfig>,
13459
13460    /// Output only. The time the template was last updated.
13461    pub update_time: std::option::Option<wkt::Timestamp>,
13462
13463    /// Output only. A session template UUID (Unique Universal Identifier). The
13464    /// service generates this value when it creates the session template.
13465    pub uuid: std::string::String,
13466
13467    /// The session configuration.
13468    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    /// Sets the value of [name][crate::model::SessionTemplate::name].
13479    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    /// Sets the value of [description][crate::model::SessionTemplate::description].
13485    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    /// Sets the value of [create_time][crate::model::SessionTemplate::create_time].
13491    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    /// Sets or clears the value of [create_time][crate::model::SessionTemplate::create_time].
13500    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    /// Sets the value of [creator][crate::model::SessionTemplate::creator].
13509    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    /// Sets the value of [labels][crate::model::SessionTemplate::labels].
13515    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    /// Sets the value of [runtime_config][crate::model::SessionTemplate::runtime_config].
13527    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    /// Sets or clears the value of [runtime_config][crate::model::SessionTemplate::runtime_config].
13536    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    /// Sets the value of [environment_config][crate::model::SessionTemplate::environment_config].
13545    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    /// Sets or clears the value of [environment_config][crate::model::SessionTemplate::environment_config].
13554    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    /// Sets the value of [update_time][crate::model::SessionTemplate::update_time].
13563    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    /// Sets or clears the value of [update_time][crate::model::SessionTemplate::update_time].
13572    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    /// Sets the value of [uuid][crate::model::SessionTemplate::uuid].
13581    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    /// Sets the value of [session_config][crate::model::SessionTemplate::session_config].
13587    ///
13588    /// Note that all the setters affecting `session_config` are mutually
13589    /// exclusive.
13590    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    /// The value of [session_config][crate::model::SessionTemplate::session_config]
13601    /// if it holds a `JupyterSession`, `None` if the field is not set or
13602    /// holds a different branch.
13603    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    /// Sets the value of [session_config][crate::model::SessionTemplate::session_config]
13616    /// to hold a `JupyterSession`.
13617    ///
13618    /// Note that all the setters affecting `session_config` are
13619    /// mutually exclusive.
13620    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    /// The value of [session_config][crate::model::SessionTemplate::session_config]
13633    /// if it holds a `SparkConnectSession`, `None` if the field is not set or
13634    /// holds a different branch.
13635    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    /// Sets the value of [session_config][crate::model::SessionTemplate::session_config]
13648    /// to hold a `SparkConnectSession`.
13649    ///
13650    /// Note that all the setters affecting `session_config` are
13651    /// mutually exclusive.
13652    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
13671/// Defines additional types related to [SessionTemplate].
13672pub mod session_template {
13673    #[allow(unused_imports)]
13674    use super::*;
13675
13676    /// The session configuration.
13677    #[derive(Clone, Debug, PartialEq)]
13678    #[non_exhaustive]
13679    pub enum SessionConfig {
13680        /// Optional. Jupyter session config.
13681        JupyterSession(std::boxed::Box<crate::model::JupyterConfig>),
13682        /// Optional. Spark Connect session config.
13683        SparkConnectSession(std::boxed::Box<crate::model::SparkConnectConfig>),
13684    }
13685}
13686
13687/// A request to create a session.
13688#[derive(Clone, Default, PartialEq)]
13689#[non_exhaustive]
13690pub struct CreateSessionRequest {
13691    /// Required. The parent resource where this session will be created.
13692    pub parent: std::string::String,
13693
13694    /// Required. The interactive session to create.
13695    pub session: std::option::Option<crate::model::Session>,
13696
13697    /// Required. The ID to use for the session, which becomes the final component
13698    /// of the session's resource name.
13699    ///
13700    /// This value must be 4-63 characters. Valid characters
13701    /// are /[a-z][0-9]-/.
13702    pub session_id: std::string::String,
13703
13704    /// Optional. A unique ID used to identify the request. If the service
13705    /// receives two
13706    /// [CreateSessionRequests](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateSessionRequest)s
13707    /// with the same ID, the second request is ignored, and the
13708    /// first [Session][google.cloud.dataproc.v1.Session] is created and stored in
13709    /// the backend.
13710    ///
13711    /// Recommendation: Set this value to a
13712    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
13713    ///
13714    /// The value must contain only letters (a-z, A-Z), numbers (0-9),
13715    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
13716    ///
13717    /// [google.cloud.dataproc.v1.Session]: crate::model::Session
13718    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    /// Sets the value of [parent][crate::model::CreateSessionRequest::parent].
13729    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    /// Sets the value of [session][crate::model::CreateSessionRequest::session].
13735    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    /// Sets or clears the value of [session][crate::model::CreateSessionRequest::session].
13744    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    /// Sets the value of [session_id][crate::model::CreateSessionRequest::session_id].
13753    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    /// Sets the value of [request_id][crate::model::CreateSessionRequest::request_id].
13759    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/// A request to get the resource representation for a session.
13772#[derive(Clone, Default, PartialEq)]
13773#[non_exhaustive]
13774pub struct GetSessionRequest {
13775    /// Required. The name of the session to retrieve.
13776    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    /// Sets the value of [name][crate::model::GetSessionRequest::name].
13787    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/// A request to list sessions in a project.
13800#[derive(Clone, Default, PartialEq)]
13801#[non_exhaustive]
13802pub struct ListSessionsRequest {
13803    /// Required. The parent, which owns this collection of sessions.
13804    pub parent: std::string::String,
13805
13806    /// Optional. The maximum number of sessions to return in each response.
13807    /// The service may return fewer than this value.
13808    pub page_size: i32,
13809
13810    /// Optional. A page token received from a previous `ListSessions` call.
13811    /// Provide this token to retrieve the subsequent page.
13812    pub page_token: std::string::String,
13813
13814    /// Optional. A filter for the sessions to return in the response.
13815    ///
13816    /// A filter is a logical expression constraining the values of various fields
13817    /// in each session resource. Filters are case sensitive, and may contain
13818    /// multiple clauses combined with logical operators (AND, OR).
13819    /// Supported fields are `session_id`, `session_uuid`, `state`, `create_time`,
13820    /// and `labels`.
13821    ///
13822    /// Example: `state = ACTIVE and create_time < "2023-01-01T00:00:00Z"`
13823    /// is a filter for sessions in an ACTIVE state that were created before
13824    /// 2023-01-01. `state = ACTIVE and labels.environment=production` is a filter
13825    /// for sessions in an ACTIVE state that have a production environment label.
13826    ///
13827    /// See <https://google.aip.dev/assets/misc/ebnf-filtering.txt> for a detailed
13828    /// description of the filter syntax and a list of supported comparators.
13829    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    /// Sets the value of [parent][crate::model::ListSessionsRequest::parent].
13840    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    /// Sets the value of [page_size][crate::model::ListSessionsRequest::page_size].
13846    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    /// Sets the value of [page_token][crate::model::ListSessionsRequest::page_token].
13852    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    /// Sets the value of [filter][crate::model::ListSessionsRequest::filter].
13858    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/// A list of interactive sessions.
13871#[derive(Clone, Default, PartialEq)]
13872#[non_exhaustive]
13873pub struct ListSessionsResponse {
13874    /// Output only. The sessions from the specified collection.
13875    pub sessions: std::vec::Vec<crate::model::Session>,
13876
13877    /// A token, which can be sent as `page_token`, to retrieve the next page.
13878    /// If this field is omitted, there are no subsequent pages.
13879    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    /// Sets the value of [sessions][crate::model::ListSessionsResponse::sessions].
13890    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    /// Sets the value of [next_page_token][crate::model::ListSessionsResponse::next_page_token].
13901    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/// A request to terminate an interactive session.
13928#[derive(Clone, Default, PartialEq)]
13929#[non_exhaustive]
13930pub struct TerminateSessionRequest {
13931    /// Required. The name of the session resource to terminate.
13932    pub name: std::string::String,
13933
13934    /// Optional. A unique ID used to identify the request. If the service
13935    /// receives two
13936    /// [TerminateSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.TerminateSessionRequest)s
13937    /// with the same ID, the second request is ignored.
13938    ///
13939    /// Recommendation: Set this value to a
13940    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
13941    ///
13942    /// The value must contain only letters (a-z, A-Z), numbers (0-9),
13943    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
13944    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    /// Sets the value of [name][crate::model::TerminateSessionRequest::name].
13955    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    /// Sets the value of [request_id][crate::model::TerminateSessionRequest::request_id].
13961    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/// A request to delete a session.
13974#[derive(Clone, Default, PartialEq)]
13975#[non_exhaustive]
13976pub struct DeleteSessionRequest {
13977    /// Required. The name of the session resource to delete.
13978    pub name: std::string::String,
13979
13980    /// Optional. A unique ID used to identify the request. If the service
13981    /// receives two
13982    /// [DeleteSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteSessionRequest)s
13983    /// with the same ID, the second request is ignored.
13984    ///
13985    /// Recommendation: Set this value to a
13986    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
13987    ///
13988    /// The value must contain only letters (a-z, A-Z), numbers (0-9),
13989    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
13990    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    /// Sets the value of [name][crate::model::DeleteSessionRequest::name].
14001    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    /// Sets the value of [request_id][crate::model::DeleteSessionRequest::request_id].
14007    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/// A representation of a session.
14020#[derive(Clone, Default, PartialEq)]
14021#[non_exhaustive]
14022pub struct Session {
14023    /// Required. The resource name of the session.
14024    pub name: std::string::String,
14025
14026    /// Output only. A session UUID (Unique Universal Identifier). The service
14027    /// generates this value when it creates the session.
14028    pub uuid: std::string::String,
14029
14030    /// Output only. The time when the session was created.
14031    pub create_time: std::option::Option<wkt::Timestamp>,
14032
14033    /// Output only. Runtime information about session execution.
14034    pub runtime_info: std::option::Option<crate::model::RuntimeInfo>,
14035
14036    /// Output only. A state of the session.
14037    pub state: crate::model::session::State,
14038
14039    /// Output only. Session state details, such as the failure
14040    /// description if the state is `FAILED`.
14041    pub state_message: std::string::String,
14042
14043    /// Output only. The time when the session entered the current state.
14044    pub state_time: std::option::Option<wkt::Timestamp>,
14045
14046    /// Output only. The email address of the user who created the session.
14047    pub creator: std::string::String,
14048
14049    /// Optional. The labels to associate with the session.
14050    /// Label **keys** must contain 1 to 63 characters, and must conform to
14051    /// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
14052    /// Label **values** may be empty, but, if present, must contain 1 to 63
14053    /// characters, and must conform to [RFC
14054    /// 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
14055    /// associated with a session.
14056    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
14057
14058    /// Optional. Runtime configuration for the session execution.
14059    pub runtime_config: std::option::Option<crate::model::RuntimeConfig>,
14060
14061    /// Optional. Environment configuration for the session execution.
14062    pub environment_config: std::option::Option<crate::model::EnvironmentConfig>,
14063
14064    /// Optional. The email address of the user who owns the session.
14065    pub user: std::string::String,
14066
14067    /// Output only. Historical state information for the session.
14068    pub state_history: std::vec::Vec<crate::model::session::SessionStateHistory>,
14069
14070    /// Optional. The session template used by the session.
14071    ///
14072    /// Only resource names, including project ID and location, are valid.
14073    ///
14074    /// Example:
14075    ///
14076    /// * `<https://www.googleapis.com/compute/v1/projects/>[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]`
14077    /// * `projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]`
14078    ///
14079    /// The template must be in the same project and Dataproc region as the
14080    /// session.
14081    pub session_template: std::string::String,
14082
14083    /// The session configuration.
14084    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    /// Sets the value of [name][crate::model::Session::name].
14095    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    /// Sets the value of [uuid][crate::model::Session::uuid].
14101    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    /// Sets the value of [create_time][crate::model::Session::create_time].
14107    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    /// Sets or clears the value of [create_time][crate::model::Session::create_time].
14116    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    /// Sets the value of [runtime_info][crate::model::Session::runtime_info].
14125    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    /// Sets or clears the value of [runtime_info][crate::model::Session::runtime_info].
14134    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    /// Sets the value of [state][crate::model::Session::state].
14143    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    /// Sets the value of [state_message][crate::model::Session::state_message].
14149    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    /// Sets the value of [state_time][crate::model::Session::state_time].
14155    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    /// Sets or clears the value of [state_time][crate::model::Session::state_time].
14164    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    /// Sets the value of [creator][crate::model::Session::creator].
14173    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    /// Sets the value of [labels][crate::model::Session::labels].
14179    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    /// Sets the value of [runtime_config][crate::model::Session::runtime_config].
14191    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    /// Sets or clears the value of [runtime_config][crate::model::Session::runtime_config].
14200    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    /// Sets the value of [environment_config][crate::model::Session::environment_config].
14209    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    /// Sets or clears the value of [environment_config][crate::model::Session::environment_config].
14218    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    /// Sets the value of [user][crate::model::Session::user].
14227    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    /// Sets the value of [state_history][crate::model::Session::state_history].
14233    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    /// Sets the value of [session_template][crate::model::Session::session_template].
14244    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    /// Sets the value of [session_config][crate::model::Session::session_config].
14253    ///
14254    /// Note that all the setters affecting `session_config` are mutually
14255    /// exclusive.
14256    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    /// The value of [session_config][crate::model::Session::session_config]
14267    /// if it holds a `JupyterSession`, `None` if the field is not set or
14268    /// holds a different branch.
14269    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    /// Sets the value of [session_config][crate::model::Session::session_config]
14280    /// to hold a `JupyterSession`.
14281    ///
14282    /// Note that all the setters affecting `session_config` are
14283    /// mutually exclusive.
14284    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    /// The value of [session_config][crate::model::Session::session_config]
14297    /// if it holds a `SparkConnectSession`, `None` if the field is not set or
14298    /// holds a different branch.
14299    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    /// Sets the value of [session_config][crate::model::Session::session_config]
14312    /// to hold a `SparkConnectSession`.
14313    ///
14314    /// Note that all the setters affecting `session_config` are
14315    /// mutually exclusive.
14316    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
14335/// Defines additional types related to [Session].
14336pub mod session {
14337    #[allow(unused_imports)]
14338    use super::*;
14339
14340    /// Historical state information.
14341    #[derive(Clone, Default, PartialEq)]
14342    #[non_exhaustive]
14343    pub struct SessionStateHistory {
14344        /// Output only. The state of the session at this point in the session
14345        /// history.
14346        pub state: crate::model::session::State,
14347
14348        /// Output only. Details about the state at this point in the session
14349        /// history.
14350        pub state_message: std::string::String,
14351
14352        /// Output only. The time when the session entered the historical state.
14353        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        /// Sets the value of [state][crate::model::session::SessionStateHistory::state].
14364        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        /// Sets the value of [state_message][crate::model::session::SessionStateHistory::state_message].
14373        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        /// Sets the value of [state_start_time][crate::model::session::SessionStateHistory::state_start_time].
14382        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        /// Sets or clears the value of [state_start_time][crate::model::session::SessionStateHistory::state_start_time].
14391        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    /// The session state.
14407    ///
14408    /// # Working with unknown values
14409    ///
14410    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14411    /// additional enum variants at any time. Adding new variants is not considered
14412    /// a breaking change. Applications should write their code in anticipation of:
14413    ///
14414    /// - New values appearing in future releases of the client library, **and**
14415    /// - New values received dynamically, without application changes.
14416    ///
14417    /// Please consult the [Working with enums] section in the user guide for some
14418    /// guidelines.
14419    ///
14420    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14421    #[derive(Clone, Debug, PartialEq)]
14422    #[non_exhaustive]
14423    pub enum State {
14424        /// The session state is unknown.
14425        Unspecified,
14426        /// The session is created prior to running.
14427        Creating,
14428        /// The session is running.
14429        Active,
14430        /// The session is terminating.
14431        Terminating,
14432        /// The session is terminated successfully.
14433        Terminated,
14434        /// The session is no longer running due to an error.
14435        Failed,
14436        /// If set, the enum was initialized with an unknown value.
14437        ///
14438        /// Applications can examine the value using [State::value] or
14439        /// [State::name].
14440        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        /// Gets the enum value.
14453        ///
14454        /// Returns `None` if the enum contains an unknown value deserialized from
14455        /// the string representation of enums.
14456        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        /// Gets the enum value as a string.
14469        ///
14470        /// Returns `None` if the enum contains an unknown value deserialized from
14471        /// the integer representation of enums.
14472        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    /// The session configuration.
14560    #[derive(Clone, Debug, PartialEq)]
14561    #[non_exhaustive]
14562    pub enum SessionConfig {
14563        /// Optional. Jupyter session config.
14564        JupyterSession(std::boxed::Box<crate::model::JupyterConfig>),
14565        /// Optional. Spark Connect session config.
14566        SparkConnectSession(std::boxed::Box<crate::model::SparkConnectConfig>),
14567    }
14568}
14569
14570/// Jupyter configuration for an interactive session.
14571#[derive(Clone, Default, PartialEq)]
14572#[non_exhaustive]
14573pub struct JupyterConfig {
14574    /// Optional. Kernel
14575    pub kernel: crate::model::jupyter_config::Kernel,
14576
14577    /// Optional. Display name, shown in the Jupyter kernelspec card.
14578    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    /// Sets the value of [kernel][crate::model::JupyterConfig::kernel].
14589    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    /// Sets the value of [display_name][crate::model::JupyterConfig::display_name].
14598    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
14610/// Defines additional types related to [JupyterConfig].
14611pub mod jupyter_config {
14612    #[allow(unused_imports)]
14613    use super::*;
14614
14615    /// Jupyter kernel types.
14616    ///
14617    /// # Working with unknown values
14618    ///
14619    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14620    /// additional enum variants at any time. Adding new variants is not considered
14621    /// a breaking change. Applications should write their code in anticipation of:
14622    ///
14623    /// - New values appearing in future releases of the client library, **and**
14624    /// - New values received dynamically, without application changes.
14625    ///
14626    /// Please consult the [Working with enums] section in the user guide for some
14627    /// guidelines.
14628    ///
14629    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14630    #[derive(Clone, Debug, PartialEq)]
14631    #[non_exhaustive]
14632    pub enum Kernel {
14633        /// The kernel is unknown.
14634        Unspecified,
14635        /// Python kernel.
14636        Python,
14637        /// Scala kernel.
14638        Scala,
14639        /// If set, the enum was initialized with an unknown value.
14640        ///
14641        /// Applications can examine the value using [Kernel::value] or
14642        /// [Kernel::name].
14643        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        /// Gets the enum value.
14656        ///
14657        /// Returns `None` if the enum contains an unknown value deserialized from
14658        /// the string representation of enums.
14659        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        /// Gets the enum value as a string.
14669        ///
14670        /// Returns `None` if the enum contains an unknown value deserialized from
14671        /// the integer representation of enums.
14672        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/// Spark Connect configuration for an interactive session.
14749#[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/// Runtime configuration for a workload.
14768#[derive(Clone, Default, PartialEq)]
14769#[non_exhaustive]
14770pub struct RuntimeConfig {
14771    /// Optional. Version of the batch runtime.
14772    pub version: std::string::String,
14773
14774    /// Optional. Optional custom container image for the job runtime environment.
14775    /// If not specified, a default container image will be used.
14776    pub container_image: std::string::String,
14777
14778    /// Optional. A mapping of property names to values, which are used to
14779    /// configure workload execution.
14780    pub properties: std::collections::HashMap<std::string::String, std::string::String>,
14781
14782    /// Optional. Dependency repository configuration.
14783    pub repository_config: std::option::Option<crate::model::RepositoryConfig>,
14784
14785    /// Optional. Autotuning configuration of the workload.
14786    pub autotuning_config: std::option::Option<crate::model::AutotuningConfig>,
14787
14788    /// Optional. Cohort identifier. Identifies families of the workloads having
14789    /// the same shape, e.g. daily ETL jobs.
14790    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    /// Sets the value of [version][crate::model::RuntimeConfig::version].
14801    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    /// Sets the value of [container_image][crate::model::RuntimeConfig::container_image].
14807    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    /// Sets the value of [properties][crate::model::RuntimeConfig::properties].
14813    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    /// Sets the value of [repository_config][crate::model::RuntimeConfig::repository_config].
14825    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    /// Sets or clears the value of [repository_config][crate::model::RuntimeConfig::repository_config].
14834    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    /// Sets the value of [autotuning_config][crate::model::RuntimeConfig::autotuning_config].
14843    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    /// Sets or clears the value of [autotuning_config][crate::model::RuntimeConfig::autotuning_config].
14852    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    /// Sets the value of [cohort][crate::model::RuntimeConfig::cohort].
14861    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/// Environment configuration for a workload.
14874#[derive(Clone, Default, PartialEq)]
14875#[non_exhaustive]
14876pub struct EnvironmentConfig {
14877    /// Optional. Execution configuration for a workload.
14878    pub execution_config: std::option::Option<crate::model::ExecutionConfig>,
14879
14880    /// Optional. Peripherals configuration that workload has access to.
14881    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    /// Sets the value of [execution_config][crate::model::EnvironmentConfig::execution_config].
14892    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    /// Sets or clears the value of [execution_config][crate::model::EnvironmentConfig::execution_config].
14901    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    /// Sets the value of [peripherals_config][crate::model::EnvironmentConfig::peripherals_config].
14910    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    /// Sets or clears the value of [peripherals_config][crate::model::EnvironmentConfig::peripherals_config].
14919    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/// Execution configuration for a workload.
14935#[derive(Clone, Default, PartialEq)]
14936#[non_exhaustive]
14937pub struct ExecutionConfig {
14938    /// Optional. Service account that used to execute workload.
14939    pub service_account: std::string::String,
14940
14941    /// Optional. Tags used for network traffic control.
14942    pub network_tags: std::vec::Vec<std::string::String>,
14943
14944    /// Optional. The Cloud KMS key to use for encryption.
14945    pub kms_key: std::string::String,
14946
14947    /// Optional. Applies to sessions only. The duration to keep the session alive
14948    /// while it's idling. Exceeding this threshold causes the session to
14949    /// terminate. This field cannot be set on a batch workload. Minimum value is
14950    /// 10 minutes; maximum value is 14 days (see JSON representation of
14951    /// [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)).
14952    /// Defaults to 1 hour if not set.
14953    /// If both `ttl` and `idle_ttl` are specified for an interactive session,
14954    /// the conditions are treated as `OR` conditions: the workload will be
14955    /// terminated when it has been idle for `idle_ttl` or when `ttl` has been
14956    /// exceeded, whichever occurs first.
14957    pub idle_ttl: std::option::Option<wkt::Duration>,
14958
14959    /// Optional. The duration after which the workload will be terminated,
14960    /// specified as the JSON representation for
14961    /// [Duration](https://protobuf.dev/programming-guides/proto3/#json).
14962    /// When the workload exceeds this duration, it will be unconditionally
14963    /// terminated without waiting for ongoing work to finish. If `ttl` is not
14964    /// specified for a batch workload, the workload will be allowed to run until
14965    /// it exits naturally (or run forever without exiting). If `ttl` is not
14966    /// specified for an interactive session, it defaults to 24 hours. If `ttl` is
14967    /// not specified for a batch that uses 2.1+ runtime version, it defaults to 4
14968    /// hours. Minimum value is 10 minutes; maximum value is 14 days. If both `ttl`
14969    /// and `idle_ttl` are specified (for an interactive session), the conditions
14970    /// are treated as `OR` conditions: the workload will be terminated when it has
14971    /// been idle for `idle_ttl` or when `ttl` has been exceeded, whichever occurs
14972    /// first.
14973    pub ttl: std::option::Option<wkt::Duration>,
14974
14975    /// Optional. A Cloud Storage bucket used to stage workload dependencies,
14976    /// config files, and store workload output and other ephemeral data, such as
14977    /// Spark history files. If you do not specify a staging bucket, Cloud Dataproc
14978    /// will determine a Cloud Storage location according to the region where your
14979    /// workload is running, and then create and manage project-level, per-location
14980    /// staging and temporary buckets.
14981    /// **This field requires a Cloud Storage bucket name, not a `gs://...` URI to
14982    /// a Cloud Storage bucket.**
14983    pub staging_bucket: std::string::String,
14984
14985    /// Optional. Authentication configuration used to set the default identity for
14986    /// the workload execution. The config specifies the type of identity
14987    /// (service account or user) that will be used by workloads to access
14988    /// resources on the project(s).
14989    pub authentication_config: std::option::Option<crate::model::AuthenticationConfig>,
14990
14991    /// Network configuration for workload execution.
14992    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    /// Sets the value of [service_account][crate::model::ExecutionConfig::service_account].
15003    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    /// Sets the value of [network_tags][crate::model::ExecutionConfig::network_tags].
15009    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    /// Sets the value of [kms_key][crate::model::ExecutionConfig::kms_key].
15020    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    /// Sets the value of [idle_ttl][crate::model::ExecutionConfig::idle_ttl].
15026    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    /// Sets or clears the value of [idle_ttl][crate::model::ExecutionConfig::idle_ttl].
15035    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    /// Sets the value of [ttl][crate::model::ExecutionConfig::ttl].
15044    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    /// Sets or clears the value of [ttl][crate::model::ExecutionConfig::ttl].
15053    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    /// Sets the value of [staging_bucket][crate::model::ExecutionConfig::staging_bucket].
15062    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    /// Sets the value of [authentication_config][crate::model::ExecutionConfig::authentication_config].
15068    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    /// Sets or clears the value of [authentication_config][crate::model::ExecutionConfig::authentication_config].
15077    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    /// Sets the value of [network][crate::model::ExecutionConfig::network].
15086    ///
15087    /// Note that all the setters affecting `network` are mutually
15088    /// exclusive.
15089    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    /// The value of [network][crate::model::ExecutionConfig::network]
15100    /// if it holds a `NetworkUri`, `None` if the field is not set or
15101    /// holds a different branch.
15102    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    /// Sets the value of [network][crate::model::ExecutionConfig::network]
15111    /// to hold a `NetworkUri`.
15112    ///
15113    /// Note that all the setters affecting `network` are
15114    /// mutually exclusive.
15115    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    /// The value of [network][crate::model::ExecutionConfig::network]
15123    /// if it holds a `SubnetworkUri`, `None` if the field is not set or
15124    /// holds a different branch.
15125    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    /// Sets the value of [network][crate::model::ExecutionConfig::network]
15136    /// to hold a `SubnetworkUri`.
15137    ///
15138    /// Note that all the setters affecting `network` are
15139    /// mutually exclusive.
15140    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
15154/// Defines additional types related to [ExecutionConfig].
15155pub mod execution_config {
15156    #[allow(unused_imports)]
15157    use super::*;
15158
15159    /// Network configuration for workload execution.
15160    #[derive(Clone, Debug, PartialEq)]
15161    #[non_exhaustive]
15162    pub enum Network {
15163        /// Optional. Network URI to connect workload to.
15164        NetworkUri(std::string::String),
15165        /// Optional. Subnetwork URI to connect workload to.
15166        SubnetworkUri(std::string::String),
15167    }
15168}
15169
15170/// Spark History Server configuration for the workload.
15171#[derive(Clone, Default, PartialEq)]
15172#[non_exhaustive]
15173pub struct SparkHistoryServerConfig {
15174    /// Optional. Resource name of an existing Dataproc Cluster to act as a Spark
15175    /// History Server for the workload.
15176    ///
15177    /// Example:
15178    ///
15179    /// * `projects/[project_id]/regions/[region]/clusters/[cluster_name]`
15180    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    /// Sets the value of [dataproc_cluster][crate::model::SparkHistoryServerConfig::dataproc_cluster].
15191    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/// Auxiliary services configuration for a workload.
15207#[derive(Clone, Default, PartialEq)]
15208#[non_exhaustive]
15209pub struct PeripheralsConfig {
15210    /// Optional. Resource name of an existing Dataproc Metastore service.
15211    ///
15212    /// Example:
15213    ///
15214    /// * `projects/[project_id]/locations/[region]/services/[service_id]`
15215    pub metastore_service: std::string::String,
15216
15217    /// Optional. The Spark History Server configuration for the workload.
15218    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    /// Sets the value of [metastore_service][crate::model::PeripheralsConfig::metastore_service].
15229    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    /// Sets the value of [spark_history_server_config][crate::model::PeripheralsConfig::spark_history_server_config].
15238    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    /// Sets or clears the value of [spark_history_server_config][crate::model::PeripheralsConfig::spark_history_server_config].
15247    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/// Runtime information about workload execution.
15263#[derive(Clone, Default, PartialEq)]
15264#[non_exhaustive]
15265pub struct RuntimeInfo {
15266    /// Output only. Map of remote access endpoints (such as web interfaces and
15267    /// APIs) to their URIs.
15268    pub endpoints: std::collections::HashMap<std::string::String, std::string::String>,
15269
15270    /// Output only. A URI pointing to the location of the stdout and stderr of the
15271    /// workload.
15272    pub output_uri: std::string::String,
15273
15274    /// Output only. A URI pointing to the location of the diagnostics tarball.
15275    pub diagnostic_output_uri: std::string::String,
15276
15277    /// Output only. Approximate workload resource usage, calculated when
15278    /// the workload completes (see [Dataproc Serverless pricing]
15279    /// (<https://cloud.google.com/dataproc-serverless/pricing>)).
15280    ///
15281    /// **Note:** This metric calculation may change in the future, for
15282    /// example, to capture cumulative workload resource
15283    /// consumption during workload execution (see the
15284    /// [Dataproc Serverless release notes]
15285    /// (<https://cloud.google.com/dataproc-serverless/docs/release-notes>)
15286    /// for announcements, changes, fixes
15287    /// and other Dataproc developments).
15288    pub approximate_usage: std::option::Option<crate::model::UsageMetrics>,
15289
15290    /// Output only. Snapshot of current workload resource usage.
15291    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    /// Sets the value of [endpoints][crate::model::RuntimeInfo::endpoints].
15302    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    /// Sets the value of [output_uri][crate::model::RuntimeInfo::output_uri].
15314    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    /// Sets the value of [diagnostic_output_uri][crate::model::RuntimeInfo::diagnostic_output_uri].
15320    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    /// Sets the value of [approximate_usage][crate::model::RuntimeInfo::approximate_usage].
15329    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    /// Sets or clears the value of [approximate_usage][crate::model::RuntimeInfo::approximate_usage].
15338    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    /// Sets the value of [current_usage][crate::model::RuntimeInfo::current_usage].
15347    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    /// Sets or clears the value of [current_usage][crate::model::RuntimeInfo::current_usage].
15356    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/// Usage metrics represent approximate total resources consumed by a workload.
15372#[derive(Clone, Default, PartialEq)]
15373#[non_exhaustive]
15374pub struct UsageMetrics {
15375    /// Optional. DCU (Dataproc Compute Units) usage in (`milliDCU` x `seconds`)
15376    /// (see [Dataproc Serverless pricing]
15377    /// (<https://cloud.google.com/dataproc-serverless/pricing>)).
15378    pub milli_dcu_seconds: i64,
15379
15380    /// Optional. Shuffle storage usage in (`GB` x `seconds`) (see
15381    /// [Dataproc Serverless pricing]
15382    /// (<https://cloud.google.com/dataproc-serverless/pricing>)).
15383    pub shuffle_storage_gb_seconds: i64,
15384
15385    /// Optional. Accelerator usage in (`milliAccelerator` x `seconds`) (see
15386    /// [Dataproc Serverless pricing]
15387    /// (<https://cloud.google.com/dataproc-serverless/pricing>)).
15388    pub milli_accelerator_seconds: i64,
15389
15390    /// Optional. Accelerator type being used, if any
15391    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    /// Sets the value of [milli_dcu_seconds][crate::model::UsageMetrics::milli_dcu_seconds].
15402    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    /// Sets the value of [shuffle_storage_gb_seconds][crate::model::UsageMetrics::shuffle_storage_gb_seconds].
15408    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    /// Sets the value of [milli_accelerator_seconds][crate::model::UsageMetrics::milli_accelerator_seconds].
15414    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    /// Sets the value of [accelerator_type][crate::model::UsageMetrics::accelerator_type].
15420    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/// The usage snapshot represents the resources consumed by a workload at a
15436/// specified time.
15437#[derive(Clone, Default, PartialEq)]
15438#[non_exhaustive]
15439pub struct UsageSnapshot {
15440    /// Optional. Milli (one-thousandth) Dataproc Compute Units (DCUs) (see
15441    /// [Dataproc Serverless pricing]
15442    /// (<https://cloud.google.com/dataproc-serverless/pricing>)).
15443    pub milli_dcu: i64,
15444
15445    /// Optional. Shuffle Storage in gigabytes (GB). (see [Dataproc Serverless
15446    /// pricing] (<https://cloud.google.com/dataproc-serverless/pricing>))
15447    pub shuffle_storage_gb: i64,
15448
15449    /// Optional. Milli (one-thousandth) Dataproc Compute Units (DCUs) charged at
15450    /// premium tier (see [Dataproc Serverless pricing]
15451    /// (<https://cloud.google.com/dataproc-serverless/pricing>)).
15452    pub milli_dcu_premium: i64,
15453
15454    /// Optional. Shuffle Storage in gigabytes (GB) charged at premium tier. (see
15455    /// [Dataproc Serverless pricing]
15456    /// (<https://cloud.google.com/dataproc-serverless/pricing>))
15457    pub shuffle_storage_gb_premium: i64,
15458
15459    /// Optional. Milli (one-thousandth) accelerator. (see [Dataproc
15460    /// Serverless pricing] (<https://cloud.google.com/dataproc-serverless/pricing>))
15461    pub milli_accelerator: i64,
15462
15463    /// Optional. Accelerator type being used, if any
15464    pub accelerator_type: std::string::String,
15465
15466    /// Optional. The timestamp of the usage snapshot.
15467    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    /// Sets the value of [milli_dcu][crate::model::UsageSnapshot::milli_dcu].
15478    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    /// Sets the value of [shuffle_storage_gb][crate::model::UsageSnapshot::shuffle_storage_gb].
15484    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    /// Sets the value of [milli_dcu_premium][crate::model::UsageSnapshot::milli_dcu_premium].
15490    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    /// Sets the value of [shuffle_storage_gb_premium][crate::model::UsageSnapshot::shuffle_storage_gb_premium].
15496    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    /// Sets the value of [milli_accelerator][crate::model::UsageSnapshot::milli_accelerator].
15502    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    /// Sets the value of [accelerator_type][crate::model::UsageSnapshot::accelerator_type].
15508    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    /// Sets the value of [snapshot_time][crate::model::UsageSnapshot::snapshot_time].
15517    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    /// Sets or clears the value of [snapshot_time][crate::model::UsageSnapshot::snapshot_time].
15526    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/// The cluster's GKE config.
15542#[derive(Clone, Default, PartialEq)]
15543#[non_exhaustive]
15544pub struct GkeClusterConfig {
15545    /// Optional. A target GKE cluster to deploy to. It must be in the same project
15546    /// and region as the Dataproc cluster (the GKE cluster can be zonal or
15547    /// regional). Format:
15548    /// 'projects/{project}/locations/{location}/clusters/{cluster_id}'
15549    pub gke_cluster_target: std::string::String,
15550
15551    /// Optional. GKE node pools where workloads will be scheduled. At least one
15552    /// node pool must be assigned the `DEFAULT`
15553    /// [GkeNodePoolTarget.Role][google.cloud.dataproc.v1.GkeNodePoolTarget.Role].
15554    /// If a `GkeNodePoolTarget` is not specified, Dataproc constructs a `DEFAULT`
15555    /// `GkeNodePoolTarget`. Each role can be given to only one
15556    /// `GkeNodePoolTarget`. All node pools must have the same location settings.
15557    ///
15558    /// [google.cloud.dataproc.v1.GkeNodePoolTarget.Role]: crate::model::gke_node_pool_target::Role
15559    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    /// Sets the value of [gke_cluster_target][crate::model::GkeClusterConfig::gke_cluster_target].
15570    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    /// Sets the value of [node_pool_target][crate::model::GkeClusterConfig::node_pool_target].
15579    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/// The configuration for running the Dataproc cluster on Kubernetes.
15597#[derive(Clone, Default, PartialEq)]
15598#[non_exhaustive]
15599pub struct KubernetesClusterConfig {
15600    /// Optional. A namespace within the Kubernetes cluster to deploy into. If this
15601    /// namespace does not exist, it is created. If it exists, Dataproc verifies
15602    /// that another Dataproc VirtualCluster is not installed into it. If not
15603    /// specified, the name of the Dataproc Cluster is used.
15604    pub kubernetes_namespace: std::string::String,
15605
15606    /// Optional. The software configuration for this Dataproc cluster running on
15607    /// Kubernetes.
15608    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    /// Sets the value of [kubernetes_namespace][crate::model::KubernetesClusterConfig::kubernetes_namespace].
15621    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    /// Sets the value of [kubernetes_software_config][crate::model::KubernetesClusterConfig::kubernetes_software_config].
15630    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    /// Sets or clears the value of [kubernetes_software_config][crate::model::KubernetesClusterConfig::kubernetes_software_config].
15639    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    /// Sets the value of [config][crate::model::KubernetesClusterConfig::config].
15648    ///
15649    /// Note that all the setters affecting `config` are mutually
15650    /// exclusive.
15651    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    /// The value of [config][crate::model::KubernetesClusterConfig::config]
15662    /// if it holds a `GkeClusterConfig`, `None` if the field is not set or
15663    /// holds a different branch.
15664    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    /// Sets the value of [config][crate::model::KubernetesClusterConfig::config]
15677    /// to hold a `GkeClusterConfig`.
15678    ///
15679    /// Note that all the setters affecting `config` are
15680    /// mutually exclusive.
15681    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
15700/// Defines additional types related to [KubernetesClusterConfig].
15701pub 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        /// Required. The configuration for running the Dataproc cluster on GKE.
15709        GkeClusterConfig(std::boxed::Box<crate::model::GkeClusterConfig>),
15710    }
15711}
15712
15713/// The software configuration for this Dataproc cluster running on Kubernetes.
15714#[derive(Clone, Default, PartialEq)]
15715#[non_exhaustive]
15716pub struct KubernetesSoftwareConfig {
15717    /// The components that should be installed in this Dataproc cluster. The key
15718    /// must be a string from the KubernetesComponent enumeration. The value is
15719    /// the version of the software to be installed.
15720    /// At least one entry must be specified.
15721    pub component_version: std::collections::HashMap<std::string::String, std::string::String>,
15722
15723    /// The properties to set on daemon config files.
15724    ///
15725    /// Property keys are specified in `prefix:property` format, for example
15726    /// `spark:spark.kubernetes.container.image`. The following are supported
15727    /// prefixes and their mappings:
15728    ///
15729    /// * spark:  `spark-defaults.conf`
15730    ///
15731    /// For more information, see [Cluster
15732    /// properties](https://cloud.google.com/dataproc/docs/concepts/cluster-properties).
15733    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    /// Sets the value of [component_version][crate::model::KubernetesSoftwareConfig::component_version].
15744    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    /// Sets the value of [properties][crate::model::KubernetesSoftwareConfig::properties].
15756    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/// GKE node pools that Dataproc workloads run on.
15775#[derive(Clone, Default, PartialEq)]
15776#[non_exhaustive]
15777pub struct GkeNodePoolTarget {
15778    /// Required. The target GKE node pool.
15779    /// Format:
15780    /// 'projects/{project}/locations/{location}/clusters/{cluster}/nodePools/{node_pool}'
15781    pub node_pool: std::string::String,
15782
15783    /// Required. The roles associated with the GKE node pool.
15784    pub roles: std::vec::Vec<crate::model::gke_node_pool_target::Role>,
15785
15786    /// Input only. The configuration for the GKE node pool.
15787    ///
15788    /// If specified, Dataproc attempts to create a node pool with the
15789    /// specified shape. If one with the same name already exists, it is
15790    /// verified against all specified fields. If a field differs, the
15791    /// virtual cluster creation will fail.
15792    ///
15793    /// If omitted, any node pool with the specified name is used. If a
15794    /// node pool with the specified name does not exist, Dataproc create a
15795    /// node pool with default values.
15796    ///
15797    /// This is an input only field. It will not be returned by the API.
15798    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    /// Sets the value of [node_pool][crate::model::GkeNodePoolTarget::node_pool].
15809    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    /// Sets the value of [roles][crate::model::GkeNodePoolTarget::roles].
15815    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    /// Sets the value of [node_pool_config][crate::model::GkeNodePoolTarget::node_pool_config].
15826    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    /// Sets or clears the value of [node_pool_config][crate::model::GkeNodePoolTarget::node_pool_config].
15835    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
15850/// Defines additional types related to [GkeNodePoolTarget].
15851pub mod gke_node_pool_target {
15852    #[allow(unused_imports)]
15853    use super::*;
15854
15855    /// `Role` specifies the tasks that will run on the node pool. Roles can be
15856    /// specific to workloads. Exactly one
15857    /// [GkeNodePoolTarget][google.cloud.dataproc.v1.GkeNodePoolTarget] within the
15858    /// virtual cluster must have the `DEFAULT` role, which is used to run all
15859    /// workloads that are not associated with a node pool.
15860    ///
15861    /// [google.cloud.dataproc.v1.GkeNodePoolTarget]: crate::model::GkeNodePoolTarget
15862    ///
15863    /// # Working with unknown values
15864    ///
15865    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15866    /// additional enum variants at any time. Adding new variants is not considered
15867    /// a breaking change. Applications should write their code in anticipation of:
15868    ///
15869    /// - New values appearing in future releases of the client library, **and**
15870    /// - New values received dynamically, without application changes.
15871    ///
15872    /// Please consult the [Working with enums] section in the user guide for some
15873    /// guidelines.
15874    ///
15875    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15876    #[derive(Clone, Debug, PartialEq)]
15877    #[non_exhaustive]
15878    pub enum Role {
15879        /// Role is unspecified.
15880        Unspecified,
15881        /// At least one node pool must have the `DEFAULT` role.
15882        /// Work assigned to a role that is not associated with a node pool
15883        /// is assigned to the node pool with the `DEFAULT` role. For example,
15884        /// work assigned to the `CONTROLLER` role will be assigned to the node pool
15885        /// with the `DEFAULT` role if no node pool has the `CONTROLLER` role.
15886        Default,
15887        /// Run work associated with the Dataproc control plane (for example,
15888        /// controllers and webhooks). Very low resource requirements.
15889        Controller,
15890        /// Run work associated with a Spark driver of a job.
15891        SparkDriver,
15892        /// Run work associated with a Spark executor of a job.
15893        SparkExecutor,
15894        /// If set, the enum was initialized with an unknown value.
15895        ///
15896        /// Applications can examine the value using [Role::value] or
15897        /// [Role::name].
15898        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        /// Gets the enum value.
15911        ///
15912        /// Returns `None` if the enum contains an unknown value deserialized from
15913        /// the string representation of enums.
15914        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        /// Gets the enum value as a string.
15926        ///
15927        /// Returns `None` if the enum contains an unknown value deserialized from
15928        /// the integer representation of enums.
15929        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/// The configuration of a GKE node pool used by a [Dataproc-on-GKE
16014/// cluster](https://cloud.google.com/dataproc/docs/concepts/jobs/dataproc-gke#create-a-dataproc-on-gke-cluster).
16015#[derive(Clone, Default, PartialEq)]
16016#[non_exhaustive]
16017pub struct GkeNodePoolConfig {
16018    /// Optional. The node pool configuration.
16019    pub config: std::option::Option<crate::model::gke_node_pool_config::GkeNodeConfig>,
16020
16021    /// Optional. The list of Compute Engine
16022    /// [zones](https://cloud.google.com/compute/docs/zones#available) where
16023    /// node pool nodes associated with a Dataproc on GKE virtual cluster
16024    /// will be located.
16025    ///
16026    /// **Note:** All node pools associated with a virtual cluster
16027    /// must be located in the same region as the virtual cluster, and they must
16028    /// be located in the same zone within that region.
16029    ///
16030    /// If a location is not specified during node pool creation, Dataproc on GKE
16031    /// will choose the zone.
16032    pub locations: std::vec::Vec<std::string::String>,
16033
16034    /// Optional. The autoscaler configuration for this node pool. The autoscaler
16035    /// is enabled only when a valid configuration is present.
16036    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    /// Sets the value of [config][crate::model::GkeNodePoolConfig::config].
16048    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    /// Sets or clears the value of [config][crate::model::GkeNodePoolConfig::config].
16057    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    /// Sets the value of [locations][crate::model::GkeNodePoolConfig::locations].
16066    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    /// Sets the value of [autoscaling][crate::model::GkeNodePoolConfig::autoscaling].
16077    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    /// Sets or clears the value of [autoscaling][crate::model::GkeNodePoolConfig::autoscaling].
16086    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
16101/// Defines additional types related to [GkeNodePoolConfig].
16102pub mod gke_node_pool_config {
16103    #[allow(unused_imports)]
16104    use super::*;
16105
16106    /// Parameters that describe cluster nodes.
16107    #[derive(Clone, Default, PartialEq)]
16108    #[non_exhaustive]
16109    pub struct GkeNodeConfig {
16110        /// Optional. The name of a Compute Engine [machine
16111        /// type](https://cloud.google.com/compute/docs/machine-types).
16112        pub machine_type: std::string::String,
16113
16114        /// Optional. The number of local SSD disks to attach to the node, which is
16115        /// limited by the maximum number of disks allowable per zone (see [Adding
16116        /// Local SSDs](https://cloud.google.com/compute/docs/disks/local-ssd)).
16117        pub local_ssd_count: i32,
16118
16119        /// Optional. Whether the nodes are created as legacy [preemptible VM
16120        /// instances] (<https://cloud.google.com/compute/docs/instances/preemptible>).
16121        /// Also see
16122        /// [Spot][google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.spot]
16123        /// VMs, preemptible VM instances without a maximum lifetime. Legacy and Spot
16124        /// preemptible nodes cannot be used in a node pool with the `CONTROLLER`
16125        /// [role]
16126        /// (/dataproc/docs/reference/rest/v1/projects.regions.clusters#role)
16127        /// or in the DEFAULT node pool if the CONTROLLER role is not assigned (the
16128        /// DEFAULT node pool will assume the CONTROLLER role).
16129        ///
16130        /// [google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.spot]: crate::model::gke_node_pool_config::GkeNodeConfig::spot
16131        pub preemptible: bool,
16132
16133        /// Optional. A list of [hardware
16134        /// accelerators](https://cloud.google.com/compute/docs/gpus) to attach to
16135        /// each node.
16136        pub accelerators:
16137            std::vec::Vec<crate::model::gke_node_pool_config::GkeNodePoolAcceleratorConfig>,
16138
16139        /// Optional. [Minimum CPU
16140        /// platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform)
16141        /// to be used by this instance. The instance may be scheduled on the
16142        /// specified or a newer CPU platform. Specify the friendly names of CPU
16143        /// platforms, such as "Intel Haswell"` or Intel Sandy Bridge".
16144        pub min_cpu_platform: std::string::String,
16145
16146        /// Optional. The [Customer Managed Encryption Key (CMEK)]
16147        /// (<https://cloud.google.com/kubernetes-engine/docs/how-to/using-cmek>)
16148        /// used to encrypt the boot disk attached to each node in the node pool.
16149        /// Specify the key using the following format:
16150        /// \<code\>projects/\<var\>KEY_PROJECT_ID\</var\>/locations/\<var\>LOCATION\</var\>/keyRings/\<var\>RING_NAME\</var\>/cryptoKeys/\<var\>KEY_NAME\</var\>\</code\>.
16151        pub boot_disk_kms_key: std::string::String,
16152
16153        /// Optional. Whether the nodes are created as [Spot VM instances]
16154        /// (<https://cloud.google.com/compute/docs/instances/spot>).
16155        /// Spot VMs are the latest update to legacy
16156        /// [preemptible
16157        /// VMs][google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.preemptible].
16158        /// Spot VMs do not have a maximum lifetime. Legacy and Spot preemptible
16159        /// nodes cannot be used in a node pool with the `CONTROLLER`
16160        /// [role](/dataproc/docs/reference/rest/v1/projects.regions.clusters#role)
16161        /// or in the DEFAULT node pool if the CONTROLLER role is not assigned (the
16162        /// DEFAULT node pool will assume the CONTROLLER role).
16163        ///
16164        /// [google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.preemptible]: crate::model::gke_node_pool_config::GkeNodeConfig::preemptible
16165        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        /// Sets the value of [machine_type][crate::model::gke_node_pool_config::GkeNodeConfig::machine_type].
16176        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        /// Sets the value of [local_ssd_count][crate::model::gke_node_pool_config::GkeNodeConfig::local_ssd_count].
16185        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        /// Sets the value of [preemptible][crate::model::gke_node_pool_config::GkeNodeConfig::preemptible].
16191        pub fn set_preemptible<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16192            self.preemptible = v.into();
16193            self
16194        }
16195
16196        /// Sets the value of [accelerators][crate::model::gke_node_pool_config::GkeNodeConfig::accelerators].
16197        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        /// Sets the value of [min_cpu_platform][crate::model::gke_node_pool_config::GkeNodeConfig::min_cpu_platform].
16208        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        /// Sets the value of [boot_disk_kms_key][crate::model::gke_node_pool_config::GkeNodeConfig::boot_disk_kms_key].
16217        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        /// Sets the value of [spot][crate::model::gke_node_pool_config::GkeNodeConfig::spot].
16226        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    /// A GkeNodeConfigAcceleratorConfig represents a Hardware Accelerator request
16239    /// for a node pool.
16240    #[derive(Clone, Default, PartialEq)]
16241    #[non_exhaustive]
16242    pub struct GkeNodePoolAcceleratorConfig {
16243        /// The number of accelerator cards exposed to an instance.
16244        pub accelerator_count: i64,
16245
16246        /// The accelerator type resource namename (see GPUs on Compute Engine).
16247        pub accelerator_type: std::string::String,
16248
16249        /// Size of partitions to create on the GPU. Valid values are described in
16250        /// the NVIDIA [mig user
16251        /// guide](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/#partitioning).
16252        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        /// Sets the value of [accelerator_count][crate::model::gke_node_pool_config::GkeNodePoolAcceleratorConfig::accelerator_count].
16263        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        /// Sets the value of [accelerator_type][crate::model::gke_node_pool_config::GkeNodePoolAcceleratorConfig::accelerator_type].
16269        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        /// Sets the value of [gpu_partition_size][crate::model::gke_node_pool_config::GkeNodePoolAcceleratorConfig::gpu_partition_size].
16278        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    /// GkeNodePoolAutoscaling contains information the cluster autoscaler needs to
16294    /// adjust the size of the node pool to the current cluster usage.
16295    #[derive(Clone, Default, PartialEq)]
16296    #[non_exhaustive]
16297    pub struct GkeNodePoolAutoscalingConfig {
16298        /// The minimum number of nodes in the node pool. Must be >= 0 and <=
16299        /// max_node_count.
16300        pub min_node_count: i32,
16301
16302        /// The maximum number of nodes in the node pool. Must be >= min_node_count,
16303        /// and must be > 0.
16304        /// **Note:** Quota must be sufficient to scale up the cluster.
16305        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        /// Sets the value of [min_node_count][crate::model::gke_node_pool_config::GkeNodePoolAutoscalingConfig::min_node_count].
16316        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        /// Sets the value of [max_node_count][crate::model::gke_node_pool_config::GkeNodePoolAutoscalingConfig::max_node_count].
16322        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/// Authentication configuration for a workload is used to set the default
16336/// identity for the workload execution.
16337/// The config specifies the type of identity (service account or user) that
16338/// will be used by workloads to access resources on the project(s).
16339#[derive(Clone, Default, PartialEq)]
16340#[non_exhaustive]
16341pub struct AuthenticationConfig {
16342    /// Optional. Authentication type for the user workload running in containers.
16343    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    /// Sets the value of [user_workload_authentication_type][crate::model::AuthenticationConfig::user_workload_authentication_type].
16354    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
16371/// Defines additional types related to [AuthenticationConfig].
16372pub mod authentication_config {
16373    #[allow(unused_imports)]
16374    use super::*;
16375
16376    /// Authentication types for workload execution.
16377    ///
16378    /// # Working with unknown values
16379    ///
16380    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16381    /// additional enum variants at any time. Adding new variants is not considered
16382    /// a breaking change. Applications should write their code in anticipation of:
16383    ///
16384    /// - New values appearing in future releases of the client library, **and**
16385    /// - New values received dynamically, without application changes.
16386    ///
16387    /// Please consult the [Working with enums] section in the user guide for some
16388    /// guidelines.
16389    ///
16390    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16391    #[derive(Clone, Debug, PartialEq)]
16392    #[non_exhaustive]
16393    pub enum AuthenticationType {
16394        /// If AuthenticationType is unspecified then END_USER_CREDENTIALS is used
16395        /// for 3.0 and newer runtimes, and SERVICE_ACCOUNT is used for older
16396        /// runtimes.
16397        Unspecified,
16398        /// Use service account credentials for authenticating to other services.
16399        ServiceAccount,
16400        /// Use OAuth credentials associated with the workload creator/user for
16401        /// authenticating to other services.
16402        EndUserCredentials,
16403        /// If set, the enum was initialized with an unknown value.
16404        ///
16405        /// Applications can examine the value using [AuthenticationType::value] or
16406        /// [AuthenticationType::name].
16407        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        /// Gets the enum value.
16420        ///
16421        /// Returns `None` if the enum contains an unknown value deserialized from
16422        /// the string representation of enums.
16423        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        /// Gets the enum value as a string.
16433        ///
16434        /// Returns `None` if the enum contains an unknown value deserialized from
16435        /// the integer representation of enums.
16436        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/// Autotuning configuration of the workload.
16513#[derive(Clone, Default, PartialEq)]
16514#[non_exhaustive]
16515pub struct AutotuningConfig {
16516    /// Optional. Scenarios for which tunings are applied.
16517    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    /// Sets the value of [scenarios][crate::model::AutotuningConfig::scenarios].
16528    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
16545/// Defines additional types related to [AutotuningConfig].
16546pub mod autotuning_config {
16547    #[allow(unused_imports)]
16548    use super::*;
16549
16550    /// Scenario represents a specific goal that autotuning will attempt to achieve
16551    /// by modifying workloads.
16552    ///
16553    /// # Working with unknown values
16554    ///
16555    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16556    /// additional enum variants at any time. Adding new variants is not considered
16557    /// a breaking change. Applications should write their code in anticipation of:
16558    ///
16559    /// - New values appearing in future releases of the client library, **and**
16560    /// - New values received dynamically, without application changes.
16561    ///
16562    /// Please consult the [Working with enums] section in the user guide for some
16563    /// guidelines.
16564    ///
16565    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16566    #[derive(Clone, Debug, PartialEq)]
16567    #[non_exhaustive]
16568    pub enum Scenario {
16569        /// Default value.
16570        Unspecified,
16571        /// Scaling recommendations such as initialExecutors.
16572        Scaling,
16573        /// Adding hints for potential relation broadcasts.
16574        BroadcastHashJoin,
16575        /// Memory management for workloads.
16576        Memory,
16577        /// No autotuning.
16578        None,
16579        /// Automatic selection of scenarios.
16580        Auto,
16581        /// If set, the enum was initialized with an unknown value.
16582        ///
16583        /// Applications can examine the value using [Scenario::value] or
16584        /// [Scenario::name].
16585        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        /// Gets the enum value.
16598        ///
16599        /// Returns `None` if the enum contains an unknown value deserialized from
16600        /// the string representation of enums.
16601        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        /// Gets the enum value as a string.
16614        ///
16615        /// Returns `None` if the enum contains an unknown value deserialized from
16616        /// the integer representation of enums.
16617        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/// Configuration for dependency repositories
16706#[derive(Clone, Default, PartialEq)]
16707#[non_exhaustive]
16708pub struct RepositoryConfig {
16709    /// Optional. Configuration for PyPi repository.
16710    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    /// Sets the value of [pypi_repository_config][crate::model::RepositoryConfig::pypi_repository_config].
16721    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    /// Sets or clears the value of [pypi_repository_config][crate::model::RepositoryConfig::pypi_repository_config].
16730    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/// Configuration for PyPi repository
16746#[derive(Clone, Default, PartialEq)]
16747#[non_exhaustive]
16748pub struct PyPiRepositoryConfig {
16749    /// Optional. PyPi repository address
16750    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    /// Sets the value of [pypi_repository][crate::model::PyPiRepositoryConfig::pypi_repository].
16761    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/// A Dataproc workflow template resource.
16774#[derive(Clone, Default, PartialEq)]
16775#[non_exhaustive]
16776pub struct WorkflowTemplate {
16777    pub id: std::string::String,
16778
16779    /// Output only. The resource name of the workflow template, as described
16780    /// in <https://cloud.google.com/apis/design/resource_names>.
16781    ///
16782    /// * For `projects.regions.workflowTemplates`, the resource name of the
16783    ///   template has the following format:
16784    ///   `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
16785    ///
16786    /// * For `projects.locations.workflowTemplates`, the resource name of the
16787    ///   template has the following format:
16788    ///   `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
16789    ///
16790    pub name: std::string::String,
16791
16792    /// Optional. Used to perform a consistent read-modify-write.
16793    ///
16794    /// This field should be left blank for a `CreateWorkflowTemplate` request. It
16795    /// is required for an `UpdateWorkflowTemplate` request, and must match the
16796    /// current server version. A typical update template flow would fetch the
16797    /// current template with a `GetWorkflowTemplate` request, which will return
16798    /// the current template with the `version` field filled in with the
16799    /// current server version. The user updates other fields in the template,
16800    /// then returns it as part of the `UpdateWorkflowTemplate` request.
16801    pub version: i32,
16802
16803    /// Output only. The time template was created.
16804    pub create_time: std::option::Option<wkt::Timestamp>,
16805
16806    /// Output only. The time template was last updated.
16807    pub update_time: std::option::Option<wkt::Timestamp>,
16808
16809    /// Optional. The labels to associate with this template. These labels
16810    /// will be propagated to all jobs and clusters created by the workflow
16811    /// instance.
16812    ///
16813    /// Label **keys** must contain 1 to 63 characters, and must conform to
16814    /// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
16815    ///
16816    /// Label **values** may be empty, but, if present, must contain 1 to 63
16817    /// characters, and must conform to
16818    /// [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
16819    ///
16820    /// No more than 32 labels can be associated with a template.
16821    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
16822
16823    /// Required. WorkflowTemplate scheduling information.
16824    pub placement: std::option::Option<crate::model::WorkflowTemplatePlacement>,
16825
16826    /// Required. The Directed Acyclic Graph of Jobs to submit.
16827    pub jobs: std::vec::Vec<crate::model::OrderedJob>,
16828
16829    /// Optional. Template parameters whose values are substituted into the
16830    /// template. Values for parameters must be provided when the template is
16831    /// instantiated.
16832    pub parameters: std::vec::Vec<crate::model::TemplateParameter>,
16833
16834    /// Optional. Timeout duration for the DAG of jobs, expressed in seconds (see
16835    /// [JSON representation of
16836    /// duration](https://developers.google.com/protocol-buffers/docs/proto3#json)).
16837    /// The timeout duration must be from 10 minutes ("600s") to 24 hours
16838    /// ("86400s"). The timer begins when the first job is submitted. If the
16839    /// workflow is running at the end of the timeout period, any remaining jobs
16840    /// are cancelled, the workflow is ended, and if the workflow was running on a
16841    /// [managed
16842    /// cluster](/dataproc/docs/concepts/workflows/using-workflows#configuring_or_selecting_a_cluster),
16843    /// the cluster is deleted.
16844    pub dag_timeout: std::option::Option<wkt::Duration>,
16845
16846    /// Optional. Encryption settings for encrypting workflow template job
16847    /// arguments.
16848    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    /// Sets the value of [id][crate::model::WorkflowTemplate::id].
16859    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    /// Sets the value of [name][crate::model::WorkflowTemplate::name].
16865    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    /// Sets the value of [version][crate::model::WorkflowTemplate::version].
16871    pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16872        self.version = v.into();
16873        self
16874    }
16875
16876    /// Sets the value of [create_time][crate::model::WorkflowTemplate::create_time].
16877    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    /// Sets or clears the value of [create_time][crate::model::WorkflowTemplate::create_time].
16886    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    /// Sets the value of [update_time][crate::model::WorkflowTemplate::update_time].
16895    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    /// Sets or clears the value of [update_time][crate::model::WorkflowTemplate::update_time].
16904    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    /// Sets the value of [labels][crate::model::WorkflowTemplate::labels].
16913    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    /// Sets the value of [placement][crate::model::WorkflowTemplate::placement].
16925    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    /// Sets or clears the value of [placement][crate::model::WorkflowTemplate::placement].
16934    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    /// Sets the value of [jobs][crate::model::WorkflowTemplate::jobs].
16943    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    /// Sets the value of [parameters][crate::model::WorkflowTemplate::parameters].
16954    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    /// Sets the value of [dag_timeout][crate::model::WorkflowTemplate::dag_timeout].
16965    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    /// Sets or clears the value of [dag_timeout][crate::model::WorkflowTemplate::dag_timeout].
16974    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    /// Sets the value of [encryption_config][crate::model::WorkflowTemplate::encryption_config].
16983    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    /// Sets or clears the value of [encryption_config][crate::model::WorkflowTemplate::encryption_config].
16992    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
17007/// Defines additional types related to [WorkflowTemplate].
17008pub mod workflow_template {
17009    #[allow(unused_imports)]
17010    use super::*;
17011
17012    /// Encryption settings for encrypting workflow template job arguments.
17013    #[derive(Clone, Default, PartialEq)]
17014    #[non_exhaustive]
17015    pub struct EncryptionConfig {
17016        /// Optional. The Cloud KMS key name to use for encrypting
17017        /// workflow template job arguments.
17018        ///
17019        /// When this this key is provided, the following workflow template
17020        /// [job arguments]
17021        /// (<https://cloud.google.com/dataproc/docs/concepts/workflows/use-workflows#adding_jobs_to_a_template>),
17022        /// if present, are
17023        /// [CMEK
17024        /// encrypted](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/customer-managed-encryption#use_cmek_with_workflow_template_data):
17025        ///
17026        /// * [FlinkJob
17027        ///   args](https://cloud.google.com/dataproc/docs/reference/rest/v1/FlinkJob)
17028        /// * [HadoopJob
17029        ///   args](https://cloud.google.com/dataproc/docs/reference/rest/v1/HadoopJob)
17030        /// * [SparkJob
17031        ///   args](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkJob)
17032        /// * [SparkRJob
17033        ///   args](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkRJob)
17034        /// * [PySparkJob
17035        ///   args](https://cloud.google.com/dataproc/docs/reference/rest/v1/PySparkJob)
17036        /// * [SparkSqlJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkSqlJob)
17037        ///   scriptVariables and queryList.queries
17038        /// * [HiveJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/HiveJob)
17039        ///   scriptVariables and queryList.queries
17040        /// * [PigJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/PigJob)
17041        ///   scriptVariables and queryList.queries
17042        /// * [PrestoJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/PrestoJob)
17043        ///   scriptVariables and queryList.queries
17044        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        /// Sets the value of [kms_key][crate::model::workflow_template::EncryptionConfig::kms_key].
17055        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/// Specifies workflow execution target.
17069///
17070/// Either `managed_cluster` or `cluster_selector` is required.
17071#[derive(Clone, Default, PartialEq)]
17072#[non_exhaustive]
17073pub struct WorkflowTemplatePlacement {
17074    /// Required. Specifies where workflow executes; either on a managed
17075    /// cluster or an existing cluster chosen by labels.
17076    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    /// Sets the value of [placement][crate::model::WorkflowTemplatePlacement::placement].
17087    ///
17088    /// Note that all the setters affecting `placement` are mutually
17089    /// exclusive.
17090    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    /// The value of [placement][crate::model::WorkflowTemplatePlacement::placement]
17103    /// if it holds a `ManagedCluster`, `None` if the field is not set or
17104    /// holds a different branch.
17105    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    /// Sets the value of [placement][crate::model::WorkflowTemplatePlacement::placement]
17118    /// to hold a `ManagedCluster`.
17119    ///
17120    /// Note that all the setters affecting `placement` are
17121    /// mutually exclusive.
17122    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    /// The value of [placement][crate::model::WorkflowTemplatePlacement::placement]
17135    /// if it holds a `ClusterSelector`, `None` if the field is not set or
17136    /// holds a different branch.
17137    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    /// Sets the value of [placement][crate::model::WorkflowTemplatePlacement::placement]
17150    /// to hold a `ClusterSelector`.
17151    ///
17152    /// Note that all the setters affecting `placement` are
17153    /// mutually exclusive.
17154    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
17173/// Defines additional types related to [WorkflowTemplatePlacement].
17174pub mod workflow_template_placement {
17175    #[allow(unused_imports)]
17176    use super::*;
17177
17178    /// Required. Specifies where workflow executes; either on a managed
17179    /// cluster or an existing cluster chosen by labels.
17180    #[derive(Clone, Debug, PartialEq)]
17181    #[non_exhaustive]
17182    pub enum Placement {
17183        /// A cluster that is managed by the workflow.
17184        ManagedCluster(std::boxed::Box<crate::model::ManagedCluster>),
17185        /// Optional. A selector that chooses target cluster for jobs based
17186        /// on metadata.
17187        ///
17188        /// The selector is evaluated at the time each job is submitted.
17189        ClusterSelector(std::boxed::Box<crate::model::ClusterSelector>),
17190    }
17191}
17192
17193/// Cluster that is managed by the workflow.
17194#[derive(Clone, Default, PartialEq)]
17195#[non_exhaustive]
17196pub struct ManagedCluster {
17197    /// Required. The cluster name prefix. A unique cluster name will be formed by
17198    /// appending a random suffix.
17199    ///
17200    /// The name must contain only lower-case letters (a-z), numbers (0-9),
17201    /// and hyphens (-). Must begin with a letter. Cannot begin or end with
17202    /// hyphen. Must consist of between 2 and 35 characters.
17203    pub cluster_name: std::string::String,
17204
17205    /// Required. The cluster configuration.
17206    pub config: std::option::Option<crate::model::ClusterConfig>,
17207
17208    /// Optional. The labels to associate with this cluster.
17209    ///
17210    /// Label keys must be between 1 and 63 characters long, and must conform to
17211    /// the following PCRE regular expression:
17212    /// [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}
17213    ///
17214    /// Label values must be between 1 and 63 characters long, and must conform to
17215    /// the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63}
17216    ///
17217    /// No more than 32 labels can be associated with a given cluster.
17218    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    /// Sets the value of [cluster_name][crate::model::ManagedCluster::cluster_name].
17229    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    /// Sets the value of [config][crate::model::ManagedCluster::config].
17235    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    /// Sets or clears the value of [config][crate::model::ManagedCluster::config].
17244    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    /// Sets the value of [labels][crate::model::ManagedCluster::labels].
17253    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/// A selector that chooses target cluster for jobs based on metadata.
17272#[derive(Clone, Default, PartialEq)]
17273#[non_exhaustive]
17274pub struct ClusterSelector {
17275    /// Optional. The zone where workflow process executes. This parameter does not
17276    /// affect the selection of the cluster.
17277    ///
17278    /// If unspecified, the zone of the first cluster matching the selector
17279    /// is used.
17280    pub zone: std::string::String,
17281
17282    /// Required. The cluster labels. Cluster must have all labels
17283    /// to match.
17284    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    /// Sets the value of [zone][crate::model::ClusterSelector::zone].
17295    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    /// Sets the value of [cluster_labels][crate::model::ClusterSelector::cluster_labels].
17301    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/// A job executed by the workflow.
17320#[derive(Clone, Default, PartialEq)]
17321#[non_exhaustive]
17322pub struct OrderedJob {
17323    /// Required. The step id. The id must be unique among all jobs
17324    /// within the template.
17325    ///
17326    /// The step id is used as prefix for job id, as job
17327    /// `goog-dataproc-workflow-step-id` label, and in
17328    /// [prerequisiteStepIds][google.cloud.dataproc.v1.OrderedJob.prerequisite_step_ids]
17329    /// field from other steps.
17330    ///
17331    /// The id must contain only letters (a-z, A-Z), numbers (0-9),
17332    /// underscores (_), and hyphens (-). Cannot begin or end with underscore
17333    /// or hyphen. Must consist of between 3 and 50 characters.
17334    ///
17335    /// [google.cloud.dataproc.v1.OrderedJob.prerequisite_step_ids]: crate::model::OrderedJob::prerequisite_step_ids
17336    pub step_id: std::string::String,
17337
17338    /// Optional. The labels to associate with this job.
17339    ///
17340    /// Label keys must be between 1 and 63 characters long, and must conform to
17341    /// the following regular expression:
17342    /// [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}
17343    ///
17344    /// Label values must be between 1 and 63 characters long, and must conform to
17345    /// the following regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63}
17346    ///
17347    /// No more than 32 labels can be associated with a given job.
17348    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
17349
17350    /// Optional. Job scheduling configuration.
17351    pub scheduling: std::option::Option<crate::model::JobScheduling>,
17352
17353    /// Optional. The optional list of prerequisite job step_ids.
17354    /// If not specified, the job will start at the beginning of workflow.
17355    pub prerequisite_step_ids: std::vec::Vec<std::string::String>,
17356
17357    /// Required. The job definition.
17358    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    /// Sets the value of [step_id][crate::model::OrderedJob::step_id].
17369    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    /// Sets the value of [labels][crate::model::OrderedJob::labels].
17375    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    /// Sets the value of [scheduling][crate::model::OrderedJob::scheduling].
17387    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    /// Sets or clears the value of [scheduling][crate::model::OrderedJob::scheduling].
17396    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    /// Sets the value of [prerequisite_step_ids][crate::model::OrderedJob::prerequisite_step_ids].
17405    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    /// Sets the value of [job_type][crate::model::OrderedJob::job_type].
17416    ///
17417    /// Note that all the setters affecting `job_type` are mutually
17418    /// exclusive.
17419    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    /// The value of [job_type][crate::model::OrderedJob::job_type]
17430    /// if it holds a `HadoopJob`, `None` if the field is not set or
17431    /// holds a different branch.
17432    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    /// Sets the value of [job_type][crate::model::OrderedJob::job_type]
17441    /// to hold a `HadoopJob`.
17442    ///
17443    /// Note that all the setters affecting `job_type` are
17444    /// mutually exclusive.
17445    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    /// The value of [job_type][crate::model::OrderedJob::job_type]
17455    /// if it holds a `SparkJob`, `None` if the field is not set or
17456    /// holds a different branch.
17457    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    /// Sets the value of [job_type][crate::model::OrderedJob::job_type]
17466    /// to hold a `SparkJob`.
17467    ///
17468    /// Note that all the setters affecting `job_type` are
17469    /// mutually exclusive.
17470    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    /// The value of [job_type][crate::model::OrderedJob::job_type]
17480    /// if it holds a `PysparkJob`, `None` if the field is not set or
17481    /// holds a different branch.
17482    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    /// Sets the value of [job_type][crate::model::OrderedJob::job_type]
17491    /// to hold a `PysparkJob`.
17492    ///
17493    /// Note that all the setters affecting `job_type` are
17494    /// mutually exclusive.
17495    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    /// The value of [job_type][crate::model::OrderedJob::job_type]
17505    /// if it holds a `HiveJob`, `None` if the field is not set or
17506    /// holds a different branch.
17507    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    /// Sets the value of [job_type][crate::model::OrderedJob::job_type]
17516    /// to hold a `HiveJob`.
17517    ///
17518    /// Note that all the setters affecting `job_type` are
17519    /// mutually exclusive.
17520    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    /// The value of [job_type][crate::model::OrderedJob::job_type]
17530    /// if it holds a `PigJob`, `None` if the field is not set or
17531    /// holds a different branch.
17532    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    /// Sets the value of [job_type][crate::model::OrderedJob::job_type]
17541    /// to hold a `PigJob`.
17542    ///
17543    /// Note that all the setters affecting `job_type` are
17544    /// mutually exclusive.
17545    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    /// The value of [job_type][crate::model::OrderedJob::job_type]
17555    /// if it holds a `SparkRJob`, `None` if the field is not set or
17556    /// holds a different branch.
17557    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    /// Sets the value of [job_type][crate::model::OrderedJob::job_type]
17566    /// to hold a `SparkRJob`.
17567    ///
17568    /// Note that all the setters affecting `job_type` are
17569    /// mutually exclusive.
17570    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    /// The value of [job_type][crate::model::OrderedJob::job_type]
17580    /// if it holds a `SparkSqlJob`, `None` if the field is not set or
17581    /// holds a different branch.
17582    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    /// Sets the value of [job_type][crate::model::OrderedJob::job_type]
17593    /// to hold a `SparkSqlJob`.
17594    ///
17595    /// Note that all the setters affecting `job_type` are
17596    /// mutually exclusive.
17597    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    /// The value of [job_type][crate::model::OrderedJob::job_type]
17607    /// if it holds a `PrestoJob`, `None` if the field is not set or
17608    /// holds a different branch.
17609    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    /// Sets the value of [job_type][crate::model::OrderedJob::job_type]
17618    /// to hold a `PrestoJob`.
17619    ///
17620    /// Note that all the setters affecting `job_type` are
17621    /// mutually exclusive.
17622    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    /// The value of [job_type][crate::model::OrderedJob::job_type]
17632    /// if it holds a `TrinoJob`, `None` if the field is not set or
17633    /// holds a different branch.
17634    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    /// Sets the value of [job_type][crate::model::OrderedJob::job_type]
17643    /// to hold a `TrinoJob`.
17644    ///
17645    /// Note that all the setters affecting `job_type` are
17646    /// mutually exclusive.
17647    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    /// The value of [job_type][crate::model::OrderedJob::job_type]
17657    /// if it holds a `FlinkJob`, `None` if the field is not set or
17658    /// holds a different branch.
17659    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    /// Sets the value of [job_type][crate::model::OrderedJob::job_type]
17668    /// to hold a `FlinkJob`.
17669    ///
17670    /// Note that all the setters affecting `job_type` are
17671    /// mutually exclusive.
17672    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
17688/// Defines additional types related to [OrderedJob].
17689pub mod ordered_job {
17690    #[allow(unused_imports)]
17691    use super::*;
17692
17693    /// Required. The job definition.
17694    #[derive(Clone, Debug, PartialEq)]
17695    #[non_exhaustive]
17696    pub enum JobType {
17697        /// Optional. Job is a Hadoop job.
17698        HadoopJob(std::boxed::Box<crate::model::HadoopJob>),
17699        /// Optional. Job is a Spark job.
17700        SparkJob(std::boxed::Box<crate::model::SparkJob>),
17701        /// Optional. Job is a PySpark job.
17702        PysparkJob(std::boxed::Box<crate::model::PySparkJob>),
17703        /// Optional. Job is a Hive job.
17704        HiveJob(std::boxed::Box<crate::model::HiveJob>),
17705        /// Optional. Job is a Pig job.
17706        PigJob(std::boxed::Box<crate::model::PigJob>),
17707        /// Optional. Job is a SparkR job.
17708        SparkRJob(std::boxed::Box<crate::model::SparkRJob>),
17709        /// Optional. Job is a SparkSql job.
17710        SparkSqlJob(std::boxed::Box<crate::model::SparkSqlJob>),
17711        /// Optional. Job is a Presto job.
17712        PrestoJob(std::boxed::Box<crate::model::PrestoJob>),
17713        /// Optional. Job is a Trino job.
17714        TrinoJob(std::boxed::Box<crate::model::TrinoJob>),
17715        /// Optional. Job is a Flink job.
17716        FlinkJob(std::boxed::Box<crate::model::FlinkJob>),
17717    }
17718}
17719
17720/// A configurable parameter that replaces one or more fields in the template.
17721/// Parameterizable fields:
17722///
17723/// - Labels
17724/// - File uris
17725/// - Job properties
17726/// - Job arguments
17727/// - Script variables
17728/// - Main class (in HadoopJob and SparkJob)
17729/// - Zone (in ClusterSelector)
17730#[derive(Clone, Default, PartialEq)]
17731#[non_exhaustive]
17732pub struct TemplateParameter {
17733    /// Required. Parameter name.
17734    /// The parameter name is used as the key, and paired with the
17735    /// parameter value, which are passed to the template when the template
17736    /// is instantiated.
17737    /// The name must contain only capital letters (A-Z), numbers (0-9), and
17738    /// underscores (_), and must not start with a number. The maximum length is
17739    /// 40 characters.
17740    pub name: std::string::String,
17741
17742    /// Required. Paths to all fields that the parameter replaces.
17743    /// A field is allowed to appear in at most one parameter's list of field
17744    /// paths.
17745    ///
17746    /// A field path is similar in syntax to a
17747    /// [google.protobuf.FieldMask][google.protobuf.FieldMask]. For example, a
17748    /// field path that references the zone field of a workflow template's cluster
17749    /// selector would be specified as `placement.clusterSelector.zone`.
17750    ///
17751    /// Also, field paths can reference fields using the following syntax:
17752    ///
17753    /// * Values in maps can be referenced by key:
17754    ///
17755    ///   * labels['key']
17756    ///   * placement.clusterSelector.clusterLabels['key']
17757    ///   * placement.managedCluster.labels['key']
17758    ///   * placement.clusterSelector.clusterLabels['key']
17759    ///   * jobs['step-id'].labels['key']
17760    /// * Jobs in the jobs list can be referenced by step-id:
17761    ///
17762    ///   * jobs['step-id'].hadoopJob.mainJarFileUri
17763    ///   * jobs['step-id'].hiveJob.queryFileUri
17764    ///   * jobs['step-id'].pySparkJob.mainPythonFileUri
17765    ///   * jobs['step-id'].hadoopJob.jarFileUris[0]
17766    ///   * jobs['step-id'].hadoopJob.archiveUris[0]
17767    ///   * jobs['step-id'].hadoopJob.fileUris[0]
17768    ///   * jobs['step-id'].pySparkJob.pythonFileUris[0]
17769    /// * Items in repeated fields can be referenced by a zero-based index:
17770    ///
17771    ///   * jobs['step-id'].sparkJob.args[0]
17772    /// * Other examples:
17773    ///
17774    ///   * jobs['step-id'].hadoopJob.properties['key']
17775    ///   * jobs['step-id'].hadoopJob.args[0]
17776    ///   * jobs['step-id'].hiveJob.scriptVariables['key']
17777    ///   * jobs['step-id'].hadoopJob.mainJarFileUri
17778    ///   * placement.clusterSelector.zone
17779    ///
17780    /// It may not be possible to parameterize maps and repeated fields in their
17781    /// entirety since only individual map values and individual items in repeated
17782    /// fields can be referenced. For example, the following field paths are
17783    /// invalid:
17784    ///
17785    /// - placement.clusterSelector.clusterLabels
17786    /// - jobs['step-id'].sparkJob.args
17787    ///
17788    /// [google.protobuf.FieldMask]: wkt::FieldMask
17789    pub fields: std::vec::Vec<std::string::String>,
17790
17791    /// Optional. Brief description of the parameter.
17792    /// Must not exceed 1024 characters.
17793    pub description: std::string::String,
17794
17795    /// Optional. Validation rules to be applied to this parameter's value.
17796    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    /// Sets the value of [name][crate::model::TemplateParameter::name].
17807    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    /// Sets the value of [fields][crate::model::TemplateParameter::fields].
17813    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    /// Sets the value of [description][crate::model::TemplateParameter::description].
17824    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    /// Sets the value of [validation][crate::model::TemplateParameter::validation].
17830    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    /// Sets or clears the value of [validation][crate::model::TemplateParameter::validation].
17839    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/// Configuration for parameter validation.
17855#[derive(Clone, Default, PartialEq)]
17856#[non_exhaustive]
17857pub struct ParameterValidation {
17858    /// Required. The type of validation to be performed.
17859    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    /// Sets the value of [validation_type][crate::model::ParameterValidation::validation_type].
17870    ///
17871    /// Note that all the setters affecting `validation_type` are mutually
17872    /// exclusive.
17873    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    /// The value of [validation_type][crate::model::ParameterValidation::validation_type]
17884    /// if it holds a `Regex`, `None` if the field is not set or
17885    /// holds a different branch.
17886    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    /// Sets the value of [validation_type][crate::model::ParameterValidation::validation_type]
17897    /// to hold a `Regex`.
17898    ///
17899    /// Note that all the setters affecting `validation_type` are
17900    /// mutually exclusive.
17901    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    /// The value of [validation_type][crate::model::ParameterValidation::validation_type]
17912    /// if it holds a `Values`, `None` if the field is not set or
17913    /// holds a different branch.
17914    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    /// Sets the value of [validation_type][crate::model::ParameterValidation::validation_type]
17925    /// to hold a `Values`.
17926    ///
17927    /// Note that all the setters affecting `validation_type` are
17928    /// mutually exclusive.
17929    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
17946/// Defines additional types related to [ParameterValidation].
17947pub mod parameter_validation {
17948    #[allow(unused_imports)]
17949    use super::*;
17950
17951    /// Required. The type of validation to be performed.
17952    #[derive(Clone, Debug, PartialEq)]
17953    #[non_exhaustive]
17954    pub enum ValidationType {
17955        /// Validation based on regular expressions.
17956        Regex(std::boxed::Box<crate::model::RegexValidation>),
17957        /// Validation based on a list of allowed values.
17958        Values(std::boxed::Box<crate::model::ValueValidation>),
17959    }
17960}
17961
17962/// Validation based on regular expressions.
17963#[derive(Clone, Default, PartialEq)]
17964#[non_exhaustive]
17965pub struct RegexValidation {
17966    /// Required. RE2 regular expressions used to validate the parameter's value.
17967    /// The value must match the regex in its entirety (substring
17968    /// matches are not sufficient).
17969    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    /// Sets the value of [regexes][crate::model::RegexValidation::regexes].
17980    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/// Validation based on a list of allowed values.
17998#[derive(Clone, Default, PartialEq)]
17999#[non_exhaustive]
18000pub struct ValueValidation {
18001    /// Required. List of allowed values for the parameter.
18002    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    /// Sets the value of [values][crate::model::ValueValidation::values].
18013    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/// A Dataproc workflow template resource.
18031#[derive(Clone, Default, PartialEq)]
18032#[non_exhaustive]
18033pub struct WorkflowMetadata {
18034    /// Output only. The resource name of the workflow template as described
18035    /// in <https://cloud.google.com/apis/design/resource_names>.
18036    ///
18037    /// * For `projects.regions.workflowTemplates`, the resource name of the
18038    ///   template has the following format:
18039    ///   `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
18040    ///
18041    /// * For `projects.locations.workflowTemplates`, the resource name of the
18042    ///   template has the following format:
18043    ///   `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
18044    ///
18045    pub template: std::string::String,
18046
18047    /// Output only. The version of template at the time of
18048    /// workflow instantiation.
18049    pub version: i32,
18050
18051    /// Output only. The create cluster operation metadata.
18052    pub create_cluster: std::option::Option<crate::model::ClusterOperation>,
18053
18054    /// Output only. The workflow graph.
18055    pub graph: std::option::Option<crate::model::WorkflowGraph>,
18056
18057    /// Output only. The delete cluster operation metadata.
18058    pub delete_cluster: std::option::Option<crate::model::ClusterOperation>,
18059
18060    /// Output only. The workflow state.
18061    pub state: crate::model::workflow_metadata::State,
18062
18063    /// Output only. The name of the target cluster.
18064    pub cluster_name: std::string::String,
18065
18066    /// Map from parameter names to values that were used for those parameters.
18067    pub parameters: std::collections::HashMap<std::string::String, std::string::String>,
18068
18069    /// Output only. Workflow start time.
18070    pub start_time: std::option::Option<wkt::Timestamp>,
18071
18072    /// Output only. Workflow end time.
18073    pub end_time: std::option::Option<wkt::Timestamp>,
18074
18075    /// Output only. The UUID of target cluster.
18076    pub cluster_uuid: std::string::String,
18077
18078    /// Output only. The timeout duration for the DAG of jobs, expressed in seconds
18079    /// (see [JSON representation of
18080    /// duration](https://developers.google.com/protocol-buffers/docs/proto3#json)).
18081    pub dag_timeout: std::option::Option<wkt::Duration>,
18082
18083    /// Output only. DAG start time, only set for workflows with
18084    /// [dag_timeout][google.cloud.dataproc.v1.WorkflowMetadata.dag_timeout] when
18085    /// DAG begins.
18086    ///
18087    /// [google.cloud.dataproc.v1.WorkflowMetadata.dag_timeout]: crate::model::WorkflowMetadata::dag_timeout
18088    pub dag_start_time: std::option::Option<wkt::Timestamp>,
18089
18090    /// Output only. DAG end time, only set for workflows with
18091    /// [dag_timeout][google.cloud.dataproc.v1.WorkflowMetadata.dag_timeout] when
18092    /// DAG ends.
18093    ///
18094    /// [google.cloud.dataproc.v1.WorkflowMetadata.dag_timeout]: crate::model::WorkflowMetadata::dag_timeout
18095    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    /// Sets the value of [template][crate::model::WorkflowMetadata::template].
18106    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    /// Sets the value of [version][crate::model::WorkflowMetadata::version].
18112    pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18113        self.version = v.into();
18114        self
18115    }
18116
18117    /// Sets the value of [create_cluster][crate::model::WorkflowMetadata::create_cluster].
18118    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    /// Sets or clears the value of [create_cluster][crate::model::WorkflowMetadata::create_cluster].
18127    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    /// Sets the value of [graph][crate::model::WorkflowMetadata::graph].
18136    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    /// Sets or clears the value of [graph][crate::model::WorkflowMetadata::graph].
18145    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    /// Sets the value of [delete_cluster][crate::model::WorkflowMetadata::delete_cluster].
18154    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    /// Sets or clears the value of [delete_cluster][crate::model::WorkflowMetadata::delete_cluster].
18163    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    /// Sets the value of [state][crate::model::WorkflowMetadata::state].
18172    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    /// Sets the value of [cluster_name][crate::model::WorkflowMetadata::cluster_name].
18181    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    /// Sets the value of [parameters][crate::model::WorkflowMetadata::parameters].
18187    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    /// Sets the value of [start_time][crate::model::WorkflowMetadata::start_time].
18199    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    /// Sets or clears the value of [start_time][crate::model::WorkflowMetadata::start_time].
18208    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    /// Sets the value of [end_time][crate::model::WorkflowMetadata::end_time].
18217    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    /// Sets or clears the value of [end_time][crate::model::WorkflowMetadata::end_time].
18226    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    /// Sets the value of [cluster_uuid][crate::model::WorkflowMetadata::cluster_uuid].
18235    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    /// Sets the value of [dag_timeout][crate::model::WorkflowMetadata::dag_timeout].
18241    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    /// Sets or clears the value of [dag_timeout][crate::model::WorkflowMetadata::dag_timeout].
18250    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    /// Sets the value of [dag_start_time][crate::model::WorkflowMetadata::dag_start_time].
18259    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    /// Sets or clears the value of [dag_start_time][crate::model::WorkflowMetadata::dag_start_time].
18268    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    /// Sets the value of [dag_end_time][crate::model::WorkflowMetadata::dag_end_time].
18277    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    /// Sets or clears the value of [dag_end_time][crate::model::WorkflowMetadata::dag_end_time].
18286    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
18301/// Defines additional types related to [WorkflowMetadata].
18302pub mod workflow_metadata {
18303    #[allow(unused_imports)]
18304    use super::*;
18305
18306    /// The operation state.
18307    ///
18308    /// # Working with unknown values
18309    ///
18310    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18311    /// additional enum variants at any time. Adding new variants is not considered
18312    /// a breaking change. Applications should write their code in anticipation of:
18313    ///
18314    /// - New values appearing in future releases of the client library, **and**
18315    /// - New values received dynamically, without application changes.
18316    ///
18317    /// Please consult the [Working with enums] section in the user guide for some
18318    /// guidelines.
18319    ///
18320    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18321    #[derive(Clone, Debug, PartialEq)]
18322    #[non_exhaustive]
18323    pub enum State {
18324        /// Unused.
18325        Unknown,
18326        /// The operation has been created.
18327        Pending,
18328        /// The operation is running.
18329        Running,
18330        /// The operation is done; either cancelled or completed.
18331        Done,
18332        /// If set, the enum was initialized with an unknown value.
18333        ///
18334        /// Applications can examine the value using [State::value] or
18335        /// [State::name].
18336        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        /// Gets the enum value.
18349        ///
18350        /// Returns `None` if the enum contains an unknown value deserialized from
18351        /// the string representation of enums.
18352        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        /// Gets the enum value as a string.
18363        ///
18364        /// Returns `None` if the enum contains an unknown value deserialized from
18365        /// the integer representation of enums.
18366        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/// The cluster operation triggered by a workflow.
18447#[derive(Clone, Default, PartialEq)]
18448#[non_exhaustive]
18449pub struct ClusterOperation {
18450    /// Output only. The id of the cluster operation.
18451    pub operation_id: std::string::String,
18452
18453    /// Output only. Error, if operation failed.
18454    pub error: std::string::String,
18455
18456    /// Output only. Indicates the operation is done.
18457    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    /// Sets the value of [operation_id][crate::model::ClusterOperation::operation_id].
18468    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    /// Sets the value of [error][crate::model::ClusterOperation::error].
18474    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    /// Sets the value of [done][crate::model::ClusterOperation::done].
18480    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/// The workflow graph.
18493#[derive(Clone, Default, PartialEq)]
18494#[non_exhaustive]
18495pub struct WorkflowGraph {
18496    /// Output only. The workflow nodes.
18497    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    /// Sets the value of [nodes][crate::model::WorkflowGraph::nodes].
18508    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/// The workflow node.
18526#[derive(Clone, Default, PartialEq)]
18527#[non_exhaustive]
18528pub struct WorkflowNode {
18529    /// Output only. The name of the node.
18530    pub step_id: std::string::String,
18531
18532    /// Output only. Node's prerequisite nodes.
18533    pub prerequisite_step_ids: std::vec::Vec<std::string::String>,
18534
18535    /// Output only. The job id; populated after the node enters RUNNING state.
18536    pub job_id: std::string::String,
18537
18538    /// Output only. The node state.
18539    pub state: crate::model::workflow_node::NodeState,
18540
18541    /// Output only. The error detail.
18542    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    /// Sets the value of [step_id][crate::model::WorkflowNode::step_id].
18553    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    /// Sets the value of [prerequisite_step_ids][crate::model::WorkflowNode::prerequisite_step_ids].
18559    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    /// Sets the value of [job_id][crate::model::WorkflowNode::job_id].
18570    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    /// Sets the value of [state][crate::model::WorkflowNode::state].
18576    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    /// Sets the value of [error][crate::model::WorkflowNode::error].
18585    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
18597/// Defines additional types related to [WorkflowNode].
18598pub mod workflow_node {
18599    #[allow(unused_imports)]
18600    use super::*;
18601
18602    /// The workflow node state.
18603    ///
18604    /// # Working with unknown values
18605    ///
18606    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18607    /// additional enum variants at any time. Adding new variants is not considered
18608    /// a breaking change. Applications should write their code in anticipation of:
18609    ///
18610    /// - New values appearing in future releases of the client library, **and**
18611    /// - New values received dynamically, without application changes.
18612    ///
18613    /// Please consult the [Working with enums] section in the user guide for some
18614    /// guidelines.
18615    ///
18616    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18617    #[derive(Clone, Debug, PartialEq)]
18618    #[non_exhaustive]
18619    pub enum NodeState {
18620        /// State is unspecified.
18621        Unspecified,
18622        /// The node is awaiting prerequisite node to finish.
18623        Blocked,
18624        /// The node is runnable but not running.
18625        Runnable,
18626        /// The node is running.
18627        Running,
18628        /// The node completed successfully.
18629        Completed,
18630        /// The node failed. A node can be marked FAILED because
18631        /// its ancestor or peer failed.
18632        Failed,
18633        /// If set, the enum was initialized with an unknown value.
18634        ///
18635        /// Applications can examine the value using [NodeState::value] or
18636        /// [NodeState::name].
18637        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        /// Gets the enum value.
18650        ///
18651        /// Returns `None` if the enum contains an unknown value deserialized from
18652        /// the string representation of enums.
18653        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        /// Gets the enum value as a string.
18666        ///
18667        /// Returns `None` if the enum contains an unknown value deserialized from
18668        /// the integer representation of enums.
18669        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/// A request to create a workflow template.
18758#[derive(Clone, Default, PartialEq)]
18759#[non_exhaustive]
18760pub struct CreateWorkflowTemplateRequest {
18761    /// Required. The resource name of the region or location, as described
18762    /// in <https://cloud.google.com/apis/design/resource_names>.
18763    ///
18764    /// * For `projects.regions.workflowTemplates.create`, the resource name of the
18765    ///   region has the following format:
18766    ///   `projects/{project_id}/regions/{region}`
18767    ///
18768    /// * For `projects.locations.workflowTemplates.create`, the resource name of
18769    ///   the location has the following format:
18770    ///   `projects/{project_id}/locations/{location}`
18771    ///
18772    pub parent: std::string::String,
18773
18774    /// Required. The Dataproc workflow template to create.
18775    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    /// Sets the value of [parent][crate::model::CreateWorkflowTemplateRequest::parent].
18786    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    /// Sets the value of [template][crate::model::CreateWorkflowTemplateRequest::template].
18792    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    /// Sets or clears the value of [template][crate::model::CreateWorkflowTemplateRequest::template].
18801    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/// A request to fetch a workflow template.
18817#[derive(Clone, Default, PartialEq)]
18818#[non_exhaustive]
18819pub struct GetWorkflowTemplateRequest {
18820    /// Required. The resource name of the workflow template, as described
18821    /// in <https://cloud.google.com/apis/design/resource_names>.
18822    ///
18823    /// * For `projects.regions.workflowTemplates.get`, the resource name of the
18824    ///   template has the following format:
18825    ///   `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
18826    ///
18827    /// * For `projects.locations.workflowTemplates.get`, the resource name of the
18828    ///   template has the following format:
18829    ///   `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
18830    ///
18831    pub name: std::string::String,
18832
18833    /// Optional. The version of workflow template to retrieve. Only previously
18834    /// instantiated versions can be retrieved.
18835    ///
18836    /// If unspecified, retrieves the current version.
18837    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    /// Sets the value of [name][crate::model::GetWorkflowTemplateRequest::name].
18848    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    /// Sets the value of [version][crate::model::GetWorkflowTemplateRequest::version].
18854    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/// A request to instantiate a workflow template.
18867#[derive(Clone, Default, PartialEq)]
18868#[non_exhaustive]
18869pub struct InstantiateWorkflowTemplateRequest {
18870    /// Required. The resource name of the workflow template, as described
18871    /// in <https://cloud.google.com/apis/design/resource_names>.
18872    ///
18873    /// * For `projects.regions.workflowTemplates.instantiate`, the resource name
18874    ///   of the template has the following format:
18875    ///   `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
18876    ///
18877    /// * For `projects.locations.workflowTemplates.instantiate`, the resource name
18878    ///   of the template has the following format:
18879    ///   `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
18880    ///
18881    pub name: std::string::String,
18882
18883    /// Optional. The version of workflow template to instantiate. If specified,
18884    /// the workflow will be instantiated only if the current version of
18885    /// the workflow template has the supplied version.
18886    ///
18887    /// This option cannot be used to instantiate a previous version of
18888    /// workflow template.
18889    pub version: i32,
18890
18891    /// Optional. A tag that prevents multiple concurrent workflow
18892    /// instances with the same tag from running. This mitigates risk of
18893    /// concurrent instances started due to retries.
18894    ///
18895    /// It is recommended to always set this value to a
18896    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
18897    ///
18898    /// The tag must contain only letters (a-z, A-Z), numbers (0-9),
18899    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
18900    pub request_id: std::string::String,
18901
18902    /// Optional. Map from parameter names to values that should be used for those
18903    /// parameters. Values may not exceed 1000 characters.
18904    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    /// Sets the value of [name][crate::model::InstantiateWorkflowTemplateRequest::name].
18915    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    /// Sets the value of [version][crate::model::InstantiateWorkflowTemplateRequest::version].
18921    pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18922        self.version = v.into();
18923        self
18924    }
18925
18926    /// Sets the value of [request_id][crate::model::InstantiateWorkflowTemplateRequest::request_id].
18927    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    /// Sets the value of [parameters][crate::model::InstantiateWorkflowTemplateRequest::parameters].
18933    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/// A request to instantiate an inline workflow template.
18952#[derive(Clone, Default, PartialEq)]
18953#[non_exhaustive]
18954pub struct InstantiateInlineWorkflowTemplateRequest {
18955    /// Required. The resource name of the region or location, as described
18956    /// in <https://cloud.google.com/apis/design/resource_names>.
18957    ///
18958    /// * For `projects.regions.workflowTemplates,instantiateinline`, the resource
18959    ///   name of the region has the following format:
18960    ///   `projects/{project_id}/regions/{region}`
18961    ///
18962    /// * For `projects.locations.workflowTemplates.instantiateinline`, the
18963    ///   resource name of the location has the following format:
18964    ///   `projects/{project_id}/locations/{location}`
18965    ///
18966    pub parent: std::string::String,
18967
18968    /// Required. The workflow template to instantiate.
18969    pub template: std::option::Option<crate::model::WorkflowTemplate>,
18970
18971    /// Optional. A tag that prevents multiple concurrent workflow
18972    /// instances with the same tag from running. This mitigates risk of
18973    /// concurrent instances started due to retries.
18974    ///
18975    /// It is recommended to always set this value to a
18976    /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
18977    ///
18978    /// The tag must contain only letters (a-z, A-Z), numbers (0-9),
18979    /// underscores (_), and hyphens (-). The maximum length is 40 characters.
18980    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    /// Sets the value of [parent][crate::model::InstantiateInlineWorkflowTemplateRequest::parent].
18991    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    /// Sets the value of [template][crate::model::InstantiateInlineWorkflowTemplateRequest::template].
18997    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    /// Sets or clears the value of [template][crate::model::InstantiateInlineWorkflowTemplateRequest::template].
19006    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    /// Sets the value of [request_id][crate::model::InstantiateInlineWorkflowTemplateRequest::request_id].
19015    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/// A request to update a workflow template.
19028#[derive(Clone, Default, PartialEq)]
19029#[non_exhaustive]
19030pub struct UpdateWorkflowTemplateRequest {
19031    /// Required. The updated workflow template.
19032    ///
19033    /// The `template.version` field must match the current version.
19034    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    /// Sets the value of [template][crate::model::UpdateWorkflowTemplateRequest::template].
19045    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    /// Sets or clears the value of [template][crate::model::UpdateWorkflowTemplateRequest::template].
19054    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/// A request to list workflow templates in a project.
19070#[derive(Clone, Default, PartialEq)]
19071#[non_exhaustive]
19072pub struct ListWorkflowTemplatesRequest {
19073    /// Required. The resource name of the region or location, as described
19074    /// in <https://cloud.google.com/apis/design/resource_names>.
19075    ///
19076    /// * For `projects.regions.workflowTemplates,list`, the resource
19077    ///   name of the region has the following format:
19078    ///   `projects/{project_id}/regions/{region}`
19079    ///
19080    /// * For `projects.locations.workflowTemplates.list`, the
19081    ///   resource name of the location has the following format:
19082    ///   `projects/{project_id}/locations/{location}`
19083    ///
19084    pub parent: std::string::String,
19085
19086    /// Optional. The maximum number of results to return in each response.
19087    pub page_size: i32,
19088
19089    /// Optional. The page token, returned by a previous call, to request the
19090    /// next page of results.
19091    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    /// Sets the value of [parent][crate::model::ListWorkflowTemplatesRequest::parent].
19102    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    /// Sets the value of [page_size][crate::model::ListWorkflowTemplatesRequest::page_size].
19108    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    /// Sets the value of [page_token][crate::model::ListWorkflowTemplatesRequest::page_token].
19114    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/// A response to a request to list workflow templates in a project.
19127#[derive(Clone, Default, PartialEq)]
19128#[non_exhaustive]
19129pub struct ListWorkflowTemplatesResponse {
19130    /// Output only. WorkflowTemplates list.
19131    pub templates: std::vec::Vec<crate::model::WorkflowTemplate>,
19132
19133    /// Output only. This token is included in the response if there are more
19134    /// results to fetch. To fetch additional results, provide this value as the
19135    /// page_token in a subsequent \<code\>ListWorkflowTemplatesRequest\</code\>.
19136    pub next_page_token: std::string::String,
19137
19138    /// Output only. List of workflow templates that could not be included in the
19139    /// response. Attempting to get one of these resources may indicate why it was
19140    /// not included in the list response.
19141    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    /// Sets the value of [templates][crate::model::ListWorkflowTemplatesResponse::templates].
19152    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    /// Sets the value of [next_page_token][crate::model::ListWorkflowTemplatesResponse::next_page_token].
19163    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    /// Sets the value of [unreachable][crate::model::ListWorkflowTemplatesResponse::unreachable].
19169    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/// A request to delete a workflow template.
19201///
19202/// Currently started workflows will remain running.
19203#[derive(Clone, Default, PartialEq)]
19204#[non_exhaustive]
19205pub struct DeleteWorkflowTemplateRequest {
19206    /// Required. The resource name of the workflow template, as described
19207    /// in <https://cloud.google.com/apis/design/resource_names>.
19208    ///
19209    /// * For `projects.regions.workflowTemplates.delete`, the resource name
19210    ///   of the template has the following format:
19211    ///   `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
19212    ///
19213    /// * For `projects.locations.workflowTemplates.instantiate`, the resource name
19214    ///   of the template has the following format:
19215    ///   `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
19216    ///
19217    pub name: std::string::String,
19218
19219    /// Optional. The version of workflow template to delete. If specified,
19220    /// will only delete the template if the current server version matches
19221    /// specified version.
19222    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    /// Sets the value of [name][crate::model::DeleteWorkflowTemplateRequest::name].
19233    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    /// Sets the value of [version][crate::model::DeleteWorkflowTemplateRequest::version].
19239    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/// Cluster components that can be activated.
19252///
19253/// # Working with unknown values
19254///
19255/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19256/// additional enum variants at any time. Adding new variants is not considered
19257/// a breaking change. Applications should write their code in anticipation of:
19258///
19259/// - New values appearing in future releases of the client library, **and**
19260/// - New values received dynamically, without application changes.
19261///
19262/// Please consult the [Working with enums] section in the user guide for some
19263/// guidelines.
19264///
19265/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19266#[derive(Clone, Debug, PartialEq)]
19267#[non_exhaustive]
19268pub enum Component {
19269    /// Unspecified component. Specifying this will cause Cluster creation to fail.
19270    Unspecified,
19271    /// The Anaconda component is no longer supported or applicable to
19272    /// [supported Dataproc on Compute Engine image versions]
19273    /// (<https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-version-clusters#supported-dataproc-image-versions>).
19274    /// It cannot be activated on clusters created with supported Dataproc on
19275    /// Compute Engine image versions.
19276    Anaconda,
19277    /// Delta Lake.
19278    Delta,
19279    /// Docker
19280    Docker,
19281    /// The Druid query engine. (alpha)
19282    Druid,
19283    /// Flink
19284    Flink,
19285    /// HBase. (beta)
19286    Hbase,
19287    /// The Hive Web HCatalog (the REST service for accessing HCatalog).
19288    HiveWebhcat,
19289    /// Hudi.
19290    Hudi,
19291    /// Iceberg.
19292    Iceberg,
19293    /// The Jupyter Notebook.
19294    Jupyter,
19295    /// The Jupyter Kernel Gateway.
19296    JupyterKernelGateway,
19297    /// The Pig component.
19298    Pig,
19299    /// The Presto query engine.
19300    Presto,
19301    /// The Trino query engine.
19302    Trino,
19303    /// The Ranger service.
19304    Ranger,
19305    /// The Solr service.
19306    Solr,
19307    /// The Zeppelin notebook.
19308    Zeppelin,
19309    /// The Zookeeper service.
19310    Zookeeper,
19311    /// If set, the enum was initialized with an unknown value.
19312    ///
19313    /// Applications can examine the value using [Component::value] or
19314    /// [Component::name].
19315    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    /// Gets the enum value.
19328    ///
19329    /// Returns `None` if the enum contains an unknown value deserialized from
19330    /// the string representation of enums.
19331    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    /// Gets the enum value as a string.
19357    ///
19358    /// Returns `None` if the enum contains an unknown value deserialized from
19359    /// the integer representation of enums.
19360    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/// Actions in response to failure of a resource associated with a cluster.
19500///
19501/// # Working with unknown values
19502///
19503/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19504/// additional enum variants at any time. Adding new variants is not considered
19505/// a breaking change. Applications should write their code in anticipation of:
19506///
19507/// - New values appearing in future releases of the client library, **and**
19508/// - New values received dynamically, without application changes.
19509///
19510/// Please consult the [Working with enums] section in the user guide for some
19511/// guidelines.
19512///
19513/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19514#[derive(Clone, Debug, PartialEq)]
19515#[non_exhaustive]
19516pub enum FailureAction {
19517    /// When FailureAction is unspecified, failure action defaults to NO_ACTION.
19518    Unspecified,
19519    /// Take no action on failure to create a cluster resource. NO_ACTION is the
19520    /// default.
19521    NoAction,
19522    /// Delete the failed cluster resource.
19523    Delete,
19524    /// If set, the enum was initialized with an unknown value.
19525    ///
19526    /// Applications can examine the value using [FailureAction::value] or
19527    /// [FailureAction::name].
19528    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    /// Gets the enum value.
19541    ///
19542    /// Returns `None` if the enum contains an unknown value deserialized from
19543    /// the string representation of enums.
19544    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    /// Gets the enum value as a string.
19554    ///
19555    /// Returns `None` if the enum contains an unknown value deserialized from
19556    /// the integer representation of enums.
19557    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}